aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2015-10-06 20:44:41 -0400
committerLee Jones <lee.jones@linaro.org>2015-10-30 13:20:37 -0400
commit8a97d4287e2659f3460a8dec61ccc935154726c0 (patch)
treed1d6a7c84147b53bc2470e60fffec0eaf36bd1c6
parentc2c9f1fe4bf2d6597bbaaab7514d9c9092b5b2f6 (diff)
mfd: sec-core: Disable buck voltage reset on watchdog falling edge
The WRSTBI bit (disabled by default but enabled by bootloader), when set, is responsible for resetting voltages to default values of certain bucks on falling edge of Warm Reset Input pin from AP. However on some boards (with S2MPS13) the pin is pulled down so any suspend will effectively trigger the reset of bucks supplying the power to the little and big cores. In the same time when resuming, these bucks must provide voltage greater or equal to voltage before suspend to match the frequency chosen by cpufreq. If voltage (default value of voltage after reset) is lower than one set by cpufreq before suspend, then system will hang during resuming. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reported-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Tested-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/mfd/sec-core.c26
-rw-r--r--include/linux/mfd/samsung/core.h2
-rw-r--r--include/linux/mfd/samsung/s2mps13.h1
3 files changed, 29 insertions, 0 deletions
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 589e5efc2d7f..2626fc0b5b8c 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -262,6 +262,29 @@ static void sec_pmic_dump_rev(struct sec_pmic_dev *sec_pmic)
262 dev_dbg(sec_pmic->dev, "Revision: 0x%x\n", val); 262 dev_dbg(sec_pmic->dev, "Revision: 0x%x\n", val);
263} 263}
264 264
265static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic)
266{
267 int err;
268
269 if (sec_pmic->device_type != S2MPS13X)
270 return;
271
272 if (sec_pmic->pdata->disable_wrstbi) {
273 /*
274 * If WRSTBI pin is pulled down this feature must be disabled
275 * because each Suspend to RAM will trigger buck voltage reset
276 * to default values.
277 */
278 err = regmap_update_bits(sec_pmic->regmap_pmic,
279 S2MPS13_REG_WRSTBI,
280 S2MPS13_REG_WRSTBI_MASK, 0x0);
281 if (err)
282 dev_warn(sec_pmic->dev,
283 "Cannot initialize WRSTBI config: %d\n",
284 err);
285 }
286}
287
265#ifdef CONFIG_OF 288#ifdef CONFIG_OF
266/* 289/*
267 * Only the common platform data elements for s5m8767 are parsed here from the 290 * Only the common platform data elements for s5m8767 are parsed here from the
@@ -289,6 +312,8 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
289 312
290 pd->manual_poweroff = of_property_read_bool(dev->of_node, 313 pd->manual_poweroff = of_property_read_bool(dev->of_node,
291 "samsung,s2mps11-acokb-ground"); 314 "samsung,s2mps11-acokb-ground");
315 pd->disable_wrstbi = of_property_read_bool(dev->of_node,
316 "samsung,s2mps11-wrstbi-ground");
292 return pd; 317 return pd;
293} 318}
294#else 319#else
@@ -434,6 +459,7 @@ static int sec_pmic_probe(struct i2c_client *i2c,
434 goto err_mfd; 459 goto err_mfd;
435 460
436 device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup); 461 device_init_wakeup(sec_pmic->dev, sec_pmic->wakeup);
462 sec_pmic_configure(sec_pmic);
437 sec_pmic_dump_rev(sec_pmic); 463 sec_pmic_dump_rev(sec_pmic);
438 464
439 return ret; 465 return ret;
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index aa78957e092f..a06098639399 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -134,6 +134,8 @@ struct sec_platform_data {
134 int buck4_init; 134 int buck4_init;
135 /* Whether or not manually set PWRHOLD to low during shutdown. */ 135 /* Whether or not manually set PWRHOLD to low during shutdown. */
136 bool manual_poweroff; 136 bool manual_poweroff;
137 /* Disable the WRSTBI (buck voltage warm reset) when probing? */
138 bool disable_wrstbi;
137}; 139};
138 140
139/** 141/**
diff --git a/include/linux/mfd/samsung/s2mps13.h b/include/linux/mfd/samsung/s2mps13.h
index b1fd675fa36f..239e977ba45d 100644
--- a/include/linux/mfd/samsung/s2mps13.h
+++ b/include/linux/mfd/samsung/s2mps13.h
@@ -184,5 +184,6 @@ enum s2mps13_regulators {
184 * Let's assume that default value will be set. 184 * Let's assume that default value will be set.
185 */ 185 */
186#define S2MPS13_BUCK_RAMP_DELAY 12500 186#define S2MPS13_BUCK_RAMP_DELAY 12500
187#define S2MPS13_REG_WRSTBI_MASK BIT(5)
187 188
188#endif /* __LINUX_MFD_S2MPS13_H */ 189#endif /* __LINUX_MFD_S2MPS13_H */