From: 许盛飞 Date: Mon, 31 Dec 2012 09:27:35 +0000 (+0800) Subject: adc-battery for rk3168 X-Git-Tag: firefly_0821_release~8024 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=00bc67668be7974cf79ac94dddeec58ff3685678;p=firefly-linux-kernel-4.4.55.git adc-battery for rk3168 --- diff --git a/arch/arm/configs/rk3168_ds1006h_defconfig b/arch/arm/configs/rk3168_ds1006h_defconfig index 44d37c333ce9..587b0cb06d69 100644 --- a/arch/arm/configs/rk3168_ds1006h_defconfig +++ b/arch/arm/configs/rk3168_ds1006h_defconfig @@ -279,7 +279,9 @@ CONFIG_EXPANDED_GPIO_IRQ_NUM=0 CONFIG_SPI_FPGA_GPIO_NUM=0 CONFIG_SPI_FPGA_GPIO_IRQ_NUM=0 CONFIG_POWER_SUPPLY=y -CONFIG_TEST_POWER=y +CONFIG_BATTERY_RK30_ADC_FAC=y +CONFIG_BATTERY_RK30_AC_CHARGE=y +CONFIG_BATTERY_RK30_VOL3V8=y # CONFIG_HWMON is not set CONFIG_MFD_RK610=y CONFIG_REGULATOR=y diff --git a/arch/arm/mach-rk30/board-rk3168-ds1006h.c b/arch/arm/mach-rk30/board-rk3168-ds1006h.c index 2ca3a37cc85d..72fa0a1d30bf 100644 --- a/arch/arm/mach-rk30/board-rk3168-ds1006h.c +++ b/arch/arm/mach-rk30/board-rk3168-ds1006h.c @@ -763,14 +763,23 @@ struct rk29_sdmmc_platform_data default_sdmmc1_data = { * the end of setting for SDMMC devices **************************************************************************************************/ -#ifdef CONFIG_BATTERY_RK30_ADC +#ifdef CONFIG_BATTERY_RK30_ADC_FAC static struct rk30_adc_battery_platform_data rk30_adc_battery_platdata = { .dc_det_pin = RK30_PIN0_PB2, - .batt_low_pin = RK30_PIN0_PB1, + .batt_low_pin = INVALID_GPIO, .charge_set_pin = INVALID_GPIO, .charge_ok_pin = RK30_PIN0_PA6, + .usb_det_pin = INVALID_GPIO, .dc_det_level = GPIO_LOW, .charge_ok_level = GPIO_HIGH, + + .reference_voltage = 1800, // the rK2928 is 3300;RK3066 and rk29 are 2500;rk3066B is 1800; + .pull_up_res = 200, //divider resistance , pull-up resistor + .pull_down_res = 120, //divider resistance , pull-down resistor + + .is_reboot_charging = 1, + .save_capacity = 1 , + .low_voltage_protection = 3600, }; static struct platform_device rk30_device_adc_battery = { @@ -1010,7 +1019,7 @@ static struct platform_device *devices[] __initdata = { &mt3326_device_gps, #endif -#ifdef CONFIG_BATTERY_RK30_ADC +#ifdef CONFIG_BATTERY_RK30_ADC_FAC &rk30_device_adc_battery, #endif #ifdef CONFIG_RFKILL_RK