162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef __ASM_SH_HW_IRQ_H
362306a36Sopenharmony_ci#define __ASM_SH_HW_IRQ_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <linux/init.h>
662306a36Sopenharmony_ci#include <linux/sh_intc.h>
762306a36Sopenharmony_ci#include <linux/atomic.h>
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciextern atomic_t irq_err_count;
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_cistruct ipr_data {
1262306a36Sopenharmony_ci	unsigned char irq;
1362306a36Sopenharmony_ci	unsigned char ipr_idx;		/* Index for the IPR registered */
1462306a36Sopenharmony_ci	unsigned char shift;		/* Number of bits to shift the data */
1562306a36Sopenharmony_ci	unsigned char priority;		/* The priority */
1662306a36Sopenharmony_ci};
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_cistruct ipr_desc {
1962306a36Sopenharmony_ci	unsigned long *ipr_offsets;
2062306a36Sopenharmony_ci	unsigned int nr_offsets;
2162306a36Sopenharmony_ci	struct ipr_data *ipr_data;
2262306a36Sopenharmony_ci	unsigned int nr_irqs;
2362306a36Sopenharmony_ci	struct irq_chip chip;
2462306a36Sopenharmony_ci};
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_civoid register_ipr_controller(struct ipr_desc *);
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_civoid __init plat_irq_setup(void);
2962306a36Sopenharmony_civoid __init plat_irq_setup_sh3(void);
3062306a36Sopenharmony_civoid __init plat_irq_setup_pins(int mode);
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_cienum { IRQ_MODE_IRQ, IRQ_MODE_IRQ7654, IRQ_MODE_IRQ3210,
3362306a36Sopenharmony_ci       IRQ_MODE_IRL7654_MASK, IRQ_MODE_IRL3210_MASK,
3462306a36Sopenharmony_ci       IRQ_MODE_IRL7654, IRQ_MODE_IRL3210 };
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci#endif /* __ASM_SH_HW_IRQ_H */
37