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


Groups > linux.kernel > #1672023

Re: [RFC] gpio: about the need to manage irq mapping dynamically.

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [RFC] gpio: about the need to manage irq mapping dynamically.
Date 2017-06-21 23:00 +0200
Message-ID <tUUTf-2Wi-3@gated-at.bofh.it> (permalink)
References <tSFOF-4JC-5@gated-at.bofh.it> <tUmRA-6dE-7@gated-at.bofh.it> <tUoA3-7os-35@gated-at.bofh.it> <tUum6-2zG-11@gated-at.bofh.it> <tUv8u-37f-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jun 20, 2017 at 7:23 PM, Jerome Brunet <jbrunet@baylibre.com> wrote:
> On Tue, 2017-06-20 at 18:37 +0200, Linus Walleij wrote:

>> Eventually gpio_to_irq() should be DELETED and replaced in full with
>> the prepare/unprepare calls.
>
> Woahh, that's not what I meant. gpio_to_irq should stay. Getting rid of it would
> be a mess and it is a useful call.
>
> The gpio_irq_prepare is meant so that the consumer can tell the gpio driver it
> will want to get irq from a particular gpio at some point.
>
> IOW, it's the consumer saying to the gpio driver "please do whatever you need to
> do, if anything, so this gpio can generate an interrupt"
>
> This is a much simpler change. Using devm, all we need is to put a
> devm_gpio_irq_prepare(<gpio_num>) in the probe of the drivers using gpio_to_irq.
>
> Mandating call to gpio_irq_prepare before any call to gpio_to_irq will be fairly
> easy.

So why can't we just return the IRQ from prepare() and be done with it
instead of having two calls? (Plus a third eventual unprepare()).

Clocks, regulators and godknowswhat is managed by two symmetrical
calls, so why shouldn't GPIO IRQs be?

It would be counterintuitive to have a third call in the middle.

Yours,
Linus Walleij

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


Thread

Re: [RFC] gpio: about the need to manage irq mapping dynamically. Linus Walleij <linus.walleij@linaro.org> - 2017-06-20 10:40 +0200
  Re: [RFC] gpio: about the need to manage irq mapping dynamically. Jerome Brunet <jbrunet@baylibre.com> - 2017-06-20 12:30 +0200
    Re: [RFC] gpio: about the need to manage irq mapping dynamically. Linus Walleij <linus.walleij@linaro.org> - 2017-06-20 18:40 +0200
      Re: [RFC] gpio: about the need to manage irq mapping dynamically. Jerome Brunet <jbrunet@baylibre.com> - 2017-06-20 19:30 +0200
        Re: [RFC] gpio: about the need to manage irq mapping dynamically. Linus Walleij <linus.walleij@linaro.org> - 2017-06-21 23:00 +0200
          Re: [RFC] gpio: about the need to manage irq mapping dynamically. Jerome Brunet <jbrunet@baylibre.com> - 2017-06-22 16:30 +0200
            Re: [RFC] gpio: about the need to manage irq mapping dynamically. Grygorii Strashko <grygorii.strashko@ti.com> - 2017-06-27 19:50 +0200
              Re: [RFC] gpio: about the need to manage irq mapping dynamically. Jerome Brunet <jbrunet@baylibre.com> - 2017-06-27 20:30 +0200
                Re: [RFC] gpio: about the need to manage irq mapping dynamically. Grygorii Strashko <grygorii.strashko@ti.com> - 2017-06-27 22:50 +0200
                Re: [RFC] gpio: about the need to manage irq mapping dynamically. Linus Walleij <linus.walleij@linaro.org> - 2017-06-29 16:20 +0200
                Re: [RFC] gpio: about the need to manage irq mapping dynamically. Grygorii Strashko <grygorii.strashko@ti.com> - 2017-06-30 22:00 +0200
                Re: [RFC] gpio: about the need to manage irq mapping dynamically. Linus Walleij <linus.walleij@linaro.org> - 2017-07-02 17:10 +0200
                Re: [RFC] gpio: about the need to manage irq mapping dynamically. Linus Walleij <linus.walleij@linaro.org> - 2017-06-29 16:20 +0200
                Re: [RFC] gpio: about the need to manage irq mapping dynamically. Jerome Brunet <jbrunet@baylibre.com> - 2017-06-29 17:00 +0200
                Re: [RFC] gpio: about the need to manage irq mapping dynamically. Marc Zyngier <marc.zyngier@arm.com> - 2017-06-29 19:00 +0200
                Re: [RFC] gpio: about the need to manage irq mapping dynamically. Jerome Brunet <jbrunet@baylibre.com> - 2017-06-29 20:40 +0200
                Re: [RFC] gpio: about the need to manage irq mapping dynamically. Linus Walleij <linus.walleij@linaro.org> - 2017-06-30 00:20 +0200

csiph-web