Skip to contentSkip to conversation

gpio_keys driver shouldn't be ARM-specific

PATCH In review David Brownell 2 participants 4 messages Mar 1, 2007 – Mar 2, 2007 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio_keys driver shouldn't be ARM-specific

The gpio_keys driver is wrongly ARM-specific; it can't build on other platforms with GPIO suport. This fixes that problem.

---
MERGE NOTE: this just moves gpio_keys.h; this patch does no GIT magic

 include/asm-arm/hardware/gpio_keys.h |   17 -----------------
 drivers/input/keyboard/gpio_keys.c   |    4 +---
 include/linux/gpio_keys.h            |   17 +++++++++++++++++
 3 files changed, 18 insertions(+), 20 deletions(-)
drivers/input/keyboard/gpio_keys.c +1 -3
Index: ap7000/drivers/input/keyboard/gpio_keys.c
===================================================================
@@ -23,11 +23,9 @@
 #include <linux/platform_device.h>
 #include <linux/input.h>
 #include <linux/irq.h>
+#include <linux/gpio_keys.h>
 
 #include <asm/gpio.h>
-#include <asm/arch/hardware.h>
-
-#include <asm/hardware/gpio_keys.h>
 
 static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
 {
include/asm-arm/hardware/gpio_keys.h deleted +0 -17
Index: ap7000/include/asm-arm/hardware/gpio_keys.h
===================================================================
@@ -1,17 +0,0 @@
-#ifndef _GPIO_KEYS_H
-#define _GPIO_KEYS_H
-
-struct gpio_keys_button {
-	/* Configuration parameters */
-	int keycode;
-	int gpio;
-	int active_low;
-	char *desc;
-};
-
-struct gpio_keys_platform_data {
-	struct gpio_keys_button *buttons;
-	int nbuttons;
-};
-
-#endif
include/linux/gpio_keys.h new file +17 -0
Index: ap7000/include/linux/gpio_keys.h
===================================================================
@@ -0,0 +1,17 @@
+#ifndef _GPIO_KEYS_H
+#define _GPIO_KEYS_H
+
+struct gpio_keys_button {
+	/* Configuration parameters */
+	int keycode;
+	int gpio;
+	int active_low;
+	char *desc;
+};
+
+struct gpio_keys_platform_data {
+	struct gpio_keys_button *buttons;
+	int nbuttons;
+};
+
+#endif
#1 lore raw
Quoted 3 lines · David Brownell

The gpio_keys driver is wrongly ARM-specific; it can't build on other platforms with GPIO suport. This fixes that problem.

I did up a similar patch a few days back, you beat me too it ;). I've been using this driver on AVR32 for a while now.

The other thing was that this driver only depends on the machine supporting your generic GPIO conventions. Currently the Kconfig entry for gpio_keys reads:

	depends on (ARCH_SA1100 || ARCH_PXA || ARCH_S3C2410)

With the || AVR32 I've added to my version it's getting a bit out of hand! Anyone else think it would be worth introducing a GPIO_FRAMEWORK symbol selected by each machine which supports it and just set the gpio_keys dependency to that?

Ben.

#2 lore raw
Quoted 6 lines · Ben Nizette
Quoted 3 lines · David Brownell

The gpio_keys driver is wrongly ARM-specific; it can't build on other platforms with GPIO suport. This fixes that problem.

I did up a similar patch a few days back, you beat me too it ;). I've been using this driver on AVR32 for a while now.

I know various folk have been doing that very thing ...

Quoted 10 lines

The other thing was that this driver only depends on the machine supporting your generic GPIO conventions. Currently the Kconfig entry for gpio_keys reads:

	depends on (ARCH_SA1100 || ARCH_PXA || ARCH_S3C2410)

With the || AVR32 I've added to my version it's getting a bit out of hand! Anyone else think it would be worth introducing a GPIO_FRAMEWORK symbol selected by each machine which supports it and just set the gpio_keys dependency to that?

Earlier today I posted a patch adding CONFIG_GENERIC_GPIO, and I think that will get merged soonish ...

- Dave

Quoted 3 lines

Ben.

#3 lore raw
Quoted 5 lines · David Brownell
Quoted 1 line

With the || AVR32 I've added to my version it's getting a bit out of hand! Anyone else think it would be worth introducing a GPIO_FRAMEWORK symbol selected by each machine which supports it and just set the gpio_keys dependency to that?

Earlier today I posted a patch adding CONFIG_GENERIC_GPIO, and I think that will get merged soonish ...

Beat me to it again. Cheers,
--Ben.

Quoted 2 lines

- Dave