linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Ranostay <mranostay@ti.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Michael Walle <michael@walle.cc>, <brgl@bgdev.pl>,
	<lee@kernel.org>, <kristo@kernel.org>,
	<alexandre.belloni@bootlin.com>, <a.zummo@towertech.it>,
	<krzysztof.kozlowski+dt@linaro.org>, <robh@kernel.org>,
	<vigneshr@ti.com>, <linux-arm-kernel@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <linux-rtc@vger.kernel.org>,
	<linux-gpio@vger.kernel.org>, Keerthy <j-keerthy@ti.com>
Subject: Re: [PATCH v3 4/7] gpio: tps6594x: add GPIO support for TPS6594x PMIC
Date: Fri, 11 Nov 2022 00:58:32 -0800	[thread overview]
Message-ID: <Y24OuHmXCV/5HuEY@ubuntu> (raw)
In-Reply-To: <CACRpkdZOR4Hcyv=bO7=rJERJK7JbCoS0_dvWj0K=YZC6Nsozdw@mail.gmail.com>

On Thu, Nov 10, 2022 at 11:15:22AM +0100, Linus Walleij wrote:
> On Thu, Nov 10, 2022 at 11:12 AM Matt Ranostay <mranostay@ti.com> wrote:
> > On Wed, Nov 09, 2022 at 10:59:08AM +0100, Linus Walleij wrote:
> > > On Wed, Nov 9, 2022 at 7:56 AM Matt Ranostay <mranostay@ti.com> wrote:
> > >
> > > > Add support for TPS6594X PMICs GPIO interface that has 11 that can be
> > > > configured as input or outputs.
> > > >
> > > > Tested-by: Keerthy <j-keerthy@ti.com>
> > > > Signed-off-by: Matt Ranostay <mranostay@ti.com>
> > >
> > > (...)
> > > > +config GPIO_TPS6594X
> > > > +       tristate "TI TPS6594X GPIO driver"
> > > > +       depends on MFD_TPS6594X
> > > > +       help
> > > > +         Select this option to enable GPIO driver for the TPS6954X
> > > > +         PMIC chip family. There are 11 GPIOs that can be configured.
> > >
> > > select GPIO_REGMAP
> > >
> > > This driver is an archetypical example of a driver that can make great
> > > use of GPIO_REGMAP helpers, so rewrite it to use them.
> > > Look in drivers/gpio/gpio-sl28cpld.c for an example.
> >
> > Linus,
> >
> > Those helpers look great for this usecase on the surface but however I think there could be some issues.
> > For GPIO direction it isn't configured by a bitmap on a register(s) but by a bit on a range of
> > registers (with a register for each GPIOx).
> >
> > For set/get values the gpio helper would work though.
> 
> Isn't is possible to just use parts of the GPIO_REGMAP
> helpers? I thought it's designed like such.
> 
> Michael Walle will know what to do with your usecase, and
> whether to use it or not, let's page him!
>

So after looking around a bit and digging into the helper code I found this
drivers/pinctrl/bcm/pinctrl-bcm63xx.c which has a example on how to override
the reg_mask_xlate function which could be used for changing the stride, and mask
based on the base address.

Currently have coded up using the gpio regmap helper. Will run through some testing
first and then submit for review.

- Matt

> Yours,
> Linus Walleij

  reply	other threads:[~2022-11-11  9:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09  6:55 [PATCH v3 0/7] mfd: add tps6594x support for Jacinto platforms Matt Ranostay
2022-11-09  6:55 ` [PATCH v3 1/7] Documentation: tps6594x: Add DT bindings for the TPS6594x PMIC Matt Ranostay
2022-11-09  8:46   ` Krzysztof Kozlowski
2022-11-09  6:55 ` [PATCH v3 2/7] MFD: TPS6594x: Add new PMIC device driver for TPS6594x chips Matt Ranostay
2022-11-09  8:52   ` Krzysztof Kozlowski
2022-11-09  6:55 ` [PATCH v3 3/7] rtc: rtc-tps6594x: Add support for TPS6594X PMIC RTC Matt Ranostay
2022-11-09  8:49   ` Krzysztof Kozlowski
2022-11-14 20:48   ` Alexandre Belloni
2022-11-09  6:55 ` [PATCH v3 4/7] gpio: tps6594x: add GPIO support for TPS6594x PMIC Matt Ranostay
2022-11-09  8:50   ` Krzysztof Kozlowski
2022-11-09  9:59   ` Linus Walleij
2022-11-10 10:12     ` Matt Ranostay
2022-11-10 10:15       ` Linus Walleij
2022-11-11  8:58         ` Matt Ranostay [this message]
2022-11-16  7:31           ` Michael Walle
2022-11-09  6:55 ` [PATCH v3 5/7] arm64: dts: ti: k3-j7200-common-proc-board: Add TPS6594x PMIC node Matt Ranostay
2022-11-09  8:52   ` Krzysztof Kozlowski
2022-11-09  6:55 ` [PATCH v3 6/7] arm64: dts: ti: k3-j721e-common-proc-board: " Matt Ranostay
2022-11-09  8:52   ` Krzysztof Kozlowski
2022-11-09  6:55 ` [PATCH v3 7/7] arm64: dts: ti: k3-j721s2-common-proc-board: " Matt Ranostay
2022-11-09  8:52   ` Krzysztof Kozlowski

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=Y24OuHmXCV/5HuEY@ubuntu \
    --to=mranostay@ti.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=brgl@bgdev.pl \
    --cc=devicetree@vger.kernel.org \
    --cc=j-keerthy@ti.com \
    --cc=kristo@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=robh@kernel.org \
    --cc=vigneshr@ti.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;
as well as URLs for NNTP newsgroup(s).