All of lore.kernel.org
 help / color / mirror / Atom feed
From: pavel@ucw.cz (Pavel Machek)
To: linux-arm-kernel@lists.infradead.org
Subject: spitz: add gpio button support (fixes regression)
Date: Tue, 6 Oct 2009 22:09:33 +0200	[thread overview]
Message-ID: <20091006200933.GA1606@ucw.cz> (raw)
In-Reply-To: <f17812d70910070727x47b2a22h8e9f9304740d5abf@mail.gmail.com>


> So what's the conclusion of the patch? Any ACK/NAK or patch needs updating?

Please take this updated version.

---

Spitz switched to generic matrix-gpio keyboard driver in 2.6.32-rc0,
but that means that support for power button and lid switches was
lost. This restores it, using button-gpio code.

Signed-off-by: Pavel Machek <pavel@ucw.cz>

--- linux-rc/arch/arm.ofic/mach-pxa/spitz.c	2009-10-06 13:48:07.000000000 +0200
+++ linux-rc/arch/arm/mach-pxa/spitz.c	2009-10-06 21:17:19.000000000 +0200
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
+#include <linux/gpio_keys.h>
 #include <linux/gpio.h>
 #include <linux/leds.h>
 #include <linux/mtd/physmap.h>
@@ -375,6 +377,51 @@
 };
 
 
+static struct gpio_keys_button spitz_gpio_keys[] = {
+	{
+		.type	= EV_KEY,
+		.code	= KEY_SUSPEND,
+		.gpio	= SPITZ_GPIO_ON_KEY,
+		.desc	= "Power button",
+		.wakeup	= 1,
+	},
+	/* Two buttons detecting the LID state */
+	{
+		.type	= EV_SW,
+		.code	= 0,
+		.gpio	= SPITZ_GPIO_SWA,
+		.desc	= "Lid SWA",
+	},
+	{
+		.type	= EV_SW,
+		.code	= 1,
+		.gpio	= SPITZ_GPIO_SWB,
+		.desc	= "Lid SWB",
+	},
+	/* This is for remote control support. Zaurus supports wired
+	   remote on headphones. */
+	{
+		.type	= EV_SW,
+		.code	= 2,
+		.gpio	= SPITZ_GPIO_AK_INT,
+		.desc	= "Wired remote (AK_INT)",
+	},
+};
+
+static struct gpio_keys_platform_data spitz_gpio_keys_platform_data = {
+	.buttons	= spitz_gpio_keys,
+	.nbuttons	= ARRAY_SIZE(spitz_gpio_keys),
+};
+
+static struct platform_device spitz_gpio_keys_device = {
+	.name	= "gpio-keys",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &spitz_gpio_keys_platform_data,
+	},
+};
+
+
 /*
  * Spitz LEDs
  */
@@ -689,6 +736,7 @@
 static struct platform_device *devices[] __initdata = {
 	&spitzscoop_device,
 	&spitzkbd_device,
+	&spitz_gpio_keys_device,
 	&spitzled_device,
 	&sharpsl_nand_device,
 	&sharpsl_rom_device,


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

WARNING: multiple messages have this Message-ID (diff)
From: Pavel Machek <pavel@ucw.cz>
To: Eric Miao <eric.y.miao@gmail.com>, Andrew Morton <akpm@osdl.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Stanislav Brabec <utx@penguin.cz>,
	rpurdie@rpsys.net, lenz@cs.wisc.edu,
	kernel list <linux-kernel@vger.kernel.org>,
	Dirk@opfer-online.de, arminlitzel@web.de,
	Cyril Hrubis <metan@ucw.cz>,
	thommycheck@gmail.com,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	dbaryshkov@gmail.com, omegamoon@gmail.com
Subject: spitz: add gpio button support (fixes regression)
Date: Tue, 6 Oct 2009 22:09:33 +0200	[thread overview]
Message-ID: <20091006200933.GA1606@ucw.cz> (raw)
In-Reply-To: <f17812d70910070727x47b2a22h8e9f9304740d5abf@mail.gmail.com>


> So what's the conclusion of the patch? Any ACK/NAK or patch needs updating?

Please take this updated version.

---

Spitz switched to generic matrix-gpio keyboard driver in 2.6.32-rc0,
but that means that support for power button and lid switches was
lost. This restores it, using button-gpio code.

Signed-off-by: Pavel Machek <pavel@ucw.cz>

--- linux-rc/arch/arm.ofic/mach-pxa/spitz.c	2009-10-06 13:48:07.000000000 +0200
+++ linux-rc/arch/arm/mach-pxa/spitz.c	2009-10-06 21:17:19.000000000 +0200
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
+#include <linux/gpio_keys.h>
 #include <linux/gpio.h>
 #include <linux/leds.h>
 #include <linux/mtd/physmap.h>
@@ -375,6 +377,51 @@
 };
 
 
