From ac4e62382417b0895fa6093ae95ab50dcc28b82d Mon Sep 17 00:00:00 2001 From: Christer Weinigel Date: Mon, 7 Jul 2008 18:12:43 +0100 Subject: [PATCH] --- yaml --- r: 100857 b: refs/heads/master c: 620657500263cca4a4d9845eeaeba47e03447075 h: refs/heads/master i: 100855: 54b1a3462690666980835b60dada183b5277970c v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-s3c2410/mach-n30.c | 67 ++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 33b61d47fa7f..a31eb4bcfc17 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d088e5fe586287da003341e7bbfdad15e0f432f7 +refs/heads/master: 620657500263cca4a4d9845eeaeba47e03447075 diff --git a/trunk/arch/arm/mach-s3c2410/mach-n30.c b/trunk/arch/arm/mach-s3c2410/mach-n30.c index 8edc0c0eb043..631f3a9e7a60 100644 --- a/trunk/arch/arm/mach-s3c2410/mach-n30.c +++ b/trunk/arch/arm/mach-s3c2410/mach-n30.c @@ -17,7 +17,9 @@ #include #include +#include #include +#include #include #include #include @@ -98,6 +100,70 @@ static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = { .vbus_pin_inverted = 0, }; +static struct gpio_keys_button n30_buttons[] = { + { + .gpio = S3C2410_GPF0, + .code = KEY_POWER, + .desc = "Power", + .active_low = 0, + }, + { + .gpio = S3C2410_GPG9, + .code = KEY_UP, + .desc = "Thumbwheel Up", + .active_low = 0, + }, + { + .gpio = S3C2410_GPG8, + .code = KEY_DOWN, + .desc = "Thumbwheel Down", + .active_low = 0, + }, + { + .gpio = S3C2410_GPG7, + .code = KEY_ENTER, + .desc = "Thumbwheel Press", + .active_low = 0, + }, + { + .gpio = S3C2410_GPF7, + .code = KEY_HOMEPAGE, + .desc = "Home", + .active_low = 0, + }, + { + .gpio = S3C2410_GPF6, + .code = KEY_CALENDAR, + .desc = "Calendar", + .active_low = 0, + }, + { + .gpio = S3C2410_GPF5, + .code = KEY_ADDRESSBOOK, + .desc = "Contacts", + .active_low = 0, + }, + { + .gpio = S3C2410_GPF4, + .code = KEY_MAIL, + .desc = "Mail", + .active_low = 0, + }, +}; + +static struct gpio_keys_platform_data n30_button_data = { + .buttons = n30_buttons, + .nbuttons = ARRAY_SIZE(n30_buttons), +}; + +static struct platform_device n30_button_device = { + .name = "gpio-keys", + .id = -1, + .dev = { + .platform_data = &n30_button_data, + } +}; + static struct platform_device *n30_devices[] __initdata = { &s3c_device_lcd, &s3c_device_wdt, @@ -105,6 +171,7 @@ static struct platform_device *n30_devices[] __initdata = { &s3c_device_iis, &s3c_device_usb, &s3c_device_usbgadget, + &n30_button_device, }; static struct s3c2410_platform_i2c n30_i2ccfg = {