Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0d98f6bbd8d62c2c7a9924e0b3e5068cc28173b0
Commit:     0d98f6bbd8d62c2c7a9924e0b3e5068cc28173b0
Parent:     1efa770f8ef0bfe12cd004f2e1f75eefcd8699d3
Author:     Philipp Zabel <[EMAIL PROTECTED]>
AuthorDate: Sun Feb 18 01:40:46 2007 -0500
Committer:  Dmitry Torokhov <[EMAIL PROTECTED]>
CommitDate: Sun Feb 18 01:40:46 2007 -0500

    Input: gpio-keys - switch to common GPIO API
    
    This adds support for at least SA1100 and S3C24xx CPUs.
    
    Signed-off-by: Philipp Zabel <[EMAIL PROTECTED]>
    Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
---
 drivers/input/keyboard/Kconfig     |    6 +++---
 drivers/input/keyboard/gpio_keys.c |   15 ++++++++-------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 1b81a72..6450968 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -215,11 +215,11 @@ config KEYBOARD_AAED2000
          module will be called aaed2000_kbd.
 
 config KEYBOARD_GPIO
-        tristate "Buttons on CPU GPIOs (PXA)"
-        depends on ARCH_PXA
+       tristate "Buttons on CPU GPIOs (PXA)"
+       depends on (ARCH_SA1100 || ARCH_PXA || ARCH_S3C2410)
        help
          This driver implements support for buttons connected
-         directly to GPIO pins of PXA CPUs.
+         directly to GPIO pins of SA1100, PXA or S3C24xx CPUs.
 
          Say Y here if your device has buttons connected
          directly to GPIO pins of the CPU.
diff --git a/drivers/input/keyboard/gpio_keys.c 
b/drivers/input/keyboard/gpio_keys.c
index 7ad479e..fa03a00 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -24,7 +24,7 @@
 #include <linux/input.h>
 #include <linux/irq.h>
 
-#include <asm/arch/pxa-regs.h>
+#include <asm/gpio.h>
 #include <asm/arch/hardware.h>
 
 #include <asm/hardware/gpio_keys.h>
@@ -38,8 +38,8 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id)
 
        for (i = 0; i < pdata->nbuttons; i++) {
                int gpio = pdata->buttons[i].gpio;
-               if (irq == IRQ_GPIO(gpio)) {
-                       int state = ((GPLR(gpio) & GPIO_bit(gpio)) ? 1 : 0) ^ 
(pdata->buttons[i].active_low);
+               if (irq == gpio_to_irq(gpio)) {
+                       int state = (gpio_get_value(gpio) ? 1 : 0) ^ 
(pdata->buttons[i].active_low);
 
                        input_report_key(input, pdata->buttons[i].keycode, 
state);
                        input_sync(input);
@@ -75,14 +75,15 @@ static int __devinit gpio_keys_probe(struct platform_device 
*pdev)
 
        for (i = 0; i < pdata->nbuttons; i++) {
                int code = pdata->buttons[i].keycode;
-               int irq = IRQ_GPIO(pdata->buttons[i].gpio);
+               int irq = gpio_to_irq(pdata->buttons[i].gpio);
 
                set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
                error = request_irq(irq, gpio_keys_isr, IRQF_SAMPLE_RANDOM,
                                     pdata->buttons[i].desc ? 
pdata->buttons[i].desc : "gpio_keys",
                                     pdev);
                if (error) {
-                       printk(KERN_ERR "gpio-keys: unable to claim irq %d; 
error %d\n", irq, ret);
+                       printk(KERN_ERR "gpio-keys: unable to claim irq %d; 
error %d\n",
+                               irq, error);
                        goto fail;
                }
                set_bit(code, input->keybit);
@@ -98,7 +99,7 @@ static int __devinit gpio_keys_probe(struct platform_device 
*pdev)
 
  fail:
        for (i = i - 1; i >= 0; i--)
-               free_irq(IRQ_GPIO(pdata->buttons[i].gpio), pdev);
+               free_irq(gpio_to_irq(pdata->buttons[i].gpio), pdev);
 
        input_free_device(input);
 
@@ -112,7 +113,7 @@ static int __devexit gpio_keys_remove(struct 
platform_device *pdev)
        int i;
 
        for (i = 0; i < pdata->nbuttons; i++) {
-               int irq = IRQ_GPIO(pdata->buttons[i].gpio);
+               int irq = gpio_to_irq(pdata->buttons[i].gpio);
                free_irq(irq, pdev);
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to