summaryrefslogtreecommitdiffstats
path: root/target/linux/xburst/files-2.6.32/arch
diff options
context:
space:
mode:
authorlars <lars@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-02-03 13:16:23 +0000
committerlars <lars@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-02-03 13:16:23 +0000
commit297f147eaef68cc4fa7775d9a23e8ab73f6fd2f2 (patch)
tree1d1621ec7e47141c91b67ae82b89ef8e57c120c3 /target/linux/xburst/files-2.6.32/arch
parent9843d86dcba86d2c8da18d67c9ea556d960454bf (diff)
[xburst] Seperate charger logic from battery driver
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19504 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/xburst/files-2.6.32/arch')
-rw-r--r--target/linux/xburst/files-2.6.32/arch/mips/jz4740/board-qi_lb60.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/board-qi_lb60.c b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/board-qi_lb60.c
index 5d22e2037..643f9c838 100644
--- a/target/linux/xburst/files-2.6.32/arch/mips/jz4740/board-qi_lb60.c
+++ b/target/linux/xburst/files-2.6.32/arch/mips/jz4740/board-qi_lb60.c
@@ -28,6 +28,7 @@
#include <linux/spi/spi_gpio.h>
#include <linux/power_supply.h>
#include <linux/power/jz4740-battery.h>
+#include <linux/power/gpio-charger.h>
#include <linux/mmc/jz4740_mmc.h>
@@ -286,8 +287,6 @@ static struct spi_board_info qi_lb60_spi_board_info[] = {
/* Battery */
static struct jz_batt_info qi_lb60_battery_pdata = {
- .dc_dect_gpio = GPIO_DC_DETE_N,
- .usb_dect_gpio = GPIO_USB_DETE,
.charg_stat_gpio = GPIO_CHARG_STAT_N,
.min_voltag = 3600000,
@@ -295,6 +294,26 @@ static struct jz_batt_info qi_lb60_battery_pdata = {
.batt_tech = POWER_SUPPLY_TECHNOLOGY_LIPO,
};
+static char *qi_lb60_batteries[] = {
+ "battery",
+};
+
+static struct gpio_charger_platform_data qi_lb60_charger_pdata = {
+ .name = "USB",
+ .type = POWER_SUPPLY_TYPE_USB,
+ .gpio = GPIO_USB_DETE,
+ .gpio_active_low = 1,
+ .batteries = qi_lb60_batteries,
+ .num_batteries = ARRAY_SIZE(qi_lb60_batteries),
+};
+
+static struct platform_device qi_lb60_charger_device = {
+ .name = "gpio-charger",
+ .dev = {
+ .platform_data = &qi_lb60_charger_pdata,
+ },
+};
+
/* GPIO Key: power */
static struct gpio_keys_button qi_lb60_gpio_keys_buttons[] = {
[0] = {
@@ -340,6 +359,7 @@ static struct platform_device *jz_platform_devices[] __initdata = {
&jz4740_adc_device,
&jz4740_battery_device,
&qi_lb60_gpio_keys,
+ &qi_lb60_charger_device,
};
static void __init board_gpio_setup(void)