]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Input: matrix_keypad - allow platform to disable key autorepeat
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 6 Apr 2010 05:29:09 +0000 (22:29 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 6 Apr 2010 06:02:00 +0000 (23:02 -0700)
In an embedded system the matrix_keypad driver might be used to
interface with an external control panel and not an actual keyboard.
On the control panel some of the keys could be used to turn on/off
various functions.  If key autorepeat is enabled this causes the
function to quickly toggle between the on and off states and makes
operation difficult.

Add an option in the platform-specific data to disable the key
autorepeat.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/keyboard/matrix_keypad.c
include/linux/input/matrix_keypad.h

index d3c8b61a941d46aa677e8f13dff3aba9edcb6f56..f9d86cfb0db07e695b75d9e9aea66316af9f6b07 100644 (file)
@@ -373,7 +373,9 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev)
        input_dev->name         = pdev->name;
        input_dev->id.bustype   = BUS_HOST;
        input_dev->dev.parent   = &pdev->dev;
-       input_dev->evbit[0]     = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
+       input_dev->evbit[0]     = BIT_MASK(EV_KEY);
+       if (!pdata->no_autorepeat)
+               input_dev->evbit[0] |= BIT_MASK(EV_REP);
        input_dev->open         = matrix_keypad_start;
        input_dev->close        = matrix_keypad_stop;
 
index 3bd018baae2046e8d0041feb883aecd7c4cce992..c964cd7f436a4ecf63d6f2080d280734f5a2a4ca 100644 (file)
@@ -44,6 +44,7 @@ struct matrix_keymap_data {
  * @active_low: gpio polarity
  * @wakeup: controls whether the device should be set up as wakeup
  *     source
+ * @no_autorepeat: disable key autorepeat
  *
  * This structure represents platform-specific data that use used by
  * matrix_keypad driver to perform proper initialization.
@@ -64,6 +65,7 @@ struct matrix_keypad_platform_data {
 
        bool            active_low;
        bool            wakeup;
+       bool            no_autorepeat;
 };
 
 /**