[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a486d8-70a0-89f7-1ae4-cd408d0e31be@ti.com>
Date: Tue, 8 Dec 2020 18:15:47 +0200
From: Grygorii Strashko <grygorii.strashko@...com>
To: "Enrico Weigelt, metux IT consult" <lkml@...ux.net>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
CC: "Enrico Weigelt, metux IT consult" <info@...ux.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jonathan Corbet <corbet@....net>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
<virtualization@...ts.linux-foundation.org>,
<linux-riscv@...ts.infradead.org>
Subject: Re: Howto listen to/handle gpio state changes ? Re: [PATCH v2 2/2]
drivers: gpio: add virtio-gpio guest driver
On 08/12/2020 16:04, Enrico Weigelt, metux IT consult wrote:
> On 08.12.20 10:38, Linus Walleij wrote:
>
> Hi,
>
>> This is Bartosz territory, but the gpio-mockup.c driver will insert
>> IRQs into the system, he went and added really core stuff
>> into kernel/irq to make this happen. Notice that in Kconfig
>> it does:
>>
>> select IRQ_SIM
>>
>> Then this is used:
>> include/linux/irq_sim.h
>>
>> This is intended for simulating IRQs and both GPIO and IIO use it.
>> I think this inserts IRQs from debugfs and I have no idea how
>> flexible that is.
>
> Oh, thx.
>
> It seems to implement a pseudo-irqchip driver. I've already though about
> doing that, but didn't think its worth it, just for my driver alone.
> I've implemented a few irq handling cb's directly the driver. But since
> we already have it, I'll reconsider :)
>
> BUT: this wasn't exactly my question :p
>
> I've been looking for some more direct notification callback for gpio
> consumers: here the consumer would register itself as a listener on
> some gpio_desc and called back when something changes (with data what
> exactly changed, eg. "gpio #3 input switched to high").
But this is exactly why there is GPIO IRQs in the first place,
which are used to notify consumers.
More over most consumers doesn't know where the IRQ came from - on one HW it can be gpio,
while on another HW - direct interrupt controller line.
--
Best regards,
grygorii
Powered by blists - more mailing lists