diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-02-07 21:43:53 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-03-25 13:45:21 -0400 |
commit | 0b4cf1813f54d708b18c639260fc13dc3d922e96 (patch) | |
tree | 2f668f90ad20e8c2bbd47aaada13425c69bd14b4 /arch/mips | |
parent | 1bbf28756149a0aa0e3c8a74cea9bbe715639027 (diff) |
MIPS: JZ4740: qi_lb60: Add gpio-charger device
Register the gpio-charger device which reports whether device is currently
charging or not.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/2059/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/jz4740/board-qi_lb60.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/mips/jz4740/board-qi_lb60.c b/arch/mips/jz4740/board-qi_lb60.c index 2c0e107966ad..ed8d66b4b03f 100644 --- a/arch/mips/jz4740/board-qi_lb60.c +++ b/arch/mips/jz4740/board-qi_lb60.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/spi/spi_gpio.h> | 23 | #include <linux/spi/spi_gpio.h> |
24 | #include <linux/power_supply.h> | 24 | #include <linux/power_supply.h> |
25 | #include <linux/power/jz4740-battery.h> | 25 | #include <linux/power/jz4740-battery.h> |
26 | #include <linux/power/gpio-charger.h> | ||
26 | 27 | ||
27 | #include <asm/mach-jz4740/jz4740_fb.h> | 28 | #include <asm/mach-jz4740/jz4740_fb.h> |
28 | #include <asm/mach-jz4740/jz4740_mmc.h> | 29 | #include <asm/mach-jz4740/jz4740_mmc.h> |
@@ -396,6 +397,28 @@ static struct platform_device qi_lb60_pwm_beeper = { | |||
396 | }, | 397 | }, |
397 | }; | 398 | }; |
398 | 399 | ||
400 | /* charger */ | ||
401 | static char *qi_lb60_batteries[] = { | ||
402 | "battery", | ||
403 | }; | ||
404 | |||
405 | static struct gpio_charger_platform_data qi_lb60_charger_pdata = { | ||
406 | .name = "usb", | ||
407 | .type = POWER_SUPPLY_TYPE_USB, | ||
408 | .gpio = JZ_GPIO_PORTD(28), | ||
409 | .gpio_active_low = 1, | ||
410 | .supplied_to = qi_lb60_batteries, | ||
411 | .num_supplicants = ARRAY_SIZE(qi_lb60_batteries), | ||
412 | }; | ||
413 | |||
414 | static struct platform_device qi_lb60_charger_device = { | ||
415 | .name = "gpio-charger", | ||
416 | .dev = { | ||
417 | .platform_data = &qi_lb60_charger_pdata, | ||
418 | }, | ||
419 | }; | ||
420 | |||
421 | |||
399 | static struct platform_device *jz_platform_devices[] __initdata = { | 422 | static struct platform_device *jz_platform_devices[] __initdata = { |
400 | &jz4740_udc_device, | 423 | &jz4740_udc_device, |
401 | &jz4740_mmc_device, | 424 | &jz4740_mmc_device, |
@@ -410,6 +433,7 @@ static struct platform_device *jz_platform_devices[] __initdata = { | |||
410 | &jz4740_adc_device, | 433 | &jz4740_adc_device, |
411 | &qi_lb60_gpio_keys, | 434 | &qi_lb60_gpio_keys, |
412 | &qi_lb60_pwm_beeper, | 435 | &qi_lb60_pwm_beeper, |
436 | &qi_lb60_charger_device, | ||
413 | }; | 437 | }; |
414 | 438 | ||
415 | static void __init board_gpio_setup(void) | 439 | static void __init board_gpio_setup(void) |