Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=21c854dcbd7698bf723676a552968040e2813490
Commit:     21c854dcbd7698bf723676a552968040e2813490
Parent:     34cc662f8aae0ce1db5c64d55a39a5081f9e3cd8
Author:     Aurelien Jarno <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 25 15:43:07 2007 +0200
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Thu Oct 11 23:46:07 2007 +0100

    [MIPS] GPIO LED driver for the WGT634U machine
    
    Add LED support to the WGT634U machine.  It uses the new gpio-led
    driver and a platform driver for the pin definitions.
    
    Signed-off-by: Aurelien Jarno <[EMAIL PROTECTED]>
    Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/bcm47xx/Makefile  |    2 +-
 arch/mips/bcm47xx/wgt634u.c |   64 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 1 deletions(-)

diff --git a/arch/mips/bcm47xx/Makefile b/arch/mips/bcm47xx/Makefile
index 0afe097..35294b1 100644
--- a/arch/mips/bcm47xx/Makefile
+++ b/arch/mips/bcm47xx/Makefile
@@ -3,4 +3,4 @@
 # under Linux.
 #
 
-obj-y := gpio.o irq.o prom.o serial.o setup.o time.o
+obj-y := gpio.o irq.o prom.o serial.o setup.o time.o wgt634u.o
diff --git a/arch/mips/bcm47xx/wgt634u.c b/arch/mips/bcm47xx/wgt634u.c
new file mode 100644
index 0000000..5a017ea
--- /dev/null
+++ b/arch/mips/bcm47xx/wgt634u.c
@@ -0,0 +1,64 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2007 Aurelien Jarno <[EMAIL PROTECTED]>
+ */
+
+#include <linux/platform_device.h>
+#include <linux/module.h>
+#include <linux/leds.h>
+#include <linux/ssb/ssb.h>
+#include <asm/mach-bcm47xx/bcm47xx.h>
+
+/* GPIO definitions for the WGT634U */
+#define WGT634U_GPIO_LED       3
+#define WGT634U_GPIO_RESET     2
+#define WGT634U_GPIO_TP1       7
+#define WGT634U_GPIO_TP2       6
+#define WGT634U_GPIO_TP3       5
+#define WGT634U_GPIO_TP4       4
+#define WGT634U_GPIO_TP5       1
+
+static struct gpio_led wgt634u_leds[] = {
+       {
+               .name = "power",
+               .gpio = WGT634U_GPIO_LED,
+               .active_low = 1,
+               .default_trigger = "heartbeat",
+       },
+};
+
+static struct gpio_led_platform_data wgt634u_led_data = {
+       .num_leds =     ARRAY_SIZE(wgt634u_leds),
+       .leds =         wgt634u_leds,
+};
+
+static struct platform_device wgt634u_gpio_leds = {
+       .name =         "leds-gpio",
+       .id =           -1,
+       .dev = {
+               .platform_data = &wgt634u_led_data,
+       }
+};
+
+static int __init wgt634u_init(void)
+{
+       /* There is no easy way to detect that we are running on a WGT634U
+        * machine. Use the MAC address as an heuristic. Netgear Inc. has
+        * been allocated ranges 00:09:5b:xx:xx:xx and 00:0f:b5:xx:xx:xx.
+        */
+
+       u8 *et0mac = ssb_bcm47xx.sprom.r1.et0mac;
+
+       if (et0mac[0] == 0x00 &&
+           ((et0mac[1] == 0x09 && et0mac[2] == 0x5b) ||
+            (et0mac[1] == 0x0f && et0mac[2] == 0xb5)))
+               return platform_device_register(&wgt634u_gpio_leds);
+       else
+               return -ENODEV;
+}
+
+module_init(wgt634u_init);
+
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to