b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -5,6 +5,7 @@ struct sys_timer;
extern struct sys_timer pxa168_timer;
extern void __init pxa168_init_irq(void);
+extern void pxa168_clear_keypad_wakeup(void);
#include <linux/i2c.h>
#include <mach/devices.h>
@@ -97,4 +98,10 @@ static inline int pxa168_add_nand(struct
pxa3xx_nand_platform_data *info)
{
return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));
}
+
+static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *info)
+{
+ info->clear_wakeup = pxa168_clear_keypad_wakeup;
+ return pxa_register_device(&pxa168_device_keypad, info, sizeof(*info));
+}
#endif /* __ASM_MACH_PXA168_H */
b/arch/arm/mach-pxa/include/mach/pxa27x_keypad.h
@@ -52,6 +52,7 @@ struct pxa27x_keypad_platform_data {
/* key debounce interval */
unsigned int debounce_interval;
+ void (*clear_wakeup);
};
extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
b/drivers/input/keyboard/pxa27x_keypad.c
@@ -330,10 +330,20 @@ static void pxa27x_keypad_scan_direct(struct
pxa27x_keypad *keypad)
keypad->direct_key_state = new_state;
}
+static void clear_wakeup(struct pxa27x_keypad *keypad)
+{
+ struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
+
+ if (pdata->clear_wakeup)
+ (pdata->clear_wakeup)();
+}
+
static irqreturn_t pxa27x_keypad_irq_handler(int irq, void *dev_id)
{
struct pxa27x_keypad *keypad = dev_id;
- unsigned long kpc = keypad_readl(KPC);
+ unsigned long kpc;
+
+ kpc = keypad_readl(KPC);
if (kpc & KPC_DI)