From: xuhuicong Date: Fri, 22 Mar 2013 01:56:00 +0000 (+0800) Subject: add cw2015 support to board-rk3168-tb X-Git-Tag: firefly_0821_release~7362 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=aaccf500d65172cb2526d6137651a2b5e840c25d;p=firefly-linux-kernel-4.4.55.git add cw2015 support to board-rk3168-tb --- diff --git a/arch/arm/mach-rk30/board-rk3168-tb.c b/arch/arm/mach-rk30/board-rk3168-tb.c index 5a115778937d..0d86d61e5b7b 100755 --- a/arch/arm/mach-rk30/board-rk3168-tb.c +++ b/arch/arm/mach-rk30/board-rk3168-tb.c @@ -48,6 +48,9 @@ #include #include +#ifdef CONFIG_CW2015_BATTERY +#include +#endif #if defined(CONFIG_MFD_RK610) #include #endif @@ -1054,6 +1057,41 @@ static struct platform_device rk30_device_adc_battery = { .platform_data = &rk30_adc_battery_platdata, }, }; +#endif +#ifdef CONFIG_CW2015_BATTERY +/* + note the follow array must set depend on the battery that you use + you must send the battery to cellwise-semi the contact information: + name: chen gan; tel:13416876079; E-mail: ben.chen@cellwise-semi.com + */ +static u8 config_info[SIZE_BATINFO] = { + 0x15, 0x42, 0x60, 0x59, 0x52, + 0x58, 0x4D, 0x48, 0x48, 0x44, + 0x44, 0x46, 0x49, 0x48, 0x32, + 0x24, 0x20, 0x17, 0x13, 0x0F, + 0x19, 0x3E, 0x51, 0x45, 0x08, + 0x76, 0x0B, 0x85, 0x0E, 0x1C, + 0x2E, 0x3E, 0x4D, 0x52, 0x52, + 0x57, 0x3D, 0x1B, 0x6A, 0x2D, + 0x25, 0x43, 0x52, 0x87, 0x8F, + 0x91, 0x94, 0x52, 0x82, 0x8C, + 0x92, 0x96, 0xFF, 0x7B, 0xBB, + 0xCB, 0x2F, 0x7D, 0x72, 0xA5, + 0xB5, 0xC1, 0x46, 0xAE +}; + +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[] = { @@ -1783,6 +1821,14 @@ static struct i2c_board_info __initdata i2c1_info[] = { .flags = 0, .irq = RK30_PIN1_PA4, }, +#if defined (CONFIG_CW2015_BATTERY) + { + .type = "cw201x", + .addr = 0x62, + .flags = 0, + .platform_data = &cw_bat_platdata, + }, +#endif #endif };