Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Support for virtual IRQ subgroups debugfs mapping.
0003  *
0004  * Copyright (C) 2010  Paul Mundt
0005  *
0006  * Modelled after arch/powerpc/kernel/irq.c.
0007  *
0008  * This file is subject to the terms and conditions of the GNU General Public
0009  * License.  See the file "COPYING" in the main directory of this archive
0010  * for more details.
0011  */
0012 #include <linux/seq_file.h>
0013 #include <linux/fs.h>
0014 #include <linux/init.h>
0015 #include <linux/irq.h>
0016 #include <linux/debugfs.h>
0017 #include "internals.h"
0018 
0019 static int intc_irq_xlate_show(struct seq_file *m, void *priv)
0020 {
0021     int i;
0022 
0023     seq_printf(m, "%-5s  %-7s  %-15s\n", "irq", "enum", "chip name");
0024 
0025     for (i = 1; i < nr_irqs; i++) {
0026         struct intc_map_entry *entry = intc_irq_xlate_get(i);
0027         struct intc_desc_int *desc = entry->desc;
0028 
0029         if (!desc)
0030             continue;
0031 
0032         seq_printf(m, "%5d  ", i);
0033         seq_printf(m, "0x%05x  ", entry->enum_id);
0034         seq_printf(m, "%-15s\n", desc->chip.name);
0035     }
0036 
0037     return 0;
0038 }
0039 
0040 DEFINE_SHOW_ATTRIBUTE(intc_irq_xlate);
0041 
0042 static int __init intc_irq_xlate_init(void)
0043 {
0044     /*
0045      * XXX.. use arch_debugfs_dir here when all of the intc users are
0046      * converted.
0047      */
0048     if (debugfs_create_file("intc_irq_xlate", S_IRUGO, NULL, NULL,
0049                 &intc_irq_xlate_fops) == NULL)
0050         return -ENOMEM;
0051 
0052     return 0;
0053 }
0054 fs_initcall(intc_irq_xlate_init);