From 6e5a8214f3dfffdf48083c889ecc5a3dac1ce989 Mon Sep 17 00:00:00 2001 From: wuhao Date: Fri, 1 Mar 2013 15:26:53 +0800 Subject: [PATCH] rk3188 ds1006h: add cw2015 --- arch/arm/configs/rk3188_ds1006h_defconfig | 4 +- arch/arm/mach-rk3188/board-rk3188-ds1006h.c | 61 +++++++++++++++++++++ 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/arch/arm/configs/rk3188_ds1006h_defconfig b/arch/arm/configs/rk3188_ds1006h_defconfig index 6e3f2de7c5ad..a41515acfe90 100644 --- a/arch/arm/configs/rk3188_ds1006h_defconfig +++ b/arch/arm/configs/rk3188_ds1006h_defconfig @@ -276,9 +276,7 @@ CONFIG_EXPANDED_GPIO_IRQ_NUM=0 CONFIG_SPI_FPGA_GPIO_NUM=0 CONFIG_SPI_FPGA_GPIO_IRQ_NUM=0 CONFIG_POWER_SUPPLY=y -CONFIG_BATTERY_RK30_ADC_FAC=y -CONFIG_BATTERY_RK30_AC_CHARGE=y -CONFIG_BATTERY_RK30_VOL3V8=y +CONFIG_CW2015_BATTERY=y CONFIG_POWER_ON_CHARGER_DISPLAY=y # CONFIG_HWMON is not set CONFIG_WATCHDOG=y diff --git a/arch/arm/mach-rk3188/board-rk3188-ds1006h.c b/arch/arm/mach-rk3188/board-rk3188-ds1006h.c index 2c0adf1cf872..c0060aebe3fa 100755 --- a/arch/arm/mach-rk3188/board-rk3188-ds1006h.c +++ b/arch/arm/mach-rk3188/board-rk3188-ds1006h.c @@ -72,6 +72,10 @@ #include #endif +#ifdef CONFIG_CW2015_BATTERY +#include +#endif + #include "../mach-rk30/board-rk3168-ds1006h-camera.c" #include @@ -895,6 +899,54 @@ static struct platform_device rk30_device_adc_battery = { }, }; #endif + +#ifdef CONFIG_CW2015_BATTERY +static u8 config_info[SIZE_BATINFO] = { +#if 0 + 0x14, 0xB0, 0x58, 0x57, 0x53, + 0x4F, 0x4C, 0x49, 0x47, 0x45, + 0x42, 0x3F, 0x3B, 0x33, 0x2C, + 0x24, 0x20, 0x1B, 0x18, 0x13, + 0x1E, 0x47, 0x4D, 0x4A, 0x30, + 0x63, 0x0B, 0x85, 0x11, 0x22, + 0x3B, 0x58, 0x6E, 0x67, 0x6C, + 0x70, 0x42, 0x1C, 0x5A, 0x2A, + 0x17, 0x4F, 0x52, 0x87, 0x8F, + 0x91, 0x94, 0x52, 0x82, 0x8C, + 0x92, 0x96, 0xB6, 0x84, 0xA4, + 0xCB, 0x2F, 0x7D, 0x72, 0xA5, + 0xB5, 0xC1, 0x46, 0xAE +#else + 0x15,0x20,0x5C,0x5A,0x58, + 0x54,0x50,0x4C,0x49,0x49, + 0x47,0x45,0x41,0x38,0x2E, + 0x26,0x1D,0x1A,0x13,0x11, + 0x1D,0x3E,0x4E,0x4C,0x36, + 0x41,0x0B,0x85,0x1E,0x3C, + 0x43,0x8B,0x95,0x70,0x61, + 0x69,0x42,0x1B,0x52,0x41, + 0x08,0x22,0x5F,0x86,0x8F, + 0x91,0x91,0x18,0x58,0x82, + 0x94,0xA5,0x42,0xB2,0xDE, + 0xCB,0x2F,0x7D,0x72,0xA5, + 0xB5,0xC1,0x46,0xAE +#endif +}; + +static struct cw_bat_platform_data cw_bat_platdata = { + .dc_det_pin = RK30_PIN0_PB2, + .bat_low_pin = RK30_PIN0_PB1, + .chg_ok_pin = RK30_PIN0_PA6, + .dc_det_level = GPIO_LOW, + .bat_low_level = GPIO_LOW, + .chg_ok_level = GPIO_HIGH, + + .cw_bat_config_info = config_info, + +}; + +#endif + #ifdef CONFIG_RK30_PWM_REGULATOR static int pwm_voltage_map[] = { 800000,825000,850000, 875000,900000, 925000 ,950000, 975000,1000000, 1025000, 1050000, 1075000, 1100000, 1125000, 1150000, 1175000, 1200000, 1225000, 1250000, 1275000, 1300000, 1325000, 1350000,1375000 @@ -1587,6 +1639,15 @@ static struct i2c_board_info __initdata i2c1_info[] = { .platform_data = &tps65910_data, }, #endif +#if defined (CONFIG_CW2015_BATTERY) + { + .type = "cw201x", + .addr = 0x62, + .flags = 0, + .platform_data = &cw_bat_platdata, + }, +#endif + }; #endif -- 2.34.1