rk2928_defconfig: 'pmic: Initialized first && charge: set default parameter
authorkfx <kfx@rock-chips.com>
Mon, 5 Nov 2012 10:05:55 +0000 (18:05 +0800)
committerkfx <kfx@rock-chips.com>
Mon, 5 Nov 2012 10:05:55 +0000 (18:05 +0800)
arch/arm/mach-rk2928/board-rk2928-config.c
arch/arm/mach-rk2928/board-rk2928-sdk-act8931.c
arch/arm/mach-rk2928/board-rk2928-sdk-tps65910.c
arch/arm/mach-rk2928/board-rk2928.c

index e961ab41274b38adfb1c0aa1f8af07a82899ea47..b7cde0fb32528e0f2c57d3c4746bb721e31d4c02 100644 (file)
@@ -353,7 +353,7 @@ int pmic_dcdc_set(int index, int on)
         return 0;
 
 }
-EXPORT_SYNBOL(pmic_dcdc_set);
+EXPORT_SYMBOL(pmic_dcdc_set);
 int pmic_ldo_set(int index, int on)
 {
         struct regulator *ldo = NULL;
@@ -377,7 +377,7 @@ int pmic_ldo_set(int index, int on)
         return 0;
 
 }
-EXPORT_SYNBOL(pmic_ldo_set);
+EXPORT_SYMBOL(pmic_ldo_set);
 /* ion */
 static uint ion_size = DEF_ION_SIZE; 
 module_param(ion_size, uint, 0644);
@@ -447,15 +447,15 @@ static inline int check_rtc_param(void)
 static int chg_adc = DEF_CHG_ADC;
 module_param(chg_adc, int, 0644);
 
-static int dc_det = -1;
+static int dc_det = DEF_DC_DET;
 module_param(dc_det, int, 0644);
-static int bat_low = -1;
+static int bat_low = DEF_BAT_LOW;
 module_param(bat_low, int, 0644);
-static int chg_ok = -1;
+static int chg_ok = DEF_CHG_OK;
 module_param(chg_ok, int, 0644);
-static int chg_set = -1;
+static int chg_set = DEF_CHG_SET;
 module_param(chg_set, int, 0644);
-static int chg_sel = -1;
+static int chg_sel = DEF_CHG_SEL;
 module_param(chg_sel, int, 0644);
 static inline int check_chg_param(void)
 {
index ce63eb569c012ba1c57ea95749ebde0deb26d59e..83dac00476348bfcb9840ee32b888af8749c8877 100755 (executable)
@@ -20,7 +20,9 @@ static int act8931_set_init(struct act8931 *act8931)
        int i = 0;
        printk("%s,line=%d\n", __func__,__LINE__);
 
+#ifndef CONFIG_RK_CONFIG
        g_pmic_type = PMIC_TYPE_ACT8931;
+#endif
        printk("%s:g_pmic_type=%d\n",__func__,g_pmic_type);
 
        #ifdef CONFIG_RK30_PWM_REGULATOR
index 495f013c9609795016302312d1641b4c846bd514..1aa640396c34d2a900067103f9daa87350341b91 100755 (executable)
@@ -255,7 +255,9 @@ int tps65910_post_init(struct tps65910 *tps65910)
        int i = 0;
        printk("%s,line=%d\n", __func__,__LINE__);
 
+#ifndef CONFIG_RK_CONFIG
        g_pmic_type = PMIC_TYPE_TPS65910;
+#endif
        printk("%s:g_pmic_type=%d\n",__func__,g_pmic_type);
 
        #ifdef CONFIG_RK30_PWM_REGULATOR
index 8bede4822e819705a92a8c65ad0e3f39f15d74e5..973931268811fc72ab8e3f5dbf8a734f18a2eb8c 100755 (executable)
@@ -684,6 +684,11 @@ static int __init chg_board_init(void)
         if(ret < 0)
                 return ret;
         rk30_adc_battery_platdata.adc_channel = chg_adc;
+        rk30_adc_battery_platdata.dc_det_pin = get_port_config(dc_det).gpio;
+        rk30_adc_battery_platdata.batt_low_pin = get_port_config(bat_low).gpio;
+        rk30_adc_battery_platdata.charge_ok_pin = get_port_config(chg_ok).gpio;
+        rk30_adc_battery_platdata.charge_set_pin = get_port_config(chg_set).gpio;
+
         return 0;
 }
 #else
@@ -1068,6 +1073,9 @@ static int __init rk2928_config_init(void)
 {
         int ret = 0;
 
+        ret = pmic_board_init();
+        if(ret < 0)
+                return ret;
         ret = key_board_init();
         if(ret < 0)
                 return ret;
@@ -1096,9 +1104,6 @@ static int __init rk2928_config_init(void)
         if(ret < 0)
                 return ret;
         ret = rtc_board_init();
-        if(ret < 0)
-                return ret;
-        ret = pmic_board_init();
         if(ret < 0)
                 return ret;
         ret = codec_board_init();