Linux GPIO subsystem development
 help / color / mirror / Atom feed
* gpio: pca953x: TCA6418 support and driver design
@ 2026-11-18 12:25 Guy Morand
  2026-11-18 14:48 ` Bartosz Golaszewski
  0 siblings, 1 reply; 4+ messages in thread
From: Guy Morand @ 2026-11-18 12:25 UTC (permalink / raw)
  To: linus.walleij, brgl; +Cc: linux-gpio, mariagarcia7293

Hi Linus, Bartosz, Maria,

We have been testing the TCA6418 support added to gpio-pca953x by the 
following patch:
https://lore.kernel.org/all/20250703205740.45385-3-mariagarcia7293@gmail.com/

On our board, using a 6.18-based NXP linux-imx kernel, the following 
command does not toggle the requested GPIO as expected:
gpioset -c /dev/gpiochip4 -t 10ms,10ms,0 0=0

While investigating, we found several issues in the TCA6418 support:
* The driver uses the PCA-style i2c auto-increment which is not 
documented in the TCA6418 datasheet, leading to corrupted registers.
* Input-status registers are not marked volatile, so reads can return 
stale cached values.
* The bulk get/set paths do not reverse the bit order of the first GPIO 
bank, so they can read or update the wrong line.
* Interrupt handling is incomplete: the generic IRQ path does not 
configure the TCA6418’s interrupt-enable and edge-selection registers or 
handle its status and acknowledgement registers.

I have spent some time trying to fix the integration, but the TCA6418 
seems to require several chip-specific operations.
Before this support was added, we used an out-of-tree TCA6418 driver 
that worked well for our use case.

I think the current support needs to be fixed, but I’m unsure whether it 
would be preferable to add the necessary chip-specific operations to 
gpio-pca953x or replace its TCA6418 support with a dedicated driver 
based on our existing one.

I’m not familiar with the subsystem’s design preferences. Which approach 
would you prefer?

If this could be useful, I can share our existing driver and the local 
fixes we have tried.

Best regards,

Guy Morand
-- 
bytesatwork
Technoparkstrasse 7
CH-8406 Winterthur
Switzerland

phone: +41 52 213 79 79

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-19  8:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 12:25 gpio: pca953x: TCA6418 support and driver design Guy Morand
2026-11-18 14:48 ` Bartosz Golaszewski
     [not found]   ` <CAFOBSkR9eHu_2UZkyu-v8saQ2YrKNcQxbLbyKNkFWtZw3XvMMQ@mail.gmail.com>
2026-11-18 15:16     ` María García Fernández
2026-11-19  8:55       ` Guy Morand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox