aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-sa1100/simpad.c67
1 files changed, 66 insertions, 1 deletions
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index c3c66b0d6b6e..9f0eefdaa2a1 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -29,6 +29,9 @@
29 29
30#include <linux/serial_core.h> 30#include <linux/serial_core.h>
31#include <linux/ioport.h> 31#include <linux/ioport.h>
32#include <linux/input.h>
33#include <linux/gpio_keys.h>
34#include <linux/i2c-gpio.h>
32 35
33#include "generic.h" 36#include "generic.h"
34 37
@@ -249,6 +252,65 @@ static void simpad_power_off(void)
249 252
250} 253}
251 254
255/*
256 * gpio_keys
257*/
258
259static struct gpio_keys_button simpad_button_table[] = {
260 { KEY_POWER, IRQ_GPIO_POWER_BUTTON, 1, "power button" },
261};
262
263static struct gpio_keys_platform_data simpad_keys_data = {
264 .buttons = simpad_button_table,
265 .nbuttons = ARRAY_SIZE(simpad_button_table),
266};
267
268static struct platform_device simpad_keys = {
269 .name = "gpio-keys",
270 .dev = {
271 .platform_data = &simpad_keys_data,
272 },
273};
274
275static struct gpio_keys_button simpad_polled_button_table[] = {
276 { KEY_PROG1, SIMPAD_UCB1X00_GPIO_PROG1, 1, "prog1 button" },
277 { KEY_PROG2, SIMPAD_UCB1X00_GPIO_PROG2, 1, "prog2 button" },
278 { KEY_UP, SIMPAD_UCB1X00_GPIO_UP, 1, "up button" },
279 { KEY_DOWN, SIMPAD_UCB1X00_GPIO_DOWN, 1, "down button" },
280 { KEY_LEFT, SIMPAD_UCB1X00_GPIO_LEFT, 1, "left button" },
281 { KEY_RIGHT, SIMPAD_UCB1X00_GPIO_RIGHT, 1, "right button" },
282};
283
284static struct gpio_keys_platform_data simpad_polled_keys_data = {
285 .buttons = simpad_polled_button_table,
286 .nbuttons = ARRAY_SIZE(simpad_polled_button_table),
287 .poll_interval = 50,
288};
289
290static struct platform_device simpad_polled_keys = {
291 .name = "gpio-keys-polled",
292 .dev = {
293 .platform_data = &simpad_polled_keys_data,
294 },
295};
296
297/*
298 * i2c
299 */
300static struct i2c_gpio_platform_data simpad_i2c_data = {
301 .sda_pin = GPIO_GPIO21,
302 .scl_pin = GPIO_GPIO25,
303 .udelay = 10,
304 .timeout = HZ,
305};
306
307static struct platform_device simpad_i2c = {
308 .name = "i2c-gpio",
309 .id = 0,
310 .dev = {
311 .platform_data = &simpad_i2c_data,
312 },
313};
252 314
253/* 315/*
254 * MediaQ Video Device 316 * MediaQ Video Device
@@ -259,7 +321,10 @@ static struct platform_device simpad_mq200fb = {
259}; 321};
260 322
261static struct platform_device *devices[] __initdata = { 323static struct platform_device *devices[] __initdata = {
262 &simpad_mq200fb 324 &simpad_keys,
325 &simpad_polled_keys,
326 &simpad_mq200fb,
327 &simpad_i2c,
263}; 328};
264 329
265 330