diff --git a/drivers/mfd/sec-acpm.c b/drivers/mfd/sec-acpm.c index c644530c44..1e1274c964 100644 --- a/drivers/mfd/sec-acpm.c +++ b/drivers/mfd/sec-acpm.c @@ -644,9 +644,9 @@ static const struct regmap_config s2mpg14_regmap_config_pmic = { /* * The RTC: everything up to the oscillator control may be read. Writes - * only where rtc-s5m writes: CTRL, UPDATE, the time and alarm 0. SMPL, - * WTSR, CAP_SEL and OSC_CTRL (the power-loss and watchdog-reset - * protections and the oscillator tuning) stay read-only. + * only where rtc-s5m writes: CTRL, UPDATE, the time and alarm 0, and SMPL + * and WTSR, where it clears SMPL_EN, WTSR_EN and COLDRST_EN at power off. + * CAP_SEL and OSC_CTRL (the oscillator tuning) stay read-only. */ static const struct regmap_range s2mpg14_rtc_rd_registers[] = { regmap_reg_range(S2MPG10_RTC_CTRL, S2MPG10_RTC_OSC_CTRL), @@ -658,7 +658,7 @@ static const struct regmap_access_table s2mpg14_rtc_rd_table = { }; static const struct regmap_range s2mpg14_rtc_wr_registers[] = { - regmap_reg_range(S2MPG10_RTC_CTRL, S2MPG10_RTC_UPDATE), + regmap_reg_range(S2MPG10_RTC_CTRL, S2MPG10_RTC_WTSR), regmap_reg_range(S2MPG10_RTC_SEC, S2MPG10_RTC_A0YEAR), }; diff --git a/drivers/mfd/sec-common.c b/drivers/mfd/sec-common.c index 6a40169c4f..03cdc22065 100644 --- a/drivers/mfd/sec-common.c +++ b/drivers/mfd/sec-common.c @@ -79,7 +79,10 @@ static const struct resource s2mpg14_rtc_resources[] = { DEFINE_RES_IRQ_NAMED(S2MPG14_IRQ_RTCA0, "alarm"), }; -/* The qualified LDOs and the RTC with its alarm; no GPIO or protection writes. */ +/* + * The qualified LDOs and the RTC with its alarm; no GPIO. The RTC's only + * protection writes clear SMPL_EN, WTSR_EN and COLDRST_EN at power off. + */ static const struct mfd_cell s2mpg14_devs[] = { MFD_CELL_NAME("s2mpg14-regulator"), MFD_CELL_RES("s2mpg14-rtc", s2mpg14_rtc_resources), diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c index 1e997bf8ca..aab5f8a73d 100644 --- a/drivers/rtc/rtc-s5m.c +++ b/drivers/rtc/rtc-s5m.c @@ -716,17 +716,19 @@ static int s5m_rtc_restart_s2mpg10(struct sys_off_data *data) * The PMIC's warm-reset (WTSR, with its cold-reset follow-up) and sudden * power loss (SMPL) restarts stay armed in the always-on RTC block across * boots. Left on, the PMIC answers the AP's power-off by powering it back - * up, so power off turns into a restart. Google's S2MPG12 RTC driver turns - * all three off in its shutdown callback before every power off, and arms - * them again only for a restart (rtc-s2mpg12.c, s2m_rtc_shutdown()). - * Restarts are left alone here: they never needed it on gs201. + * up, so power off turns into a restart. Google's S2MPG12 and S2MPG14 RTC + * drivers turn all three off in their shutdown callbacks before every power + * off, and arm them again only for a restart (rtc-s2mpg12.c and + * rtc-s2mpg14.c, s2m_rtc_shutdown()). The S2MPG14's RTC has the same + * registers and bits. Restarts are left alone here: they never needed it + * on gs201. */ static void s5m_rtc_shutdown(struct platform_device *pdev) { struct s5m_rtc_info *info = platform_get_drvdata(pdev); int ret; - if (info->device_type != S2MPG12) + if (info->device_type != S2MPG12 && info->device_type != S2MPG14) return; if (system_state != SYSTEM_POWER_OFF && system_state != SYSTEM_HALT)