Re: Using ps2-gpio driver

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

 



Hi Vyacheslav,

thank you for your mail.

I figured out that this is caused by some changes in
kernel/irq/manage.c making it more likely gpiochip_lock_as_irq()
being called which sets the bit FLAG_USED_AS_IRQ. This bit is
checked in gpiod_direction_output() as you mentioned.

In gpiod_direction_output() it should also be checked for wether
the IRQ of the particular GPIO is enabled or not, so that it can
be driven as output when the irq is disabled.

In v4.20-rc1 this is already done with 4e9439ddacea ("gpiolib: add flag to indicate if the irq is disabled").
(https://patchwork.ozlabs.org/patch/967292/)

You can either back port this patch to your kernel version (recommended) or just modify the driver to free the irq whenever the gpio needs to
be set as output (instead of disabling it only).

Regards,
Danilo

On 11/23/18 9:14 AM, Вячеслав Бондарев wrote:
Hello, Danilo!

Sorry to bother you, but if you can give some advice -- it would be great.

I'm trying to using your driver ps2-gpio in our project.
But when I assign gpio-clk and interrupt to same gpio pin as in
example you applied(Documentation/devicetree/bindings/serio/ps2-gpio.txt), I get
an error "_gpiod_direction_output_raw: tried to set a GPIO tied to an IRQ as output".

Am I using the driver wrong?

With best regards,
Vyacheslav Bondarev,
embedded engineer,
SKTB SKIT LLC.
Site: www.skitlab.ru
Phone: +7-917-201-37-08




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux