18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __ASM_SH_HW_IRQ_H
38c2ecf20Sopenharmony_ci#define __ASM_SH_HW_IRQ_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/init.h>
68c2ecf20Sopenharmony_ci#include <linux/sh_intc.h>
78c2ecf20Sopenharmony_ci#include <linux/atomic.h>
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciextern atomic_t irq_err_count;
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_cistruct ipr_data {
128c2ecf20Sopenharmony_ci	unsigned char irq;
138c2ecf20Sopenharmony_ci	unsigned char ipr_idx;		/* Index for the IPR registered */
148c2ecf20Sopenharmony_ci	unsigned char shift;		/* Number of bits to shift the data */
158c2ecf20Sopenharmony_ci	unsigned char priority;		/* The priority */
168c2ecf20Sopenharmony_ci};
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_cistruct ipr_desc {
198c2ecf20Sopenharmony_ci	unsigned long *ipr_offsets;
208c2ecf20Sopenharmony_ci	unsigned int nr_offsets;
218c2ecf20Sopenharmony_ci	struct ipr_data *ipr_data;
228c2ecf20Sopenharmony_ci	unsigned int nr_irqs;
238c2ecf20Sopenharmony_ci	struct irq_chip chip;
248c2ecf20Sopenharmony_ci};
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_civoid register_ipr_controller(struct ipr_desc *);
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_civoid __init plat_irq_setup(void);
298c2ecf20Sopenharmony_civoid __init plat_irq_setup_sh3(void);
308c2ecf20Sopenharmony_civoid __init plat_irq_setup_pins(int mode);
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_cienum { IRQ_MODE_IRQ, IRQ_MODE_IRQ7654, IRQ_MODE_IRQ3210,
338c2ecf20Sopenharmony_ci       IRQ_MODE_IRL7654_MASK, IRQ_MODE_IRL3210_MASK,
348c2ecf20Sopenharmony_ci       IRQ_MODE_IRL7654, IRQ_MODE_IRL3210 };
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci#endif /* __ASM_SH_HW_IRQ_H */
37