gpio-pca953x: Spurious interrupts

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

 



Hi,

after some more research, I found the reason why the pca953x driver in its
current state does not work well with my use case:
The problem occurs when using a PCA9555 and rapidly changing input states which
asserts and deasserts the INT line rapidly.

For the PCA9555 there is no solution, other than requiring that the interrupt
stays asserted until the inputs are read and that they do not change in between.

The PCAL9555A can latch its inputs and not assert the interrupt again until the
inputs are read. To find out which interrupt triggered, the interrupt status
registers need to be read. Otherwise the source of the interrupt is unknown,
which leads to the "nobody cared, disabling IRQ.." error after some time.

With the current logic (comparing with the old input values) the interrupts stay
unhandled because with a rapidly asserting and deasserting interrupt line, it
looks like the state did not change in the first place.

My idea for fixing this would be to treat the PCAL9555A interrupts differently:
By default, enabling the input latch for all inputs and clearing the hw
interrupt mask. Then in the interrupt handler, instead of comparing the input
values, read the status registers and after that read the corresponding input
registers. Then the interrupt line deasserts and we should no longer have
spurious interrupts.

If someone wants to use the PCAL9555A in the same way as a PCA9555, he can just
use the pca9555 dt id.

What do you think?

Btw: I marked the previous patchset as superseded in patchwork and I will send
a new version after having tested it thoroughly with PWM outputs connected to
the inputs, changing the input states with 1kHz or more.

Cheers,
Clemens
--
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