rk:move pmic_type to board.h
author张晴 <zhangqing@rock-chips.com>
Wed, 17 Oct 2012 07:18:35 +0000 (15:18 +0800)
committer张晴 <zhangqing@rock-chips.com>
Wed, 17 Oct 2012 07:18:35 +0000 (15:18 +0800)
arch/arm/mach-rk2928/board-rk2926-sdk.c
arch/arm/mach-rk2928/board-rk2928-a720.c
arch/arm/mach-rk2928/board-rk2928-sdk.c
arch/arm/mach-rk2928/board-rk2928.c
arch/arm/mach-rk2928/i2c_sram.c
arch/arm/mach-rk2928/include/mach/board.h
arch/arm/mach-rk30/board-rk30-phonepad.c
arch/arm/mach-rk30/board-rk30-sdk.c
arch/arm/mach-rk30/board-rk3066b-m701.c
arch/arm/mach-rk30/board-rk3066b-sdk.c
arch/arm/plat-rk/include/plat/board.h

index 9f9a0a21fc3dd81c0dbb69df151524bfdaffdf6a..64c1ef9f9cc49c6b54f50e7d19d3e52b8ad53825 100755 (executable)
@@ -125,16 +125,12 @@ static int rk29_backlight_pwm_suspend(void)
                return -1;
        }
        #if defined(CONFIG_MFD_TPS65910)        
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
-       {
-               gpio_direction_output(PWM_GPIO, GPIO_LOW);
-       }
+        if (pmic_is_tps65910() )
+          gpio_direction_output(PWM_GPIO, GPIO_LOW);
        #endif
        #if defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
-       {
-               gpio_direction_output(PWM_GPIO, GPIO_HIGH);
-       }
+        if (pmic_is_act8931() )
+          gpio_direction_output(PWM_GPIO, GPIO_HIGH);
        #endif
 #ifdef  LCD_DISP_ON_PIN
        gpio_direction_output(BL_EN_PIN, 0);
