summaryrefslogtreecommitdiff
path: root/drivers/power/reset/sc27xx-poweroff.c
diff options
context:
space:
mode:
authorSherry Zong <sherry.zong@unisoc.com>2020-03-09 11:18:44 +0300
committerSebastian Reichel <sebastian.reichel@collabora.com>2020-03-12 01:32:09 +0300
commit6cdd5b09cbe67365c42aee539f6fd00f2ecfdaab (patch)
tree516e7d57713c63e53f7ec231148f5740f9defa6b /drivers/power/reset/sc27xx-poweroff.c
parent9027f6111ca40dcc703e1cf6129a73703ae299b7 (diff)
downloadlinux-6cdd5b09cbe67365c42aee539f6fd00f2ecfdaab.tar.xz
power: reset: sc27xx: Power off the external subsystems' connection
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@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/reset/sc27xx-poweroff.c')
-rw-r--r--drivers/power/reset/sc27xx-poweroff.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/power/reset/sc27xx-poweroff.c b/drivers/power/reset/sc27xx-poweroff.c
index 29fb08b8faa0..2bedd4c58ddc 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 struct syscore_ops poweroff_syscore_ops = {
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);
}