From aa8e87ca619a3d1944874e85d74fda90607c73b9 Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Sun, 24 Feb 2008 14:26:03 +0100 Subject: 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 --- arch/avr32/mach-at32ap/intc.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'arch/avr32') 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 @@ /* - * Copyright (C) 2006 Atmel Corporation + * Copyright (C) 2006, 2008 Atmel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -12,14 +12,16 @@ #include #include #include +#include #include #include "intc.h" struct intc { - void __iomem *regs; - struct irq_chip chip; + void __iomem *regs; + struct irq_chip chip; + struct sys_device sysdev; }; extern struct platform_device at32_intc0_device; @@ -136,6 +138,26 @@ fail: panic("Interrupt controller initialization failed!\n"); } +static struct sysdev_class intc_class = { + .name = "intc", +}; + +static int __init intc_init_sysdev(void) +{ + int ret; + + ret = sysdev_class_register(&intc_class); + if (ret) + return ret; + + intc0.sysdev.id = 0; + intc0.sysdev.cls = &intc_class; + ret = sysdev_register(&intc0.sysdev); + + return ret; +} +device_initcall(intc_init_sysdev); + unsigned long intc_get_pending(unsigned int group) { return intc_readl(&intc0, INTREQ0 + 4 * group); -- cgit v1.2.3-59-g8ed1b