From: Thomas Gleixner <tglx@linutronix.de>
To: Joshua Henderson <joshua.henderson@microchip.com>
Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org,
ralf@linux-mips.org,
Cristian Birsan <cristian.birsan@microchip.com>,
Jason Cooper <jason@lakedaemon.net>,
Marc Zyngier <marc.zyngier@arm.com>
Subject: Re: [PATCH v5 02/14] irqchip: irq-pic32-evic: Add support for PIC32 interrupt controller
Date: Thu, 14 Jan 2016 09:10:09 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.11.1601140901210.3575@nanos> (raw)
In-Reply-To: <1452734299-460-3-git-send-email-joshua.henderson@microchip.com>
On Wed, 13 Jan 2016, Joshua Henderson wrote:
> +static int pic32_set_type_edge(struct irq_data *data,
> + unsigned int flow_type)
> +{
> + struct evic_chip_data *priv = irqd_to_priv(data);
> + int ret;
> + int i;
> +
> + if (!(flow_type & IRQ_TYPE_EDGE_BOTH))
> + return -EBADR;
> +
> + /* set polarity for external interrupts only */
> + for (i = 0; i < ARRAY_SIZE(priv->ext_irqs); i++) {
> + if (priv->ext_irqs[i] == data->hwirq) {
> + ret = pic32_set_ext_polarity(i + 1, flow_type);
> + if (ret)
> + return ret;
> + }
> + }
> +
> + irqd_set_trigger_type(data, flow_type);
The core code handles that already.
> +static int pic32_irq_domain_map(struct irq_domain *d, unsigned int virq,
> + irq_hw_number_t hw)
> +{
> + struct evic_chip_data *priv = d->host_data;
> + struct irq_data *data;
> + int ret;
> + u32 iecclr, ifsclr;
> + u32 reg, mask;
> +
> + ret = irq_map_generic_chip(d, virq, hw);
> + if (ret)
> + return ret;
> +
> + /*
> + * Piggyback on xlate function to move to an alternate chip as necessary
> + * at time of mapping instead of allowing the flow handler/chip to be
> + * changed later. This requires all interrupts to be configured through
> + * DT.
> + */
> + if (priv->irq_types[hw] & IRQ_TYPE_SENSE_MASK) {
> + data = irq_domain_get_irq_data(d, virq);
> + irqd_set_trigger_type(data, priv->irq_types[hw]);
> + irq_setup_alt_chip(data, priv->irq_types[hw]);
> + }
I like that approach.
So except for the nit in pic32_set_type_edge() this looks good. It's pretty
clear now what the code does and how the hardware works.
Thanks for following up!
tglx
next prev parent reply other threads:[~2016-01-14 8:11 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-14 1:15 [PATCH v5 00/14] Initial Microchip PIC32MZDA Support Joshua Henderson
2016-01-14 1:15 ` [PATCH v5 01/14] dt/bindings: Add bindings for PIC32 interrupt controller Joshua Henderson
2016-01-17 3:57 ` Rob Herring
2016-01-14 1:15 ` [PATCH v5 02/14] irqchip: irq-pic32-evic: Add support " Joshua Henderson
2016-01-14 8:10 ` Thomas Gleixner [this message]
2016-01-14 11:12 ` Ralf Baechle
2016-01-14 1:15 ` [PATCH v5 03/14] dt/bindings: Add PIC32 clock binding documentation Joshua Henderson
2016-01-14 1:15 ` [PATCH v5 04/14] clk: clk-pic32: Add PIC32 clock driver Joshua Henderson
2016-01-26 17:04 ` Joshua Henderson
2016-01-29 23:58 ` Stephen Boyd
2016-02-03 5:36 ` Purna Chandra Mandal
2016-01-14 1:15 ` [PATCH v5 05/14] dt/bindings: Add bindings for PIC32/MZDA platforms Joshua Henderson
2016-01-14 1:15 ` [PATCH v5 06/14] MIPS: Add support for PIC32MZDA platform Joshua Henderson
2016-01-14 1:15 ` [PATCH v5 07/14] dt/bindings: Add bindings for PIC32 pin control and GPIO Joshua Henderson
2016-01-14 1:15 ` [PATCH v5 08/14] pinctrl: pinctrl-pic32: Add PIC32 pin control driver Joshua Henderson
2016-01-26 17:04 ` Joshua Henderson
2016-01-27 13:49 ` Linus Walleij
2016-01-28 0:33 ` Joshua Henderson
2016-01-14 1:15 ` [PATCH v5 09/14] dt/bindings: Add bindings for PIC32 UART driver Joshua Henderson
2016-01-14 1:15 ` [PATCH v5 10/14] serial: pic32_uart: Add " Joshua Henderson
2016-01-14 13:55 ` One Thousand Gnomes
2016-01-26 17:04 ` Joshua Henderson
2016-01-26 17:33 ` Greg Kroah-Hartman
2016-01-27 15:55 ` Joshua Henderson
2016-02-07 7:04 ` Greg Kroah-Hartman
2016-04-15 17:28 ` Sudeep Holla
2016-04-16 16:09 ` Greg Kroah-Hartman
2016-01-14 1:15 ` [PATCH v5 11/14] dt/bindings: Add bindings for PIC32 SDHCI host controller Joshua Henderson
2016-02-08 9:58 ` Ulf Hansson
2016-01-14 1:15 ` [PATCH v5 12/14] mmc: sdhci-pic32: Add PIC32 SDHCI host controller driver Joshua Henderson
2016-01-26 17:04 ` Joshua Henderson
2016-02-08 9:59 ` Ulf Hansson
2016-01-14 1:15 ` [PATCH v5 13/14] MIPS: dts: Add initial DTS for the PIC32MZDA Starter Kit Joshua Henderson
2016-01-14 1:15 ` [PATCH v5 14/14] MIPS: pic32mzda: Add initial PIC32MZDA Starter Kit defconfig Joshua Henderson
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=alpine.DEB.2.11.1601140901210.3575@nanos \
--to=tglx@linutronix.de \
--cc=cristian.birsan@microchip.com \
--cc=jason@lakedaemon.net \
--cc=joshua.henderson@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=marc.zyngier@arm.com \
--cc=ralf@linux-mips.org \
/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
all inboxes | Powered by JetHome®