mfd: rk808: disable rk817 int when shutdown

rk817 int pin is connect to sleep pin on ebook hardware design,
cpu unable to pull high sleep pin to shutdown devices,
when pmic occurs interrupt, so we just disable pmic int
on shutdown process to avoid this.

TEST:Press the Power button frequently while shutting down ebook devices

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I2a3a45be371b78720a94b1380fbb101a5597cfc6
This commit is contained in:
Zorro Liu
2021-09-26 11:13:35 +08:00
committed by Tao Huang
parent fd5fd8b70e
commit 02456ae203

View File

@@ -784,14 +784,22 @@ static void rk817_shutdown_prepare(void)
int ret;
struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
/* close rtc int when power off */
/* close int when power off */
regmap_update_bits(rk808->regmap,
RK817_INT_STS_MSK_REG0,
(0x3 << 5), (0x3 << 5));
0xff, 0xff);
regmap_update_bits(rk808->regmap,
RK817_INT_STS_MSK_REG1,
0xff, 0xff);
regmap_update_bits(rk808->regmap,
RK817_INT_STS_MSK_REG2,
0xff, 0xff);
regmap_update_bits(rk808->regmap,
RK817_RTC_INT_REG,
(0x3 << 2), (0x0 << 2));
dev_info(&rk808_i2c_client->dev, "disabled int when device shutdown!\n");
if (rk808->pins && rk808->pins->p && rk808->pins->power_off) {
ret = regmap_update_bits(rk808->regmap,
RK817_SYS_CFG(3),