Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Guy Morand <guy.morand@bytesatwork.ch>
To: linus.walleij@linaro.org, brgl@kernel.org
Cc: linux-gpio@vger.kernel.org, mariagarcia7293@gmail.com
Subject: gpio: pca953x: TCA6418 support and driver design
Date: Wed, 18 Nov 2026 13:25:35 +0100	[thread overview]
Message-ID: <0935c08b-828e-4a8f-95fc-04b82ab30fe7@bytesatwork.ch> (raw)

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

             reply	other threads:[~2026-11-18 12:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 12:25 Guy Morand [this message]
2026-11-18 14:48 ` gpio: pca953x: TCA6418 support and driver design Bartosz Golaszewski
     [not found]   ` <CAFOBSkR9eHu_2UZkyu-v8saQ2YrKNcQxbLbyKNkFWtZw3XvMMQ@mail.gmail.com>
2026-11-18 15:16     ` María García Fernández

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0935c08b-828e-4a8f-95fc-04b82ab30fe7@bytesatwork.ch \
    --to=guy.morand@bytesatwork.ch \
    --cc=brgl@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mariagarcia7293@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox