mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Lakshay Piplani <lakshay.piplani@nxp.com>
Cc: linux-kernel@vger.kernel.org, linux-i3c@lists.infradead.org,
	alexandre.belloni@bootlin.com, krzk+dt@kernel.org,
	robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
	broonie@kernel.org, mfd@lists.linux.dev, Frank.Li@nxp.com,
	lgirdwood@gmail.com, linux-gpio@vger.kernel.org,
	linusw@kernel.org, brgl@kernel.org, vikash.bansal@nxp.com,
	priyanka.jain@nxp.com, aman.kumarpandey@nxp.com
Subject: Re: [RFC PATCH 7/7] gpio: p3h2x4x: add GPIO expander for the NXP P3H2x4x I3C hub
Date: Mon, 19 Oct 2026 15:25:55 +0100	[thread overview]
Message-ID: <20261019142555.GB2663669@google.com> (raw)
In-Reply-To: <20261016164625.3166779-8-lakshay.piplani@nxp.com>

On Fri, 16 Oct 2026, Lakshay Piplani wrote:

> Expose the pins of the target ports placed in GPIO mode as a gpio_chip, so
> the hub can be used as an IO expander.
> 
> Each port contributes two lines, the SCL pin first, so target port N owns
> the lines 2 * N and 2 * N + 1, and the line number is also the port bit
> position in the direction and level registers. Ports that carry bus traffic
> are masked out through init_valid_mask. The port function is taken from the
> device tree rather than from the GPIO mode register, because the hub child
> that programs that register and this child are independent MFD devices with
> no probe ordering guarantee.
> 
> Direction is the output enable: clearing it leaves the pin in Hi-Z. An
> output drives the level before the buffer is enabled to avoid a glitch, and
> the input level register is used for reads in both directions. These
> registers are not protected, so the callbacks do not take the shared
> register lock. Implement get_multiple and set_multiple so an access to all
> lines of the hub costs two register accesses instead of one per line.
> 
> Interrupts on input level changes are not supported yet: they arrive as an
> I3C in-band interrupt and the edge detection configuration is shared by
> groups of four ports.
> 
> Signed-off-by: Lakshay Piplani <lakshay.piplani@nxp.com>
> Signed-off-by: Aman Kumar Pandey <aman.kumarpandey@nxp.com>
> Signed-off-by: Vikash Bansal <vikash.bansal@nxp.com>
> ---
>  MAINTAINERS                 |   1 +
>  drivers/gpio/Kconfig        |  11 ++
>  drivers/gpio/Makefile       |   1 +
>  drivers/gpio/gpio-p3h2x4x.c | 294 ++++++++++++++++++++++++++++++++++++
>  drivers/mfd/p3h2840.c       |   5 +

This needs to be a separate patch.

>  5 files changed, 312 insertions(+)
>  create mode 100644 drivers/gpio/gpio-p3h2x4x.c

-- 
Lee Jones

      parent reply	other threads:[~2026-10-19 14:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 16:46 [RFC PATCH 0/7] i3c: hub: p3h2x4x: add debugfs, i2c-tools, bus rate and GPIO mode support Lakshay Piplani
2026-10-16 16:46 ` [RFC PATCH 1/7] i3c: hub: p3h2x4x: Add support for debugfs Lakshay Piplani
2026-10-16 16:46 ` [RFC PATCH 2/7] i3c: hub: add i2c-tools support for SMBus-configured target ports Lakshay Piplani
2026-10-16 16:46 ` [RFC PATCH 3/7] dt-bindings: i3c: nxp,p3h2840: add clock-frequency for SMBus " Lakshay Piplani
2026-10-16 16:46 ` [RFC PATCH 4/7] i3c: hub: p3h2x4x: add clock-frequency DTS support Lakshay Piplani
2026-10-16 16:46 ` [RFC PATCH 5/7] dt-bindings: i3c: nxp,p3h2840: add GPIO mode target ports Lakshay Piplani
2026-10-16 16:46 ` [RFC PATCH 6/7] i3c: hub: p3h2x4x: configure target ports placed in GPIO mode Lakshay Piplani
2026-10-16 16:46 ` [RFC PATCH 7/7] gpio: p3h2x4x: add GPIO expander for the NXP P3H2x4x I3C hub Lakshay Piplani
2026-10-19  6:53   ` Uwe Kleine-König
2026-10-19 14:25   ` Lee Jones [this message]

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=20261019142555.GB2663669@google.com \
    --to=lee@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=aman.kumarpandey@nxp.com \
    --cc=brgl@kernel.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lakshay.piplani@nxp.com \
    --cc=lgirdwood@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=priyanka.jain@nxp.com \
    --cc=robh@kernel.org \
    --cc=vikash.bansal@nxp.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

all inboxes | Powered by JetHome®