aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl4030-power.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-16 21:55:20 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-16 21:55:20 -0500
commit2dfea3803dcf70983d14ce1dcbb3e97a7459a28b (patch)
tree59bffc7389ff554585f79d7cc06021790dc2b317 /drivers/mfd/twl4030-power.c
parentaed606e3bc1f10753254db308d3fd8c053c41328 (diff)
parent1881b68b8961a86d40c3c5c205e533515a2dc9c6 (diff)
Merge tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFS update from Samuel Ortiz: "This is the MFD patch set for the 3.8 merge window. We have several new drivers, most of the time coming with their sub devices drivers: - Austria Microsystem's AS3711 - Nano River's viperboard - TI's TPS80031, AM335x TS/ADC, - Realtek's MMC/memstick card reader - Nokia's retu We also got some notable cleanups and improvements: - tps6586x got converted to IRQ domains. - tps65910 and tps65090 moved to the regmap IRQ API. - STMPE is now Device Tree aware. - A general twl6040 and twl-core cleanup, with moves to the regmap I/O and IRQ APIs and a conversion to the recently added PWM framework. - sta2x11 gained regmap support. Then the rest is mostly tiny cleanups and fixes, among which we have Mark's wm5xxx and wm8xxx patchset." Far amount of annoying but largely trivial conflicts. Many due to __devinit/exit removal, others due to one or two of the new drivers also having come in through another tree. * tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (119 commits) mfd: tps6507x: Convert to devm_kzalloc mfd: stmpe: Update DT support for stmpe driver mfd: wm5102: Add readback of DSP status 3 register mfd: arizona: Log if we fail to create the primary IRQ domain mfd: tps80031: MFD_TPS80031 needs to select REGMAP_IRQ mfd: tps80031: Add terminating entry for tps80031_id_table mfd: sta2x11: Fix potential NULL pointer dereference in __sta2x11_mfd_mask() mfd: wm5102: Add tuning for revision B mfd: arizona: Defer patch initialistation until after first device boot mfd: tps65910: Fix wrong ack_base register mfd: tps65910: Remove unused data mfd: stmpe: Get rid of irq_invert_polarity mfd: ab8500-core: Fix invalid free of devm_ allocated data mfd: wm5102: Mark DSP memory regions as volatile mfd: wm5102: Correct default for LDO1_CONTROL_2 mfd: arizona: Register haptics devices mfd: wm8994: Make current device behaviour the default mfd: tps65090: MFD_TPS65090 needs to select REGMAP_IRQ mfd: Fix stmpe.c build when OF is not enabled mfd: jz4740-adc: Use devm_kzalloc ...
Diffstat (limited to 'drivers/mfd/twl4030-power.c')
-rw-r--r--drivers/mfd/twl4030-power.c124
1 files changed, 51 insertions, 73 deletions
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index a5332063183a..4dae241e5017 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -128,12 +128,10 @@ static int twl4030_write_script_byte(u8 address, u8 byte)
128{ 128{
129 int err; 129 int err;
130 130
131 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address, 131 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, address, R_MEMORY_ADDRESS);
132 R_MEMORY_ADDRESS);
133 if (err) 132 if (err)
134 goto out; 133 goto out;
135 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, byte, 134 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, byte, R_MEMORY_DATA);
136 R_MEMORY_DATA);
137out: 135out:
138 return err; 136 return err;
139} 137}
@@ -189,19 +187,16 @@ static int twl4030_config_wakeup3_sequence(u8 address)
189 u8 data; 187 u8 data;
190 188
191 /* Set SLEEP to ACTIVE SEQ address for P3 */ 189 /* Set SLEEP to ACTIVE SEQ address for P3 */
192 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address, 190 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, address, R_SEQ_ADD_S2A3);
193 R_SEQ_ADD_S2A3);
194 if (err) 191 if (err)
195 goto out; 192 goto out;
196 193
197 /* P3 LVL_WAKEUP should be on LEVEL */ 194 /* P3 LVL_WAKEUP should be on LEVEL */
198 err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, 195 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data, R_P3_SW_EVENTS);
199 R_P3_SW_EVENTS);
200 if (err) 196 if (err)
201 goto out; 197 goto out;
202 data |= LVL_WAKEUP; 198 data |= LVL_WAKEUP;
203 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data, 199 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P3_SW_EVENTS);
204 R_P3_SW_EVENTS);
205out: 200out:
206 if (err) 201 if (err)
207 pr_err("TWL4030 wakeup sequence for P3 config error\n"); 202 pr_err("TWL4030 wakeup sequence for P3 config error\n");
@@ -214,43 +209,38 @@ static int twl4030_config_wakeup12_sequence(u8 address)
214 u8 data; 209 u8 data;
215 210
216 /* Set SLEEP to ACTIVE SEQ address for P1 and P2 */ 211 /* Set SLEEP to ACTIVE SEQ address for P1 and P2 */
217 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address, 212 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, address, R_SEQ_ADD_S2A12);
218 R_SEQ_ADD_S2A12);
219 if (err) 213 if (err)
220 goto out; 214 goto out;
221 215
222 /* P1/P2 LVL_WAKEUP should be on LEVEL */ 216 /* P1/P2 LVL_WAKEUP should be on LEVEL */
223 err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, 217 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data, R_P1_SW_EVENTS);
224 R_P1_SW_EVENTS);
225 if (err) 218 if (err)
226 goto out; 219 goto out;
227 220
228 data |= LVL_WAKEUP; 221 data |= LVL_WAKEUP;
229 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data, 222 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P1_SW_EVENTS);
230 R_P1_SW_EVENTS);
231 if (err) 223 if (err)
232 goto out; 224 goto out;
233 225
234 err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, 226 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data, R_P2_SW_EVENTS);
235 R_P2_SW_EVENTS);
236 if (err) 227 if (err)
237 goto out; 228 goto out;
238 229
239 data |= LVL_WAKEUP; 230 data |= LVL_WAKEUP;
240 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data, 231 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data, R_P2_SW_EVENTS);
241 R_P2_SW_EVENTS);
242 if (err) 232 if (err)
243 goto out; 233 goto out;
244 234
245 if (machine_is_omap_3430sdp() || machine_is_omap_ldp()) { 235 if (machine_is_omap_3430sdp() || machine_is_omap_ldp()) {
246 /* Disabling AC charger effect on sleep-active transitions */ 236 /* Disabling AC charger effect on sleep-active transitions */
247 err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data, 237 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &data,
248 R_CFG_P1_TRANSITION); 238 R_CFG_P1_TRANSITION);
249 if (err) 239 if (err)
250 goto out; 240 goto out;
251 data &= ~(1<<1); 241 data &= ~(1<<1);
252 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data , 242 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, data,
253 R_CFG_P1_TRANSITION); 243 R_CFG_P1_TRANSITION);
254 if (err) 244 if (err)
255 goto out; 245 goto out;
256 } 246 }
@@ -267,8 +257,7 @@ static int twl4030_config_sleep_sequence(u8 address)
267 int err; 257 int err;
268 258
269 /* Set ACTIVE to SLEEP SEQ address in T2 memory*/ 259 /* Set ACTIVE to SLEEP SEQ address in T2 memory*/
270 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address, 260 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, address, R_SEQ_ADD_A2S);
271 R_SEQ_ADD_A2S);
272 261
273 if (err) 262 if (err)
274 pr_err("TWL4030 sleep sequence config error\n"); 263 pr_err("TWL4030 sleep sequence config error\n");
@@ -282,42 +271,35 @@ static int twl4030_config_warmreset_sequence(u8 address)
282 u8 rd_data; 271 u8 rd_data;
283 272
284 /* Set WARM RESET SEQ address for P1 */ 273 /* Set WARM RESET SEQ address for P1 */
285 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address, 274 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, address, R_SEQ_ADD_WARM);
286 R_SEQ_ADD_WARM);
287 if (err) 275 if (err)
288 goto out; 276 goto out;
289 277
290 /* P1/P2/P3 enable WARMRESET */ 278 /* P1/P2/P3 enable WARMRESET */
291 err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &rd_data, 279 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &rd_data, R_P1_SW_EVENTS);
292 R_P1_SW_EVENTS);
293 if (err) 280 if (err)
294 goto out; 281 goto out;
295 282
296 rd_data |= ENABLE_WARMRESET; 283 rd_data |= ENABLE_WARMRESET;
297 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data, 284 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P1_SW_EVENTS);
298 R_P1_SW_EVENTS);
299 if (err) 285 if (err)
300 goto out; 286 goto out;
301 287
302 err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &rd_data, 288 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &rd_data, R_P2_SW_EVENTS);
303 R_P2_SW_EVENTS);
304 if (err) 289 if (err)
305 goto out; 290 goto out;
306 291
307 rd_data |= ENABLE_WARMRESET; 292 rd_data |= ENABLE_WARMRESET;
308 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data, 293 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P2_SW_EVENTS);
309 R_P2_SW_EVENTS);
310 if (err) 294 if (err)
311 goto out; 295 goto out;
312 296
313 err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &rd_data, 297 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &rd_data, R_P3_SW_EVENTS);
314 R_P3_SW_EVENTS);
315 if (err) 298 if (err)
316 goto out; 299 goto out;
317 300
318 rd_data |= ENABLE_WARMRESET; 301 rd_data |= ENABLE_WARMRESET;
319 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data, 302 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, rd_data, R_P3_SW_EVENTS);
320 R_P3_SW_EVENTS);
321out: 303out:
322 if (err) 304 if (err)
323 pr_err("TWL4030 warmreset seq config error\n"); 305 pr_err("TWL4030 warmreset seq config error\n");
@@ -341,7 +323,7 @@ static int twl4030_configure_resource(struct twl4030_resconfig *rconfig)
341 rconfig_addr = res_config_addrs[rconfig->resource]; 323 rconfig_addr = res_config_addrs[rconfig->resource];
342 324
343 /* Set resource group */ 325 /* Set resource group */
344 err = twl_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &grp, 326 err = twl_i2c_read_u8(TWL_MODULE_PM_RECEIVER, &grp,
345 rconfig_addr + DEV_GRP_OFFSET); 327 rconfig_addr + DEV_GRP_OFFSET);
346 if (err) { 328 if (err) {
347 pr_err("TWL4030 Resource %d group could not be read\n", 329 pr_err("TWL4030 Resource %d group could not be read\n",
@@ -352,7 +334,7 @@ static int twl4030_configure_resource(struct twl4030_resconfig *rconfig)
352 if (rconfig->devgroup != TWL4030_RESCONFIG_UNDEF) { 334 if (rconfig->devgroup != TWL4030_RESCONFIG_UNDEF) {
353 grp &= ~DEV_GRP_MASK; 335 grp &= ~DEV_GRP_MASK;
354 grp |= rconfig->devgroup << DEV_GRP_SHIFT; 336 grp |= rconfig->devgroup << DEV_GRP_SHIFT;
355 err = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 337 err = twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER,
356 grp, rconfig_addr + DEV_GRP_OFFSET); 338 grp, rconfig_addr + DEV_GRP_OFFSET);
357 if (err < 0) { 339 if (err < 0) {
358 pr_err("TWL4030 failed to program devgroup\n"); 340 pr_err("TWL4030 failed to program devgroup\n");
@@ -361,7 +343,7 @@ static int twl4030_configure_resource(struct twl4030_resconfig *rconfig)
361 } 343 }
362 344
363 /* Set resource types */ 345 /* Set resource types */
364 err = twl_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &type, 346 err = twl_i2c_read_u8(TWL_MODULE_PM_RECEIVER, &type,
365 rconfig_addr + TYPE_OFFSET); 347 rconfig_addr + TYPE_OFFSET);
366 if (err < 0) { 348 if (err < 0) {
367 pr_err("TWL4030 Resource %d type could not be read\n", 349 pr_err("TWL4030 Resource %d type could not be read\n",
@@ -379,7 +361,7 @@ static int twl4030_configure_resource(struct twl4030_resconfig *rconfig)
379 type |= rconfig->type2 << TYPE2_SHIFT; 361 type |= rconfig->type2 << TYPE2_SHIFT;
380 } 362 }
381 363
382 err = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 364 err = twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER,
383 type, rconfig_addr + TYPE_OFFSET); 365 type, rconfig_addr + TYPE_OFFSET);
384 if (err < 0) { 366 if (err < 0) {
385 pr_err("TWL4030 failed to program resource type\n"); 367 pr_err("TWL4030 failed to program resource type\n");
@@ -387,7 +369,7 @@ static int twl4030_configure_resource(struct twl4030_resconfig *rconfig)
387 } 369 }
388 370
389 /* Set remap states */ 371 /* Set remap states */
390 err = twl_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &remap, 372 err = twl_i2c_read_u8(TWL_MODULE_PM_RECEIVER, &remap,
391 rconfig_addr + REMAP_OFFSET); 373 rconfig_addr + REMAP_OFFSET);
392 if (err < 0) { 374 if (err < 0) {
393 pr_err("TWL4030 Resource %d remap could not be read\n", 375 pr_err("TWL4030 Resource %d remap could not be read\n",
@@ -405,7 +387,7 @@ static int twl4030_configure_resource(struct twl4030_resconfig *rconfig)
405 remap |= rconfig->remap_sleep << SLEEP_STATE_SHIFT; 387 remap |= rconfig->remap_sleep << SLEEP_STATE_SHIFT;
406 } 388 }
407 389
408 err = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 390 err = twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER,
409 remap, 391 remap,
410 rconfig_addr + REMAP_OFFSET); 392 rconfig_addr + REMAP_OFFSET);
411 if (err < 0) { 393 if (err < 0) {
@@ -463,49 +445,47 @@ int twl4030_remove_script(u8 flags)
463{ 445{
464 int err = 0; 446 int err = 0;
465 447
466 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 448 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1,
467 TWL4030_PM_MASTER_KEY_CFG1, 449 TWL4030_PM_MASTER_PROTECT_KEY);
468 TWL4030_PM_MASTER_PROTECT_KEY);
469 if (err) { 450 if (err) {
470 pr_err("twl4030: unable to unlock PROTECT_KEY\n"); 451 pr_err("twl4030: unable to unlock PROTECT_KEY\n");
471 return err; 452 return err;
472 } 453 }
473 454
474 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 455 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG2,
475 TWL4030_PM_MASTER_KEY_CFG2, 456 TWL4030_PM_MASTER_PROTECT_KEY);
476 TWL4030_PM_MASTER_PROTECT_KEY);
477 if (err) { 457 if (err) {
478 pr_err("twl4030: unable to unlock PROTECT_KEY\n"); 458 pr_err("twl4030: unable to unlock PROTECT_KEY\n");
479 return err; 459 return err;
480 } 460 }
481 461
482 if (flags & TWL4030_WRST_SCRIPT) { 462 if (flags & TWL4030_WRST_SCRIPT) {
483 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, END_OF_SCRIPT, 463 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
484 R_SEQ_ADD_WARM); 464 R_SEQ_ADD_WARM);
485 if (err) 465 if (err)
486 return err; 466 return err;
487 } 467 }
488 if (flags & TWL4030_WAKEUP12_SCRIPT) { 468 if (flags & TWL4030_WAKEUP12_SCRIPT) {
489 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, END_OF_SCRIPT, 469 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
490 R_SEQ_ADD_S2A12); 470 R_SEQ_ADD_S2A12);
491 if (err) 471 if (err)
492 return err; 472 return err;
493 } 473 }
494 if (flags & TWL4030_WAKEUP3_SCRIPT) { 474 if (flags & TWL4030_WAKEUP3_SCRIPT) {
495 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, END_OF_SCRIPT, 475 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
496 R_SEQ_ADD_S2A3); 476 R_SEQ_ADD_S2A3);
497 if (err) 477 if (err)
498 return err; 478 return err;
499 } 479 }
500 if (flags & TWL4030_SLEEP_SCRIPT) { 480 if (flags & TWL4030_SLEEP_SCRIPT) {
501 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, END_OF_SCRIPT, 481 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
502 R_SEQ_ADD_A2S); 482 R_SEQ_ADD_A2S);
503 if (err) 483 if (err)
504 return err; 484 return err;
505 } 485 }
506 486
507 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, 487 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0,
508 TWL4030_PM_MASTER_PROTECT_KEY); 488 TWL4030_PM_MASTER_PROTECT_KEY);
509 if (err) 489 if (err)
510 pr_err("TWL4030 Unable to relock registers\n"); 490 pr_err("TWL4030 Unable to relock registers\n");
511 491
@@ -521,7 +501,7 @@ void twl4030_power_off(void)
521{ 501{
522 int err; 502 int err;
523 503
524 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, PWR_DEVOFF, 504 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, PWR_DEVOFF,
525 TWL4030_PM_MASTER_P1_SW_EVENTS); 505 TWL4030_PM_MASTER_P1_SW_EVENTS);
526 if (err) 506 if (err)
527 pr_err("TWL4030 Unable to power off\n"); 507 pr_err("TWL4030 Unable to power off\n");
@@ -534,15 +514,13 @@ void twl4030_power_init(struct twl4030_power_data *twl4030_scripts)
534 struct twl4030_resconfig *resconfig; 514 struct twl4030_resconfig *resconfig;
535 u8 val, address = twl4030_start_script_address; 515 u8 val, address = twl4030_start_script_address;
536 516
537 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 517 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG1,
538 TWL4030_PM_MASTER_KEY_CFG1, 518 TWL4030_PM_MASTER_PROTECT_KEY);
539 TWL4030_PM_MASTER_PROTECT_KEY);
540 if (err) 519 if (err)
541 goto unlock; 520 goto unlock;
542 521
543 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 522 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, TWL4030_PM_MASTER_KEY_CFG2,
544 TWL4030_PM_MASTER_KEY_CFG2, 523 TWL4030_PM_MASTER_PROTECT_KEY);
545 TWL4030_PM_MASTER_PROTECT_KEY);
546 if (err) 524 if (err)
547 goto unlock; 525 goto unlock;
548 526
@@ -567,14 +545,14 @@ void twl4030_power_init(struct twl4030_power_data *twl4030_scripts)
567 /* Board has to be wired properly to use this feature */ 545 /* Board has to be wired properly to use this feature */
568 if (twl4030_scripts->use_poweroff && !pm_power_off) { 546 if (twl4030_scripts->use_poweroff && !pm_power_off) {
569 /* Default for SEQ_OFFSYNC is set, lets ensure this */ 547 /* Default for SEQ_OFFSYNC is set, lets ensure this */
570 err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &val, 548 err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val,
571 TWL4030_PM_MASTER_CFG_P123_TRANSITION); 549 TWL4030_PM_MASTER_CFG_P123_TRANSITION);
572 if (err) { 550 if (err) {
573 pr_warning("TWL4030 Unable to read registers\n"); 551 pr_warning("TWL4030 Unable to read registers\n");
574 552
575 } else if (!(val & SEQ_OFFSYNC)) { 553 } else if (!(val & SEQ_OFFSYNC)) {
576 val |= SEQ_OFFSYNC; 554 val |= SEQ_OFFSYNC;
577 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, val, 555 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, val,
578 TWL4030_PM_MASTER_CFG_P123_TRANSITION); 556 TWL4030_PM_MASTER_CFG_P123_TRANSITION);
579 if (err) { 557 if (err) {
580 pr_err("TWL4030 Unable to setup SEQ_OFFSYNC\n"); 558 pr_err("TWL4030 Unable to setup SEQ_OFFSYNC\n");
@@ -586,8 +564,8 @@ void twl4030_power_init(struct twl4030_power_data *twl4030_scripts)
586 } 564 }
587 565
588relock: 566relock:
589 err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, 567 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, 0,
590 TWL4030_PM_MASTER_PROTECT_KEY); 568 TWL4030_PM_MASTER_PROTECT_KEY);
591 if (err) 569 if (err)
592 pr_err("TWL4030 Unable to relock registers\n"); 570 pr_err("TWL4030 Unable to relock registers\n");
593 return; 571 return;