generic: rtl8367: use the generic get_port_link implementation
[openwrt.git] / target / linux / xburst / patches-2.6.36 / 020-qi_lb60-add-gpio-charger.patch
1 From 11f9a327e3dfc62773cfd4b3c93af19e7132cc7a Mon Sep 17 00:00:00 2001
2 From: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Sat, 17 Jul 2010 11:16:29 +0000
4 Subject: [PATCH] MIPS: JZ4740: qi_lb60: Add gpio-charger device
5
6 Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
7 ---
8 arch/mips/jz4740/board-qi_lb60.c | 24 ++++++++++++++++++++++++
9 1 files changed, 24 insertions(+), 0 deletions(-)
10
11 --- a/arch/mips/jz4740/board-qi_lb60.c
12 +++ b/arch/mips/jz4740/board-qi_lb60.c
13 @@ -23,6 +23,7 @@
14 #include <linux/spi/spi_gpio.h>
15 #include <linux/power_supply.h>
16 #include <linux/power/jz4740-battery.h>
17 +#include <linux/power/gpio-charger.h>
18
19 #include <asm/mach-jz4740/jz4740_fb.h>
20 #include <asm/mach-jz4740/jz4740_mmc.h>
21 @@ -396,6 +397,28 @@ static struct platform_device qi_lb60_pw
22 },
23 };
24
25 +/* charger */
26 +static char *qi_lb60_batteries[] = {
27 + "battery",
28 +};
29 +
30 +static struct gpio_charger_platform_data qi_lb60_charger_pdata = {
31 + .name = "usb",
32 + .type = POWER_SUPPLY_TYPE_USB,
33 + .gpio = JZ_GPIO_PORTD(28),
34 + .gpio_active_low = 1,
35 + .batteries = qi_lb60_batteries,
36 + .num_batteries = ARRAY_SIZE(qi_lb60_batteries),
37 +};
38 +
39 +static struct platform_device qi_lb60_charger_device = {
40 + .name = "gpio-charger",
41 + .dev = {
42 + .platform_data = &qi_lb60_charger_pdata,
43 + },
44 +};
45 +
46 +
47 static struct platform_device *jz_platform_devices[] __initdata = {
48 &jz4740_udc_device,
49 &jz4740_mmc_device,
50 @@ -410,6 +433,7 @@ static struct platform_device *jz_platfo
51 &jz4740_adc_device,
52 &qi_lb60_gpio_keys,
53 &qi_lb60_pwm_beeper,
54 + &qi_lb60_charger_device,
55 };
56
57 static void __init board_gpio_setup(void)
This page took 0.053925 seconds and 5 git commands to generate.