Commit ee1d8040 authored by Chao Xie's avatar Chao Xie Committed by Haojian Zhuang

Input: pxa27x_keypad direct key may be low active

KPDK_DK only indicates the pin level of direct key.
So it is related to board, and low level may be active which
indicates that a key is pressed.
Signed-off-by: default avatarChao Xie <chao.xie@marvell.com>
Signed-off-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
parent 5545fa89
...@@ -44,6 +44,8 @@ struct pxa27x_keypad_platform_data { ...@@ -44,6 +44,8 @@ struct pxa27x_keypad_platform_data {
/* direct keys */ /* direct keys */
int direct_key_num; int direct_key_num;
unsigned int direct_key_map[MAX_DIRECT_KEY_NUM]; unsigned int direct_key_map[MAX_DIRECT_KEY_NUM];
/* the key output may be low active */
int direct_key_low_active;
/* rotary encoders 0 */ /* rotary encoders 0 */
int enable_rotary0; int enable_rotary0;
......
...@@ -311,7 +311,15 @@ static void pxa27x_keypad_scan_direct(struct pxa27x_keypad *keypad) ...@@ -311,7 +311,15 @@ static void pxa27x_keypad_scan_direct(struct pxa27x_keypad *keypad)
if (pdata->enable_rotary0 || pdata->enable_rotary1) if (pdata->enable_rotary0 || pdata->enable_rotary1)
pxa27x_keypad_scan_rotary(keypad); pxa27x_keypad_scan_rotary(keypad);
/*
* The KPDR_DK only output the key pin level, so it relates to board,
* and low level may be active.
*/
if (pdata->direct_key_low_active)
new_state = ~KPDK_DK(kpdk) & keypad->direct_key_mask;
else
new_state = KPDK_DK(kpdk) & keypad->direct_key_mask; new_state = KPDK_DK(kpdk) & keypad->direct_key_mask;
bits_changed = keypad->direct_key_state ^ new_state; bits_changed = keypad->direct_key_state ^ new_state;
if (bits_changed == 0) if (bits_changed == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment