提交 71084406 编写于 作者: F Felipe Balbi 提交者: Samuel Ortiz

mfd: Switch twl4030-power over to defines in twl.h

use the new definitions on twl header for code
consistency.
Signed-off-by: NFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 49e6f87e
...@@ -63,10 +63,6 @@ static u8 twl4030_start_script_address = 0x2b; ...@@ -63,10 +63,6 @@ static u8 twl4030_start_script_address = 0x2b;
#define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59) #define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59)
#define R_MEMORY_DATA PHY_TO_OFF_PM_MASTER(0x5a) #define R_MEMORY_DATA PHY_TO_OFF_PM_MASTER(0x5a)
#define R_PROTECT_KEY 0x0E
#define R_KEY_1 0xC0
#define R_KEY_2 0x0C
/* resource configuration registers /* resource configuration registers
<RESOURCE>_DEV_GRP at address 'n+0' <RESOURCE>_DEV_GRP at address 'n+0'
<RESOURCE>_TYPE at address 'n+1' <RESOURCE>_TYPE at address 'n+1'
...@@ -465,15 +461,17 @@ int twl4030_remove_script(u8 flags) ...@@ -465,15 +461,17 @@ int twl4030_remove_script(u8 flags)
{ {
int err = 0; int err = 0;
err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, R_KEY_1, err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER,
R_PROTECT_KEY); TWL4030_PM_MASTER_KEY_CFG1,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err) { if (err) {
pr_err("twl4030: unable to unlock PROTECT_KEY\n"); pr_err("twl4030: unable to unlock PROTECT_KEY\n");
return err; return err;
} }
err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, R_KEY_2, err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER,
R_PROTECT_KEY); TWL4030_PM_MASTER_KEY_CFG2,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err) { if (err) {
pr_err("twl4030: unable to unlock PROTECT_KEY\n"); pr_err("twl4030: unable to unlock PROTECT_KEY\n");
return err; return err;
...@@ -504,7 +502,8 @@ int twl4030_remove_script(u8 flags) ...@@ -504,7 +502,8 @@ int twl4030_remove_script(u8 flags)
return err; return err;
} }
err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, R_PROTECT_KEY); err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err) if (err)
pr_err("TWL4030 Unable to relock registers\n"); pr_err("TWL4030 Unable to relock registers\n");
...@@ -518,13 +517,15 @@ void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts) ...@@ -518,13 +517,15 @@ void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts)
struct twl4030_resconfig *resconfig; struct twl4030_resconfig *resconfig;
u8 address = twl4030_start_script_address; u8 address = twl4030_start_script_address;
err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, R_KEY_1, err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER,
R_PROTECT_KEY); TWL4030_PM_MASTER_KEY_CFG1,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err) if (err)
goto unlock; goto unlock;
err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, R_KEY_2, err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER,
R_PROTECT_KEY); TWL4030_PM_MASTER_KEY_CFG2,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err) if (err)
goto unlock; goto unlock;
...@@ -546,7 +547,8 @@ void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts) ...@@ -546,7 +547,8 @@ void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts)
} }
} }
err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, R_PROTECT_KEY); err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0,
TWL4030_PM_MASTER_PROTECT_KEY);
if (err) if (err)
pr_err("TWL4030 Unable to relock registers\n"); pr_err("TWL4030 Unable to relock registers\n");
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册