summaryrefslogtreecommitdiff
path: root/target/linux/xburst/files-2.6.32/arch
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2010-02-03 13:16:23 +0000
committerLars-Peter Clausen <lars@metafoo.de>2010-02-03 13:16:23 +0000
commit27a0d8478d43ee9503b1e985dcb7b0957ac5be3e (patch)
treea2395dfbb582f77f5d6ee6024620c5f81c40ef19 /target/linux/xburst/files-2.6.32/arch
parent863e3c739a089a6245b9f2b962bab3230df28159 (diff)
downloadmtk-20170518-27a0d8478d43ee9503b1e985dcb7b0957ac5be3e.zip
mtk-20170518-27a0d8478d43ee9503b1e985dcb7b0957ac5be3e.tar.gz
mtk-20170518-27a0d8478d43ee9503b1e985dcb7b0957ac5be3e.tar.bz2
Seperate charger logic from battery driver
SVN-Revision: 19504
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 5d22e20..643f9c8 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)