From 297f147eaef68cc4fa7775d9a23e8ab73f6fd2f2 Mon Sep 17 00:00:00 2001 From: lars Date: Wed, 3 Feb 2010 13:16:23 +0000 Subject: [xburst] Seperate charger logic from battery driver git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19504 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../files-2.6.32/arch/mips/jz4740/board-qi_lb60.c | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'target/linux/xburst/files-2.6.32/arch') 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 #include #include +#include #include @@ -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) -- cgit v1.2.3