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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 20, 2017 at 7:23 PM, Jerome Brunet <jbrunet@xxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux