diff options
-rw-r--r-- | Documentation/devicetree/bindings/mfd/tps65910.txt | 4 | ||||
-rw-r--r-- | drivers/mfd/tps65910.c | 22 | ||||
-rw-r--r-- | include/linux/mfd/tps65910.h | 3 |
3 files changed, 29 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/mfd/tps65910.txt b/Documentation/devicetree/bindings/mfd/tps65910.txt index db03599ae4dc..2e3304888ffc 100644 --- a/Documentation/devicetree/bindings/mfd/tps65910.txt +++ b/Documentation/devicetree/bindings/mfd/tps65910.txt | |||
@@ -59,6 +59,8 @@ Optional properties: | |||
59 | in TPS6591X datasheet) | 59 | in TPS6591X datasheet) |
60 | - ti,en-gpio-sleep: enable sleep control for gpios | 60 | - ti,en-gpio-sleep: enable sleep control for gpios |
61 | There should be 9 entries here, one for each gpio. | 61 | There should be 9 entries here, one for each gpio. |
62 | - ti,system-power-controller: Telling whether or not this pmic is controlling | ||
63 | the system power. | ||
62 | 64 | ||
63 | Regulator Optional properties: | 65 | Regulator Optional properties: |
64 | - ti,regulator-ext-sleep-control: enable external sleep | 66 | - ti,regulator-ext-sleep-control: enable external sleep |
@@ -79,6 +81,8 @@ Example: | |||
79 | #interrupt-cells = <2>; | 81 | #interrupt-cells = <2>; |
80 | interrupt-controller; | 82 | interrupt-controller; |
81 | 83 | ||
84 | ti,system-power-controller; | ||
85 | |||
82 | ti,vmbch-threshold = 0; | 86 | ti,vmbch-threshold = 0; |
83 | ti,vmbch2-threshold = 0; | 87 | ti,vmbch2-threshold = 0; |
84 | ti,en-ck32k-xtal; | 88 | ti,en-ck32k-xtal; |
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c index d3ce4d569deb..ca902943cfa9 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c | |||
@@ -198,6 +198,8 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, | |||
198 | 198 | ||
199 | board_info->irq = client->irq; | 199 | board_info->irq = client->irq; |
200 | board_info->irq_base = -1; | 200 | board_info->irq_base = -1; |
201 | board_info->pm_off = of_property_read_bool(np, | ||
202 | "ti,system-power-controller"); | ||
201 | 203 | ||
202 | return board_info; | 204 | return board_info; |
203 | } | 205 | } |
@@ -210,6 +212,21 @@ struct tps65910_board *tps65910_parse_dt(struct i2c_client *client, | |||
210 | } | 212 | } |
211 | #endif | 213 | #endif |
212 | 214 | ||
215 | static struct i2c_client *tps65910_i2c_client; | ||
216 | static void tps65910_power_off(void) | ||
217 | { | ||
218 | struct tps65910 *tps65910; | ||
219 | |||
220 | tps65910 = dev_get_drvdata(&tps65910_i2c_client->dev); | ||
221 | |||
222 | if (tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL, | ||
223 | DEVCTRL_PWR_OFF_MASK) < 0) | ||
224 | return; | ||
225 | |||
226 | tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, | ||
227 | DEVCTRL_DEV_ON_MASK); | ||
228 | } | ||
229 | |||
213 | static __devinit int tps65910_i2c_probe(struct i2c_client *i2c, | 230 | static __devinit int tps65910_i2c_probe(struct i2c_client *i2c, |
214 | const struct i2c_device_id *id) | 231 | const struct i2c_device_id *id) |
215 | { | 232 | { |
@@ -267,6 +284,11 @@ static __devinit int tps65910_i2c_probe(struct i2c_client *i2c, | |||
267 | tps65910_ck32k_init(tps65910, pmic_plat_data); | 284 | tps65910_ck32k_init(tps65910, pmic_plat_data); |
268 | tps65910_sleepinit(tps65910, pmic_plat_data); | 285 | tps65910_sleepinit(tps65910, pmic_plat_data); |
269 | 286 | ||
287 | if (pmic_plat_data->pm_off && !pm_power_off) { | ||
288 | tps65910_i2c_client = i2c; | ||
289 | pm_power_off = tps65910_power_off; | ||
290 | } | ||
291 | |||
270 | return ret; | 292 | return ret; |
271 | } | 293 | } |
272 | 294 | ||
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h index 9bf8767818b4..ac772b36a1b1 100644 --- a/include/linux/mfd/tps65910.h +++ b/include/linux/mfd/tps65910.h | |||
@@ -366,6 +366,8 @@ | |||
366 | 366 | ||
367 | 367 | ||
368 | /*Register DEVCTRL (0x80) register.RegisterDescription */ | 368 | /*Register DEVCTRL (0x80) register.RegisterDescription */ |
369 | #define DEVCTRL_PWR_OFF_MASK 0x80 | ||
370 | #define DEVCTRL_PWR_OFF_SHIFT 7 | ||
369 | #define DEVCTRL_RTC_PWDN_MASK 0x40 | 371 | #define DEVCTRL_RTC_PWDN_MASK 0x40 |
370 | #define DEVCTRL_RTC_PWDN_SHIFT 6 | 372 | #define DEVCTRL_RTC_PWDN_SHIFT 6 |
371 | #define DEVCTRL_CK32K_CTRL_MASK 0x20 | 373 | #define DEVCTRL_CK32K_CTRL_MASK 0x20 |
@@ -809,6 +811,7 @@ struct tps65910_board { | |||
809 | int vmbch2_threshold; | 811 | int vmbch2_threshold; |
810 | bool en_ck32k_xtal; | 812 | bool en_ck32k_xtal; |
811 | bool en_dev_slp; | 813 | bool en_dev_slp; |
814 | bool pm_off; | ||
812 | struct tps65910_sleep_keepon_data *slp_keepon; | 815 | struct tps65910_sleep_keepon_data *slp_keepon; |
813 | bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO]; | 816 | bool en_gpio_sleep[TPS6591X_MAX_NUM_GPIO]; |
814 | unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS]; | 817 | unsigned long regulator_ext_sleep_control[TPS65910_NUM_REGS]; |