All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] pmic: stpmic1: add support for SYSRESET_POWER_OFF
@ 2019-05-20  7:47 Patrick Delaunay
  2019-07-12 12:59 ` Patrick DELAUNAY
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Delaunay @ 2019-05-20  7:47 UTC (permalink / raw)
  To: u-boot

Adds support for SYSRESET_POWER_OFF = PMIC power off used by command
power off and introduced by commit 751fed426f87 ("sysreset: Add a way
to find the last reset").
The driver use SYSRESET_POWER for the PMIC-level power cycle, with restart.

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

 drivers/power/pmic/stpmic1.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/power/pmic/stpmic1.c b/drivers/power/pmic/stpmic1.c
index 65296c5..c338148 100644
--- a/drivers/power/pmic/stpmic1.c
+++ b/drivers/power/pmic/stpmic1.c
@@ -221,7 +221,7 @@ static int stpmic1_sysreset_request(struct udevice *dev, enum sysreset_t type)
 	struct udevice *pmic_dev;
 	int ret;
 
-	if (type != SYSRESET_POWER)
+	if (type != SYSRESET_POWER && type != SYSRESET_POWER_OFF)
 		return -EPROTONOSUPPORT;
 
 	ret = uclass_get_device_by_driver(UCLASS_PMIC,
@@ -235,8 +235,13 @@ static int stpmic1_sysreset_request(struct udevice *dev, enum sysreset_t type)
 	if (ret < 0)
 		return ret;
 
-	ret = pmic_reg_write(pmic_dev, STPMIC1_MAIN_CR,
-			     ret | STPMIC1_SWOFF | STPMIC1_RREQ_EN);
+	ret |= STPMIC1_SWOFF;
+	ret &= ~STPMIC1_RREQ_EN;
+	/* request Power Cycle */
+	if (type == SYSRESET_POWER)
+		ret |= STPMIC1_RREQ_EN;
+
+	ret = pmic_reg_write(pmic_dev, STPMIC1_MAIN_CR, ret);
 	if (ret < 0)
 		return ret;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] pmic: stpmic1: add support for SYSRESET_POWER_OFF
  2019-05-20  7:47 [U-Boot] [PATCH] pmic: stpmic1: add support for SYSRESET_POWER_OFF Patrick Delaunay
@ 2019-07-12 12:59 ` Patrick DELAUNAY
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick DELAUNAY @ 2019-07-12 12:59 UTC (permalink / raw)
  To: u-boot

Hi,

> From: Patrick DELAUNAY <patrick.delaunay@st.com>
> Sent: lundi 20 mai 2019 09:47
> 
> Adds support for SYSRESET_POWER_OFF = PMIC power off used by command
> power off and introduced by commit 751fed426f87 ("sysreset: Add a way to find
> the last reset").
> The driver use SYSRESET_POWER for the PMIC-level power cycle, with restart.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
> 
>  drivers/power/pmic/stpmic1.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 

Applied to u-boot-stm32/master, thanks!

Patrick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-12 12:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-20  7:47 [U-Boot] [PATCH] pmic: stpmic1: add support for SYSRESET_POWER_OFF Patrick Delaunay
2019-07-12 12:59 ` Patrick DELAUNAY

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.