aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2008-02-24 08:26:03 -0500
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-07-02 05:05:01 -0400
commitaa8e87ca619a3d1944874e85d74fda90607c73b9 (patch)
tree9c80fc66f16e665a4247db402210e043b09b7bee
parentb83d6ee17588f1a4fbfc8ef0451b0900a5ef5950 (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>
-rw-r--r--arch/avr32/mach-at32ap/intc.c28
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
20struct intc { 21struct 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
25extern struct platform_device at32_intc0_device; 27extern 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
141static struct sysdev_class intc_class = {
142 .name = "intc",
143};
144
145static 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}
159device_initcall(intc_init_sysdev);
160
139unsigned long intc_get_pending(unsigned int group) 161unsigned 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);