diff options
author | Siddarth Gore <gores@marvell.com> | 2009-05-05 05:22:09 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2009-06-08 13:04:55 -0400 |
commit | 96e7d211b46ce838ceca5d9734d6e166cfafdef4 (patch) | |
tree | cacb5303ace61d4c87fd97cb1eb6e62ea2e9a027 /arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c | |
parent | 91af7bb2f48e14892c5c961bca1fae5c7886532e (diff) |
[ARM] Kirkwood: enable gpio leds/buttons for the mv88f6281gtw_ge board
Signed-off-by: Siddarth Gore <gores@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Diffstat (limited to 'arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c')
-rw-r--r-- | arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c index 4fb03f4d3f4a..0358f45766cb 100644 --- a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c +++ b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c | |||
@@ -17,6 +17,10 @@ | |||
17 | #include <linux/timer.h> | 17 | #include <linux/timer.h> |
18 | #include <linux/mv643xx_eth.h> | 18 | #include <linux/mv643xx_eth.h> |
19 | #include <linux/ethtool.h> | 19 | #include <linux/ethtool.h> |
20 | #include <linux/gpio.h> | ||
21 | #include <linux/leds.h> | ||
22 | #include <linux/input.h> | ||
23 | #include <linux/gpio_keys.h> | ||
20 | #include <linux/spi/flash.h> | 24 | #include <linux/spi/flash.h> |
21 | #include <linux/spi/spi.h> | 25 | #include <linux/spi/spi.h> |
22 | #include <linux/spi/orion_spi.h> | 26 | #include <linux/spi/orion_spi.h> |
@@ -26,6 +30,7 @@ | |||
26 | #include <asm/mach/pci.h> | 30 | #include <asm/mach/pci.h> |
27 | #include <mach/kirkwood.h> | 31 | #include <mach/kirkwood.h> |
28 | #include "common.h" | 32 | #include "common.h" |
33 | #include "mpp.h" | ||
29 | 34 | ||
30 | static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = { | 35 | static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = { |
31 | .phy_addr = MV643XX_ETH_PHY_NONE, | 36 | .phy_addr = MV643XX_ETH_PHY_NONE, |
@@ -62,12 +67,79 @@ static struct spi_board_info __initdata mv88f6281gtw_ge_spi_slave_info[] = { | |||
62 | }, | 67 | }, |
63 | }; | 68 | }; |
64 | 69 | ||
70 | static struct gpio_keys_button mv88f6281gtw_ge_button_pins[] = { | ||
71 | { | ||
72 | .code = KEY_RESTART, | ||
73 | .gpio = 47, | ||
74 | .desc = "SWR Button", | ||
75 | .active_low = 1, | ||
76 | }, { | ||
77 | .code = KEY_F1, | ||
78 | .gpio = 46, | ||
79 | .desc = "WPS Button(F1)", | ||
80 | .active_low = 1, | ||
81 | }, | ||
82 | }; | ||
83 | |||
84 | static struct gpio_keys_platform_data mv88f6281gtw_ge_button_data = { | ||
85 | .buttons = mv88f6281gtw_ge_button_pins, | ||
86 | .nbuttons = ARRAY_SIZE(mv88f6281gtw_ge_button_pins), | ||
87 | }; | ||
88 | |||
89 | static struct platform_device mv88f6281gtw_ge_buttons = { | ||
90 | .name = "gpio-keys", | ||
91 | .id = -1, | ||
92 | .num_resources = 0, | ||
93 | .dev = { | ||
94 | .platform_data = &mv88f6281gtw_ge_button_data, | ||
95 | }, | ||
96 | }; | ||
97 | |||
98 | static struct gpio_led mv88f6281gtw_ge_led_pins[] = { | ||
99 | { | ||
100 | .name = "gtw:green:Status", | ||
101 | .gpio = 20, | ||
102 | .active_low = 0, | ||
103 | }, { | ||
104 | .name = "gtw:red:Status", | ||
105 | .gpio = 21, | ||
106 | .active_low = 0, | ||
107 | }, { | ||
108 | .name = "gtw:green:USB", | ||
109 | .gpio = 12, | ||
110 | .active_low = 0, | ||
111 | }, | ||
112 | }; | ||
113 | |||
114 | static struct gpio_led_platform_data mv88f6281gtw_ge_led_data = { | ||
115 | .leds = mv88f6281gtw_ge_led_pins, | ||
116 | .num_leds = ARRAY_SIZE(mv88f6281gtw_ge_led_pins), | ||
117 | }; | ||
118 | |||
119 | static struct platform_device mv88f6281gtw_ge_leds = { | ||
120 | .name = "leds-gpio", | ||
121 | .id = -1, | ||
122 | .dev = { | ||
123 | .platform_data = &mv88f6281gtw_ge_led_data, | ||
124 | }, | ||
125 | }; | ||
126 | |||
127 | static unsigned int mv88f6281gtw_ge_mpp_config[] __initdata = { | ||
128 | MPP12_GPO, /* Status#_USB pin */ | ||
129 | MPP20_GPIO, /* Status#_GLED pin */ | ||
130 | MPP21_GPIO, /* Status#_RLED pin */ | ||
131 | MPP46_GPIO, /* WPS_Switch pin */ | ||
132 | MPP47_GPIO, /* SW_Init pin */ | ||
133 | 0 | ||
134 | }; | ||
135 | |||
65 | static void __init mv88f6281gtw_ge_init(void) | 136 | static void __init mv88f6281gtw_ge_init(void) |
66 | { | 137 | { |
67 | /* | 138 | /* |
68 | * Basic setup. Needs to be called early. | 139 | * Basic setup. Needs to be called early. |
69 | */ | 140 | */ |
70 | kirkwood_init(); | 141 | kirkwood_init(); |
142 | kirkwood_mpp_conf(mv88f6281gtw_ge_mpp_config); | ||
71 | 143 | ||
72 | kirkwood_ehci_init(); | 144 | kirkwood_ehci_init(); |
73 | kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data); | 145 | kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data); |
@@ -76,6 +148,8 @@ static void __init mv88f6281gtw_ge_init(void) | |||
76 | ARRAY_SIZE(mv88f6281gtw_ge_spi_slave_info)); | 148 | ARRAY_SIZE(mv88f6281gtw_ge_spi_slave_info)); |
77 | kirkwood_spi_init(); | 149 | kirkwood_spi_init(); |
78 | kirkwood_uart0_init(); | 150 | kirkwood_uart0_init(); |
151 | platform_device_register(&mv88f6281gtw_ge_leds); | ||
152 | platform_device_register(&mv88f6281gtw_ge_buttons); | ||
79 | } | 153 | } |
80 | 154 | ||
81 | static int __init mv88f6281gtw_ge_pci_init(void) | 155 | static int __init mv88f6281gtw_ge_pci_init(void) |