Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1508543

Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq
Date 2016-10-25 20:30 +0200
Message-ID <sweE1-OM-1@gated-at.bofh.it> (permalink)
References (6 earlier) <sw9El-641-1@gated-at.bofh.it> <swa7n-6eB-9@gated-at.bofh.it> <swaTM-6Oo-9@gated-at.bofh.it> <swbd8-6Vq-27@gated-at.bofh.it> <swbZw-7sf-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Oct 25, 2016 at 5:31 PM, Jerome Brunet <jbrunet@baylibre.com> wrote:
> On Tue, 2016-10-25 at 15:47 +0100, Marc Zyngier wrote:

>> Is gpio_to_irq() supposed to allocate an interrupt? Or merely to
>> report the existence of a mapping?

It should provide an IRQ corresponding to the gpio line, if possible.

However the semantic is such, that it is not necessary to call to_irq()
before using an IRQ: the irqchip and gpiochip abstractions should be
orthogonal.

This goes especially when using device tree or ACPI, where you
may reference an IRQ from something modeled as irqchip, which
is simultaneously a gpiochip.

> Linus, please correct me if I'm wrong,
> .to_irq gets the linux gpio number and returns the linux virtual irq
> numbers, 0 if there is no interrupt.

Yes. But it may *or may not* be called before using the IRQ.

So it should look up or try to create a mapping on request, but not
assume to have been called before using some line as IRQ.

The only thing you should assume to be called before an interrupt
is put to use is the stuff in irqchip. So you have to do your
dynamic irqdomain mapping elsewhere than .to_irq().

Yours,
Linus Walleij

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4/9] pinctrl: meson: allow gpio to request irq Jerome Brunet <jbrunet@baylibre.com> - 2016-10-19 17:30 +0200
  Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Linus Walleij <linus.walleij@linaro.org> - 2016-10-20 21:30 +0200
    Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Jerome Brunet <jbrunet@baylibre.com> - 2016-10-21 11:10 +0200
      Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Linus Walleij <linus.walleij@linaro.org> - 2016-10-25 11:20 +0200
        Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Marc Zyngier <marc.zyngier@arm.com> - 2016-10-25 12:40 +0200
          Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Jerome Brunet <jbrunet@baylibre.com> - 2016-10-25 15:10 +0200
            Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Marc Zyngier <marc.zyngier@arm.com> - 2016-10-25 15:40 +0200
              Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Jerome Brunet <jbrunet@baylibre.com> - 2016-10-25 16:30 +0200
                Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Marc Zyngier <marc.zyngier@arm.com> - 2016-10-25 16:50 +0200
                Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Jerome Brunet <jbrunet@baylibre.com> - 2016-10-25 17:40 +0200
                Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Linus Walleij <linus.walleij@linaro.org> - 2016-10-25 20:30 +0200
                Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Jerome Brunet <jbrunet@baylibre.com> - 2016-10-26 16:30 +0200
                Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Linus Walleij <linus.walleij@linaro.org> - 2016-10-26 16:40 +0200
                Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Kevin Hilman <khilman@baylibre.com> - 2016-10-26 18:00 +0200
                Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Linus Walleij <linus.walleij@linaro.org> - 2016-10-25 20:20 +0200
                Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Jerome Brunet <jbrunet@baylibre.com> - 2016-10-26 16:30 +0200
                Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Linus Walleij <linus.walleij@linaro.org> - 2016-10-26 16:50 +0200
        Re: [PATCH 4/9] pinctrl: meson: allow gpio to request irq Thomas Gleixner <tglx@linutronix.de> - 2016-10-25 12:50 +0200

csiph-web