aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@informatik.tu-chemnitz.de>2011-04-12 02:34:37 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-04-12 02:53:09 -0400
commit92a47674f57b4a84a43ce93b0dfdb596c0543749 (patch)
treed6f0d0a270125faa6deaa24a75621e38bda2c28f /drivers/input
parentdef179c271ac9b5020deca798470521f14d11edd (diff)
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')
-rw-r--r--drivers/input/keyboard/gpio_keys.c9
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)
324 unsigned int type = button->type ?: EV_KEY; 324 unsigned int type = button->type ?: EV_KEY;
325 int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low; 325 int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low;
326 326
327 input_event(input, type, button->code, !!state); 327 if (type == EV_ABS) {
328 if (state)
329 input_event(input, type, button->code, button->value);
330 } else {
331 input_event(input, type, button->code, !!state);
332 }
328 input_sync(input); 333 input_sync(input);
329} 334}
330 335
@@ -363,7 +368,7 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev,
363 struct gpio_button_data *bdata, 368 struct gpio_button_data *bdata,
364 struct gpio_keys_button *button) 369 struct gpio_keys_button *button)
365{ 370{
366 char *desc = button->desc ? button->desc : "gpio_keys"; 371 const char *desc = button->desc ? button->desc : "gpio_keys";
367 struct device *dev = &pdev->dev; 372 struct device *dev = &pdev->dev;
368 unsigned long irqflags; 373 unsigned long irqflags;
369 int irq, error; 374 int irq, error;