diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-11 22:21:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-11 22:21:23 -0400 |
commit | dd6d1844af33acb4edd0a40b1770d091a22c94be (patch) | |
tree | e6bd3549919773a13b770324a4dddb51b194b452 /arch/mips/bcm47xx/wgt634u.c | |
parent | 19f71153b9be219756c6b2757921433a69b7975c (diff) | |
parent | aaf76a3245c02faba51c96b9a340c14d6bb0dcc0 (diff) |
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (80 commits)
[MIPS] tlbex.c: Cleanup __init usage.
[MIPS] WRPPMC serial support move to platform device
[MIPS] R1: Fix hazard barriers to make kernels work on R2 also.
[MIPS] VPE: reimplement ELF loader.
[MIPS] cleanup WRPPMC include files
[MIPS] Add BUG_ON assertion for attempt to run kernel on the wrong CPU type.
[MIPS] SMP: Use ISO C struct initializer for local structs.
[MIPS] SMP: Kill useless casts.
[MIPS] Kill num_online_cpus() loops.
[MIPS] SMP: Implement smp_call_function_mask().
[MIPS] Make facility to convert CPU types to strings generally available.
[MIPS] Convert list of CPU types from #define to enum.
[MIPS] Optimize get_unaligned / put_unaligned implementations.
[MIPS] checkfiles: Fix "need space after that ','" errors.
[MIPS] Fix "no space between function name and open parenthesis" warnings.
[MIPS] Allow hardwiring of the CPU type to a single type for optimization.
[MIPS] tlbex: Size optimize code by declaring a few functions inline.
[MIPS] pg-r4k.c: Dump the generated code
[MIPS] Cobalt: Remove cobalt_machine_power_off()
[MIPS] Cobalt: Move reset port definition to arch/mips/cobalt/reset.c
...
Diffstat (limited to 'arch/mips/bcm47xx/wgt634u.c')
-rw-r--r-- | arch/mips/bcm47xx/wgt634u.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/mips/bcm47xx/wgt634u.c b/arch/mips/bcm47xx/wgt634u.c new file mode 100644 index 000000000000..5a017eaee712 --- /dev/null +++ b/arch/mips/bcm47xx/wgt634u.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
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 | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net> | ||
7 | */ | ||
8 | |||
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> | ||
14 | |||
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 | ||
23 | |||
24 | static struct gpio_led wgt634u_leds[] = { | ||
25 | { | ||
26 | .name = "power", | ||
27 | .gpio = WGT634U_GPIO_LED, | ||
28 | .active_low = 1, | ||
29 | .default_trigger = "heartbeat", | ||
30 | }, | ||
31 | }; | ||
32 | |||
33 | static struct gpio_led_platform_data wgt634u_led_data = { | ||
34 | .num_leds = ARRAY_SIZE(wgt634u_leds), | ||
35 | .leds = wgt634u_leds, | ||
36 | }; | ||
37 | |||
38 | static struct platform_device wgt634u_gpio_leds = { | ||
39 | .name = "leds-gpio", | ||
40 | .id = -1, | ||
41 | .dev = { | ||
42 | .platform_data = &wgt634u_led_data, | ||
43 | } | ||
44 | }; | ||
45 | |||
46 | static int __init wgt634u_init(void) | ||
47 | { | ||
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. | ||
51 | */ | ||
52 | |||
53 | u8 *et0mac = ssb_bcm47xx.sprom.r1.et0mac; | ||
54 | |||
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); | ||
59 | else | ||
60 | return -ENODEV; | ||
61 | } | ||
62 | |||
63 | module_init(wgt634u_init); | ||
64 | |||