rk:move pmic_type to board.h
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rk2928 / board-rk2926-sdk.c
index f477c7c25c6b3eb1cfeba0e421f8ea9a3a70bfee..64c1ef9f9cc49c6b54f50e7d19d3e52b8ad53825 100755 (executable)
 #include "../../../drivers/spi/rk29_spim.h"
 #endif
 
-#include "board-rk2928-a720-camera.c" 
-#include "board-rk2928-a720-key.c"
-
-int __sramdata g_pmic_type =  0;
-#define PMIC_TYPE_TPS65910     2
-#define PMIC_TYPE_ACT8931      3
+#include "board-rk2928-sdk-camera.c" 
+#include "board-rk2928-sdk-key.c"
 
 #ifdef  CONFIG_THREE_FB_BUFFER
 #define RK30_FB0_MEM_SIZE 12*SZ_1M
@@ -68,6 +64,8 @@ int __sramdata g_pmic_type =  0;
 #define RK30_FB0_MEM_SIZE 8*SZ_1M
 #endif
 
+int __sramdata g_pmic_type =  0;
+
 static struct spi_board_info board_spi_devices[] = {
 };
 
@@ -127,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);
@@ -209,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);
@@ -224,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);
@@ -451,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) {
@@ -619,7 +609,7 @@ static struct platform_device *devices[] __initdata = {
 #ifdef CONFIG_I2C0_RK30
 #ifdef CONFIG_MFD_TPS65910
 #define TPS65910_HOST_IRQ        RK2928_PIN1_PB2
-#include "board-rk2928-a720-tps65910.c"
+#include "board-rk2928-sdk-tps65910.c"
 #endif
 #ifdef CONFIG_REGULATOR_ACT8931
 #define ACT8931_HOST_IRQ               RK2928_PIN1_PB1
@@ -704,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
 }
 
@@ -796,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);