When the keypad is used as wake up source, the clock can not
be disabled. Or it can not detect key pressing.
If the keypad is used as wake up source, when resume back,
do not enable the clock and configure it again because the
register content is retained.
Signed-off-by: Chao Xie <redacted>
---
drivers/input/keyboard/pxa27x_keypad.c | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
When direcct_key_num is 0, the mask should be 0.
When direcct_key_num is 1, the mask should be 0b1.
Signed-off-by: Chao Xie <redacted>
---
drivers/input/keyboard/pxa27x_keypad.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
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: Chao Xie <redacted>
---
arch/arm/plat-pxa/include/plat/pxa27x_keypad.h | 2 ++
drivers/input/keyboard/pxa27x_keypad.c | 10 +++++++++-
2 files changed, 11 insertions(+), 1 deletions(-)
@@ -44,6 +44,8 @@ struct pxa27x_keypad_platform_data {/* direct keys */intdirect_key_num;unsignedintdirect_key_map[MAX_DIRECT_KEY_NUM];+/* the key output may be low active */+intdirect_key_low_active;/* rotary encoders 0 */intenable_rotary0;
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 <redacted>
---
arch/arm/plat-pxa/include/plat/pxa27x_keypad.h | 2 ++
drivers/input/keyboard/pxa27x_keypad.c | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletions(-)
@@ -46,6 +46,8 @@ struct pxa27x_keypad_platform_data {unsignedintdirect_key_map[MAX_DIRECT_KEY_NUM];/* the key output may be low active */intdirect_key_low_active;+/* give board a chance to choose the start direct key */+unsignedintdirect_key_mask;/* rotary encoders 0 */intenable_rotary0;
@@ -391,7 +391,12 @@ static void pxa27x_keypad_config(struct pxa27x_keypad *keypad)if(pdata->direct_key_num>direct_key_num)direct_key_num=pdata->direct_key_num;-keypad->direct_key_mask=((1<<direct_key_num)-1)&~mask;+/* Direct keys usage may not start from KP_DKIN0, check the platfrom+*mskdatatoconfigthespecific*/+if(pdata->direct_key_mask)+keypad->direct_key_mask=pdata->direct_key_mask;+else+keypad->direct_key_mask=((1<<direct_key_num)-1)&~mask;/* enable direct key */if(direct_key_num)
@@ -391,7 +391,12 @@ static void pxa27x_keypad_config(struct pxa27x_keypad *keypad)if(pdata->direct_key_num>direct_key_num)direct_key_num=pdata->direct_key_num;-keypad->direct_key_mask=((1<<direct_key_num)-1)&~mask;+/* Direct keys usage may not start from KP_DKIN0, check the platfrom+*mskdatatoconfigthespecific*/
The preferred multi-line comment style is not this one. You got it right in
the previous patch. :-)
WBR, Sergei
Thanks. I will sent V2 patches.
-----Original Message-----
From: Sergei Shtylyov [mailto:sshtylyov@mvista.com]
Sent: Thursday, March 29, 2012 2:04 AM
To: Chao Xie
Cc: linux-input@vger.kernel.org; eric.y.miao@gmail.com; Haojian Zhuang; linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 4/4] Input: pxa27x_keypad add choice to set direct_key_mask
Hello.
On 03/28/2012 09:08 AM, Chao Xie wrote:
Direct keys usage may not start from KP_DKIN0, add a msk option
to configure the specifics for platforms that can skip some keys.
@@ -391,7 +391,12 @@ static void pxa27x_keypad_config(struct pxa27x_keypad *keypad)if(pdata->direct_key_num>direct_key_num)direct_key_num=pdata->direct_key_num;-keypad->direct_key_mask=((1<<direct_key_num)-1)&~mask;+/* Direct keys usage may not start from KP_DKIN0, check the platfrom+*mskdatatoconfigthespecific*/
The preferred multi-line comment style is not this one. You got it right in
the previous patch. :-)
WBR, Sergei