Commit a9bc67de authored by Michał Mirosław's avatar Michał Mirosław Committed by Mark Brown

regulator: tps65910: wire up sleep control configuration

This enables configuring the PMIC's sleep mode via device-tree.

A pointer indirection to sleep mode data is removed, as it simplifies
the implementation slightly. In current kernel tree, platform data
structure is not used outside MFD cell drivers.
Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fe953904
...@@ -61,6 +61,10 @@ Optional properties: ...@@ -61,6 +61,10 @@ Optional properties:
There should be 9 entries here, one for each gpio. There should be 9 entries here, one for each gpio.
- ti,system-power-controller: Telling whether or not this pmic is controlling - ti,system-power-controller: Telling whether or not this pmic is controlling
the system power. the system power.
- ti,sleep-enable: Enable SLEEP state.
- ti,sleep-keep-therm: Keep thermal monitoring on in sleep state.
- ti,sleep-keep-ck32k: Keep the 32KHz clock output on in sleep state.
- ti,sleep-keep-hsclk: Keep high speed internal clock on in sleep state.
Regulator Optional properties: Regulator Optional properties:
- ti,regulator-ext-sleep-control: enable external sleep - ti,regulator-ext-sleep-control: enable external sleep
......
...@@ -328,11 +328,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910, ...@@ -328,11 +328,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
goto err_sleep_init; goto err_sleep_init;
} }
/* Return if there is no sleep keepon data. */ if (pmic_pdata->slp_keepon.therm_keepon) {
if (!pmic_pdata->slp_keepon)
return 0;
if (pmic_pdata->slp_keepon->therm_keepon) {
ret = tps65910_reg_set_bits(tps65910, ret = tps65910_reg_set_bits(tps65910,
TPS65910_SLEEP_KEEP_RES_ON, TPS65910_SLEEP_KEEP_RES_ON,
SLEEP_KEEP_RES_ON_THERM_KEEPON_MASK); SLEEP_KEEP_RES_ON_THERM_KEEPON_MASK);
...@@ -342,7 +338,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910, ...@@ -342,7 +338,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
} }
} }
if (pmic_pdata->slp_keepon->clkout32k_keepon) { if (pmic_pdata->slp_keepon.clkout32k_keepon) {
ret = tps65910_reg_set_bits(tps65910, ret = tps65910_reg_set_bits(tps65910,
TPS65910_SLEEP_KEEP_RES_ON, TPS65910_SLEEP_KEEP_RES_ON,
SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK); SLEEP_KEEP_RES_ON_CLKOUT32K_KEEPON_MASK);
...@@ -352,7 +348,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910, ...@@ -352,7 +348,7 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
} }
} }
if (pmic_pdata->slp_keepon->i2chs_keepon) { if (pmic_pdata->slp_keepon.i2chs_keepon) {
ret = tps65910_reg_set_bits(tps65910, ret = tps65910_reg_set_bits(tps65910,
TPS65910_SLEEP_KEEP_RES_ON, TPS65910_SLEEP_KEEP_RES_ON,
SLEEP_KEEP_RES_ON_I2CHS_KEEPON_MASK); SLEEP_KEEP_RES_ON_I2CHS_KEEPON_MASK);
...@@ -415,6 +411,18 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, ...@@ -415,6 +411,18 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
prop = of_property_read_bool(np, "ti,en-ck32k-xtal"); prop = of_property_read_bool(np, "ti,en-ck32k-xtal");
board_info->en_ck32k_xtal = prop; board_info->en_ck32k_xtal = prop;
prop = of_property_read_bool(np, "ti,sleep-enable");
board_info->en_dev_slp = prop;
prop = of_property_read_bool(np, "ti,sleep-keep-therm");
board_info->slp_keepon.therm_keepon = prop;
prop = of_property_read_bool(np, "ti,sleep-keep-ck32k");
board_info->slp_keepon.clkout32k_keepon = prop;
prop = of_property_read_bool(np, "ti,sleep-keep-hsclk");
board_info->slp_keepon.i2chs_keepon = prop;
board_info->irq = client->irq; board_info->irq = client->irq;
board_info->irq_base = -1; board_info->irq_base = -1;
board_info->pm_off = of_property_read_bool(np, board_info->pm_off = of_property_read_bool(np,
......
...@@ -879,7 +879,7 @@ struct tps65910_board { ...@@ -879,7 +879,7 @@ struct tps65910_board {
bool en_ck32k_xtal; bool en_ck32k_xtal;
bool en_dev_slp; bool en_dev_slp;
bool pm_off; bool pm_off;
struct tps65910_sleep_keepon_data *slp_keepon; struct tps65910_sleep_keepon_data slp_keepon;
bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO]; bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO];
unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS]; unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS];
struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS]; struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment