U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lokesh Vutla <lokeshvutla@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 08/25] dm: reset: Update uclass to allow querying reset status
Date: Tue, 21 Aug 2018 20:01:46 +0530	[thread overview]
Message-ID: <20180821143203.29142-9-lokeshvutla@ti.com> (raw)
In-Reply-To: <20180821143203.29142-1-lokeshvutla@ti.com>

From: Andreas Dannenberg <dannenberg@ti.com>

Add a reset operations function pointer to support querying the current
status of a reset control.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 drivers/reset/reset-uclass.c |  9 +++++++++
 include/reset-uclass.h       |  8 ++++++++
 include/reset.h              | 14 ++++++++++++++
 3 files changed, 31 insertions(+)

diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c
index 3899537635..89e39c6b5a 100644
--- a/drivers/reset/reset-uclass.c
+++ b/drivers/reset/reset-uclass.c
@@ -192,6 +192,15 @@ int reset_deassert_bulk(struct reset_ctl_bulk *bulk)
 	return 0;
 }
 
+int reset_status(struct reset_ctl *reset_ctl)
+{
+	struct reset_ops *ops = reset_dev_ops(reset_ctl->dev);
+
+	debug("%s(reset_ctl=%p)\n", __func__, reset_ctl);
+
+	return ops->rst_status(reset_ctl);
+}
+
 int reset_release_all(struct reset_ctl *reset_ctl, int count)
 {
 	int i, ret;
diff --git a/include/reset-uclass.h b/include/reset-uclass.h
index c17d738b31..7b5cc3cb3b 100644
--- a/include/reset-uclass.h
+++ b/include/reset-uclass.h
@@ -76,6 +76,14 @@ struct reset_ops {
 	 * @return 0 if OK, or a negative error code.
 	 */
 	int (*rst_deassert)(struct reset_ctl *reset_ctl);
+	/**
+	 * rst_status - Check reset signal status.
+	 *
+	 * @reset_ctl:	The reset signal to check.
+	 * @return 0 if deasserted, positive if asserted, or a negative
+	 *           error code.
+	 */
+	int (*rst_status)(struct reset_ctl *reset_ctl);
 };
 
 #endif
diff --git a/include/reset.h b/include/reset.h
index a7bbc1c331..34ebb096dd 100644
--- a/include/reset.h
+++ b/include/reset.h
@@ -206,6 +206,15 @@ int reset_deassert(struct reset_ctl *reset_ctl);
  */
 int reset_deassert_bulk(struct reset_ctl_bulk *bulk);
 
+/**
+ * rst_status - Check reset signal status.
+ *
+ * @reset_ctl:	The reset signal to check.
+ * @return 0 if deasserted, positive if asserted, or a negative
+ *           error code.
+ */
+int reset_status(struct reset_ctl *reset_ctl);
+
 /**
  * reset_release_all - Assert/Free an array of previously requested resets.
  *
@@ -279,6 +288,11 @@ static inline int reset_deassert_bulk(struct reset_ctl_bulk *bulk)
 	return 0;
 }
 
+static inline int reset_status(struct reset_ctl *reset_ctl)
+{
+	return -ENOTSUPP;
+}
+
 static inline int reset_release_all(struct reset_ctl *reset_ctl, int count)
 {
 	return 0;
-- 
2.18.0

  parent reply	other threads:[~2018-08-21 14:31 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21 14:31 [U-Boot] [PATCH 00/25] [2/3] Initial support Texas Instrument's AM654 Platform Lokesh Vutla
2018-08-21 14:31 ` [U-Boot] [PATCH 01/25] firmware: Add basic support for TI System Control Interface (TI SCI) protocol Lokesh Vutla
2018-08-24 14:11   ` Tom Rini
2018-08-24 15:00     ` Lokesh Vutla
2018-08-21 14:31 ` [U-Boot] [PATCH 02/25] firmware: ti_sci: Add support for board configuration Lokesh Vutla
2018-08-24 14:11   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 03/25] firmware: ti_sci: Add support for device control Lokesh Vutla
2018-08-24 14:11   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 04/25] firmware: ti_sci: Add support for clock control Lokesh Vutla
2018-08-24 14:11   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 05/25] firmware: ti_sci: Add support for reboot core service Lokesh Vutla
2018-08-24 14:11   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 06/25] firmware: ti_sci: Add support for processor control services Lokesh Vutla
2018-08-24 14:11   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 07/25] dm: firmware: Automatically bind child devices Lokesh Vutla
2018-08-24 14:11   ` Tom Rini
2018-08-21 14:31 ` Lokesh Vutla [this message]
2018-08-24 14:11   ` [U-Boot] [PATCH 08/25] dm: reset: Update uclass to allow querying reset status Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 09/25] reset: Extend reset control with an optional data field Lokesh Vutla
2018-08-24 14:11   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 10/25] reset: Introduce TI System Control Interface (TI SCI) reset driver Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 11/25] clk: Allow clock defaults to be set also during re-reloc state Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-24 14:42     ` Dr. Philipp Tomsich
2018-08-24 15:54       ` Andreas Dannenberg
2018-08-24 16:00         ` Dr. Philipp Tomsich
2018-08-24 16:28           ` Andreas Dannenberg
2018-08-27  3:26           ` Kever Yang
2018-08-27 16:06             ` Andreas Dannenberg
2018-08-28  9:12               ` Lokesh Vutla
2018-08-27  6:02       ` Lokesh Vutla
2018-08-21 14:31 ` [U-Boot] [PATCH 12/25] clk: Extend clock control with an optional data field Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 13/25] clk: Introduce TI System Control Interface (TI SCI) clock driver Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 14/25] power domain: Add support for multiple powerdomains per device Lokesh Vutla
2018-08-22  9:21   ` Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 15/25] power domain: Introduce TI System Control Interface (TI SCI) power domain driver Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 16/25] sysreset: Add TI System Control Interface (TI SCI) sysreset driver Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 17/25] mailbox: Allow attaching private data for mbox_chan Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 18/25] mailbox: Introduce K3 Secure Proxy Driver Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 19/25] spl: Allow mailbox drivers to be used within SPL Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 20/25] remoteproc: Allow for individual remoteproc initialization Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:31 ` [U-Boot] [PATCH 21/25] remoteproc: Introduce K3 system controller Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-24 15:02     ` Lokesh Vutla
2018-08-21 14:32 ` [U-Boot] [PATCH 22/25] remoteproc: Introduce K3 remoteproc driver Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:32 ` [U-Boot] [PATCH 23/25] spl: Allow remoteproc drivers to be used within SPL Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:32 ` [U-Boot] [PATCH 24/25] mmc: k3_arasan: Add sdhci driver support for K3 family SoCs Lokesh Vutla
2018-08-24 14:12   ` Tom Rini
2018-08-21 14:32 ` [U-Boot] [PATCH 25/25] gpio: do not include <asm/arch/gpio.h> for ARCH_K3 Lokesh Vutla
2018-08-24 14:13   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180821143203.29142-9-lokeshvutla@ti.com \
    --to=lokeshvutla@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox