Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / sh / intc / virq-debugfs.c
blob5dd8febe6da52460282db0a978231e917041e3d4
1 /*
2 * Support for virtual IRQ subgroups debugfs mapping.
4 * Copyright (C) 2010 Paul Mundt
6 * Modelled after arch/powerpc/kernel/irq.c.
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
12 #include <linux/seq_file.h>
13 #include <linux/fs.h>
14 #include <linux/init.h>
15 #include <linux/irq.h>
16 #include <linux/debugfs.h>
17 #include "internals.h"
19 static int intc_irq_xlate_show(struct seq_file *m, void *priv)
21 const unsigned int nr_irqs = irq_get_nr_irqs();
22 int i;
24 seq_printf(m, "%-5s %-7s %-15s\n", "irq", "enum", "chip name");
26 for (i = 1; i < nr_irqs; i++) {
27 struct intc_map_entry *entry = intc_irq_xlate_get(i);
28 struct intc_desc_int *desc = entry->desc;
30 if (!desc)
31 continue;
33 seq_printf(m, "%5d ", i);
34 seq_printf(m, "0x%05x ", entry->enum_id);
35 seq_printf(m, "%-15s\n", desc->chip.name);
38 return 0;
41 DEFINE_SHOW_ATTRIBUTE(intc_irq_xlate);
43 static int __init intc_irq_xlate_init(void)
46 * XXX.. use arch_debugfs_dir here when all of the intc users are
47 * converted.
49 if (debugfs_create_file("intc_irq_xlate", S_IRUGO, NULL, NULL,
50 &intc_irq_xlate_fops) == NULL)
51 return -ENOMEM;
53 return 0;
55 fs_initcall(intc_irq_xlate_init);