@@ -207,8 +203,7 @@ static int rk_fb_io_disable(void)
 {
 
        #if 0//defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
-       {
+       if (pmic_is_act8931() ){
                struct regulator *ldo;
                ldo = regulator_get(NULL, "act_ldo4");   //vcc_lcd
                regulator_disable(ldo);
@@ -222,8 +217,7 @@ static int rk_fb_io_disable(void)
 static int rk_fb_io_enable(void)
 {
        #if 0//defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
-       {
+       if (pmic_is_act8931() ){
                struct regulator *ldo;
                ldo = regulator_get(NULL, "act_ldo4");   //vcc_lcd
                regulator_enable(ldo);
@@ -449,14 +443,12 @@ static void rkusb_wifi_power(int on) {
        struct regulator *ldo = NULL;
        
 #if defined(CONFIG_MFD_TPS65910)       
-       if(g_pmic_type == PMIC_TYPE_TPS65910) {
+       if (pmic_is_tps65910() )
                ldo = regulator_get(NULL, "vmmc");  //vccio_wl
-       }
 #endif
 #if defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931) {
+       if(pmic_is_act8931() )
                ldo = regulator_get(NULL, "act_ldo4");  //vccio_wl
-       }
 #endif 
        
        if(on) {
@@ -702,15 +694,15 @@ void  rk30_pwm_resume_voltage_set(void)
 void __sramfunc board_pmu_suspend(void)
 {      
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
-       board_pmu_tps65910_suspend(); 
+        if(pmic_is_tps65910() )
+        board_pmu_tps65910_suspend(); 
        #endif   
 }
 void __sramfunc board_pmu_resume(void)
 {      
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
-       board_pmu_tps65910_resume(); 
+        if(pmic_is_tps65910() )
+        board_pmu_tps65910_resume(); 
        #endif
 }
 
@@ -794,18 +786,15 @@ static void rk2928_pm_power_off(void)
        printk(KERN_ERR "rk2928_pm_power_off start...\n");
         
         #if defined(CONFIG_REGULATOR_ACT8931)
-        if(g_pmic_type == PMIC_TYPE_ACT8931)
-        {
+         if (pmic_is_act8931() ){
               if(act8931_charge_det)
                    arm_pm_restart(0, NULL);
-        }
+         }
         #endif
        
        #if defined(CONFIG_MFD_TPS65910)        
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
-       {
+        if(pmic_is_tps65910() )
                tps65910_device_shutdown();//tps65910 shutdown
-       }
        #endif
        gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
        
index 3ed19d531741fdc8b3c617ba529f8a0774891e3a..41803c13fdababcc575ad25d5a8e0123765e0dbf 100755 (executable)
@@ -129,13 +129,13 @@ static int rk29_backlight_pwm_suspend(void)
                return -1;
        }
        #if defined(CONFIG_MFD_TPS65910)        
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        {
                gpio_direction_output(PWM_GPIO, GPIO_LOW);
        }
        #endif
        #if defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
+       if(pmic_is_act8931())
        {
                gpio_direction_output(PWM_GPIO, GPIO_HIGH);
        }
@@ -215,7 +215,7 @@ static int rk_fb_io_disable(void)
 {
 
        #if 0//defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
+       if(pmic_is_act8931())
        {
                struct regulator *ldo;
                ldo = regulator_get(NULL, "act_ldo4");   //vcc_lcd
@@ -230,7 +230,7 @@ static int rk_fb_io_disable(void)
 static int rk_fb_io_enable(void)
 {
        #if 0//defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
+       if(pmic_is_act8931())
        {
                struct regulator *ldo;
                ldo = regulator_get(NULL, "act_ldo4");   //vcc_lcd
@@ -478,12 +478,12 @@ static void rkusb_wifi_power(int on) {
        struct regulator *ldo = NULL;
        
 #if defined(CONFIG_MFD_TPS65910)       
-       if(g_pmic_type == PMIC_TYPE_TPS65910) {
+       if(pmic_is_tps65910()) {
                ldo = regulator_get(NULL, "vmmc");  //vccio_wl
        }
 #endif
 #if defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931) {
+       if(pmic_is_act8931()) {
                ldo = regulator_get(NULL, "act_ldo4");  //vccio_wl
        }
 #endif 
@@ -761,14 +761,14 @@ void  rk30_pwm_resume_voltage_set(void)
 void __sramfunc board_pmu_suspend(void)
 {      
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        board_pmu_tps65910_suspend(); 
        #endif   
 }
 void __sramfunc board_pmu_resume(void)
 {      
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        board_pmu_tps65910_resume(); 
        #endif
 }
@@ -857,7 +857,7 @@ static void rk2928_pm_power_off(void)
        printk(KERN_ERR "rk2928_pm_power_off start...\n");
         
         #if defined(CONFIG_REGULATOR_ACT8931)
-        if(g_pmic_type == PMIC_TYPE_ACT8931)
+        if(pmic_is_act8931())
         {
               if(act8931_charge_det)
                    arm_pm_restart(0, NULL);
@@ -865,7 +865,7 @@ static void rk2928_pm_power_off(void)
         #endif
        
        #if defined(CONFIG_MFD_TPS65910)        
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        {
                tps65910_device_shutdown();//tps65910 shutdown
        }
index 4e2a00f5faada44eb841533a106ed934c6c13990..84e6768715bd51016842cd4b6a8f6149e0409938 100755 (executable)
@@ -59,8 +59,6 @@
 #include "board-rk2928-sdk-key.c"\r
 \r
 int __sramdata g_pmic_type =  0;\r
-#define PMIC_TYPE_TPS65910     2\r
-#define PMIC_TYPE_ACT8931      3\r
 \r
 #ifdef  CONFIG_THREE_FB_BUFFER\r
 #define RK30_FB0_MEM_SIZE 12*SZ_1M\r
@@ -127,13 +125,13 @@ static int rk29_backlight_pwm_suspend(void)
                return -1;\r
        }\r
        #if defined(CONFIG_MFD_TPS65910)        \r
-       if(g_pmic_type == PMIC_TYPE_TPS65910)\r
+       if(pmic_is_tps65910())\r
        {\r
                gpio_direction_output(PWM_GPIO, GPIO_LOW);\r
        }\r
        #endif\r
        #if defined(CONFIG_REGULATOR_ACT8931)\r
-       if(g_pmic_type == PMIC_TYPE_ACT8931)\r
+       if(pmic_is_act8931())\r
        {\r
                gpio_direction_output(PWM_GPIO, GPIO_HIGH);\r
        }\r
@@ -209,7 +207,7 @@ static int rk_fb_io_disable(void)
 {\r
 \r
        #if 0//defined(CONFIG_REGULATOR_ACT8931)\r
-       if(g_pmic_type == PMIC_TYPE_ACT8931)\r
+       if(pmic_is_act8931())\r
        {\r
                struct regulator *ldo;\r
                ldo = regulator_get(NULL, "act_ldo4");   //vcc_lcd\r
@@ -224,7 +222,7 @@ static int rk_fb_io_disable(void)
 static int rk_fb_io_enable(void)\r
 {\r
        #if 0//defined(CONFIG_REGULATOR_ACT8931)\r
-       if(g_pmic_type == PMIC_TYPE_ACT8931)\r
+       if(pmic_is_act8931())\r
        {\r
                struct regulator *ldo;\r
                ldo = regulator_get(NULL, "act_ldo4");   //vcc_lcd\r
@@ -486,12 +484,12 @@ static void rkusb_wifi_power(int on) {
        struct regulator *ldo = NULL;\r
        \r
 #if defined(CONFIG_MFD_TPS65910)       \r
-       if(g_pmic_type == PMIC_TYPE_TPS65910) {\r
+       if(pmic_is_tps65910()) {\r
                ldo = regulator_get(NULL, "vmmc");  //vccio_wl\r
        }\r
 #endif\r
 #if defined(CONFIG_REGULATOR_ACT8931)\r
-       if(g_pmic_type == PMIC_TYPE_ACT8931) {\r
+       if(pmic_is_act8931()) {\r
                ldo = regulator_get(NULL, "act_ldo4");  //vccio_wl\r
        }\r
 #endif \r
@@ -745,14 +743,14 @@ void  rk30_pwm_resume_voltage_set(void)
 void __sramfunc board_pmu_suspend(void)\r
 {      \r
        #if defined (CONFIG_MFD_TPS65910)\r
-       if(g_pmic_type == PMIC_TYPE_TPS65910)\r
+       if(pmic_is_tps65910())\r
        board_pmu_tps65910_suspend(); \r
        #endif   \r
 }\r
 void __sramfunc board_pmu_resume(void)\r
 {      \r
        #if defined (CONFIG_MFD_TPS65910)\r
-       if(g_pmic_type == PMIC_TYPE_TPS65910)\r
+       if(pmic_is_tps65910())\r
        board_pmu_tps65910_resume(); \r
        #endif\r
 }\r
@@ -848,7 +846,7 @@ static void rk2928_pm_power_off(void)
        printk(KERN_ERR "rk2928_pm_power_off start...\n");\r
         \r
         #if defined(CONFIG_REGULATOR_ACT8931)\r
-        if(g_pmic_type == PMIC_TYPE_ACT8931)\r
+        if(pmic_is_act8931())\r
         {\r
                  #ifdef CONFIG_BATTERY_RK30_ADC_FAC\r
               if (gpio_get_value (rk30_adc_battery_platdata.dc_det_pin) == rk30_adc_battery_platdata.dc_det_level)//if(act8931_charge_det)\r
@@ -858,7 +856,7 @@ static void rk2928_pm_power_off(void)
         #endif\r
        \r
        #if defined(CONFIG_MFD_TPS65910)        \r
-       if(g_pmic_type == PMIC_TYPE_TPS65910)\r
+       if(pmic_is_tps65910())\r
        {\r
                tps65910_device_shutdown();//tps65910 shutdown\r
        }\r
index a2ecdbc721aeefb63e9484476809bf327c7eee77..eb919103866fd80d6176be02041b55a2252a64ec 100755 (executable)
@@ -60,8 +60,6 @@
 #include "board-rk2928-a720-key.c"
 
 int __sramdata g_pmic_type =  0;
-#define PMIC_TYPE_TPS65910     2
-#define PMIC_TYPE_ACT8931      3
 
 #ifdef  CONFIG_THREE_FB_BUFFER
 #define RK30_FB0_MEM_SIZE 12*SZ_1M
@@ -128,13 +126,13 @@ static int rk29_backlight_pwm_suspend(void)
                return -1;
        }
        #if defined(CONFIG_MFD_TPS65910)        
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        {
                gpio_direction_output(PWM_GPIO, GPIO_LOW);
        }
        #endif
        #if defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
+       if(pmic_is_act8931())
        {
                gpio_direction_output(PWM_GPIO, GPIO_HIGH);
        }
@@ -210,7 +208,7 @@ static int rk_fb_io_disable(void)
 {
 
        #if 0//defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
+       if(pmic_is_act8931())
        {
                struct regulator *ldo;
                ldo = regulator_get(NULL, "act_ldo4");   //vcc_lcd
@@ -225,7 +223,7 @@ static int rk_fb_io_disable(void)
 static int rk_fb_io_enable(void)
 {
        #if 0//defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
+       if(pmic_is_act8931())
        {
                struct regulator *ldo;
                ldo = regulator_get(NULL, "act_ldo4");   //vcc_lcd
@@ -453,12 +451,12 @@ static void rkusb_wifi_power(int on) {
        struct regulator *ldo = NULL;
        
 #if defined(CONFIG_MFD_TPS65910)       
-       if(g_pmic_type == PMIC_TYPE_TPS65910) {
+       if(pmic_is_tps65910()) {
                ldo = regulator_get(NULL, "vmmc");  //vccio_wl
        }
 #endif
 #if defined(CONFIG_REGULATOR_ACT8931)
-       if(g_pmic_type == PMIC_TYPE_ACT8931) {
+       if(pmic_is_act8931()) {
                ldo = regulator_get(NULL, "act_ldo4");  //vccio_wl
        }
 #endif 
@@ -738,7 +736,7 @@ static void rk2928_pm_power_off(void)
        printk(KERN_ERR "rk2928_pm_power_off start...\n");
        
        #if defined(CONFIG_MFD_TPS65910)        
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        {
                tps65910_device_shutdown();//tps65910 shutdown
        }
index 853105454c9023d61e3c5c8e952d67c37a0003ca..21bf05905ff91e2ccb0810f859c4ce5ead2722d0 100755 (executable)
@@ -308,7 +308,7 @@ uint8 __sramfunc sram_i2c_read(uint8 I2CSlaveAddr, uint8 regAddr)
        sram_i2c_disenable();
        return data;
 }
-extern int __sramdata g_pmic_type ;
+
 void __sramfunc rk30_suspend_voltage_set(unsigned int vol)
 {
     uint8 slaveaddr;
@@ -317,7 +317,7 @@ void __sramfunc rk30_suspend_voltage_set(unsigned int vol)
        uint8 rtc_status_reg = 0x11;
        sram_i2c_init();  //init i2c device
        #if defined(CONFIG_MFD_TPS65910)        
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        {
        slaveaddr = 0x2d;            //slave device addr
        slavereg = 0x22;            // reg addr
@@ -332,7 +332,7 @@ void __sramfunc rk30_suspend_voltage_set(unsigned int vol)
        #endif
        
        #if defined(CONFIG_REGULATOR_ACT8931)   
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
+       if(pmic_is_act8931())
        {
        slaveaddr = 0x5b;            //slave device addr
        slavereg = 0x40;            // reg addr
@@ -357,7 +357,7 @@ void __sramfunc rk30_suspend_voltage_resume(unsigned int vol)
        data = arm_voltage;
        sram_i2c_init();  //init i2c device
        #if defined(CONFIG_MFD_TPS65910)        
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        {
                slaveaddr = 0x2d;            //slave device addr
                slavereg = 0x22;            // reg add
@@ -366,7 +366,7 @@ void __sramfunc rk30_suspend_voltage_resume(unsigned int vol)
        }
        #endif
        #if defined(CONFIG_REGULATOR_ACT8931)   
-       if(g_pmic_type == PMIC_TYPE_ACT8931)
+       if(pmic_is_act8931())
        {
                slaveaddr = 0x5b;            //slave device addr
                slavereg = 0x40;            // reg addr
index 1e368114e2061d45293c9d73b3c884b29f28479a..840b598dee4edfb2f5cef5d5f62f4720f3fc122c 100755 (executable)
@@ -15,9 +15,6 @@
 #define GPIO_SWPORTA_DR  0x0000
 #define GPIO_SWPORTA_DDR 0x0004
 
-#define PMIC_TYPE_TPS65910     2
-#define PMIC_TYPE_ACT8931      3
-
 extern struct rk29_sdmmc_platform_data default_sdmmc0_data;
 extern struct rk29_sdmmc_platform_data default_sdmmc1_data;
 
index 04bba1910374117f9c69af72104a7b9e14c7c0f4..a50e94120ed12677ae4c69c1d43a6a03c1bd6c77 100755 (executable)
@@ -2528,8 +2528,6 @@ static struct i2c_board_info __initdata i2c0_info[] = {
 };
 #endif
 
-#define PMIC_TYPE_WM8326       1
-#define PMIC_TYPE_TPS65910     2
 int __sramdata g_pmic_type =  0;
 #ifdef CONFIG_I2C1_RK30
 #ifdef CONFIG_MFD_WM831X_I2C
@@ -2566,11 +2564,11 @@ static struct i2c_board_info __initdata i2c1_info[] = {
 void __sramfunc board_pmu_suspend(void)
 {      
        #if defined (CONFIG_MFD_WM831X_I2C)
-       if(g_pmic_type == PMIC_TYPE_WM8326)
+       if(pmic_is_wm8326())
        board_pmu_wm8326_suspend();
        #endif
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        board_pmu_tps65910_suspend(); 
     #endif   
 }
@@ -2578,11 +2576,11 @@ void __sramfunc board_pmu_suspend(void)
 void __sramfunc board_pmu_resume(void)
 {      
        #if defined (CONFIG_MFD_WM831X_I2C)
-       if(g_pmic_type == PMIC_TYPE_WM8326)
+       if(pmic_is_wm8326())
        board_pmu_wm8326_resume();
        #endif
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        board_pmu_tps65910_resume(); 
        #endif
 }
@@ -2824,14 +2822,14 @@ void rk30_pm_power_off(void)
        }
 #endif
        #if defined(CONFIG_MFD_WM831X)  
-       if(g_pmic_type == PMIC_TYPE_WM8326)
+       if(pmic_is_wm8326())
        {
                wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000);  //set sys_pwr 0
                wm831x_device_shutdown(Wm831x);//wm8326 shutdown
        }
        #endif
        #if defined(CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        {
                tps65910_device_shutdown();//tps65910 shutdown
        }
index 02a5f254afd413fe9aa071795518ba44be6adae8..01b0d184aedb97836f1b1d3ef1d67a2edfae7406 100755 (executable)
@@ -1388,8 +1388,6 @@ static struct i2c_board_info __initdata i2c0_info[] = {
 
 };
 #endif
-#define PMIC_TYPE_WM8326       1
-#define PMIC_TYPE_TPS65910     2
 int __sramdata g_pmic_type =  0;
 #ifdef CONFIG_I2C1_RK30
 #ifdef CONFIG_MFD_WM831X_I2C
@@ -1425,11 +1423,11 @@ static struct i2c_board_info __initdata i2c1_info[] = {
 void __sramfunc board_pmu_suspend(void)
 {      
        #if defined (CONFIG_MFD_WM831X_I2C)
-       if(g_pmic_type == PMIC_TYPE_WM8326)
+       if(pmic_is_wm8326())
        board_pmu_wm8326_suspend();
        #endif
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        board_pmu_tps65910_suspend(); 
     #endif   
 }
@@ -1437,11 +1435,11 @@ void __sramfunc board_pmu_suspend(void)
 void __sramfunc board_pmu_resume(void)
 {      
        #if defined (CONFIG_MFD_WM831X_I2C)
-       if(g_pmic_type == PMIC_TYPE_WM8326)
+       if(pmic_is_wm8326())
        board_pmu_wm8326_resume();
        #endif
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        board_pmu_tps65910_resume(); 
        #endif
 }
@@ -1530,14 +1528,14 @@ static void rk30_pm_power_off(void)
        printk(KERN_ERR "rk30_pm_power_off start...\n");
        gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
        #if defined(CONFIG_MFD_WM831X)  
-       if(g_pmic_type == PMIC_TYPE_WM8326)
+       if(pmic_is_wm8326())
        {
                wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000);  //set sys_pwr 0
                wm831x_device_shutdown(Wm831x);//wm8326 shutdown
        }
        #endif
        #if defined(CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        {
                tps65910_device_shutdown();//tps65910 shutdown
        }
index 1c4c3e53bf9faed91356a4309490e895cb9c7ea6..7735e9e08860ac9d17c53f4ab44ed409161af513 100755 (executable)
@@ -1409,8 +1409,6 @@ static struct i2c_board_info __initdata i2c0_info[] = {
 };
 #endif
 
-#define PMIC_TYPE_WM8326       1
-#define PMIC_TYPE_TPS65910     2
 int __sramdata g_pmic_type =  0;
 #ifdef CONFIG_I2C1_RK30
 #ifdef CONFIG_MFD_WM831X_I2C
@@ -1446,11 +1444,11 @@ static struct i2c_board_info __initdata i2c1_info[] = {
 void __sramfunc board_pmu_suspend(void)
 {      
        #if defined (CONFIG_MFD_WM831X_I2C)
-       if(g_pmic_type == PMIC_TYPE_WM8326)
+       if(pmic_is_wm8326())
        board_pmu_wm8326_suspend();
        #endif
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        board_pmu_tps65910_suspend(); 
     #endif   
 }
@@ -1458,11 +1456,11 @@ void __sramfunc board_pmu_suspend(void)
 void __sramfunc board_pmu_resume(void)
 {      
        #if defined (CONFIG_MFD_WM831X_I2C)
-       if(g_pmic_type == PMIC_TYPE_WM8326)
+       if(pmic_is_wm8326())
        board_pmu_wm8326_resume();
        #endif
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        board_pmu_tps65910_resume(); 
        #endif
 }
index 4cf5f01308a9fccb889463d5d24632a394d5e03d..8c01f5e92182ecac24e7f01a4fc6408dd190e809 100755 (executable)
@@ -1326,8 +1326,6 @@ static struct i2c_board_info __initdata i2c0_info[] = {
 };
 #endif
 
-#define PMIC_TYPE_WM8326       1
-#define PMIC_TYPE_TPS65910     2
 int __sramdata g_pmic_type =  0;
 #ifdef CONFIG_I2C1_RK30
 #ifdef CONFIG_MFD_WM831X_I2C
@@ -1367,11 +1365,11 @@ static struct i2c_board_info __initdata i2c1_info[] = {
 void __sramfunc board_pmu_suspend(void)
 {      
        #if defined (CONFIG_MFD_WM831X_I2C)
-       if(g_pmic_type == PMIC_TYPE_WM8326)
+       if(pmic_is_wm8326())
        board_pmu_wm8326_suspend();
        #endif
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        board_pmu_tps65910_suspend(); 
     #endif   
 }
@@ -1379,11 +1377,11 @@ void __sramfunc board_pmu_suspend(void)
 void __sramfunc board_pmu_resume(void)
 {      
        #if defined (CONFIG_MFD_WM831X_I2C)
-       if(g_pmic_type == PMIC_TYPE_WM8326)
+       if(pmic_is_wm8326())
        board_pmu_wm8326_resume();
        #endif
        #if defined (CONFIG_MFD_TPS65910)
-       if(g_pmic_type == PMIC_TYPE_TPS65910)
+       if(pmic_is_tps65910())
        board_pmu_tps65910_resume(); 
        #endif
 }
index 388c1d0ce60ff839cd16fc636f959b84f53cd05a..0225079bb81d29f07c42dce2bb0ef971e9e00591 100755 (executable)
@@ -5,6 +5,8 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/rk_screen.h>
+#include <plat/sram.h>
+
 
 enum {
         I2C_IDLE = 0,
@@ -60,7 +62,17 @@ struct rk29_io_t {
     int (*io_init)(void);
 };
 
-
+enum {
+       PMIC_TYPE_NOE =0,
+       PMIC_TYPE_WM8326 =1,
+       PMIC_TYPE_TPS65910 =2,
+       PMIC_TYPE_ACT8931 =3,
+       PMIC_TYPE_MAX,
+};
+extern __sramdata  int g_pmic_type;
+#define pmic_is_wm8326()  (g_pmic_type == PMIC_TYPE_WM8326)
+#define pmic_is_tps65910()  (g_pmic_type == PMIC_TYPE_TPS65910)
+#define pmic_is_act8931()  (g_pmic_type == PMIC_TYPE_ACT8931)
 
 struct rk29_fb_setting_info {
        u8 data_num;