From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] pinctrl: exynos5440: add gpio interrupt support
Date: Tue, 9 Apr 2013 10:23:03 +0200 [thread overview]
Message-ID: <CACRpkdbEUe1NkOY7wR2FU+0Y=D5Qd=Lu2Zvv=TPBBCbWja0HMQ@mail.gmail.com> (raw)
In-Reply-To: <1364310754-3692-3-git-send-email-kgene.kim@samsung.com>
On Tue, Mar 26, 2013 at 4:12 PM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> From: Thomas Abraham <thomas.ab@samsung.com>
>
> Exynos5440 supports gpio interrupts on gpios 16 to 23. The eight interrupt lines
> originating from the pin-controller are connected to the gic. Add irq-chip support
> for these interrupts.
>
> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Basically really nice. Patch has been applied, but some comments
for future reference:
> +/* gpiolib gpio_to_irq callback function */
> +static int exynos5440_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
> +{
> + struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev);
> + unsigned int virq;
I'm a bit annoyed by use of the abbreviation "virq" as if the IRQs were
"virtual", they are not - this implies that the Linux IRQ numbers are not
"real" or something.
I use the nomenclature:
irq = Linux IRQ
hwirq = whatever offset that IRQ has in the hardware IRQ controller.
virq I think is confusing...
> +static irqreturn_t exynos5440_gpio_irq(int irq, void *data)
> +{
> + struct exynos5440_gpio_intr_data *intd = data;
> + struct exynos5440_pinctrl_priv_data *d = intd->priv;
> + int virq;
> +
> + virq = irq_linear_revmap(d->irq_domain, intd->gpio_int);
> + if (!virq)
> + return IRQ_NONE;
> + generic_handle_irq(virq);
> + return IRQ_HANDLED;
> +}
Same here. Actually, I guess irq_linear_revmap works here,
but irq_find_mapping(domain, hwirq) is more archaic, could
you test if that works as well and make a follow-up patch to
change it?
Yours,
Linus Walleij
next prev parent reply other threads:[~2013-04-09 8:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 15:12 [PATCH 0/3] pinctrl: exynos5440: add gpio interrupt Kukjin Kim
2013-03-26 15:12 ` [PATCH 1/3] pinctrl: exynos5440: fix probe failure due to missing pin-list in config nodes Kukjin Kim
2013-04-09 8:14 ` Linus Walleij
2013-03-26 15:12 ` [PATCH 2/3] pinctrl: exynos5440: add gpio interrupt support Kukjin Kim
2013-04-09 8:23 ` Linus Walleij [this message]
2013-03-26 15:12 ` [PATCH 3/3] ARM: dts: list the interrupts generated by pin-controller on Exynos5440 Kukjin Kim
2013-04-09 8:24 ` Linus Walleij
2013-04-09 14:56 ` Kukjin Kim
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='CACRpkdbEUe1NkOY7wR2FU+0Y=D5Qd=Lu2Zvv=TPBBCbWja0HMQ@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).