* [patch 1/1] Add definitions for the h1940 buttons.
[not found] <20101009213734.286778338@rtp-net.org>
@ 2010-10-09 21:37 ` Arnaud Patard (Rtp)
0 siblings, 0 replies; 4+ messages in thread
From: Arnaud Patard @ 2010-10-09 21:37 UTC (permalink / raw)
To: Ben Dooks
Cc: Vasily Khoruzhick, linux-samsung-soc, linux-arm-kernel,
Arnaud Patard
[-- Attachment #1: buttons.patch --]
[-- Type: text/plain, Size: 2271 bytes --]
Add support for the h1940 buttons/keys connected to GPIOs.
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
---
arch/arm/mach-s3c2410/mach-h1940.c | 39 39 + 0 - 0 !
1 file changed, 39 insertions(+)
Index: linux/arch/arm/mach-s3c2410/mach-h1940.c
===================================================================
--- linux.orig/arch/arm/mach-s3c2410/mach-h1940.c 2010-10-09 22:26:52.652798539 +0200
+++ linux/arch/arm/mach-s3c2410/mach-h1940.c 2010-10-09 22:27:36.944815754 +0200
@@ -23,6 +23,8 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/gpio.h>
+#include <linux/input.h>
+#include <linux/gpio_keys.h>
#include <linux/pwm_backlight.h>
#include <video/platform_lcd.h>
@@ -365,7 +367,44 @@ static struct platform_device h1940_lcd_
.dev.platform_data = &h1940_lcd_power_data,
};
+#define DECLARE_BUTTON(p, k, n, w) \
+ { \
+ .gpio = p, \
+ .code = k, \
+ .desc = n, \
+ .wakeup = w, \
+ .active_low = 1, \
+ }
+
+static struct gpio_keys_button h1940_buttons[] = {
+ DECLARE_BUTTON(S3C2410_GPF(0), KEY_POWER, "Power", 1),
+ DECLARE_BUTTON(S3C2410_GPF(6), KEY_ENTER, "Select", 1),
+ DECLARE_BUTTON(S3C2410_GPF(7), KEY_RECORD, "Record", 0),
+ DECLARE_BUTTON(S3C2410_GPG(0), KEY_F11, "Calendar", 0),
+ DECLARE_BUTTON(S3C2410_GPG(2), KEY_F12, "Contacts", 0),
+ DECLARE_BUTTON(S3C2410_GPG(3), KEY_MAIL, "Mail", 0),
+ DECLARE_BUTTON(S3C2410_GPG(6), KEY_LEFT, "Left_arrow", 0),
+ DECLARE_BUTTON(S3C2410_GPG(7), KEY_HOMEPAGE, "Home", 0),
+ DECLARE_BUTTON(S3C2410_GPG(8), KEY_RIGHT, "Right_arrow", 0),
+ DECLARE_BUTTON(S3C2410_GPG(9), KEY_UP, "Up_arrow", 0),
+ DECLARE_BUTTON(S3C2410_GPG(10), KEY_DOWN, "Down_arrow", 0),
+};
+
+static struct gpio_keys_platform_data h1940_buttons_data = {
+ .buttons = h1940_buttons,
+ .nbuttons = ARRAY_SIZE(h1940_buttons),
+};
+
+static struct platform_device h1940_dev_buttons = {
+ .name = "gpio-keys",
+ .id = -1,
+ .dev = {
+ .platform_data = &h1940_buttons_data,
+ }
+};
+
static struct platform_device *h1940_devices[] __initdata = {
+ &h1940_dev_buttons,
&s3c_device_ohci,
&s3c_device_lcd,
&s3c_device_wdt,
^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch 1/1] Add definitions for the h1940 buttons.
@ 2010-10-09 21:37 ` Arnaud Patard (Rtp)
0 siblings, 0 replies; 4+ messages in thread
From: Arnaud Patard (Rtp) @ 2010-10-09 21:37 UTC (permalink / raw)
To: linux-arm-kernel
An embedded and charset-unspecified text was scrubbed...
Name: buttons.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101009/21c1c974/attachment.ksh>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 1/1] Add definitions for the h1940 buttons.
2010-10-09 21:37 ` Arnaud Patard (Rtp)
@ 2010-10-10 23:32 ` Ben Dooks
-1 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2010-10-10 23:32 UTC (permalink / raw)
To: Arnaud Patard (Rtp)
Cc: Ben Dooks, Vasily Khoruzhick, linux-samsung-soc, linux-arm-kernel
On 09/10/10 22:37, Arnaud Patard (Rtp) wrote:
ok, will apply.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch 1/1] Add definitions for the h1940 buttons.
@ 2010-10-10 23:32 ` Ben Dooks
0 siblings, 0 replies; 4+ messages in thread
From: Ben Dooks @ 2010-10-10 23:32 UTC (permalink / raw)
To: linux-arm-kernel
On 09/10/10 22:37, Arnaud Patard (Rtp) wrote:
ok, will apply.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-10 23:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20101009213734.286778338@rtp-net.org>
2010-10-09 21:37 ` [patch 1/1] Add definitions for the h1940 buttons Arnaud Patard
2010-10-09 21:37 ` Arnaud Patard (Rtp)
2010-10-10 23:32 ` Ben Dooks
2010-10-10 23:32 ` Ben Dooks
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.