Skip to content

Commit

Permalink
Input: matrix_keypad - allow platform to disable key autorepeat
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Dmitry Torokhov committed Apr 6, 2010
1 parent 5e28d8e commit 9d32c30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/input/keyboard/matrix_keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions include/linux/input/matrix_keypad.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -64,6 +65,7 @@ struct matrix_keypad_platform_data {

bool active_low;
bool wakeup;
bool no_autorepeat;
};

/**
Expand Down

0 comments on commit 9d32c30

Please sign in to comment.