aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x/edmini_v2-setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-orion5x/edmini_v2-setup.c')
-rw-r--r--arch/arm/mach-orion5x/edmini_v2-setup.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/arch/arm/mach-orion5x/edmini_v2-setup.c b/arch/arm/mach-orion5x/edmini_v2-setup.c
index 2d67591dbce6..b24ee0c2cd61 100644
--- a/arch/arm/mach-orion5x/edmini_v2-setup.c
+++ b/arch/arm/mach-orion5x/edmini_v2-setup.c
@@ -25,6 +25,9 @@
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/mtd/physmap.h> 26#include <linux/mtd/physmap.h>
27#include <linux/mv643xx_eth.h> 27#include <linux/mv643xx_eth.h>
28#include <linux/leds.h>
29#include <linux/gpio_keys.h>
30#include <linux/input.h>
28#include <linux/i2c.h> 31#include <linux/i2c.h>
29#include <linux/ata_platform.h> 32#include <linux/ata_platform.h>
30#include <linux/gpio.h> 33#include <linux/gpio.h>
@@ -120,6 +123,61 @@ static struct mv_sata_platform_data edmini_v2_sata_data = {
120}; 123};
121 124
122/***************************************************************************** 125/*****************************************************************************
126 * GPIO LED (simple - doesn't use hardware blinking support)
127 ****************************************************************************/
128
129#define EDMINI_V2_GPIO_LED_POWER 16
130
131static struct gpio_led edmini_v2_leds[] = {
132 {
133 .name = "power:blue",
134 .gpio = EDMINI_V2_GPIO_LED_POWER,
135 .active_low = 1,
136 },
137};
138
139static struct gpio_led_platform_data edmini_v2_led_data = {
140 .num_leds = ARRAY_SIZE(edmini_v2_leds),
141 .leds = edmini_v2_leds,
142};
143
144static struct platform_device edmini_v2_gpio_leds = {
145 .name = "leds-gpio",
146 .id = -1,
147 .dev = {
148 .platform_data = &edmini_v2_led_data,
149 },
150};
151
152/****************************************************************************
153 * GPIO key
154 ****************************************************************************/
155
156#define EDMINI_V2_GPIO_KEY_POWER 18
157
158static struct gpio_keys_button edmini_v2_buttons[] = {
159 {
160 .code = KEY_POWER,
161 .gpio = EDMINI_V2_GPIO_KEY_POWER,
162 .desc = "Power Button",
163 .active_low = 0,
164 },
165};
166
167static struct gpio_keys_platform_data edmini_v2_button_data = {
168 .buttons = edmini_v2_buttons,
169 .nbuttons = ARRAY_SIZE(edmini_v2_buttons),
170};
171
172static struct platform_device edmini_v2_gpio_buttons = {
173 .name = "gpio-keys",
174 .id = -1,
175 .dev = {
176 .platform_data = &edmini_v2_button_data,
177 },
178};
179
180/*****************************************************************************
123 * General Setup 181 * General Setup
124 ****************************************************************************/ 182 ****************************************************************************/
125static struct orion5x_mpp_mode edminiv2_mpp_modes[] __initdata = { 183static struct orion5x_mpp_mode edminiv2_mpp_modes[] __initdata = {
@@ -170,6 +228,8 @@ static void __init edmini_v2_init(void)
170 orion5x_setup_dev_boot_win(EDMINI_V2_NOR_BOOT_BASE, 228 orion5x_setup_dev_boot_win(EDMINI_V2_NOR_BOOT_BASE,
171 EDMINI_V2_NOR_BOOT_SIZE); 229 EDMINI_V2_NOR_BOOT_SIZE);
172 platform_device_register(&edmini_v2_nor_flash); 230 platform_device_register(&edmini_v2_nor_flash);
231 platform_device_register(&edmini_v2_gpio_leds);
232 platform_device_register(&edmini_v2_gpio_buttons);
173 233
174 pr_notice("edmini_v2: USB device port, flash write and power-off " 234 pr_notice("edmini_v2: USB device port, flash write and power-off "
175 "are not yet supported.\n"); 235 "are not yet supported.\n");