summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLiGang <b41990@freescale.com>2012-09-29 14:48:51 +0800
committerLiGang <b41990@freescale.com>2012-09-29 14:48:51 +0800
commit63d1edebb7ba2ed2c1566883e179daa525d5895a (patch)
tree3f6d17f6a890fb64f6866d6382d27c2178f66dbd /drivers
parent0ccf1609f3d00d1f3d093a621969379e2fc46346 (diff)
ENGR00224514 EVK-MX6SL: Change key report property to none repeat
1. Delete useless EV_MSC event input; 2. Correct the input key value, 1 for pressed, 0 for released; 3. Change key event property to none repeat. Signed-off-by: LiGang <b41990@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/keyboard/imx_keypad.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 37f61efba838..020ed50fe4a1 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -172,9 +172,9 @@ static void imx_keypad_fire_events(struct imx_keypad *keypad,
continue; /* Row does not contain changes */
code = MATRIX_SCAN_CODE(row, col, MATRIX_ROW_SHIFT);
- input_event(input_dev, EV_MSC, MSC_SCAN, code);
+ /* value should be 1 when key pressed, 0 for released */
input_report_key(input_dev, keypad->keycodes[code],
- matrix_volatile_state[col] & (1 << row));
+ (matrix_volatile_state[col] >> row) & 0x1);
dev_dbg(&input_dev->dev, "Event code: %d, val: %d",
keypad->keycodes[code],
matrix_volatile_state[col] & (1 << row));
@@ -496,7 +496,13 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev)
input_dev->dev.parent = &pdev->dev;
input_dev->open = imx_keypad_open;
input_dev->close = imx_keypad_close;
- input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
+
+ /* Should not set BIT_MASK(EV_REP) to evbit[0] when some keys(like
+ power key) in keypad don't require to repeat, otherwise it will
+ auto repeat the key event if long press those keys. The disadvantage
+ is all keys in keypad, will not auto repeat when long pressed, but it
+ should be acceptable to remove the EV_REP flag*/
+ input_dev->evbit[0] = BIT_MASK(EV_KEY);
input_dev->keycode = keypad->keycodes;
input_dev->keycodesize = sizeof(keypad->keycodes[0]);
input_dev->keycodemax = ARRAY_SIZE(keypad->keycodes);