diff options
| -rw-r--r-- | arch/arm/plat-pxa/include/plat/pxa27x_keypad.h | 10 | ||||
| -rw-r--r-- | drivers/input/keyboard/pxa27x_keypad.c | 10 |
2 files changed, 20 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 7b4eadc6df3a..abcc36eb1242 100644 --- a/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h +++ b/arch/arm/plat-pxa/include/plat/pxa27x_keypad.h | |||
| @@ -25,6 +25,13 @@ | |||
| 25 | * | 25 | * |
| 26 | * 4. matrix key and direct key will use the same debounce_interval by | 26 | * 4. matrix key and direct key will use the same debounce_interval by |
| 27 | * default, which should be sufficient in most cases | 27 | * default, which should be sufficient in most cases |
| 28 | * | ||
| 29 | * pxa168 keypad platform specific parameter | ||
| 30 | * | ||
| 31 | * NOTE: | ||
| 32 | * clear_wakeup_event callback is a workaround required to clear the | ||
| 33 | * keypad interrupt. The keypad wake must be cleared in addition to | ||
| 34 | * reading the MI/DI bits in the KPC register. | ||
| 28 | */ | 35 | */ |
| 29 | struct pxa27x_keypad_platform_data { | 36 | struct pxa27x_keypad_platform_data { |
| 30 | 37 | ||
| @@ -52,6 +59,9 @@ struct pxa27x_keypad_platform_data { | |||
| 52 | 59 | ||
| 53 | /* key debounce interval */ | 60 | /* key debounce interval */ |
| 54 | unsigned int debounce_interval; | 61 | unsigned int debounce_interval; |
| 62 | |||
| 63 | /* clear wakeup event requirement for pxa168 */ | ||
| 64 | void (*clear_wakeup_event)(void); | ||
| 55 | }; | 65 | }; |
| 56 | 66 | ||
| 57 | extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info); | 67 | 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 731bd88bb076..4b0ec35259a1 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) | |||
| 330 | keypad->direct_key_state = new_state; | 330 | keypad->direct_key_state = new_state; |
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | static void clear_wakeup_event(struct pxa27x_keypad *keypad) | ||
| 334 | { | ||
| 335 | struct pxa27x_keypad_platform_data *pdata = keypad->pdata; | ||
| 336 | |||
| 337 | if (pdata->clear_wakeup_event) | ||
| 338 | (pdata->clear_wakeup_event)(); | ||
| 339 | } | ||
| 340 | |||
| 333 | static irqreturn_t pxa27x_keypad_irq_handler(int irq, void *dev_id) | 341 | static irqreturn_t pxa27x_keypad_irq_handler(int irq, void *dev_id) |
| 334 | { | 342 | { |
| 335 | struct pxa27x_keypad *keypad = dev_id; | 343 | struct pxa27x_keypad *keypad = dev_id; |
| 336 | unsigned long kpc = keypad_readl(KPC); | 344 | unsigned long kpc = keypad_readl(KPC); |
| 337 | 345 | ||
| 346 | clear_wakeup_event(keypad); | ||
| 347 | |||
| 338 | if (kpc & KPC_DI) | 348 | if (kpc & KPC_DI) |
| 339 | pxa27x_keypad_scan_direct(keypad); | 349 | pxa27x_keypad_scan_direct(keypad); |
| 340 | 350 | ||
