Skip to content

Commit

Permalink
mfd: Switch twl-core over to defines in twl.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Balbi authored and Samuel Ortiz committed Oct 28, 2010
1 parent 8971205 commit 49e6f87
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions drivers/mfd/twl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,6 @@

/* Few power values */
#define R_CFG_BOOT 0x05
#define R_PROTECT_KEY 0x0E

/* access control values for R_PROTECT_KEY */
#define KEY_UNLOCK1 0xce
#define KEY_UNLOCK2 0xec
#define KEY_LOCK 0x00

/* some fields in R_CFG_BOOT */
#define HFCLK_FREQ_19p2_MHZ (1 << 0)
Expand Down Expand Up @@ -846,19 +840,22 @@ static inline int __init protect_pm_master(void)
{
int e = 0;

e = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, KEY_LOCK,
R_PROTECT_KEY);
e = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0,
TWL4030_PM_MASTER_PROTECT_KEY);
return e;
}

static inline int __init unprotect_pm_master(void)
{
int e = 0;

e |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, KEY_UNLOCK1,
R_PROTECT_KEY);
e |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, KEY_UNLOCK2,
R_PROTECT_KEY);
e |= twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER,
TWL4030_PM_MASTER_KEY_CFG1,
TWL4030_PM_MASTER_PROTECT_KEY);
e |= twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER,
TWL4030_PM_MASTER_KEY_CFG2,
TWL4030_PM_MASTER_PROTECT_KEY);

return e;
}

Expand Down

0 comments on commit 49e6f87

Please sign in to comment.