From: Marc Zyngier <marc.zyngier@arm.com>
To: Loic Pallardy <loic.pallardy@st.com>,
tglx@linutronix.de, jason@lakedaemon.net,
mcoquelin.stm32@gmail.com, alexandre.torgue@st.com
Cc: linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/1] irqchip: stm32-exti: add domain translate function
Date: Fri, 11 Jan 2019 15:52:15 +0000 [thread overview]
Message-ID: <7e36a9f2-2b43-5af3-2094-198a61030687@arm.com> (raw)
In-Reply-To: <1547215132-85612-1-git-send-email-loic.pallardy@st.com>
On 11/01/2019 13:58, Loic Pallardy wrote:
> Domain translate function is needed to recover irq
> configuration parameters from DT node
>
> Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Surely this fixes something, right? Can you please add a Fixes: tag?
> ---
> drivers/irqchip/irq-stm32-exti.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c
> index 6edfd4bfa169..717879028cc4 100644
> --- a/drivers/irqchip/irq-stm32-exti.c
> +++ b/drivers/irqchip/irq-stm32-exti.c
> @@ -819,9 +819,27 @@ static int __init stm32_exti_init(const struct stm32_exti_drv_data *drv_data,
> return ret;
> }
>
> +static int stm32_exti_h_translate(struct irq_domain *d,
> + struct irq_fwspec *fwspec,
> + unsigned long *out_hwirq,
> + unsigned int *out_type)
> +{
> + if (is_of_node(fwspec->fwnode)) {
Is there any case where this wouldn't be true? i.e. an stm32 ACPI system?
> + if (fwspec->param_count != 2)
> + return -EINVAL;
> +
> + *out_hwirq = fwspec->param[0];
> + *out_type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK;
> + return 0;
> + }
> +
> + return -EINVAL;
> +}
Because otherwise, this is exactly what irq_domain_xlate_twocell() does.
> +
> static const struct irq_domain_ops stm32_exti_h_domain_ops = {
> .alloc = stm32_exti_h_domain_alloc,
> .free = irq_domain_free_irqs_common,
> + .translate = stm32_exti_h_translate,
> };
>
> static int
>
Thanks,
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2019-01-11 15:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 13:58 [PATCH 1/1] irqchip: stm32-exti: add domain translate function Loic Pallardy
2019-01-11 15:52 ` Marc Zyngier [this message]
2019-01-11 17:34 ` Loic PALLARDY
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e36a9f2-2b43-5af3-2094-198a61030687@arm.com \
--to=marc.zyngier@arm.com \
--cc=alexandre.torgue@st.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=loic.pallardy@st.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).