+static struct gpio_keys_button spitz_gpio_keys[] = {
+	{
+		.type	= EV_KEY,
+		.code	= KEY_SUSPEND,
+		.gpio	= SPITZ_GPIO_ON_KEY,
+		.desc	= "Power button",
+		.wakeup	= 1,
+	},
+	/* Two buttons detecting the LID state */
+	{
+		.type	= EV_SW,
+		.code	= 0,
+		.gpio	= SPITZ_GPIO_SWA,
+		.desc	= "Lid SWA",
+	},
+	{
+		.type	= EV_SW,
+		.code	= 1,
+		.gpio	= SPITZ_GPIO_SWB,
+		.desc	= "Lid SWB",
+	},
+	/* This is for remote control support. Zaurus supports wired
+	   remote on headphones. */
+	{
+		.type	= EV_SW,
+		.code	= 2,
+		.gpio	= SPITZ_GPIO_AK_INT,
+		.desc	= "Wired remote (AK_INT)",
+	},
+};
+
+static struct gpio_keys_platform_data spitz_gpio_keys_platform_data = {
+	.buttons	= spitz_gpio_keys,
+	.nbuttons	= ARRAY_SIZE(spitz_gpio_keys),
+};
+
+static struct platform_device spitz_gpio_keys_device = {
+	.name	= "gpio-keys",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &spitz_gpio_keys_platform_data,
+	},
+};
+
+
 /*
  * Spitz LEDs
  */
@@ -689,6 +736,7 @@
 static struct platform_device *devices[] __initdata = {
 	&spitzscoop_device,
 	&spitzkbd_device,
+	&spitz_gpio_keys_device,
 	&spitzled_device,
 	&sharpsl_nand_device,
 	&sharpsl_rom_device,


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2009-10-06 20:09 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-06  7:46 spitz: add gpio button support Pavel Machek
2009-10-06  7:46 ` Pavel Machek
2009-10-06 11:48 ` spitz: add gpio button support (AK_INT and remote control description) Stanislav Brabec
2009-10-06 11:48   ` Stanislav Brabec
2009-10-07  8:58   ` Pavel Machek
2009-10-07  8:58     ` Pavel Machek
2009-10-07 11:29     ` Stanislav Brabec
2009-10-07 11:29       ` Stanislav Brabec
2009-10-07 12:06       ` Mark Brown
2009-10-07 12:06         ` Mark Brown
2009-10-07 14:27         ` Eric Miao
2009-10-07 14:27           ` Eric Miao
2009-10-06 20:09           ` Pavel Machek [this message]
2009-10-06 20:09             ` spitz: add gpio button support (fixes regression) Pavel Machek
2009-10-15 21:16             ` Stanislav Brabec
2009-10-15 21:16               ` Stanislav Brabec
2009-10-15 21:20               ` Pavel Machek
2009-10-15 21:20                 ` Pavel Machek
2009-10-15 21:47                 ` Stanislav Brabec
2009-10-15 21:47                   ` Stanislav Brabec
2009-10-15 21:52                   ` Pavel Machek
2009-10-15 21:52                     ` Pavel Machek
2009-10-16  3:01                     ` Eric Miao
2009-10-16  3:01                       ` Eric Miao
2009-10-16  9:28                     ` Stanislav Brabec
2009-10-16  9:28                       ` Stanislav Brabec
2009-10-16  9:39                       ` Pavel Machek
2009-10-16  9:39                         ` Pavel Machek
2009-10-16 18:50                         ` [PATCH] " Stanislav Brabec
2009-10-16 18:50                           ` Stanislav Brabec
2009-10-16 19:05                           ` Russell King - ARM Linux
2009-10-16 19:05                             ` Russell King - ARM Linux
2009-10-16 22:22                             ` Stanislav Brabec
2009-10-16 22:22                               ` Stanislav Brabec
2009-10-17  4:42                               ` Eric Miao
2009-10-17  4:42                                 ` Eric Miao

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=20091006200933.GA1606@ucw.cz \
    --to=pavel@ucw.cz \
    --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 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.