aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorMark F. Brown <mark.brown314@gmail.com>2010-09-03 18:28:10 -0400
committerEric Miao <eric.y.miao@gmail.com>2010-10-09 05:07:20 -0400
commitab5739a17953b22480dc7caf6603380d563c53fc (patch)
tree6ff08440ce7e9c03e2b102943e928249c9d58eb4 /arch/arm
parent3587c258078479824342f33dc513ca7c66d729bc (diff)
ARM: pxa168: added keypad wake clear event support for platform
Signed-off-by: Mark F. Brown <mark.brown314@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa168.h5
-rw-r--r--arch/arm/mach-mmp/pxa168.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h
index f34e6638fc6c..1801e4206232 100644
--- a/arch/arm/mach-mmp/include/mach/pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -5,6 +5,7 @@ struct sys_timer;
5 5
6extern struct sys_timer pxa168_timer; 6extern struct sys_timer pxa168_timer;
7extern void __init pxa168_init_irq(void); 7extern void __init pxa168_init_irq(void);
8extern void pxa168_clear_keypad_wakeup(void);
8 9
9#include <linux/i2c.h> 10#include <linux/i2c.h>
10#include <mach/devices.h> 11#include <mach/devices.h>
@@ -12,6 +13,7 @@ extern void __init pxa168_init_irq(void);
12#include <plat/pxa3xx_nand.h> 13#include <plat/pxa3xx_nand.h>
13#include <video/pxa168fb.h> 14#include <video/pxa168fb.h>
14#include <plat/pxa27x_keypad.h> 15#include <plat/pxa27x_keypad.h>
16#include <mach/cputype.h>
15 17
16extern struct pxa_device_desc pxa168_device_uart1; 18extern struct pxa_device_desc pxa168_device_uart1;
17extern struct pxa_device_desc pxa168_device_uart2; 19extern struct pxa_device_desc pxa168_device_uart2;
@@ -109,6 +111,9 @@ static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
109 111
110static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data) 112static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
111{ 113{
114 if (cpu_is_pxa168())
115 data->clear_wakeup_event = pxa168_clear_keypad_wakeup;
116
112 return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data)); 117 return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
113} 118}
114 119
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index 2fa16fb4503c..72b4e7631583 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -136,6 +136,16 @@ struct sys_timer pxa168_timer = {
136 .init = pxa168_timer_init, 136 .init = pxa168_timer_init,
137}; 137};
138 138
139void pxa168_clear_keypad_wakeup(void)
140{
141 uint32_t val;
142 uint32_t mask = APMU_PXA168_KP_WAKE_CLR;
143
144 /* wake event clear is needed in order to clear keypad interrupt */
145 val = __raw_readl(APMU_WAKE_CLR);
146 __raw_writel(val | mask, APMU_WAKE_CLR);
147}
148
139/* on-chip devices */ 149/* on-chip devices */
140PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22); 150PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22);
141PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24); 151PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24);