mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-06-12 22:31:45 +01:00
lib: sbi_irqchip: Allow irqchip drivers advertise capabilities
Extend struct sbi_irqchip_device to allow irqchip drivers advertise interrupt controller capabilities (such as wired interrupt, MSIs, etc). This further allows other parts of OpenSBI to lookup irqchip devices based on capabilities. Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260608125257.3220114-2-anup.patel@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -31,12 +31,17 @@ struct sbi_irqchip_device {
|
||||
/** Internal data of all hardware interrupts of this irqchip (private) */
|
||||
struct sbi_irqchip_hwirq_data *hwirqs;
|
||||
|
||||
/** List of interrupt handlers */
|
||||
/** List of interrupt handlers (private) */
|
||||
struct sbi_dlist handler_list;
|
||||
|
||||
/** Unique ID of this irqchip */
|
||||
u32 id;
|
||||
|
||||
/** Capabilities of this irqchip */
|
||||
#define SBI_IRQCHIP_CAPS_WIRED BIT(0)
|
||||
#define SBI_IRQCHIP_CAPS_MSI BIT(1)
|
||||
unsigned long caps;
|
||||
|
||||
/** Number of hardware IRQs of this irqchip */
|
||||
u32 num_hwirq;
|
||||
|
||||
@@ -141,6 +146,10 @@ int sbi_irqchip_register_reserved(struct sbi_irqchip_device *chip,
|
||||
int sbi_irqchip_unregister_handler(struct sbi_irqchip_device *chip,
|
||||
u32 first_hwirq, u32 num_hwirq);
|
||||
|
||||
/** Find an irqchip device based on matching capabilities */
|
||||
struct sbi_irqchip_device *sbi_irqchip_find_device_by_caps(unsigned long caps,
|
||||
struct sbi_irqchip_device *first);
|
||||
|
||||
/** Find an irqchip device based on unique ID */
|
||||
struct sbi_irqchip_device *sbi_irqchip_find_device(u32 id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user