aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHolger Freyther <zecke@openmoko.org>2008-11-19 17:09:36 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:09:36 +0000
commit45dc83b5242f041b1c0af6415d773564ab198942 (patch)
treea9a7e1271fcb70b723e8a74468612a4601b2ac9a /drivers
parent8c5ea97172f712b24b8ed9fc82014d4a99c35a70 (diff)
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
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/keyboard/neo1973kbd.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/input/keyboard/neo1973kbd.c b/drivers/input/keyboard/neo1973kbd.c
index b413bc8afe8..06fa8e049e5 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;