diff mbox series

[U-Boot] sysreset: syscon: remove POWER reset cause

Message ID 1555600582-29790-1-git-send-email-patrick.delaunay@st.com
State Accepted
Commit 50fd31fd7781e979254af49efcbc1fbb4882a751
Delegated to: Tom Rini
Headers show
Series [U-Boot] sysreset: syscon: remove POWER reset cause | expand

Commit Message

Patrick DELAUNAY April 18, 2019, 3:16 p.m. UTC
The sysreset of 'POWER' type is a PMIC reset defined as
'remove and restore power'.
So normally only COLD/WARN is supported by sysreset_syscon.

This modification allows to use the function sysreset_walk(SYSRESET_POWER)
when it is supported by PMIC driver (see example in stpmic1).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

 drivers/sysreset/sysreset_syscon.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Tom Rini April 27, 2019, 2:47 p.m. UTC | #1
On Thu, Apr 18, 2019 at 05:16:21PM +0200, Patrick Delaunay wrote:

> The sysreset of 'POWER' type is a PMIC reset defined as
> 'remove and restore power'.
> So normally only COLD/WARN is supported by sysreset_syscon.
> 
> This modification allows to use the function sysreset_walk(SYSRESET_POWER)
> when it is supported by PMIC driver (see example in stpmic1).
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/sysreset/sysreset_syscon.c b/drivers/sysreset/sysreset_syscon.c
index 3fb39b9..1028160 100644
--- a/drivers/sysreset/sysreset_syscon.c
+++ b/drivers/sysreset/sysreset_syscon.c
@@ -24,6 +24,9 @@  static int syscon_reboot_request(struct udevice *dev, enum sysreset_t type)
 {
 	struct syscon_reboot_priv *priv = dev_get_priv(dev);
 
+	if (type == SYSRESET_POWER)
+		return -EPROTONOSUPPORT;
+
 	regmap_write(priv->regmap, priv->offset, priv->mask);
 
 	return -EINPROGRESS;