diff options
author | Yash Shah <yash.shah@sifive.com> | 2019-12-10 12:11:09 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2020-01-20 10:19:33 +0100 |
commit | b01ecceaf2c0c4b3f2d24aa0adcf096ab1648253 (patch) | |
tree | c38b5c376b3f5cd856b3f9e1a50a45b3b29534ae /kernel/irq/irqdomain.c | |
parent | Linux 5.5-rc4 (diff) | |
download | linux-b01ecceaf2c0c4b3f2d24aa0adcf096ab1648253.tar.xz linux-b01ecceaf2c0c4b3f2d24aa0adcf096ab1648253.zip |
genirq: Introduce irq_domain_translate_onecell
Add a new function irq_domain_translate_onecell() that is to be used as
the translate function in struct irq_domain_ops.
Signed-off-by: Yash Shah <yash.shah@sifive.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/1575976274-13487-2-git-send-email-yash.shah@sifive.com
Diffstat (limited to 'kernel/irq/irqdomain.c')
-rw-r--r-- | kernel/irq/irqdomain.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index dd822fd8a7d5..7a8808c8dfec 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -987,6 +987,23 @@ const struct irq_domain_ops irq_domain_simple_ops = { EXPORT_SYMBOL_GPL(irq_domain_simple_ops); /** + * irq_domain_translate_onecell() - Generic translate for direct one cell + * bindings + */ +int irq_domain_translate_onecell(struct irq_domain *d, + struct irq_fwspec *fwspec, + unsigned long *out_hwirq, + unsigned int *out_type) +{ + if (WARN_ON(fwspec->param_count < 1)) + return -EINVAL; + *out_hwirq = fwspec->param[0]; + *out_type = IRQ_TYPE_NONE; + return 0; +} +EXPORT_SYMBOL_GPL(irq_domain_translate_onecell); + +/** * irq_domain_translate_twocell() - Generic translate for direct two cell * bindings * |