LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] MIPS: JZ4740: qi_lb60: Add gpio-charger device
@ 2011-02-08  2:43 Lars-Peter Clausen
  2011-02-08  2:43 ` [PATCH] MIPS: JZ4740: Set nand ecc offsets for the qi_lb60 board Lars-Peter Clausen
  2011-03-25 12:30 ` [PATCH] MIPS: JZ4740: qi_lb60: Add gpio-charger device Ralf Baechle
  0 siblings, 2 replies; 5+ messages in thread
From: Lars-Peter Clausen @ 2011-02-08  2:43 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, linux-kernel, Lars-Peter Clausen

Register the gpio-charger device which reports whether device is currently
charging or not.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 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 3e33264..e3f21ba 100644
--- a/arch/mips/jz4740/board-qi_lb60.c
+++ b/arch/mips/jz4740/board-qi_lb60.c
@@ -23,6 +23,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 <asm/mach-jz4740/jz4740_fb.h>
 #include <asm/mach-jz4740/jz4740_mmc.h>
@@ -395,6 +396,28 @@ static struct platform_device qi_lb60_pwm_beeper = {
 	},
 };
 
+/* charger */
+static char *qi_lb60_batteries[] = {
+	"battery",
+};
+
+static struct gpio_charger_platform_data qi_lb60_charger_pdata = {
+	.name = "usb",
+	.type = POWER_SUPPLY_TYPE_USB,
+	.gpio = JZ_GPIO_PORTD(28),
+	.gpio_active_low = 1,
+	.supplied_to = qi_lb60_batteries,
+	.num_supplicants = ARRAY_SIZE(qi_lb60_batteries),
+};
+
+static struct platform_device qi_lb60_charger_device = {
+	.name = "gpio-charger",
+	.dev = {
+		.platform_data = &qi_lb60_charger_pdata,
+	},
+};
+
+
 static struct platform_device *jz_platform_devices[] __initdata = {
 	&jz4740_udc_device,
 	&jz4740_mmc_device,
@@ -409,6 +432,7 @@ static struct platform_device *jz_platform_devices[] __initdata = {
 	&jz4740_adc_device,
 	&qi_lb60_gpio_keys,
 	&qi_lb60_pwm_beeper,
+	&qi_lb60_charger_device,
 };
 
 static void __init board_gpio_setup(void)
-- 
1.7.2.3


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] MIPS: JZ4740: Fix pcm device name
@ 2010-11-11 18:08 Lars-Peter Clausen
  2010-11-11 18:08 ` [PATCH] MIPS: JZ4740: Set nand ecc offsets for the qi_lb60 board Lars-Peter Clausen
  0 siblings, 1 reply; 5+ messages in thread
From: Lars-Peter Clausen @ 2010-11-11 18:08 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, linux-kernel, Lars-Peter Clausen

As part the ASoC multi-component patch (commit f0fba2ad) the jz4740 pcm driver
was renamed to 'jz4740-pcm-audio'. Adjust the device name accordingly.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 arch/mips/jz4740/platform.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/jz4740/platform.c b/arch/mips/jz4740/platform.c
index c860b01..a17a17b 100644
--- a/arch/mips/jz4740/platform.c
+++ b/arch/mips/jz4740/platform.c
@@ -208,7 +208,7 @@ struct platform_device jz4740_i2s_device = {
 
 /* PCM */
 struct platform_device jz4740_pcm_device = {
-	.name		= "jz4740-pcm",
+	.name		= "jz4740-pcm-audio",
 	.id		= -1,
 };
 
-- 
1.5.6.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-25 12:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-08  2:43 [PATCH] MIPS: JZ4740: qi_lb60: Add gpio-charger device Lars-Peter Clausen
2011-02-08  2:43 ` [PATCH] MIPS: JZ4740: Set nand ecc offsets for the qi_lb60 board Lars-Peter Clausen
2011-03-25 12:31   ` Ralf Baechle
2011-03-25 12:30 ` [PATCH] MIPS: JZ4740: qi_lb60: Add gpio-charger device Ralf Baechle
  -- strict thread matches above, loose matches on Subject: below --
2010-11-11 18:08 [PATCH] MIPS: JZ4740: Fix pcm device name Lars-Peter Clausen
2010-11-11 18:08 ` [PATCH] MIPS: JZ4740: Set nand ecc offsets for the qi_lb60 board Lars-Peter Clausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).