rk:move pmic_type to board.h
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk2928 / board-rk2928-sdk.c
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