diff options
author | Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> | 2011-04-12 08:34:37 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-04-12 08:53:09 +0200 |
commit | 92a47674f57b4a84a43ce93b0dfdb596c0543749 (patch) | |
tree | d6f0d0a270125faa6deaa24a75621e38bda2c28f /drivers/input/keyboard | |
parent | Merge branch 'tsc2005' into next (diff) | |
download | linux-92a47674f57b4a84a43ce93b0dfdb596c0543749.tar.xz linux-92a47674f57b4a84a43ce93b0dfdb596c0543749.zip |
Input: gpio_keys - add support for EV_ABS
With this patch you can setup a group of GPIOs representing a specific
position on an EV_ABS axis.
Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index eb3006361ee4..73e58a96ab99 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -324,7 +324,12 @@ static void gpio_keys_report_event(struct gpio_button_data *bdata) unsigned int type = button->type ?: EV_KEY; int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low; - input_event(input, type, button->code, !!state); + if (type == EV_ABS) { + if (state) + input_event(input, type, button->code, button->value); + } else { + input_event(input, type, button->code, !!state); + } input_sync(input); } @@ -363,7 +368,7 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev, struct gpio_button_data *bdata, struct gpio_keys_button *button) { - char *desc = button->desc ? button->desc : "gpio_keys"; + const char *desc = button->desc ? button->desc : "gpio_keys"; struct device *dev = &pdev->dev; unsigned long irqflags; int irq, error; |