18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * include/asm-xtensa/irq.h
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
58c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
68c2ecf20Sopenharmony_ci * for more details.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Copyright (C) 2001 - 2005 Tensilica Inc.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef _XTENSA_IRQ_H
128c2ecf20Sopenharmony_ci#define _XTENSA_IRQ_H
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <linux/init.h>
158c2ecf20Sopenharmony_ci#include <asm/core.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#ifdef CONFIG_PLATFORM_NR_IRQS
188c2ecf20Sopenharmony_ci# define PLATFORM_NR_IRQS CONFIG_PLATFORM_NR_IRQS
198c2ecf20Sopenharmony_ci#else
208c2ecf20Sopenharmony_ci# define PLATFORM_NR_IRQS 0
218c2ecf20Sopenharmony_ci#endif
228c2ecf20Sopenharmony_ci#define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS
238c2ecf20Sopenharmony_ci#define NR_IRQS (XTENSA_NR_IRQS + PLATFORM_NR_IRQS + 1)
248c2ecf20Sopenharmony_ci#define XTENSA_PIC_LINUX_IRQ(hwirq) ((hwirq) + 1)
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_cistatic __inline__ int irq_canonicalize(int irq)
278c2ecf20Sopenharmony_ci{
288c2ecf20Sopenharmony_ci	return (irq);
298c2ecf20Sopenharmony_ci}
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_cistruct irqaction;
328c2ecf20Sopenharmony_cistruct irq_domain;
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_civoid migrate_irqs(void);
358c2ecf20Sopenharmony_ciint xtensa_irq_domain_xlate(const u32 *intspec, unsigned int intsize,
368c2ecf20Sopenharmony_ci		unsigned long int_irq, unsigned long ext_irq,
378c2ecf20Sopenharmony_ci		unsigned long *out_hwirq, unsigned int *out_type);
388c2ecf20Sopenharmony_ciint xtensa_irq_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw);
398c2ecf20Sopenharmony_ciunsigned xtensa_map_ext_irq(unsigned ext_irq);
408c2ecf20Sopenharmony_ciunsigned xtensa_get_ext_irq_no(unsigned irq);
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#endif	/* _XTENSA_IRQ_H */
43