Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions drivers/mfd/sec-acpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
};

Expand Down
5 changes: 4 additions & 1 deletion drivers/mfd/sec-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
12 changes: 7 additions & 5 deletions drivers/rtc/rtc-s5m.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down