All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/8] bcm63xx: register GPIO-connected LEDs for known references designs
@ 2009-08-07 21:46 Florian Fainelli
  2009-08-08 12:10 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2009-08-07 21:46 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Maxime Bizon, linux-mips

This patch makes the board code register GPIO-connected LEDs for which
we know the mapping since they are reference designs.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 668abdb..8bc4966 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -51,6 +51,36 @@ static struct board_info __initdata board_96348r = {
 		.has_phy		= 1,
 		.use_internal_phy	= 1,
 	},
+
+	.leds = {
+		{
+			.name		= "adsl-fail",
+			.gpio		= 2,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp",
+			.gpio		= 3,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp-fail",
+			.gpio		= 4,
+			.active_low	= 1,
+		},
+		{
+			.name		= "power",
+			.gpio		= 0,
+			.active_low	= 1,
+			.default_trigger = "default-on",
+
+		},
+		{
+			.name		= "stop",
+			.gpio		= 1,
+			.active_low	= 1,
+		},
+	},
 };
 
 static struct board_info __initdata board_96348gw_10 = {
@@ -81,6 +111,35 @@ static struct board_info __initdata board_96348gw_10 = {
 		.cs			= 2,
 		.ext_irq		= 2,
 	},
+
+	.leds = {
+		{
+			.name		= "adsl-fail",
+			.gpio		= 2,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp",
+			.gpio		= 3,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp-fail",
+			.gpio		= 4,
+			.active_low	= 1,
+		},
+		{
+			.name		= "power",
+			.gpio		= 0,
+			.active_low	= 1,
+			.default_trigger = "default-on",
+		},
+		{
+			.name		= "stop",
+			.gpio		= 1,
+			.active_low	= 1,
+		},
+	},
 };
 
 static struct board_info __initdata board_96348gw_11 = {
@@ -105,6 +164,35 @@ static struct board_info __initdata board_96348gw_11 = {
 	.has_ohci0 = 1,
 	.has_pccard = 1,
 	.has_ehci0 = 1,
+
+	.leds = {
+		{
+			.name		= "adsl-fail",
+			.gpio		= 2,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp",
+			.gpio		= 3,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp-fail",
+			.gpio		= 4,
+			.active_low	= 1,
+		},
+		{
+			.name		= "power",
+			.gpio		= 0,
+			.active_low	= 1,
+			.default_trigger = "default-on",
+		},
+		{
+			.name		= "stop",
+			.gpio		= 1,
+			.active_low	= 1,
+		},
+	},
 };
 
 static struct board_info __initdata board_96348gw = {
@@ -133,6 +221,35 @@ static struct board_info __initdata board_96348gw = {
 		.ext_irq		= 2,
 		.cs			= 2,
 	},
+
+	.leds = {
+		{
+			.name		= "adsl-fail",
+			.gpio		= 2,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp",
+			.gpio		= 3,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp-fail",
+			.gpio		= 4,
+			.active_low	= 1,
+		},
+		{
+			.name		= "power",
+			.gpio		= 0,
+			.active_low	= 1,
+			.default_trigger = "default-on",
+		},
+		{
+			.name		= "stop",
+			.gpio		= 1,
+			.active_low	= 1,
+		},
+	},
 };
 
 static struct board_info __initdata board_FAST2404 = {
@@ -225,6 +342,33 @@ static struct board_info __initdata board_96358vw = {
 	.has_ohci0 = 1,
 	.has_pccard = 1,
 	.has_ehci0 = 1,
+
+	.leds = {
+		{
+			.name		= "adsl-fail",
+			.gpio		= 15,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp",
+			.gpio		= 22,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp-fail",
+			.gpio		= 23,
+			.active_low	= 1,
+		},
+		{
+			.name		= "power",
+			.gpio		= 4,
+			.default_trigger = "default-on",
+		},
+		{
+			.name		= "stop",
+			.gpio		= 5,
+		},
+	},
 };
 
 static struct board_info __initdata board_96358vw2 = {
@@ -249,6 +393,29 @@ static struct board_info __initdata board_96358vw2 = {
 	.has_ohci0 = 1,
 	.has_pccard = 1,
 	.has_ehci0 = 1,
+
+	.leds = {
+		{
+			.name		= "adsl",
+			.gpio		= 22,
+			.active_low	= 1,
+		},
+		{
+			.name		= "ppp-fail",
+			.gpio		= 23,
+		},
+		{
+			.name		= "power",
+			.gpio		= 5,
+			.active_low	= 1,
+			.default_trigger = "default-on",
+		},
+		{
+			.name		= "stop",
+			.gpio		= 4,
+			.active_low	= 1,
+		},
+	},
 };
 
 static struct board_info __initdata board_AGPFS0 = {
@@ -505,6 +672,14 @@ static struct ssb_sprom bcm63xx_sprom = {
 };
 #endif
 
+static struct gpio_led_platform_data bcm63xx_led_data;
+
+static struct platform_device bcm63xx_gpio_leds = {
+	.name			= "leds-gpio",
+	.id			= 0,
+	.dev.platform_data	= &bcm63xx_led_data,
+};
+
 /*
  * third stage init callback, register all board devices.
  */
@@ -553,6 +728,11 @@ int __init board_register_devices(void)
 
 	platform_device_register(&mtd_dev);
 
+	bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds);
+	bcm63xx_led_data.leds = board.leds;
+
+	platform_device_register(&bcm63xx_gpio_leds);
+
 	return 0;
 }
 
diff --git a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
index 9fde025..6479090 100644
--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
@@ -2,6 +2,8 @@
 #define BOARD_BCM963XX_H_
 
 #include <linux/types.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
 #include <bcm63xx_dev_enet.h>
 #include <bcm63xx_dev_dsp.h>
 
@@ -50,6 +52,9 @@ struct board_info {
 
 	/* DSP config */
 	struct bcm63xx_dsp_platform_data dsp;
+
+	/* GPIO LEDs */
+	struct gpio_led leds[5];
 };
 
 #endif /* ! BOARD_BCM963XX_H_ */

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

* Re: [PATCH 3/8] bcm63xx: register GPIO-connected LEDs for known references designs
  2009-08-07 21:46 [PATCH 3/8] bcm63xx: register GPIO-connected LEDs for known references designs Florian Fainelli
@ 2009-08-08 12:10 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2009-08-08 12:10 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Maxime Bizon, linux-mips

On Fri, Aug 07, 2009 at 11:46:40PM +0200, Florian Fainelli wrote:

Folded into "MIPS: BCM63XX: Add board support code."

Thanks!

  Ralf

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

end of thread, other threads:[~2009-08-08 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-07 21:46 [PATCH 3/8] bcm63xx: register GPIO-connected LEDs for known references designs Florian Fainelli
2009-08-08 12:10 ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.