rk3188 ds1006h: add cw2015
authorwuhao <wuhao@wuhao@rock-chips.com>
Fri, 1 Mar 2013 07:26:53 +0000 (15:26 +0800)
committerwuhao <wuhao@wuhao@rock-chips.com>
Fri, 1 Mar 2013 07:26:53 +0000 (15:26 +0800)
arch/arm/configs/rk3188_ds1006h_defconfig
arch/arm/mach-rk3188/board-rk3188-ds1006h.c

index 6e3f2de7c5ad8031374801e0912504cd4d83de67..a41515acfe90a6623e9ec982441a543fc1b0cb55 100644 (file)
@@ -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
index 2c0adf1cf8721daaf7318d46bd04f6cc713706cc..c0060aebe3fa09c69877bbf567bec57a6559cf9d 100755 (executable)
 #include <linux/gps.h>
 #endif
 
+#ifdef CONFIG_CW2015_BATTERY
+#include <linux/power/cw2015_battery.h>
+#endif
+
 #include "../mach-rk30/board-rk3168-ds1006h-camera.c"
 #include <plat/key.h>
 
@@ -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