2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net>
9 #include <linux/platform_device.h>
10 #include <linux/module.h>
11 #include <linux/leds.h>
12 #include <linux/ssb/ssb.h>
13 #include <asm/mach-bcm47xx/bcm47xx.h>
15 /* GPIO definitions for the WGT634U */
16 #define WGT634U_GPIO_LED 3
17 #define WGT634U_GPIO_RESET 2
18 #define WGT634U_GPIO_TP1 7
19 #define WGT634U_GPIO_TP2 6
20 #define WGT634U_GPIO_TP3 5
21 #define WGT634U_GPIO_TP4 4
22 #define WGT634U_GPIO_TP5 1
24 static struct gpio_led wgt634u_leds[] = {
27 .gpio = WGT634U_GPIO_LED,
29 .default_trigger = "heartbeat",
33 static struct gpio_led_platform_data wgt634u_led_data = {
34 .num_leds = ARRAY_SIZE(wgt634u_leds),
38 static struct platform_device wgt634u_gpio_leds = {
42 .platform_data = &wgt634u_led_data,
46 static int __init wgt634u_init(void)
48 /* There is no easy way to detect that we are running on a WGT634U
49 * machine. Use the MAC address as an heuristic. Netgear Inc. has
50 * been allocated ranges 00:09:5b:xx:xx:xx and 00:0f:b5:xx:xx:xx.
53 u8 *et0mac = ssb_bcm47xx.sprom.r1.et0mac;
55 if (et0mac[0] == 0x00 &&
56 ((et0mac[1] == 0x09 && et0mac[2] == 0x5b) ||
57 (et0mac[1] == 0x0f && et0mac[2] == 0xb5)))
58 return platform_device_register(&wgt634u_gpio_leds);
63 module_init(wgt634u_init);