aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mfd/twl4030-power.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 1b30d8adc270..0b037dca46a8 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -34,8 +34,15 @@
34 34
35static u8 twl4030_start_script_address = 0x2b; 35static u8 twl4030_start_script_address = 0x2b;
36 36
37#define PWR_P1_SW_EVENTS 0x10 37/* Register bits for P1, P2 and P3_SW_EVENTS */
38#define PWR_DEVOFF (1 << 0) 38#define PWR_STOPON_PRWON BIT(6)
39#define PWR_STOPON_SYSEN BIT(5)
40#define PWR_ENABLE_WARMRESET BIT(4)
41#define PWR_LVL_WAKEUP BIT(3)
42#define PWR_DEVACT BIT(2)
43#define PWR_DEVSLP BIT(1)
44#define PWR_DEVOFF BIT(0)
45
39#define SEQ_OFFSYNC (1 << 0) 46#define SEQ_OFFSYNC (1 << 0)
40 47
41#define PHY_TO_OFF_PM_MASTER(p) (p - 0x36) 48#define PHY_TO_OFF_PM_MASTER(p) (p - 0x36)
@@ -52,10 +59,6 @@ static u8 twl4030_start_script_address = 0x2b;
52#define R_CFG_P2_TRANSITION PHY_TO_OFF_PM_MASTER(0x37) 59#define R_CFG_P2_TRANSITION PHY_TO_OFF_PM_MASTER(0x37)
53#define R_CFG_P3_TRANSITION PHY_TO_OFF_PM_MASTER(0x38) 60#define R_CFG_P3_TRANSITION PHY_TO_OFF_PM_MASTER(0x38)
54 61
55#define LVL_WAKEUP 0x08
56
57#define ENABLE_WARMRESET (1<<4)
58
59#define END_OF_SCRIPT 0x3f 62#define END_OF_SCRIPT 0x3f
60 63
61#define R_SEQ_ADD_A2S PHY_TO_OFF_PM_MASTER(0x55) 64#define R_SEQ_ADD_A2S PHY_TO_OFF_PM_MASTER(0x55)
@@ -196,7 +199,7 @@ static int twl4030_config_wakeup3_sequence(u8 address)
196 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data, R_P3_SW_EVENTS); 199 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data, R_P3_SW_EVENTS);
197 if (err) 200 if (err)
198 goto out; 201 goto out;
199 data |= LVL_WAKEUP; 202 data |= PWR_LVL_WAKEUP;
200 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P3_SW_EVENTS); 203 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P3_SW_EVENTS);
201out: 204out:
202 if (err) 205 if (err)
@@ -219,7 +222,7 @@ static int twl4030_config_wakeup12_sequence(u8 address)
219 if (err) 222 if (err)
220 goto out; 223 goto out;
221 224
222 data |= LVL_WAKEUP; 225 data |= PWR_LVL_WAKEUP;
223 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P1_SW_EVENTS); 226 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P1_SW_EVENTS);
224 if (err) 227 if (err)
225 goto out; 228 goto out;
@@ -228,7 +231,7 @@ static int twl4030_config_wakeup12_sequence(u8 address)
228 if (err) 231 if (err)
229 goto out; 232 goto out;
230 233
231 data |= LVL_WAKEUP; 234 data |= PWR_LVL_WAKEUP;
232 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P2_SW_EVENTS); 235 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P2_SW_EVENTS);
233 if (err) 236 if (err)
234 goto out; 237 goto out;
@@ -281,7 +284,7 @@ static int twl4030_config_warmreset_sequence(u8 address)
281 if (err) 284 if (err)
282 goto out; 285 goto out;
283 286
284 rd_data |= ENABLE_WARMRESET; 287 rd_data |= PWR_ENABLE_WARMRESET;
285 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P1_SW_EVENTS); 288 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P1_SW_EVENTS);
286 if (err) 289 if (err)
287 goto out; 290 goto out;
@@ -290,7 +293,7 @@ static int twl4030_config_warmreset_sequence(u8 address)
290 if (err) 293 if (err)
291 goto out; 294 goto out;
292 295
293 rd_data |= ENABLE_WARMRESET; 296 rd_data |= PWR_ENABLE_WARMRESET;
294 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P2_SW_EVENTS); 297 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P2_SW_EVENTS);
295 if (err) 298 if (err)
296 goto out; 299 goto out;
@@ -299,7 +302,7 @@ static int twl4030_config_warmreset_sequence(u8 address)
299 if (err) 302 if (err)
300 goto out; 303 goto out;
301 304
302 rd_data |= ENABLE_WARMRESET; 305 rd_data |= PWR_ENABLE_WARMRESET;
303 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P3_SW_EVENTS); 306 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P3_SW_EVENTS);
304out: 307out:
305 if (err) 308 if (err)