aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 1e93f176c1de..07564404fb89 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -23,6 +23,8 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/input.h>
27#include <linux/gpio_keys.h>
26#include <linux/pwm_backlight.h> 28#include <linux/pwm_backlight.h>
27#include <linux/i2c.h> 29#include <linux/i2c.h>
28#include <video/platform_lcd.h> 30#include <video/platform_lcd.h>
@@ -362,7 +364,44 @@ static struct i2c_board_info h1940_i2c_devices[] = {
362 }, 364 },
363}; 365};
364 366
367#define DECLARE_BUTTON(p, k, n, w) \
368 { \
369 .gpio = p, \
370 .code = k, \
371 .desc = n, \
372 .wakeup = w, \
373 .active_low = 1, \
374 }
375
376static struct gpio_keys_button h1940_buttons[] = {
377 DECLARE_BUTTON(S3C2410_GPF(0), KEY_POWER, "Power", 1),
378 DECLARE_BUTTON(S3C2410_GPF(6), KEY_ENTER, "Select", 1),
379 DECLARE_BUTTON(S3C2410_GPF(7), KEY_RECORD, "Record", 0),
380 DECLARE_BUTTON(S3C2410_GPG(0), KEY_F11, "Calendar", 0),
381 DECLARE_BUTTON(S3C2410_GPG(2), KEY_F12, "Contacts", 0),
382 DECLARE_BUTTON(S3C2410_GPG(3), KEY_MAIL, "Mail", 0),
383 DECLARE_BUTTON(S3C2410_GPG(6), KEY_LEFT, "Left_arrow", 0),
384 DECLARE_BUTTON(S3C2410_GPG(7), KEY_HOMEPAGE, "Home", 0),
385 DECLARE_BUTTON(S3C2410_GPG(8), KEY_RIGHT, "Right_arrow", 0),
386 DECLARE_BUTTON(S3C2410_GPG(9), KEY_UP, "Up_arrow", 0),
387 DECLARE_BUTTON(S3C2410_GPG(10), KEY_DOWN, "Down_arrow", 0),
388};
389
390static struct gpio_keys_platform_data h1940_buttons_data = {
391 .buttons = h1940_buttons,
392 .nbuttons = ARRAY_SIZE(h1940_buttons),
393};
394
395static struct platform_device h1940_dev_buttons = {
396 .name = "gpio-keys",
397 .id = -1,
398 .dev = {
399 .platform_data = &h1940_buttons_data,
400 }
401};
402
365static struct platform_device *h1940_devices[] __initdata = { 403static struct platform_device *h1940_devices[] __initdata = {
404 &h1940_dev_buttons,
366 &s3c_device_ohci, 405 &s3c_device_ohci,
367 &s3c_device_lcd, 406 &s3c_device_lcd,
368 &s3c_device_wdt, 407 &s3c_device_wdt,