Input: gpio-keys - add flag to allow auto repeat
authorDominic Curran <dcurran@ti.com>
Tue, 28 Oct 2008 02:30:53 +0000 (22:30 -0400)
committerGrazvydas Ignotas <notasas@gmail.com>
Wed, 5 May 2010 23:03:56 +0000 (02:03 +0300)
This patch adds a flag to gpio-key driver to turn on the input subsystems
auto repeat feature if needed.

Signed-off-by: Dominic Curran <dcurran@ti.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/keyboard/gpio_keys.c
include/linux/gpio_keys.h

index 74de0ce..a33f2a1 100644 (file)
@@ -108,6 +108,10 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
        input->id.product = 0x0001;
        input->id.version = 0x0100;
 
+       /* Enable auto repeat feature of Linux input subsystem */
+       if (pdata->rep)
+               __set_bit(EV_REP, input->evbit);
+
        ddata->input = input;
 
        for (i = 0; i < pdata->nbuttons; i++) {
index fb88422..ee38a69 100644 (file)
@@ -15,6 +15,7 @@ struct gpio_keys_button {
 struct gpio_keys_platform_data {
        struct gpio_keys_button *buttons;
        int nbuttons;
+       unsigned int rep:1;             /* enable input subsystem auto repeat */
        const unsigned short *buttons_reserved;
        int nbuttons_reserved;
 };