[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <eae00dced755376239401b18b38e4553200dc517.1583740881.git.baolin.wang7@gmail.com>
Date: Mon, 9 Mar 2020 16:18:44 +0800
From: Baolin Wang <baolin.wang7@...il.com>
To: sre@...nel.org
Cc: baolin.wang7@...il.com, orsonzhai@...il.com, zhang.lyra@...il.com,
kernel-team@...roid.com, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] power: reset: sc27xx: Power off the external subsystems' connection
From: Sherry Zong <sherry.zong@...soc.com>
When powering off the whole system, we should power off some external
subsystems' connection firstly, otherwise some external subsystems
will hold some power and result in powering down abnormally.
Signed-off-by: Sherry Zong <sherry.zong@...soc.com>
Signed-off-by: Baolin Wang <baolin.wang7@...il.com>
---
drivers/power/reset/sc27xx-poweroff.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/power/reset/sc27xx-poweroff.c b/drivers/power/reset/sc27xx-poweroff.c
index 29fb08b..2bedd4c 100644
--- a/drivers/power/reset/sc27xx-poweroff.c
+++ b/drivers/power/reset/sc27xx-poweroff.c
@@ -13,6 +13,8 @@
#define SC27XX_PWR_PD_HW 0xc2c
#define SC27XX_PWR_OFF_EN BIT(0)
+#define SC27XX_SLP_CTRL 0xdf0
+#define SC27XX_LDO_XTL_EN BIT(3)
static struct regmap *regmap;
@@ -40,6 +42,9 @@ static void sc27xx_poweroff_shutdown(void)
static void sc27xx_poweroff_do_poweroff(void)
{
+ /* Disable the external subsys connection's power firstly */
+ regmap_write(regmap, SC27XX_SLP_CTRL, SC27XX_LDO_XTL_EN);
+
regmap_write(regmap, SC27XX_PWR_PD_HW, SC27XX_PWR_OFF_EN);
}
--
1.9.1
Powered by blists - more mailing lists