diff options
author | Felipe Balbi <felipe.balbi@nokia.com> | 2010-08-18 02:19:36 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-10-28 18:28:49 -0400 |
commit | 71084406bc605621c61e3ec4776bd84f265d5df3 (patch) | |
tree | a20a2ea4f5a271a8713b761723681894ede68418 /drivers/mfd/twl4030-power.c | |
parent | 49e6f87eb6bcdc40663958f938e4b919dca47f40 (diff) |
mfd: Switch twl4030-power over to defines in twl.h
use the new definitions on twl header for code
consistency.
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/twl4030-power.c')
-rw-r--r-- | drivers/mfd/twl4030-power.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 7efa8789a3a2..16422de0823a 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c | |||
@@ -63,10 +63,6 @@ static u8 twl4030_start_script_address = 0x2b; | |||
63 | #define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59) | 63 | #define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59) |
64 | #define R_MEMORY_DATA PHY_TO_OFF_PM_MASTER(0x5a) | 64 | #define R_MEMORY_DATA PHY_TO_OFF_PM_MASTER(0x5a) |
65 | 65 | ||
66 | #define R_PROTECT_KEY 0x0E | ||
67 | #define R_KEY_1 0xC0 | ||
68 | #define R_KEY_2 0x0C | ||
69 | |||
70 | /* resource configuration registers | 66 | /* resource configuration registers |
71 | <RESOURCE>_DEV_GRP at address 'n+0' | 67 | <RESOURCE>_DEV_GRP at address 'n+0' |
72 | <RESOURCE>_TYPE at address 'n+1' | 68 | <RESOURCE>_TYPE at address 'n+1' |
@@ -465,15 +461,17 @@ int twl4030_remove_script(u8 flags) | |||
465 | { | 461 | { |
466 | int err = 0; | 462 | int err = 0; |
467 | 463 | ||
468 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, R_KEY_1, | 464 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, |
469 | R_PROTECT_KEY); | 465 | TWL4030_PM_MASTER_KEY_CFG1, |
466 | TWL4030_PM_MASTER_PROTECT_KEY); | ||
470 | if (err) { | 467 | if (err) { |
471 | pr_err("twl4030: unable to unlock PROTECT_KEY\n"); | 468 | pr_err("twl4030: unable to unlock PROTECT_KEY\n"); |
472 | return err; | 469 | return err; |
473 | } | 470 | } |
474 | 471 | ||
475 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, R_KEY_2, | 472 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, |
476 | R_PROTECT_KEY); | 473 | TWL4030_PM_MASTER_KEY_CFG2, |
474 | TWL4030_PM_MASTER_PROTECT_KEY); | ||
477 | if (err) { | 475 | if (err) { |
478 | pr_err("twl4030: unable to unlock PROTECT_KEY\n"); | 476 | pr_err("twl4030: unable to unlock PROTECT_KEY\n"); |
479 | return err; | 477 | return err; |
@@ -504,7 +502,8 @@ int twl4030_remove_script(u8 flags) | |||
504 | return err; | 502 | return err; |
505 | } | 503 | } |
506 | 504 | ||
507 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, R_PROTECT_KEY); | 505 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, |
506 | TWL4030_PM_MASTER_PROTECT_KEY); | ||
508 | if (err) | 507 | if (err) |
509 | pr_err("TWL4030 Unable to relock registers\n"); | 508 | pr_err("TWL4030 Unable to relock registers\n"); |
510 | 509 | ||
@@ -518,13 +517,15 @@ void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts) | |||
518 | struct twl4030_resconfig *resconfig; | 517 | struct twl4030_resconfig *resconfig; |
519 | u8 address = twl4030_start_script_address; | 518 | u8 address = twl4030_start_script_address; |
520 | 519 | ||
521 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, R_KEY_1, | 520 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, |
522 | R_PROTECT_KEY); | 521 | TWL4030_PM_MASTER_KEY_CFG1, |
522 | TWL4030_PM_MASTER_PROTECT_KEY); | ||
523 | if (err) | 523 | if (err) |
524 | goto unlock; | 524 | goto unlock; |
525 | 525 | ||
526 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, R_KEY_2, | 526 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, |
527 | R_PROTECT_KEY); | 527 | TWL4030_PM_MASTER_KEY_CFG2, |
528 | TWL4030_PM_MASTER_PROTECT_KEY); | ||
528 | if (err) | 529 | if (err) |
529 | goto unlock; | 530 | goto unlock; |
530 | 531 | ||
@@ -546,7 +547,8 @@ void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts) | |||
546 | } | 547 | } |
547 | } | 548 | } |
548 | 549 | ||
549 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, R_PROTECT_KEY); | 550 | err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, |
551 | TWL4030_PM_MASTER_PROTECT_KEY); | ||
550 | if (err) | 552 | if (err) |
551 | pr_err("TWL4030 Unable to relock registers\n"); | 553 | pr_err("TWL4030 Unable to relock registers\n"); |
552 | return; | 554 | return; |