irq.c (68d2cf25d39324c54b5e42de7915c623a0917abe) irq.c (2eaa03b5bebd1e80014f780d7bf27c3e66daefd6)
1/*
2 * linux/arch/arm/mach-pxa/irq.c
3 *
4 * Generic PXA IRQ handling
5 *
6 * Author: Nicolas Pitre
7 * Created: Jun 15, 2001
8 * Copyright: MontaVista Software Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/interrupt.h>
1/*
2 * linux/arch/arm/mach-pxa/irq.c
3 *
4 * Generic PXA IRQ handling
5 *
6 * Author: Nicolas Pitre
7 * Created: Jun 15, 2001
8 * Copyright: MontaVista Software Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/interrupt.h>
18#include <linux/sysdev.h>
18#include <linux/syscore_ops.h>
19#include <linux/io.h>
20#include <linux/irq.h>
21
22#include <mach/hardware.h>
23#include <mach/irqs.h>
24#include <mach/gpio.h>
25
26#include "generic.h"

--- 151 unchanged lines hidden (view full) ---

178 pxa_internal_irq_chip.irq_set_wake = fn;
179 pxa_init_low_gpio_irq(fn);
180}
181
182#ifdef CONFIG_PM
183static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
184static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
185
19#include <linux/io.h>
20#include <linux/irq.h>
21
22#include <mach/hardware.h>
23#include <mach/irqs.h>
24#include <mach/gpio.h>
25
26#include "generic.h"

--- 151 unchanged lines hidden (view full) ---

178 pxa_internal_irq_chip.irq_set_wake = fn;
179 pxa_init_low_gpio_irq(fn);
180}
181
182#ifdef CONFIG_PM
183static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
184static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
185
186static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
186static int pxa_irq_suspend(void)
187{
188 int i;
189
190 for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
191 void __iomem *base = irq_base(i);
192
193 saved_icmr[i] = __raw_readl(base + ICMR);
194 __raw_writel(0, base + ICMR);
195 }
196
197 if (cpu_has_ipr()) {
198 for (i = 0; i < pxa_internal_irq_nr; i++)
199 saved_ipr[i] = __raw_readl(IRQ_BASE + IPR(i));
200 }
201
202 return 0;
203}
204
187{
188 int i;
189
190 for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
191 void __iomem *base = irq_base(i);
192
193 saved_icmr[i] = __raw_readl(base + ICMR);
194 __raw_writel(0, base + ICMR);
195 }
196
197 if (cpu_has_ipr()) {
198 for (i = 0; i < pxa_internal_irq_nr; i++)
199 saved_ipr[i] = __raw_readl(IRQ_BASE + IPR(i));
200 }
201
202 return 0;
203}
204
205static int pxa_irq_resume(struct sys_device *dev)
205static void pxa_irq_resume(void)
206{
207 int i;
208
209 for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
210 void __iomem *base = irq_base(i);
211
212 __raw_writel(saved_icmr[i], base + ICMR);
213 __raw_writel(0, base + ICLR);
214 }
215
216 if (cpu_has_ipr())
217 for (i = 0; i < pxa_internal_irq_nr; i++)
218 __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i));
219
220 __raw_writel(1, IRQ_BASE + ICCR);
206{
207 int i;
208
209 for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
210 void __iomem *base = irq_base(i);
211
212 __raw_writel(saved_icmr[i], base + ICMR);
213 __raw_writel(0, base + ICLR);
214 }
215
216 if (cpu_has_ipr())
217 for (i = 0; i < pxa_internal_irq_nr; i++)
218 __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i));
219
220 __raw_writel(1, IRQ_BASE + ICCR);
221 return 0;
222}
223#else
224#define pxa_irq_suspend NULL
225#define pxa_irq_resume NULL
226#endif
227
221}
222#else
223#define pxa_irq_suspend NULL
224#define pxa_irq_resume NULL
225#endif
226
228struct sysdev_class pxa_irq_sysclass = {
229 .name = "irq",
227struct syscore_ops pxa_irq_syscore_ops = {
230 .suspend = pxa_irq_suspend,
231 .resume = pxa_irq_resume,
232};
228 .suspend = pxa_irq_suspend,
229 .resume = pxa_irq_resume,
230};
233
234static int __init pxa_irq_init(void)
235{
236 return sysdev_class_register(&pxa_irq_sysclass);
237}
238
239core_initcall(pxa_irq_init);