Re: [PATCH v2 4/6 RESEND] ARM: pxa27x_keypad: added wakeup eventhandler for keypad interrupts

From: Eric Miao
Date: Sun Sep 05 2010 - 06:47:39 EST


On Sun, Sep 5, 2010 at 4:02 PM, Igor Grinberg <grinberg@xxxxxxxxxxxxxx> wrote:
> ÂOn 09/04/10 01:28, Mark F. Brown wrote:
>> mach-mmp needs to clear wake event in order to clear the keypad interrupt
>>
>> Signed-off-by: Mark F. Brown <mark.brown314@xxxxxxxxx>
>> ---
>> Âarch/arm/plat-pxa/include/plat/pxa27x_keypad.h | Â Â1 +
>> Âdrivers/input/keyboard/pxa27x_keypad.c     |  10 ++++++++++
>> Â2 files changed, 11 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h b/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
>> index 7b4eadc..73dacda 100644
>> --- a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
>> +++ b/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
>> @@ -52,6 +52,7 @@ struct pxa27x_keypad_platform_data {
>>
>> Â Â Â /* key debounce interval */
>>    unsigned int  Âdebounce_interval;
>> +   void      Â(*clear_wakeup_event)(void);
>
> I understand, this is a bit late... but still I want to ask a question:
> As I understand, the clear_wakeup_event() function is called in interrupt context,
> wouldn't it be wiser to add a comment on this, so platform (current/future) code
> will be aware and will make no heavy stuff in it (accidentally).
>

A comment will be good to have indeed, not just explaining the context
this function will be running, but also a bit about why this is introduced.

Mark,

If you come up with an updated patch, I'll help rebase my tree.

>> Â};
>>
>> Âextern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
>> diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
>> index 0610d10..b36d2be 100644
>> --- a/drivers/input/keyboard/pxa27x_keypad.c
>> +++ b/drivers/input/keyboard/pxa27x_keypad.c
>> @@ -330,11 +330,21 @@ static void pxa27x_keypad_scan_direct(struct pxa27x_keypad *keypad)
>> Â Â Â keypad->direct_key_state = new_state;
>> Â}
>>
>> +static void clear_wakeup_event(struct pxa27x_keypad *keypad)
>> +{
>> + Â Â struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
>> +
>> + Â Â if (pdata->clear_wakeup_event)
>> + Â Â Â Â Â Â (pdata->clear_wakeup_event)();
>> +}
>> +
>> Âstatic irqreturn_t pxa27x_keypad_irq_handler(int irq, void *dev_id)
>> Â{
>> Â Â Â struct pxa27x_keypad *keypad = dev_id;
>> Â Â Â unsigned long kpc = keypad_readl(KPC);
>>
>> + Â Â clear_wakeup_event(keypad);
>> +
>> Â Â Â if (kpc & KPC_DI)
>> Â Â Â Â Â Â Â pxa27x_keypad_scan_direct(keypad);
>>
>
> --
> Regards,
> Igor.
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/