Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a2e32d2 authored by Sherry Zong's avatar Sherry Zong Committed by Todd Kjos
Browse files

FROMGIT: 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.

bug: 146864653
Signed-off-by: default avatarSherry Zong <sherry.zong@unisoc.com>
Signed-off-by: default avatarBaolin Wang <baolin.wang7@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
(cherry picked from commit 6cdd5b09cbe67365c42aee539f6fd00f2ecfdaab
https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next)
parent 342d6951
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);
}