aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-09-14 18:28:52 -0400
committerArnd Bergmann <arnd@arndb.de>2016-09-14 18:28:52 -0400
commitbe46f95b54e00922a506d9b3ecf588cc8255d310 (patch)
treeb8ca0a50850536c0c2f39ededad3e426d75ac01e /arch/arm/mach-pxa
parentf6b2dae76e0e138f8b4b6c375f10d2f8272982be (diff)
parent9ba63e3cc849cdaf3b675c47cc51fe35419e5117 (diff)
Merge tag 'pxa-for-4.9' of https://github.com/rjarzmik/linux into next/soc
Pull "This is the pxa changes for v4.9 cycle" from Robert Jarzmik: This cycle is covering : - the removal of the legacy DMA API This is the major contributor to the negative diffstat, as dmaengine have taken over in this area. - IDE subsystem defconfig fixes - preparation for pxa25x to be device-tree compliant - various irq related fixes * tag 'pxa-for-4.9' of https://github.com/rjarzmik/linux: ARM: pxa: pxa_cplds: fix interrupt handling ARM: pxa: remove irq init from dt machines ARM: pxa: Use kmalloc_array() in pxa_pm_init() ARM: pxa: magician: Remove duplicated I2C pins declaration ARM: pxa: fix GPIO double shifts arm: trizeps4_defconfig: disable IDE subsystem arm: pxa255-idp_defconfig: disable IDE subsystem arm: lpda270_defconfig: disable IDE subsystem arm: colibri_pxa270_defconfig: disable IDE subsystem ARM: pxa: add pxa25x device-tree support ARM: pxa: prepare pxa25x interrupts for device-tree platforms ARM: pxa: remove platform dma code ARM: pxa: remove devicetree boards from pxa_defconfig
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/Kconfig11
-rw-r--r--arch/arm/mach-pxa/Makefile3
-rw-r--r--arch/arm/mach-pxa/corgi_pm.c13
-rw-r--r--arch/arm/mach-pxa/devices.h1
-rw-r--r--arch/arm/mach-pxa/generic.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/dma.h1
-rw-r--r--arch/arm/mach-pxa/magician.c4
-rw-r--r--arch/arm/mach-pxa/pm.c5
-rw-r--r--arch/arm/mach-pxa/pxa-dt.c35
-rw-r--r--arch/arm/mach-pxa/pxa25x.c26
-rw-r--r--arch/arm/mach-pxa/pxa27x.c14
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c11
-rw-r--r--arch/arm/mach-pxa/pxa_cplds_irqs.c24
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c2
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.h2
-rw-r--r--arch/arm/mach-pxa/spitz_pm.c9
16 files changed, 95 insertions, 68 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index cd894d69e766..76fbc115ec33 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -4,6 +4,17 @@ menu "Intel PXA2xx/PXA3xx Implementations"
4 4
5comment "Intel/Marvell Dev Platforms (sorted by hardware release time)" 5comment "Intel/Marvell Dev Platforms (sorted by hardware release time)"
6 6
7config MACH_PXA25X_DT
8 bool "Support PXA25x platforms from device tree"
9 select PINCTRL
10 select POWER_SUPPLY
11 select PXA25x
12 select USE_OF
13 help
14 Include support for Marvell PXA25x based platforms using
15 the device tree. Needn't select any other machine while
16 MACH_PXA25x_DT is enabled.
17
7config MACH_PXA27X_DT 18config MACH_PXA27X_DT
8 bool "Support PXA27x platforms from device tree" 19 bool "Support PXA27x platforms from device tree"
9 select PINCTRL 20 select PINCTRL
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 2ceed407eda9..ef25dc597f30 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -19,8 +19,9 @@ obj-$(CONFIG_CPU_PXA930) += pxa930.o
19# NOTE: keep the order of boards in accordance to their order in Kconfig 19# NOTE: keep the order of boards in accordance to their order in Kconfig
20 20
21# Device Tree support 21# Device Tree support
22obj-$(CONFIG_MACH_PXA3XX_DT) += pxa-dt.o 22obj-$(CONFIG_MACH_PXA25X_DT) += pxa-dt.o
23obj-$(CONFIG_MACH_PXA27X_DT) += pxa-dt.o 23obj-$(CONFIG_MACH_PXA27X_DT) += pxa-dt.o
24obj-$(CONFIG_MACH_PXA3XX_DT) += pxa-dt.o
24 25
25# Intel/Marvell Dev Platforms 26# Intel/Marvell Dev Platforms
26obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o 27obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c
index d9206811be9b..c71c483f410e 100644
--- a/arch/arm/mach-pxa/corgi_pm.c
+++ b/arch/arm/mach-pxa/corgi_pm.c
@@ -131,16 +131,11 @@ static int corgi_should_wakeup(unsigned int resume_on_alarm)
131 return is_resume; 131 return is_resume;
132} 132}
133 133
134static unsigned long corgi_charger_wakeup(void) 134static bool corgi_charger_wakeup(void)
135{ 135{
136 unsigned long ret; 136 return !gpio_get_value(CORGI_GPIO_AC_IN) ||
137 137 !gpio_get_value(CORGI_GPIO_KEY_INT) ||
138 ret = (!gpio_get_value(CORGI_GPIO_AC_IN) << GPIO_bit(CORGI_GPIO_AC_IN)) 138 !gpio_get_value(CORGI_GPIO_WAKEUP);
139 | (!gpio_get_value(CORGI_GPIO_KEY_INT)
140 << GPIO_bit(CORGI_GPIO_KEY_INT))
141 | (!gpio_get_value(CORGI_GPIO_WAKEUP)
142 << GPIO_bit(CORGI_GPIO_WAKEUP));
143 return ret;
144} 139}
145 140
146unsigned long corgipm_read_devdata(int type) 141unsigned long corgipm_read_devdata(int type)
diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h
index 4a13c32fb705..04580c407276 100644
--- a/arch/arm/mach-pxa/devices.h
+++ b/arch/arm/mach-pxa/devices.h
@@ -54,3 +54,4 @@ extern struct platform_device pxa3xx_device_gpio;
54extern struct platform_device pxa93x_device_gpio; 54extern struct platform_device pxa93x_device_gpio;
55 55
56void __init pxa_register_device(struct platform_device *dev, void *data); 56void __init pxa_register_device(struct platform_device *dev, void *data);
57void __init pxa2xx_set_dmac_info(int nb_channels, int nb_requestors);
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index 0b1dbb54871a..75e3f611e5d8 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -33,14 +33,12 @@ extern void __init pxa26x_init_irq(void);
33 33
34#define pxa27x_handle_irq ichp_handle_irq 34#define pxa27x_handle_irq ichp_handle_irq
35extern int __init pxa27x_clocks_init(void); 35extern int __init pxa27x_clocks_init(void);
36extern void __init pxa27x_dt_init_irq(void);
37extern unsigned pxa27x_get_clk_frequency_khz(int); 36extern unsigned pxa27x_get_clk_frequency_khz(int);
38extern void __init pxa27x_init_irq(void); 37extern void __init pxa27x_init_irq(void);
39extern void __init pxa27x_map_io(void); 38extern void __init pxa27x_map_io(void);
40 39
41#define pxa3xx_handle_irq ichp_handle_irq 40#define pxa3xx_handle_irq ichp_handle_irq
42extern int __init pxa3xx_clocks_init(void); 41extern int __init pxa3xx_clocks_init(void);
43extern void __init pxa3xx_dt_init_irq(void);
44extern void __init pxa3xx_init_irq(void); 42extern void __init pxa3xx_init_irq(void);
45extern void __init pxa3xx_map_io(void); 43extern void __init pxa3xx_map_io(void);
46 44
diff --git a/arch/arm/mach-pxa/include/mach/dma.h b/arch/arm/mach-pxa/include/mach/dma.h
index 5bd55894a48d..20026bdc6b24 100644
--- a/arch/arm/mach-pxa/include/mach/dma.h
+++ b/arch/arm/mach-pxa/include/mach/dma.h
@@ -17,5 +17,4 @@
17/* DMA Controller Registers Definitions */ 17/* DMA Controller Registers Definitions */
18#define DMAC_REGS_VIRT io_p2v(0x40000000) 18#define DMAC_REGS_VIRT io_p2v(0x40000000)
19 19
20#include <plat/dma.h>
21#endif /* _ASM_ARCH_DMA_H */ 20#endif /* _ASM_ARCH_DMA_H */
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index abc918169367..6f8837ebbf91 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -121,10 +121,6 @@ static unsigned long magician_pin_config[] __initdata = {
121 GPIO107_GPIO, /* DS1WM_IRQ */ 121 GPIO107_GPIO, /* DS1WM_IRQ */
122 GPIO108_GPIO, /* GSM_READY */ 122 GPIO108_GPIO, /* GSM_READY */
123 GPIO115_GPIO, /* nPEN_IRQ */ 123 GPIO115_GPIO, /* nPEN_IRQ */
124
125 /* I2C */
126 GPIO117_I2C_SCL,
127 GPIO118_I2C_SDA,
128}; 124};
129 125
130/* 126/*
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index 388463b99090..e7450fb49d24 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -104,8 +104,9 @@ static int __init pxa_pm_init(void)
104 return -EINVAL; 104 return -EINVAL;
105 } 105 }
106 106
107 sleep_save = kmalloc(pxa_cpu_pm_fns->save_count * sizeof(unsigned long), 107 sleep_save = kmalloc_array(pxa_cpu_pm_fns->save_count,
108 GFP_KERNEL); 108 sizeof(*sleep_save),
109 GFP_KERNEL);
109 if (!sleep_save) { 110 if (!sleep_save) {
110 printk(KERN_ERR "failed to alloc memory for pm save\n"); 111 printk(KERN_ERR "failed to alloc memory for pm save\n");
111 return -ENOMEM; 112 return -ENOMEM;
diff --git a/arch/arm/mach-pxa/pxa-dt.c b/arch/arm/mach-pxa/pxa-dt.c
index f128133a8f30..aa9b255f5570 100644
--- a/arch/arm/mach-pxa/pxa-dt.c
+++ b/arch/arm/mach-pxa/pxa-dt.c
@@ -18,20 +18,16 @@
18 18
19#include "generic.h" 19#include "generic.h"
20 20
21#ifdef CONFIG_PXA3xx 21#ifdef CONFIG_PXA25x
22static const char *const pxa3xx_dt_board_compat[] __initconst = { 22static const char * const pxa25x_dt_board_compat[] __initconst = {
23 "marvell,pxa300", 23 "marvell,pxa250",
24 "marvell,pxa310",
25 "marvell,pxa320",
26 NULL, 24 NULL,
27}; 25};
28 26
29DT_MACHINE_START(PXA_DT, "Marvell PXA3xx (Device Tree Support)") 27DT_MACHINE_START(PXA25X_DT, "Marvell PXA25x (Device Tree Support)")
30 .map_io = pxa3xx_map_io, 28 .map_io = pxa25x_map_io,
31 .init_irq = pxa3xx_dt_init_irq,
32 .handle_irq = pxa3xx_handle_irq,
33 .restart = pxa_restart, 29 .restart = pxa_restart,
34 .dt_compat = pxa3xx_dt_board_compat, 30 .dt_compat = pxa25x_dt_board_compat,
35MACHINE_END 31MACHINE_END
36#endif 32#endif
37 33
@@ -41,11 +37,24 @@ static const char * const pxa27x_dt_board_compat[] __initconst = {
41 NULL, 37 NULL,
42}; 38};
43 39
44DT_MACHINE_START(PXA27X_DT, "Marvell PXA2xx (Device Tree Support)") 40DT_MACHINE_START(PXA27X_DT, "Marvell PXA27x (Device Tree Support)")
45 .map_io = pxa27x_map_io, 41 .map_io = pxa27x_map_io,
46 .init_irq = pxa27x_dt_init_irq,
47 .handle_irq = pxa27x_handle_irq,
48 .restart = pxa_restart, 42 .restart = pxa_restart,
49 .dt_compat = pxa27x_dt_board_compat, 43 .dt_compat = pxa27x_dt_board_compat,
50MACHINE_END 44MACHINE_END
51#endif 45#endif
46
47#ifdef CONFIG_PXA3xx
48static const char *const pxa3xx_dt_board_compat[] __initconst = {
49 "marvell,pxa300",
50 "marvell,pxa310",
51 "marvell,pxa320",
52 NULL,
53};
54
55DT_MACHINE_START(PXA_DT, "Marvell PXA3xx (Device Tree Support)")
56 .map_io = pxa3xx_map_io,
57 .restart = pxa_restart,
58 .dt_compat = pxa3xx_dt_board_compat,
59MACHINE_END
60#endif
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 823504f48f80..12b94357fbc1 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -25,6 +25,7 @@
25#include <linux/suspend.h> 25#include <linux/suspend.h>
26#include <linux/syscore_ops.h> 26#include <linux/syscore_ops.h>
27#include <linux/irq.h> 27#include <linux/irq.h>
28#include <linux/irqchip.h>
28 29
29#include <asm/mach/map.h> 30#include <asm/mach/map.h>
30#include <asm/suspend.h> 31#include <asm/suspend.h>
@@ -151,6 +152,16 @@ void __init pxa26x_init_irq(void)
151} 152}
152#endif 153#endif
153 154
155static int __init __init
156pxa25x_dt_init_irq(struct device_node *node, struct device_node *parent)
157{
158 pxa_dt_irq_init(pxa25x_set_wake);
159 set_handle_irq(ichp_handle_irq);
160
161 return 0;
162}
163IRQCHIP_DECLARE(pxa25x_intc, "marvell,pxa-intc", pxa25x_dt_init_irq);
164
154static struct map_desc pxa25x_io_desc[] __initdata = { 165static struct map_desc pxa25x_io_desc[] __initdata = {
155 { /* Mem Ctl */ 166 { /* Mem Ctl */
156 .virtual = (unsigned long)SMEMC_VIRT, 167 .virtual = (unsigned long)SMEMC_VIRT,
@@ -198,20 +209,17 @@ static int __init pxa25x_init(void)
198 209
199 reset_status = RCSR; 210 reset_status = RCSR;
200 211
201 if ((ret = pxa_init_dma(IRQ_DMA, 16)))
202 return ret;
203
204 pxa25x_init_pm(); 212 pxa25x_init_pm();
205 213
206 register_syscore_ops(&pxa_irq_syscore_ops); 214 register_syscore_ops(&pxa_irq_syscore_ops);
207 register_syscore_ops(&pxa2xx_mfp_syscore_ops); 215 register_syscore_ops(&pxa2xx_mfp_syscore_ops);
208 216
209 pxa2xx_set_dmac_info(16, 40); 217 if (!of_have_populated_dt()) {
210 pxa_register_device(&pxa25x_device_gpio, &pxa25x_gpio_info); 218 pxa2xx_set_dmac_info(16, 40);
211 ret = platform_add_devices(pxa25x_devices, 219 pxa_register_device(&pxa25x_device_gpio, &pxa25x_gpio_info);
212 ARRAY_SIZE(pxa25x_devices)); 220 ret = platform_add_devices(pxa25x_devices,
213 if (ret) 221 ARRAY_SIZE(pxa25x_devices));
214 return ret; 222 }
215 } 223 }
216 224
217 return ret; 225 return ret;
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 2eaa341dd3f8..c0185c5c5a08 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -16,6 +16,7 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/irqchip.h>
19#include <linux/suspend.h> 20#include <linux/suspend.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/syscore_ops.h> 22#include <linux/syscore_ops.h>
@@ -233,11 +234,15 @@ void __init pxa27x_init_irq(void)
233 pxa_init_irq(34, pxa27x_set_wake); 234 pxa_init_irq(34, pxa27x_set_wake);
234} 235}
235 236
236void __init pxa27x_dt_init_irq(void) 237static int __init
238pxa27x_dt_init_irq(struct device_node *node, struct device_node *parent)
237{ 239{
238 if (IS_ENABLED(CONFIG_OF)) 240 pxa_dt_irq_init(pxa27x_set_wake);
239 pxa_dt_irq_init(pxa27x_set_wake); 241 set_handle_irq(ichp_handle_irq);
242
243 return 0;
240} 244}
245IRQCHIP_DECLARE(pxa27x_intc, "marvell,pxa-intc", pxa27x_dt_init_irq);
241 246
242static struct map_desc pxa27x_io_desc[] __initdata = { 247static struct map_desc pxa27x_io_desc[] __initdata = {
243 { /* Mem Ctl */ 248 { /* Mem Ctl */
@@ -300,9 +305,6 @@ static int __init pxa27x_init(void)
300 305
301 reset_status = RCSR; 306 reset_status = RCSR;
302 307
303 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
304 return ret;
305
306 pxa27x_init_pm(); 308 pxa27x_init_pm();
307 309
308 register_syscore_ops(&pxa_irq_syscore_ops); 310 register_syscore_ops(&pxa_irq_syscore_ops);
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 3c9184d1d6b9..87acc96388c7 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -19,6 +19,7 @@
19#include <linux/pm.h> 19#include <linux/pm.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/irqchip.h>
22#include <linux/io.h> 23#include <linux/io.h>
23#include <linux/of.h> 24#include <linux/of.h>
24#include <linux/syscore_ops.h> 25#include <linux/syscore_ops.h>
@@ -356,11 +357,16 @@ void __init pxa3xx_init_irq(void)
356} 357}
357 358
358#ifdef CONFIG_OF 359#ifdef CONFIG_OF
359void __init pxa3xx_dt_init_irq(void) 360static int __init __init
361pxa3xx_dt_init_irq(struct device_node *node, struct device_node *parent)
360{ 362{
361 __pxa3xx_init_irq(); 363 __pxa3xx_init_irq();
362 pxa_dt_irq_init(pxa3xx_set_wake); 364 pxa_dt_irq_init(pxa3xx_set_wake);
365 set_handle_irq(ichp_handle_irq);
366
367 return 0;
363} 368}
369IRQCHIP_DECLARE(pxa3xx_intc, "marvell,pxa-intc", pxa3xx_dt_init_irq);
364#endif /* CONFIG_OF */ 370#endif /* CONFIG_OF */
365 371
366static struct map_desc pxa3xx_io_desc[] __initdata = { 372static struct map_desc pxa3xx_io_desc[] __initdata = {
@@ -438,9 +444,6 @@ static int __init pxa3xx_init(void)
438 */ 444 */
439 NDCR = (NDCR & ~NDCR_ND_ARB_EN) | NDCR_ND_ARB_CNTL; 445 NDCR = (NDCR & ~NDCR_ND_ARB_EN) | NDCR_ND_ARB_CNTL;
440 446
441 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
442 return ret;
443
444 pxa3xx_init_pm(); 447 pxa3xx_init_pm();
445 448
446 register_syscore_ops(&pxa_irq_syscore_ops); 449 register_syscore_ops(&pxa_irq_syscore_ops);
diff --git a/arch/arm/mach-pxa/pxa_cplds_irqs.c b/arch/arm/mach-pxa/pxa_cplds_irqs.c
index 2385052b0ce1..e362f865fcd2 100644
--- a/arch/arm/mach-pxa/pxa_cplds_irqs.c
+++ b/arch/arm/mach-pxa/pxa_cplds_irqs.c
@@ -41,30 +41,35 @@ static irqreturn_t cplds_irq_handler(int in_irq, void *d)
41 unsigned long pending; 41 unsigned long pending;
42 unsigned int bit; 42 unsigned int bit;
43 43
44 pending = readl(fpga->base + FPGA_IRQ_SET_CLR) & fpga->irq_mask; 44 do {
45 for_each_set_bit(bit, &pending, CPLDS_NB_IRQ) 45 pending = readl(fpga->base + FPGA_IRQ_SET_CLR) & fpga->irq_mask;
46 generic_handle_irq(irq_find_mapping(fpga->irqdomain, bit)); 46 for_each_set_bit(bit, &pending, CPLDS_NB_IRQ) {
47 generic_handle_irq(irq_find_mapping(fpga->irqdomain,
48 bit));
49 }
50 } while (pending);
47 51
48 return IRQ_HANDLED; 52 return IRQ_HANDLED;
49} 53}
50 54
51static void cplds_irq_mask_ack(struct irq_data *d) 55static void cplds_irq_mask(struct irq_data *d)
52{ 56{
53 struct cplds *fpga = irq_data_get_irq_chip_data(d); 57 struct cplds *fpga = irq_data_get_irq_chip_data(d);
54 unsigned int cplds_irq = irqd_to_hwirq(d); 58 unsigned int cplds_irq = irqd_to_hwirq(d);
55 unsigned int set, bit = BIT(cplds_irq); 59 unsigned int bit = BIT(cplds_irq);
56 60
57 fpga->irq_mask &= ~bit; 61 fpga->irq_mask &= ~bit;
58 writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN); 62 writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN);
59 set = readl(fpga->base + FPGA_IRQ_SET_CLR);
60 writel(set & ~bit, fpga->base + FPGA_IRQ_SET_CLR);
61} 63}
62 64
63static void cplds_irq_unmask(struct irq_data *d) 65static void cplds_irq_unmask(struct irq_data *d)
64{ 66{
65 struct cplds *fpga = irq_data_get_irq_chip_data(d); 67 struct cplds *fpga = irq_data_get_irq_chip_data(d);
66 unsigned int cplds_irq = irqd_to_hwirq(d); 68 unsigned int cplds_irq = irqd_to_hwirq(d);
67 unsigned int bit = BIT(cplds_irq); 69 unsigned int set, bit = BIT(cplds_irq);
70
71 set = readl(fpga->base + FPGA_IRQ_SET_CLR);
72 writel(set & ~bit, fpga->base + FPGA_IRQ_SET_CLR);
68 73
69 fpga->irq_mask |= bit; 74 fpga->irq_mask |= bit;
70 writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN); 75 writel(fpga->irq_mask, fpga->base + FPGA_IRQ_MASK_EN);
@@ -72,7 +77,8 @@ static void cplds_irq_unmask(struct irq_data *d)
72 77
73static struct irq_chip cplds_irq_chip = { 78static struct irq_chip cplds_irq_chip = {
74 .name = "pxa_cplds", 79 .name = "pxa_cplds",
75 .irq_mask_ack = cplds_irq_mask_ack, 80 .irq_ack = cplds_irq_mask,
81 .irq_mask = cplds_irq_mask,
76 .irq_unmask = cplds_irq_unmask, 82 .irq_unmask = cplds_irq_unmask,
77 .flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE, 83 .flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE,
78}; 84};
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index b80eab9993c5..249b7bd5fbc4 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -744,7 +744,7 @@ static int sharpsl_off_charge_battery(void)
744 time = RCNR; 744 time = RCNR;
745 while (1) { 745 while (1) {
746 /* Check if any wakeup event had occurred */ 746 /* Check if any wakeup event had occurred */
747 if (sharpsl_pm.machinfo->charger_wakeup() != 0) 747 if (sharpsl_pm.machinfo->charger_wakeup())
748 return 0; 748 return 0;
749 /* Check for timeout */ 749 /* Check for timeout */
750 if ((RCNR - time) > SHARPSL_WAIT_CO_TIME) 750 if ((RCNR - time) > SHARPSL_WAIT_CO_TIME)
diff --git a/arch/arm/mach-pxa/sharpsl_pm.h b/arch/arm/mach-pxa/sharpsl_pm.h
index 905be6755f04..fa75b6df8134 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.h
+++ b/arch/arm/mach-pxa/sharpsl_pm.h
@@ -34,7 +34,7 @@ struct sharpsl_charger_machinfo {
34#define SHARPSL_STATUS_LOCK 5 34#define SHARPSL_STATUS_LOCK 5
35#define SHARPSL_STATUS_CHRGFULL 6 35#define SHARPSL_STATUS_CHRGFULL 6
36#define SHARPSL_STATUS_FATAL 7 36#define SHARPSL_STATUS_FATAL 7
37 unsigned long (*charger_wakeup)(void); 37 bool (*charger_wakeup)(void);
38 int (*should_wakeup)(unsigned int resume_on_alarm); 38 int (*should_wakeup)(unsigned int resume_on_alarm);
39 void (*backlight_limit)(int); 39 void (*backlight_limit)(int);
40 int (*backlight_get_status) (void); 40 int (*backlight_get_status) (void);
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c
index ea9f9034cb54..4e64a140252e 100644
--- a/arch/arm/mach-pxa/spitz_pm.c
+++ b/arch/arm/mach-pxa/spitz_pm.c
@@ -165,13 +165,10 @@ static int spitz_should_wakeup(unsigned int resume_on_alarm)
165 return is_resume; 165 return is_resume;
166} 166}
167 167
168static unsigned long spitz_charger_wakeup(void) 168static bool spitz_charger_wakeup(void)
169{ 169{
170 unsigned long ret; 170 return !gpio_get_value(SPITZ_GPIO_KEY_INT) ||
171 ret = ((!gpio_get_value(SPITZ_GPIO_KEY_INT) 171 gpio_get_value(SPITZ_GPIO_SYNC);
172 << GPIO_bit(SPITZ_GPIO_KEY_INT))
173 | gpio_get_value(SPITZ_GPIO_SYNC));
174 return ret;
175} 172}
176 173
177unsigned long spitzpm_read_devdata(int type) 174unsigned long spitzpm_read_devdata(int type)