xref: /linux/kernel/irq/debugfs.h (revision 0eaed89c18aeedf0898baf2dbf5ff027c6795152)
1*61b51a16SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0 */
2*61b51a16SThomas Gleixner #ifndef _KERNEL_IRQ_DEBUGFS_H
3*61b51a16SThomas Gleixner #define _KERNEL_IRQ_DEBUGFS_H
4*61b51a16SThomas Gleixner 
5*61b51a16SThomas Gleixner #ifdef CONFIG_GENERIC_IRQ_DEBUGFS
6*61b51a16SThomas Gleixner #include <linux/debugfs.h>
7*61b51a16SThomas Gleixner 
8*61b51a16SThomas Gleixner struct irq_bit_descr {
9*61b51a16SThomas Gleixner 	unsigned int	mask;
10*61b51a16SThomas Gleixner 	char		*name;
11*61b51a16SThomas Gleixner };
12*61b51a16SThomas Gleixner 
13*61b51a16SThomas Gleixner #define BIT_MASK_DESCR(m)	{ .mask = m, .name = #m }
14*61b51a16SThomas Gleixner 
15*61b51a16SThomas Gleixner void irq_debug_show_bits(struct seq_file *m, int ind, unsigned int state,
16*61b51a16SThomas Gleixner 			 const struct irq_bit_descr *sd, int size);
17*61b51a16SThomas Gleixner 
18*61b51a16SThomas Gleixner void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc);
19*61b51a16SThomas Gleixner static inline void irq_remove_debugfs_entry(struct irq_desc *desc)
20*61b51a16SThomas Gleixner {
21*61b51a16SThomas Gleixner 	debugfs_remove(desc->debugfs_file);
22*61b51a16SThomas Gleixner 	kfree(desc->dev_name);
23*61b51a16SThomas Gleixner }
24*61b51a16SThomas Gleixner void irq_debugfs_copy_devname(int irq, struct device *dev);
25*61b51a16SThomas Gleixner # ifdef CONFIG_IRQ_DOMAIN
26*61b51a16SThomas Gleixner void irq_domain_debugfs_init(struct dentry *root);
27*61b51a16SThomas Gleixner # else
28*61b51a16SThomas Gleixner static inline void irq_domain_debugfs_init(struct dentry *root)
29*61b51a16SThomas Gleixner {
30*61b51a16SThomas Gleixner }
31*61b51a16SThomas Gleixner # endif
32*61b51a16SThomas Gleixner #else /* CONFIG_GENERIC_IRQ_DEBUGFS */
33*61b51a16SThomas Gleixner static inline void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *d)
34*61b51a16SThomas Gleixner {
35*61b51a16SThomas Gleixner }
36*61b51a16SThomas Gleixner static inline void irq_remove_debugfs_entry(struct irq_desc *d)
37*61b51a16SThomas Gleixner {
38*61b51a16SThomas Gleixner }
39*61b51a16SThomas Gleixner static inline void irq_debugfs_copy_devname(int irq, struct device *dev)
40*61b51a16SThomas Gleixner {
41*61b51a16SThomas Gleixner }
42*61b51a16SThomas Gleixner #endif /* CONFIG_GENERIC_IRQ_DEBUGFS */
43*61b51a16SThomas Gleixner 
44*61b51a16SThomas Gleixner #endif
45