Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: pxa27x_keypad add choice to set direct_key_mask

Direct keys usage may not start from KP_DKIN0, add a msk option
to configure the specifics for platforms that can skip some keys.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>

authored by

Chao Xie and committed by
Haojian Zhuang
fb054bf2 ee1d8040

+10 -1
+2
arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
··· 46 46 unsigned int direct_key_map[MAX_DIRECT_KEY_NUM]; 47 47 /* the key output may be low active */ 48 48 int direct_key_low_active; 49 + /* give board a chance to choose the start direct key */ 50 + unsigned int direct_key_mask; 49 51 50 52 /* rotary encoders 0 */ 51 53 int enable_rotary0;
+8 -1
drivers/input/keyboard/pxa27x_keypad.c
··· 391 391 if (pdata->direct_key_num > direct_key_num) 392 392 direct_key_num = pdata->direct_key_num; 393 393 394 - keypad->direct_key_mask = ((1 << direct_key_num) - 1) & ~mask; 394 + /* 395 + * Direct keys usage may not start from KP_DKIN0, check the platfrom 396 + * mask data to config the specific. 397 + */ 398 + if (pdata->direct_key_mask) 399 + keypad->direct_key_mask = pdata->direct_key_mask; 400 + else 401 + keypad->direct_key_mask = ((1 << direct_key_num) - 1) & ~mask; 395 402 396 403 /* enable direct key */ 397 404 if (direct_key_num)