diff options
author | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2008-02-24 08:26:03 -0500 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-07-02 05:05:01 -0400 |
commit | aa8e87ca619a3d1944874e85d74fda90607c73b9 (patch) | |
tree | 9c80fc66f16e665a4247db402210e043b09b7bee /arch/avr32 | |
parent | b83d6ee17588f1a4fbfc8ef0451b0900a5ef5950 (diff) |
avr32: Add system device for the internal interrupt controller (intc)
This makes the intc show up in sysfs (probably not very useful), and
allows us to easily add suspend/resume support later.
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32')
-rw-r--r-- | arch/avr32/mach-at32ap/intc.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/arch/avr32/mach-at32ap/intc.c b/arch/avr32/mach-at32ap/intc.c index 097cf4e84052..644a3fb8c164 100644 --- a/arch/avr32/mach-at32ap/intc.c +++ b/arch/avr32/mach-at32ap/intc.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2006 Atmel Corporation | 2 | * Copyright (C) 2006, 2008 Atmel Corporation |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
@@ -12,14 +12,16 @@ | |||
12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/sysdev.h> | ||
15 | 16 | ||
16 | #include <asm/io.h> | 17 | #include <asm/io.h> |
17 | 18 | ||
18 | #include "intc.h" | 19 | #include "intc.h" |
19 | 20 | ||
20 | struct intc { | 21 | struct intc { |
21 | void __iomem *regs; | 22 | void __iomem *regs; |
22 | struct irq_chip chip; | 23 | struct irq_chip chip; |
24 | struct sys_device sysdev; | ||
23 | }; | 25 | }; |
24 | 26 | ||
25 | extern struct platform_device at32_intc0_device; | 27 | extern struct platform_device at32_intc0_device; |
@@ -136,6 +138,26 @@ fail: | |||
136 | panic("Interrupt controller initialization failed!\n"); | 138 | panic("Interrupt controller initialization failed!\n"); |
137 | } | 139 | } |
138 | 140 | ||
141 | static struct sysdev_class intc_class = { | ||
142 | .name = "intc", | ||
143 | }; | ||
144 | |||
145 | static int __init intc_init_sysdev(void) | ||
146 | { | ||
147 | int ret; | ||
148 | |||
149 | ret = sysdev_class_register(&intc_class); | ||
150 | if (ret) | ||
151 | return ret; | ||
152 | |||
153 | intc0.sysdev.id = 0; | ||
154 | intc0.sysdev.cls = &intc_class; | ||
155 | ret = sysdev_register(&intc0.sysdev); | ||
156 | |||
157 | return ret; | ||
158 | } | ||
159 | device_initcall(intc_init_sysdev); | ||
160 | |||
139 | unsigned long intc_get_pending(unsigned int group) | 161 | unsigned long intc_get_pending(unsigned int group) |
140 | { | 162 | { |
141 | return intc_readl(&intc0, INTREQ0 + 4 * group); | 163 | return intc_readl(&intc0, INTREQ0 + 4 * group); |