Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa8e87ca authored by Haavard Skinnemoen's avatar Haavard Skinnemoen Committed by Haavard Skinnemoen
Browse files

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: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
parent b83d6ee1
Loading
Loading
Loading
Loading
+25 −3
Original line number Diff line number Diff line
/*
 * 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,6 +12,7 @@
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/platform_device.h>
#include <linux/sysdev.h>

#include <asm/io.h>

@@ -20,6 +21,7 @@
struct intc {
	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);