linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lars@metafoo.de (Lars-Peter Clausen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: gta02: Add button support
Date: Sat, 28 Nov 2009 04:05:29 +0100	[thread overview]
Message-ID: <1259377532-8012-2-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1259377532-8012-1-git-send-email-lars@metafoo.de>

The gta02 has two buttons which are connected to gpio pins and thus can get
supported by using the generic gpio-keys driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-By: Nelson Castillo <arhuaco@freaks-unidos.net>
---
 arch/arm/mach-s3c2442/mach-gta02.c |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index 0fb385b..0f0c619 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -58,6 +58,8 @@
 #include <linux/mfd/pcf50633/gpio.h>
 #include <linux/mfd/pcf50633/pmic.h>
 
+#include <linux/gpio_keys.h>
+
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
@@ -550,6 +552,36 @@ static struct s3c2410_hcd_info gta02_usb_info = {
 	},
 };
 
+/* Buttons */
+static struct gpio_keys_button gta02_buttons[] = {
+	{
+		.gpio = GTA02_GPIO_AUX_KEY,
+		.code = KEY_PHONE,
+		.desc = "Aux",
+		.type = EV_KEY,
+		.debounce_interval = 100,
+	},
+	{
+		.gpio = GTA02_GPIO_HOLD_KEY,
+		.code = KEY_PAUSE,
+		.desc = "Hold",
+		.type = EV_KEY,
+		.debounce_interval = 100,
+	},
+};
+
+static struct gpio_keys_platform_data gta02_buttons_pdata = {
+	.buttons = gta02_buttons,
+	.nbuttons = ARRAY_SIZE(gta02_buttons),
+};
+
+static struct platform_device gta02_buttons_device = {
+	.name = "gpio-keys",
+	.id = -1,
+	.dev = {
+		.platform_data = &gta02_buttons_pdata,
+	},
+};
 
 static void __init gta02_map_io(void)
 {
@@ -571,6 +603,7 @@ static struct platform_device *gta02_devices[] __initdata = {
 	&s3c24xx_pwm_device,
 	&s3c_device_iis,
 	&s3c_device_i2c0,
+	&gta02_buttons_device,
 };
 
 /* These guys DO need to be children of PMU. */
-- 
1.5.6.5

  reply	other threads:[~2009-11-28  3:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-28  3:05 ARM: gta02: Add Button, LED and Vibrator support Lars-Peter Clausen
2009-11-28  3:05 ` Lars-Peter Clausen [this message]
2009-11-28  3:05   ` [PATCH] ARM: gta02: Add LED support Lars-Peter Clausen
2009-11-28  3:05     ` [PATCH] ARM: gta02: Add vibrator support Lars-Peter Clausen
2009-11-28  3:05       ` [PATCH] ARM: gta02: Add gpio bank B quirk for hardware revision 5 and earlier Lars-Peter Clausen
2009-11-29  8:34         ` Pavel Machek
2009-11-29 10:56           ` Lars-Peter Clausen
2009-11-30 12:31             ` Pavel Machek
2009-11-30 18:56               ` Jamie Lokier
2009-12-01 12:32                 ` Pavel Machek
2009-12-01 18:27         ` Ben Dooks
2009-11-29  8:37       ` [PATCH] ARM: gta02: Add vibrator support Pavel Machek
2009-11-29  8:31   ` [PATCH] ARM: gta02: Add button support Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1259377532-8012-2-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).