diff options
author | Mirko Vogt <mirko@openwrt.org> | 2008-12-13 01:54:56 +0000 |
---|---|---|
committer | Mirko Vogt <mirko@openwrt.org> | 2008-12-13 01:54:56 +0000 |
commit | c931b21161bf3d8a8cab193045b7deb52f914fb2 (patch) | |
tree | 6f4c70017b90c8dddb4845ce8a363d61268e016d /target/linux/s3c24xx/patches-2.6.26/1100-Add-GPIO-IRQ-for-the-s3c2410-and-add-irq_to_gpio.patch | |
parent | 738e5ca558af0a32073576d9a361d0b5e6383e8e (diff) | |
download | upstream-c931b21161bf3d8a8cab193045b7deb52f914fb2.tar.gz upstream-c931b21161bf3d8a8cab193045b7deb52f914fb2.tar.bz2 upstream-c931b21161bf3d8a8cab193045b7deb52f914fb2.zip |
change prefix for kernelpatchbase 2.6.26
SVN-Revision: 13619
Diffstat (limited to 'target/linux/s3c24xx/patches-2.6.26/1100-Add-GPIO-IRQ-for-the-s3c2410-and-add-irq_to_gpio.patch')
-rwxr-xr-x | target/linux/s3c24xx/patches-2.6.26/1100-Add-GPIO-IRQ-for-the-s3c2410-and-add-irq_to_gpio.patch | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/target/linux/s3c24xx/patches-2.6.26/1100-Add-GPIO-IRQ-for-the-s3c2410-and-add-irq_to_gpio.patch b/target/linux/s3c24xx/patches-2.6.26/1100-Add-GPIO-IRQ-for-the-s3c2410-and-add-irq_to_gpio.patch new file mode 100755 index 0000000000..952a229956 --- /dev/null +++ b/target/linux/s3c24xx/patches-2.6.26/1100-Add-GPIO-IRQ-for-the-s3c2410-and-add-irq_to_gpio.patch @@ -0,0 +1,92 @@ +From d0342f6cc0388862a8e62b4b77f1c4c011385e9a Mon Sep 17 00:00:00 2001 +From: Holger Freyther <zecke@openmoko.org> +Date: Fri, 25 Jul 2008 23:06:03 +0100 +Subject: [PATCH] Add GPIO -> IRQ for the s3c2410 and add irq_to_gpio to the gpio.h of the Samsung SoC + +Use this irq_to_gpio in the neo1973 keyboard driver +--- + drivers/input/keyboard/neo1973kbd.c | 19 ++++++------------- + include/asm-arm/arch-s3c2410/gpio.h | 5 ++--- + 2 files changed, 8 insertions(+), 16 deletions(-) + +diff --git a/drivers/input/keyboard/neo1973kbd.c b/drivers/input/keyboard/neo1973kbd.c +index b413bc8..06fa8e0 100644 +--- a/drivers/input/keyboard/neo1973kbd.c ++++ b/drivers/input/keyboard/neo1973kbd.c +@@ -28,16 +28,13 @@ + struct neo1973kbd { + struct input_dev *input; + unsigned int suspended; +- int gpio_aux; +- int gpio_hold; +- int gpio_jack; + }; + + static irqreturn_t neo1973kbd_aux_irq(int irq, void *dev_id) + { + struct neo1973kbd *neo1973kbd_data = dev_id; + +- int key_pressed = !gpio_get_value(neo1973kbd_data->gpio_aux); ++ int key_pressed = !gpio_get_value(irq_to_gpio(irq)); + input_report_key(neo1973kbd_data->input, KEY_PHONE, key_pressed); + input_sync(neo1973kbd_data->input); + +@@ -48,7 +45,7 @@ static irqreturn_t neo1973kbd_hold_irq(int irq, void *dev_id) + { + struct neo1973kbd *neo1973kbd_data = dev_id; + +- int key_pressed = gpio_get_value(neo1973kbd_data->gpio_hold); ++ int key_pressed = gpio_get_value(irq_to_gpio(irq)); + input_report_key(neo1973kbd_data->input, KEY_PAUSE, key_pressed); + input_sync(neo1973kbd_data->input); + +@@ -59,7 +56,7 @@ static irqreturn_t neo1973kbd_headphone_irq(int irq, void *dev_id) + { + struct neo1973kbd *neo1973kbd_data = dev_id; + +- int key_pressed = gpio_get_value(neo1973kbd_data->gpio_jack); ++ int key_pressed = gpio_get_value(irq_to_gpio(irq)); + input_report_switch(neo1973kbd_data->input, + SW_HEADPHONE_INSERT, key_pressed); + input_sync(neo1973kbd_data->input); +@@ -107,19 +104,15 @@ static int neo1973kbd_probe(struct platform_device *pdev) + if (pdev->resource[0].flags != 0) + return -EINVAL; + +- neo1973kbd->gpio_aux = pdev->resource[0].start; +- neo1973kbd->gpio_hold = pdev->resource[1].start; +- neo1973kbd->gpio_jack = pdev->resource[2].start; +- +- irq_aux = gpio_to_irq(neo1973kbd->gpio_aux); ++ irq_aux = gpio_to_irq(pdev->resource[0].start); + if (irq_aux < 0) + return -EINVAL; + +- irq_hold = gpio_to_irq(neo1973kbd->gpio_hold); ++ irq_hold = gpio_to_irq(pdev->resource[1].start); + if (irq_hold < 0) + return -EINVAL; + +- irq_jack = gpio_to_irq(neo1973kbd->gpio_jack); ++ irq_jack = gpio_to_irq(pdev->resource[2].start); + if (irq_jack < 0) + return -EINVAL; + +diff --git a/include/asm-arm/arch-s3c2410/gpio.h b/include/asm-arm/arch-s3c2410/gpio.h +index 7583895..1b96c4e 100644 +--- a/include/asm-arm/arch-s3c2410/gpio.h ++++ b/include/asm-arm/arch-s3c2410/gpio.h +@@ -61,8 +61,7 @@ static inline int gpio_direction_output(unsigned gpio, int value) + #define gpio_to_irq(gpio) s3c2400_gpio_getirq(gpio) + #else + #define gpio_to_irq(gpio) s3c2410_gpio_getirq(gpio) ++#define irq_to_gpio(irq) s3c2410_irq_to_gpio(irq) + #endif +- +-/* FIXME implement irq_to_gpio() */ +- + #endif ++#include <asm-generic/gpio.h> +-- +1.5.6.3 + |