[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <db13664e-f01a-5492-942b-f021f1bbe4e2@gmail.com>
Date: Mon, 6 Jan 2020 17:34:24 -0600
From: Frank Rowand <frowand.list@...il.com>
To: Geert Uytterhoeven <geert+renesas@...der.be>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Pantelis Antoniou <pantelis.antoniou@...sulko.com>,
Rob Herring <robh+dt@...nel.org>
Cc: Peter Ujfalusi <peter.ujfalusi@...com>,
Chris Brandt <chris.brandt@...esas.com>,
linux-gpio@...r.kernel.org, devicetree@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH/RFC 0/2] gpio: of: Add DT overlay support for GPIO hogs
On 12/30/19 7:38 AM, Geert Uytterhoeven wrote:
> Hi all,
>
> As GPIO hogs are configured at GPIO controller initialization time,
> adding/removing GPIO hogs in Device Tree overlays currently does not
> work. Hence this patch series adds support for that, by registering an
> of_reconfig notifier, as is already done for platform, i2c, and SPI
> devices.
>
> Perhaps this would be better served through a pinctrl-gpio driver?
> Pinctrl is already working fine with DT overlays, as the pinctrl-*
> properties are part of the slave device node, and thus looked up at
> slave device node attachment time, not at pin controller initialization
> time.
>
> In my particular use case (talking to SPI devices connected to a PMOD
> connector on the RSK+RZA1 development board), the GPIO performs board
> level muxing of a.o. the SPI MOSI/MISO/SCK signals. Hence the hog
> really needs to be active only while talking to the SPI device, so the
> muxing could (in theory) be done upon demand.
> But how to describe that in DT, and implement it (using Runtime PM?)?
I'm trying to understand the use case. I can easily imagine two cases:
(1) want to configure the GPIO to be able to use the SPI bus sometimes,
but configure the GPIO differently when not using the SPI bus
(2) want to describe a device on the SPI bus in an overlay, thus
also needing to describe the associate gpio hog node in the
same overlay
For use case (2), the proposed patch seems to be a good solution.
For use case (1), this is a case of trying to use devicetree as a
way to control configuration instead of describing the hardware.
In this case, Bartosz' reply may indicate the way forward.
I'll assume use case (2) for patch comments.
>
> Thanks for your comments!
>
> Geert Uytterhoeven (2):
> gpio: of: Extract of_gpiochip_add_hog()
> gpio: of: Add DT overlay support for GPIO hogs
>
> drivers/gpio/gpiolib-of.c | 133 +++++++++++++++++++++++++++++++++-----
> drivers/gpio/gpiolib-of.h | 2 +
> drivers/gpio/gpiolib.c | 14 +++-
> drivers/gpio/gpiolib.h | 3 +
> 4 files changed, 133 insertions(+), 19 deletions(-)
>
Powered by blists - more mailing lists