mfd: Switch twl-core over to defines in twl.h
authorFelipe Balbi <felipe.balbi@nokia.com>
Wed, 18 Aug 2010 06:19:35 +0000 (09:19 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 28 Oct 2010 22:28:48 +0000 (00:28 +0200)
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>
drivers/mfd/twl-core.c

index 5d0fb60a4c147138833506588d6329b1e716e1ae..b0f2c0004efe8fdacfd88008e09a9453c6b02f7f 100644 (file)
 
 /* 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)
@@ -846,8 +840,8 @@ 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;
 }
 
@@ -855,10 +849,13 @@ 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;
 }