mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
ARM: pxa27x_keypad: added wakeup event handler for keypad interrupts
mach-mmp needs to clear wake event in order to clear the keypad interrupt Signed-off-by: Mark F. Brown <mark.brown314@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
This commit is contained in:
parent
2ce4389068
commit
3587c25807
2 changed files with 20 additions and 0 deletions
|
@ -25,6 +25,13 @@
|
||||||
*
|
*
|
||||||
* 4. matrix key and direct key will use the same debounce_interval by
|
* 4. matrix key and direct key will use the same debounce_interval by
|
||||||
* default, which should be sufficient in most cases
|
* default, which should be sufficient in most cases
|
||||||
|
*
|
||||||
|
* pxa168 keypad platform specific parameter
|
||||||
|
*
|
||||||
|
* NOTE:
|
||||||
|
* clear_wakeup_event callback is a workaround required to clear the
|
||||||
|
* keypad interrupt. The keypad wake must be cleared in addition to
|
||||||
|
* reading the MI/DI bits in the KPC register.
|
||||||
*/
|
*/
|
||||||
struct pxa27x_keypad_platform_data {
|
struct pxa27x_keypad_platform_data {
|
||||||
|
|
||||||
|
@ -52,6 +59,9 @@ struct pxa27x_keypad_platform_data {
|
||||||
|
|
||||||
/* key debounce interval */
|
/* key debounce interval */
|
||||||
unsigned int debounce_interval;
|
unsigned int debounce_interval;
|
||||||
|
|
||||||
|
/* clear wakeup event requirement for pxa168 */
|
||||||
|
void (*clear_wakeup_event)(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
|
extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
|
||||||
|
|
|
@ -330,11 +330,21 @@ static void pxa27x_keypad_scan_direct(struct pxa27x_keypad *keypad)
|
||||||
keypad->direct_key_state = new_state;
|
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)
|
static irqreturn_t pxa27x_keypad_irq_handler(int irq, void *dev_id)
|
||||||
{
|
{
|
||||||
struct pxa27x_keypad *keypad = dev_id;
|
struct pxa27x_keypad *keypad = dev_id;
|
||||||
unsigned long kpc = keypad_readl(KPC);
|
unsigned long kpc = keypad_readl(KPC);
|
||||||
|
|
||||||
|
clear_wakeup_event(keypad);
|
||||||
|
|
||||||
if (kpc & KPC_DI)
|
if (kpc & KPC_DI)
|
||||||
pxa27x_keypad_scan_direct(keypad);
|
pxa27x_keypad_scan_direct(keypad);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue