All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>,
	Carlo Caione <carlo@caione.org>,
	Kevin Hilman <khilman@baylibre.com>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Rob Herring <robh+dt@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq
Date: Tue, 25 Oct 2016 20:10:00 +0200	[thread overview]
Message-ID: <CACRpkdba_iaOK61KiQGvJZYuz7-PiBgtN4vxv__tJLsZ8ZVL=w@mail.gmail.com> (raw)
In-Reply-To: <bbc268c8-35c3-206a-46b1-62cebef174b2@arm.com>

On Tue, Oct 25, 2016 at 4:47 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> On 25/10/16 15:22, Jerome Brunet wrote:

>> There is a few problems to guarantee that gpio == hwirq.
>> 1. We have 2 instances of pinctrl, to guarantee that the linux gpio
>> number == hwirq, we would have to guarantee the order in which they are
>> probed. At least this my understanding
>
> Maybe I wasn't clear enough, and my use of gpio is probably wrong. So
> Linux has a gpio number, which is obviously an abstract number (just
> like the Linux irq number). But the pad number, in the context of given
> SoC, is constant. So we have:
>
>         pad->gpio
>         hwirq->irq
>
> Why can't you have pad == hwirq, always? This is already what you have
> in the irqchip driver. This would simplify a lot of things.

My thought as well.

We usually refer to the local numberspace on the GPIO controller
as "offsets", so line offsets 0...31 on a gpiochip with 31 lines.

The ngpio in struct gpio_chip is the number of lines on that controller,
and should nominally map 1:1 to hwirq sources.

Yours,
Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/9] pinctrl: meson: allow gpio to request irq
Date: Tue, 25 Oct 2016 20:10:00 +0200	[thread overview]
Message-ID: <CACRpkdba_iaOK61KiQGvJZYuz7-PiBgtN4vxv__tJLsZ8ZVL=w@mail.gmail.com> (raw)
In-Reply-To: <bbc268c8-35c3-206a-46b1-62cebef174b2@arm.com>

On Tue, Oct 25, 2016 at 4:47 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> On 25/10/16 15:22, Jerome Brunet wrote:

>> There is a few problems to guarantee that gpio == hwirq.
>> 1. We have 2 instances of pinctrl, to guarantee that the linux gpio
>> number == hwirq, we would have to guarantee the order in which they are
>> probed. At least this my understanding
>
> Maybe I wasn't clear enough, and my use of gpio is probably wrong. So
> Linux has a gpio number, which is obviously an abstract number (just
> like the Linux irq number). But the pad number, in the context of given
> SoC, is constant. So we have:
>
>         pad->gpio
>         hwirq->irq
>
> Why can't you have pad == hwirq, always? This is already what you have
> in the irqchip driver. This would simplify a lot of things.

My thought as well.

We usually refer to the local numberspace on the GPIO controller
as "offsets", so line offsets 0...31 on a gpiochip with 31 lines.

The ngpio in struct gpio_chip is the number of lines on that controller,
and should nominally map 1:1 to hwirq sources.

Yours,
Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: linus.walleij@linaro.org (Linus Walleij)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 4/9] pinctrl: meson: allow gpio to request irq
Date: Tue, 25 Oct 2016 20:10:00 +0200	[thread overview]
Message-ID: <CACRpkdba_iaOK61KiQGvJZYuz7-PiBgtN4vxv__tJLsZ8ZVL=w@mail.gmail.com> (raw)
In-Reply-To: <bbc268c8-35c3-206a-46b1-62cebef174b2@arm.com>

On Tue, Oct 25, 2016 at 4:47 PM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> On 25/10/16 15:22, Jerome Brunet wrote:

>> There is a few problems to guarantee that gpio == hwirq.
>> 1. We have 2 instances of pinctrl, to guarantee that the linux gpio
>> number == hwirq, we would have to guarantee the order in which they are
>> probed. At least this my understanding
>
> Maybe I wasn't clear enough, and my use of gpio is probably wrong. So
> Linux has a gpio number, which is obviously an abstract number (just
> like the Linux irq number). But the pad number, in the context of given
> SoC, is constant. So we have:
>
>         pad->gpio
>         hwirq->irq
>
> Why can't you have pad == hwirq, always? This is already what you have
> in the irqchip driver. This would simplify a lot of things.

My thought as well.

We usually refer to the local numberspace on the GPIO controller
as "offsets", so line offsets 0...31 on a gpiochip with 31 lines.

The ngpio in struct gpio_chip is the number of lines on that controller,
and should nominally map 1:1 to hwirq sources.

Yours,
Linus Walleij

  parent reply	other threads:[~2016-10-25 18:10 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19 10:08 [PATCH 0/9] irqchip: meson: add support for the gpio interrupt controller Jerome Brunet
2016-10-19 10:08 ` Jerome Brunet
2016-10-19 10:08 ` Jerome Brunet
2016-10-19 10:08 ` Jerome Brunet
2016-10-19 10:08 ` [PATCH 1/9] irqchip: meson: add support for " Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08 ` [PATCH 2/9] dt-bindings: interrupt-controller: add DT binding for meson GPIO " Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08 ` [PATCH 3/9] pinctrl: meson: update pinctrl data with gpio irq data Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08 ` [PATCH 4/9] pinctrl: meson: allow gpio to request irq Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-20 19:21   ` Linus Walleij
2016-10-20 19:21     ` Linus Walleij
2016-10-20 19:21     ` Linus Walleij
2016-10-20 19:21     ` Linus Walleij
2016-10-21  9:06     ` Jerome Brunet
2016-10-21  9:06       ` Jerome Brunet
2016-10-21  9:06       ` Jerome Brunet
2016-10-21  9:06       ` Jerome Brunet
2016-10-25  9:14       ` Linus Walleij
2016-10-25  9:14         ` Linus Walleij
2016-10-25  9:14         ` Linus Walleij
2016-10-25  9:14         ` Linus Walleij
2016-10-25 10:38         ` Marc Zyngier
2016-10-25 10:38           ` Marc Zyngier
2016-10-25 10:38           ` Marc Zyngier
2016-10-25 10:38           ` Marc Zyngier
2016-10-25 13:08           ` Jerome Brunet
2016-10-25 13:08             ` Jerome Brunet
2016-10-25 13:08             ` Jerome Brunet
2016-10-25 13:08             ` Jerome Brunet
     [not found]             ` <1477400900.2482.51.camel-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
2016-10-25 13:38               ` Marc Zyngier
2016-10-25 13:38                 ` Marc Zyngier
2016-10-25 13:38                 ` Marc Zyngier
2016-10-25 13:38                 ` Marc Zyngier
2016-10-25 14:22                 ` Jerome Brunet
2016-10-25 14:22                   ` Jerome Brunet
2016-10-25 14:22                   ` Jerome Brunet
2016-10-25 14:22                   ` Jerome Brunet
     [not found]                   ` <1477405332.2482.87.camel-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
2016-10-25 14:47                     ` Marc Zyngier
2016-10-25 14:47                       ` Marc Zyngier
2016-10-25 14:47                       ` Marc Zyngier
2016-10-25 14:47                       ` Marc Zyngier
2016-10-25 15:31                       ` Jerome Brunet
2016-10-25 15:31                         ` Jerome Brunet
2016-10-25 15:31                         ` Jerome Brunet
2016-10-25 15:31                         ` Jerome Brunet
2016-10-25 18:20                         ` Linus Walleij
2016-10-25 18:20                           ` Linus Walleij
2016-10-25 18:20                           ` Linus Walleij
2016-10-25 18:20                           ` Linus Walleij
     [not found]                           ` <CACRpkdbGo4BJOdzkgBrE9jT-rKodd4zssCnOtOuGS+OqV-Uc6Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-26 14:22                             ` Jerome Brunet
2016-10-26 14:22                               ` Jerome Brunet
2016-10-26 14:22                               ` Jerome Brunet
2016-10-26 14:22                               ` Jerome Brunet
     [not found]                               ` <1477491766.2482.159.camel-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
2016-10-26 14:32                                 ` Linus Walleij
2016-10-26 14:32                                   ` Linus Walleij
2016-10-26 14:32                                   ` Linus Walleij
2016-10-26 14:32                                   ` Linus Walleij
2016-10-26 15:50                                   ` Kevin Hilman
2016-10-26 15:50                                     ` Kevin Hilman
2016-10-26 15:50                                     ` Kevin Hilman
2016-10-26 15:50                                     ` Kevin Hilman
2016-11-04 14:40                                     ` Linus Walleij
2016-11-04 14:40                                       ` Linus Walleij
2016-11-04 14:40                                       ` Linus Walleij
2016-11-04 14:40                                       ` Linus Walleij
2016-10-25 18:10                       ` Linus Walleij [this message]
2016-10-25 18:10                         ` Linus Walleij
2016-10-25 18:10                         ` Linus Walleij
2016-10-25 18:10                         ` Linus Walleij
2016-10-26 14:23                         ` Jerome Brunet
2016-10-26 14:23                           ` Jerome Brunet
2016-10-26 14:23                           ` Jerome Brunet
2016-10-26 14:23                           ` Jerome Brunet
     [not found]                           ` <1477491816.2482.160.camel-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>
2016-10-26 14:44                             ` Linus Walleij
2016-10-26 14:44                               ` Linus Walleij
2016-10-26 14:44                               ` Linus Walleij
2016-10-26 14:44                               ` Linus Walleij
2016-10-27 10:42                               ` Jerome Brunet
2016-10-27 10:42                                 ` Jerome Brunet
2016-10-27 10:42                                 ` Jerome Brunet
2016-10-27 10:42                                 ` Jerome Brunet
2016-11-04 15:03                                 ` Linus Walleij
2016-11-04 15:03                                   ` Linus Walleij
2016-11-04 15:03                                   ` Linus Walleij
2016-11-04 15:03                                   ` Linus Walleij
     [not found]         ` <CACRpkdYUVXny57AC9rKX3VRAyooEk_2XLvqe9jOuT3rOaE75rg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-25 10:39           ` Thomas Gleixner
2016-10-25 10:39             ` Thomas Gleixner
2016-10-25 10:39             ` Thomas Gleixner
2016-10-25 10:39             ` Thomas Gleixner
2016-10-19 10:08 ` [PATCH 5/9] dt-bindings: pinctrl: meson: update gpio dt-bindings Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08 ` [PATCH 6/9] ARM64: meson: enable MESON_IRQ_GPIO in Kconfig Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08 ` [PATCH 7/9] ARM: meson: enable MESON_IRQ_GPIO in Kconfig for meson8 Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08 ` [PATCH 8/9] ARM64: dts: amlogic: enable gpio interrupt controller on gxbb Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08 ` [PATCH 9/9] ARM: dts: amlogic: enable gpio interrupt controller on meson8 Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet
2016-10-19 10:08   ` Jerome Brunet

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='CACRpkdba_iaOK61KiQGvJZYuz7-PiBgtN4vxv__tJLsZ8ZVL=w@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=carlo@caione.org \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jason@lakedaemon.net \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=marc.zyngier@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.