From: kfx Date: Mon, 5 Nov 2012 10:05:55 +0000 (+0800) Subject: rk2928_defconfig: 'pmic: Initialized first && charge: set default parameter X-Git-Tag: firefly_0821_release~8269^2~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=74facdddedb7337d3abff4779fd71c73c6e806bb;p=firefly-linux-kernel-4.4.55.git rk2928_defconfig: 'pmic: Initialized first && charge: set default parameter --- diff --git a/arch/arm/mach-rk2928/board-rk2928-config.c b/arch/arm/mach-rk2928/board-rk2928-config.c index e961ab41274b..b7cde0fb3252 100644 --- a/arch/arm/mach-rk2928/board-rk2928-config.c +++ b/arch/arm/mach-rk2928/board-rk2928-config.c @@ -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) { diff --git a/arch/arm/mach-rk2928/board-rk2928-sdk-act8931.c b/arch/arm/mach-rk2928/board-rk2928-sdk-act8931.c index ce63eb569c01..83dac0047634 100755 --- a/arch/arm/mach-rk2928/board-rk2928-sdk-act8931.c +++ b/arch/arm/mach-rk2928/board-rk2928-sdk-act8931.c @@ -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 diff --git a/arch/arm/mach-rk2928/board-rk2928-sdk-tps65910.c b/arch/arm/mach-rk2928/board-rk2928-sdk-tps65910.c index 495f013c9609..1aa640396c34 100755 --- a/arch/arm/mach-rk2928/board-rk2928-sdk-tps65910.c +++ b/arch/arm/mach-rk2928/board-rk2928-sdk-tps65910.c @@ -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 diff --git a/arch/arm/mach-rk2928/board-rk2928.c b/arch/arm/mach-rk2928/board-rk2928.c index 8bede4822e81..973931268811 100755 --- a/arch/arm/mach-rk2928/board-rk2928.c +++ b/arch/arm/mach-rk2928/board-rk2928.c @@ -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();