Hello!
I have a question about gpiochip ->to_irq().
Kernel call gpio_to_irq() requests IRQ for the pin, previously taken by
*gpio_request().
But for sysfs when user does echo "pin#" > /sys/class/gpio/export
gpio_to_irq() is also called at the time of export there:
https://elixir.bootlin.com/linux/v5.4.100/source/drivers/gpio/gpiolib-sysfs.c#L171
and there
https://elixir.bootlin.com/linux/v5.4.100/source/drivers/gpio/gpiolib-sysfs.c#L378
It is a problem for my driver. I have 120 pins and only 7 dynamically
muxed GPIO irqs.
So when somebody requests gpio_to_irq() I am creating the mux to the
first free gpio IRQ. But When user just exports GPIO pin using "old"
sysfs kernel interface in the filesystem, it should not be done.
How can I see if gpio_to_irq() has been called by sysfs to prevent
unnecessary dynamic muxing? Or there another way to get rid of this
wrong behavior in my driver?
BEGIN:VCARD
VERSION:4.0
EMAIL;PREF=1:dvorkin@xxxxxxxxx
EMAIL:dvorkindmitry@xxxxxxxxx
FN:Dmitry Dvorkin
NICKNAME:dv
ORG:Tibbo Technology Inc.;
TITLE:Embedded Linux Architect
N:Dvorkin;Dmitry;;;
ADR:;;9F-3\, No.31, Lane 169, Kang-Ning St., Hsi-Chih;New Taipei City;;2218
0;Taiwan
TEL;VALUE=TEXT:+79190546388
URL;VALUE=URL:https://tibbo.com/
UID:1c58210f-ac8c-4337-b391-0bde146d2d83
END:VCARD