Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: maramaopercheseimorto@gmail.com (Alberto Panizzo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] [MXC] Armadillo500 Add support for onboard GPIO Buttons.
Date: Thu, 15 Oct 2009 19:24:51 +0200	[thread overview]
Message-ID: <20091015192451.50ee35c5@Marramao-laptop> (raw)
In-Reply-To: <20091015191325.74ba24fb@Marramao-laptop>

There are two low active Buttons on boards.
This patch connect those to the Input Subsystem over gpio-keys driver.

Signed-off-by: Alberto Panizzo <maramaopercheseimorto@gmail.com>
---
 arch/arm/mach-mx3/armadillo5x0.c |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/armadillo5x0.c
index 776c0ee..309fa7a 100644
--- a/arch/arm/mach-mx3/armadillo5x0.c
+++ b/arch/arm/mach-mx3/armadillo5x0.c
@@ -33,6 +33,8 @@
 #include <linux/irq.h>
 #include <linux/mtd/physmap.h>
 #include <linux/io.h>
+#include <linux/input.h>
+#include <linux/gpio_keys.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -98,6 +100,36 @@ static int armadillo5x0_pins[] = {
 	MX31_PIN_DRDY0__DRDY0,
 	IOMUX_MODE(MX31_PIN_LCS1, IOMUX_CONFIG_GPIO), /*ADV7125_PSAVE*/
 };
+/* GPIO BUTTONS */
+static struct gpio_keys_button armadillo5x0_buttons[] = {
+	{
+		.code		= KEY_ENTER, /*28*/
+		.gpio		= IOMUX_TO_GPIO(MX31_PIN_SCLK0),
+		.active_low	= 1,
+		.desc		= "menu",
+		.wakeup		= 1,
+	}, {
+		.code		= KEY_BACK, /*158*/
+		.gpio		= IOMUX_TO_GPIO(MX31_PIN_SRST0),
+		.active_low	= 1,
+		.desc		= "back",
+		.wakeup		= 1,
+	}
+};
+
+static struct gpio_keys_platform_data armadillo5x0_button_data = {
+	.buttons	= armadillo5x0_buttons,
+	.nbuttons	= ARRAY_SIZE(armadillo5x0_buttons),
+};
+
+static struct platform_device armadillo5x0_button_device = {
+	.name		= "gpio-keys",
+	.id		= -1,
+	.num_resources	= 0,
+	.dev		= {
+		.platform_data	= &armadillo5x0_button_data,
+	}
+};
 
 /*
  * NAND Flash
@@ -300,6 +332,7 @@ static struct imxuart_platform_data uart_pdata = {
 
 static struct platform_device *devices[] __initdata = {
 	&armadillo5x0_smc911x_device,
+	&armadillo5x0_button_device,
 };
 
 /*
-- 
1.5.4.3

  reply	other threads:[~2009-10-15 17:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-15 17:13 [PATCH 0/4] [MXC] Armadillo500 patches to support various devices Alberto Panizzo
2009-10-15 17:24 ` Alberto Panizzo [this message]
2009-10-15 17:29   ` [PATCH 2/4] [MXC] Armadillo500 Correct bus length for SMSC9118 on board chip Alberto Panizzo
2009-10-15 17:31     ` [PATCH 3/4] [MXC] Armadillo500 Add i2c second bus support Alberto Panizzo
2009-10-15 17:33       ` [PATCH 4/4] [MXC] Armadillo500 Add support for Seiko Instruments S-35390A rtc over i2c Alberto Panizzo
2009-10-19 14:27     ` [PATCH 2/4] [MXC] Armadillo500 Correct bus length for SMSC9118 on board chip Sascha Hauer
2009-10-21 21:40       ` Alberto Panizzo

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=20091015192451.50ee35c5@Marramao-laptop \
    --to=maramaopercheseimorto@gmail.com \
    --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