mbox series

[00/10] ARM: pxa: use software nodes/properties for GPIOs

Message ID 20240628180852.1738922-1-dmitry.torokhov@gmail.com (mailing list archive)
Headers show
Series ARM: pxa: use software nodes/properties for GPIOs | expand

Message

Dmitry Torokhov June 28, 2024, 6:08 p.m. UTC
This series converts legacy pxa boards (spitz, gumstix) to use software
nodes/properties to describe various GPIOs instead of relying on GPIO
lookup tables. The benefit is that structure and behavior is closer to
DT-described GPIOs.

The very first patch ("ARM: spitz: fix GPIO assignment for backlight")
is actually a fix that IMO should be applied sooner rather than later,
the rest of patches are enhancements. The reason it is sent with the
rest of the series is that later changes contextually depend on it.

The last patch ("ARM: spitz: Use software nodes for the ADS7846
touchscreen") soft-depends on corresponding changes by Linus Walleij to
the ads7846 driver in input tree. It compiles without it, but the device
will not sync with display refreshes. I have created an immutable branch
(branched from v6.9) at:

git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git ib/ads7846-hsync

in case you wish to pull it in.

Regretfully it was only compiled as I do not have access to the relevant
hardware.

Dmitry Torokhov (8):
  ARM: spitz: fix GPIO assignment for backlight
  ARM: pxa: consolidate GPIO chip platform data
  ARM: pxa/gumstix: convert vbus gpio to use software nodes
  ARM: spitz: Simplify instantiating SPI controller
  ARM: spitz: Use software nodes to describe audio GPIOs
  ARM: spitz: Use software nodes to describe LCD GPIOs
  ARM: spitz: Use software nodes to describe MMC GPIOs
  ARM: spitz: Use software nodes to describe LED GPIOs

Linus Walleij (2):
  ARM: spitz: Use software nodes to describe SPI CS lines
  ARM: spitz: Use software nodes for the ADS7846 touchscreen

 arch/arm/mach-pxa/devices.c              |  53 +++--
 arch/arm/mach-pxa/devices.h              |   5 +-
 arch/arm/mach-pxa/gumstix.c              |  24 +-
 arch/arm/mach-pxa/pxa25x.c               |   8 +-
 arch/arm/mach-pxa/pxa27x.c               |   9 +-
 arch/arm/mach-pxa/spitz.c                | 284 ++++++++++++-----------
 include/linux/platform_data/mmc-pxamci.h |   4 +-
 7 files changed, 208 insertions(+), 179 deletions(-)

Thanks.

Comments

Arnd Bergmann June 28, 2024, 8:59 p.m. UTC | #1
On Fri, Jun 28, 2024, at 20:08, Dmitry Torokhov wrote:
> This series converts legacy pxa boards (spitz, gumstix) to use software
> nodes/properties to describe various GPIOs instead of relying on GPIO
> lookup tables. The benefit is that structure and behavior is closer to
> DT-described GPIOs.
>
> The very first patch ("ARM: spitz: fix GPIO assignment for backlight")
> is actually a fix that IMO should be applied sooner rather than later,
> the rest of patches are enhancements. The reason it is sent with the
> rest of the series is that later changes contextually depend on it.
>
> The last patch ("ARM: spitz: Use software nodes for the ADS7846
> touchscreen") soft-depends on corresponding changes by Linus Walleij to
> the ads7846 driver in input tree. It compiles without it, but the device
> will not sync with display refreshes. I have created an immutable branch
> (branched from v6.9) at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git ib/ads7846-hsync
>
> in case you wish to pull it in.
>
> Regretfully it was only compiled as I do not have access to the relevant
> hardware.

Hi Dmitry,

I'm happy to pull these in directly, hopefully with some extra
review or ack from the maintainers. If there are no negative
comments, feel free to resend them to soc@kernel.org for me
to pick up.

Is your goal to of the series to eventually convert all
gpio descriptors over to software nodes, or are you working
towards converting all of mach-pxa to DT?

In the latter case, note that the reason we kept these
specific board files is that they have reasonable support in
qemu and you can probably figure out how to test them if you
try hard enough. I have not tried myself though, and there is
a high chance that current kernels won't boot without extra
fixes.

If your goal is to change all board files to software nodes,
I think we should take a step back, since most of those boards
are likely to get removed anyway. Two years ago, I removed
almost 90% of the board files remaining at the time after
showing that they were pretty much all unused. I kept the
ones that either had known users, or that someone wanted to
keep for some reason and work on doing the DT conversion.
For most of these (including PXA), there has been no work
on this in the past two years, so I think we should ask the
same question again and see which ones we can just remove
this time.

      Arnd
Arnd Bergmann June 28, 2024, 9:08 p.m. UTC | #2
On Fri, Jun 28, 2024, at 22:59, Arnd Bergmann wrote:
> I'm happy to pull these in directly, hopefully with some extra
> review or ack from the maintainers. If there are no negative
> comments, feel free to resend them to soc@kernel.org for me
> to pick up.

I just saw that you did in fact send it to soc@kernel.org
already. I'll wait for comments then and just merge it
if nobody has any objections.

      Arnd
Dmitry Torokhov June 28, 2024, 9:44 p.m. UTC | #3
Hi Arnd,

On Fri, Jun 28, 2024 at 10:59:53PM +0200, Arnd Bergmann wrote:
> On Fri, Jun 28, 2024, at 20:08, Dmitry Torokhov wrote:
> > This series converts legacy pxa boards (spitz, gumstix) to use software
> > nodes/properties to describe various GPIOs instead of relying on GPIO
> > lookup tables. The benefit is that structure and behavior is closer to
> > DT-described GPIOs.
> >
> > The very first patch ("ARM: spitz: fix GPIO assignment for backlight")
> > is actually a fix that IMO should be applied sooner rather than later,
> > the rest of patches are enhancements. The reason it is sent with the
> > rest of the series is that later changes contextually depend on it.
> >
> > The last patch ("ARM: spitz: Use software nodes for the ADS7846
> > touchscreen") soft-depends on corresponding changes by Linus Walleij to
> > the ads7846 driver in input tree. It compiles without it, but the device
> > will not sync with display refreshes. I have created an immutable branch
> > (branched from v6.9) at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git ib/ads7846-hsync
> >
> > in case you wish to pull it in.
> >
> > Regretfully it was only compiled as I do not have access to the relevant
> > hardware.
> 
> Hi Dmitry,
> 
> I'm happy to pull these in directly, hopefully with some extra
> review or ack from the maintainers. If there are no negative
> comments, feel free to resend them to soc@kernel.org for me
> to pick up.
> 
> Is your goal to of the series to eventually convert all
> gpio descriptors over to software nodes, or are you working
> towards converting all of mach-pxa to DT?
> 
> In the latter case, note that the reason we kept these
> specific board files is that they have reasonable support in
> qemu and you can probably figure out how to test them if you
> try hard enough. I have not tried myself though, and there is
> a high chance that current kernels won't boot without extra
> fixes.
> 
> If your goal is to change all board files to software nodes,
> I think we should take a step back, since most of those boards
> are likely to get removed anyway. Two years ago, I removed
> almost 90% of the board files remaining at the time after
> showing that they were pretty much all unused. I kept the
> ones that either had known users, or that someone wanted to
> keep for some reason and work on doing the DT conversion.
> For most of these (including PXA), there has been no work
> on this in the past two years, so I think we should ask the
> same question again and see which ones we can just remove
> this time.

I would like to eventually switch everything to the software
nodes/property entries. The GPIO lookup tables were introduced before we
had software nodes and were really convenient way to describe GPIOs on
non-ACPI non-DT boards. However now that we have software
nodes/properties we can move away from both custom platform data and
lookup tables in the board code and remove platform data support from
the drivers, unifying the driver behavior.

I am not in any rush with this, so if some boards are on a cutting block
I am happy to wait. I started poking at Spitz and the rest of mach-pxa
because Linus W sent out a patch to ads7846 ;) and I also remembered
that you already dropped bunch of PXA boards that were no longer
relevant so I assumed spitz and gumstix still have some use.

Could you tell me which ones are likely to stay vs ones that might go? I
think arch/arm/mach-s3c/mach-crag* is staying? jornada720?

Thanks.
Arnd Bergmann June 29, 2024, 7:34 a.m. UTC | #4
On Fri, Jun 28, 2024, at 23:44, Dmitry Torokhov wrote:
> I would like to eventually switch everything to the software
> nodes/property entries. The GPIO lookup tables were introduced before we
> had software nodes and were really convenient way to describe GPIOs on
> non-ACPI non-DT boards. However now that we have software
> nodes/properties we can move away from both custom platform data and
> lookup tables in the board code and remove platform data support from
> the drivers, unifying the driver behavior.

Right, makes sense.

> I am not in any rush with this, so if some boards are on a cutting block
> I am happy to wait. I started poking at Spitz and the rest of mach-pxa
> because Linus W sent out a patch to ads7846 ;) and I also remembered
> that you already dropped bunch of PXA boards that were no longer
> relevant so I assumed spitz and gumstix still have some use.
>
> Could you tell me which ones are likely to stay vs ones that might go? I
> think arch/arm/mach-s3c/mach-crag* is staying? jornada720?

I think in the long run all of them will either get removed
or converted to DT, though it looks like the DT conversion has
not picked up for anything other than ep93xx.

For the timeline, I need to ask the same people again that
wanted the board files to stay two years ago. omap1 might be
a good one to prioritize for software nodes, as that likely
still has users and it would help getting closer to a DT
version.

     Arnd
Linus Walleij June 30, 2024, 8:07 a.m. UTC | #5
On Fri, Jun 28, 2024 at 8:09 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:

> This series converts legacy pxa boards (spitz, gumstix) to use software
> nodes/properties to describe various GPIOs instead of relying on GPIO
> lookup tables. The benefit is that structure and behavior is closer to
> DT-described GPIOs.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
for the patches I didn't write myself.

What this really needs is testing... :/

If nobody is testing, I think you should just send a pull request
to soc@kernel.org and users can find out the hard way and help
fixing regressions. It's a bit hopeless to work on this sometimes.

Yours,
Linus Walleij
Arnd Bergmann June 30, 2024, 8:41 a.m. UTC | #6
On Sun, Jun 30, 2024, at 10:07, Linus Walleij wrote:
> On Fri, Jun 28, 2024 at 8:09 PM Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
>
>> This series converts legacy pxa boards (spitz, gumstix) to use software
>> nodes/properties to describe various GPIOs instead of relying on GPIO
>> lookup tables. The benefit is that structure and behavior is closer to
>> DT-described GPIOs.
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> for the patches I didn't write myself.

Thanks for the review!

> What this really needs is testing... :/
>
> If nobody is testing, I think you should just send a pull request
> to soc@kernel.org and users can find out the hard way and help
> fixing regressions. It's a bit hopeless to work on this sometimes.

No need, the patches are already in my patchwork queue and I
will just apply them directly.

       Arnd
patchwork-bot+linux-soc@kernel.org July 9, 2024, 1:50 p.m. UTC | #7
Hello:

This series was applied to soc/soc.git (for-next)
by Arnd Bergmann <arnd@arndb.de>:

On Fri, 28 Jun 2024 11:08:40 -0700 you wrote:
> This series converts legacy pxa boards (spitz, gumstix) to use software
> nodes/properties to describe various GPIOs instead of relying on GPIO
> lookup tables. The benefit is that structure and behavior is closer to
> DT-described GPIOs.
> 
> The very first patch ("ARM: spitz: fix GPIO assignment for backlight")
> is actually a fix that IMO should be applied sooner rather than later,
> the rest of patches are enhancements. The reason it is sent with the
> rest of the series is that later changes contextually depend on it.
> 
> [...]

Here is the summary with links:
  - [01/10] ARM: spitz: fix GPIO assignment for backlight
    https://git.kernel.org/soc/soc/c/78ab3d352f29
  - [02/10] ARM: pxa: consolidate GPIO chip platform data
    https://git.kernel.org/soc/soc/c/917195d6f829
  - [03/10] ARM: pxa/gumstix: convert vbus gpio to use software nodes
    https://git.kernel.org/soc/soc/c/f1d6588af93b
  - [04/10] ARM: spitz: Simplify instantiating SPI controller
    https://git.kernel.org/soc/soc/c/6eabaf9d6e2a
  - [05/10] ARM: spitz: Use software nodes to describe SPI CS lines
    https://git.kernel.org/soc/soc/c/224b9329fb9f
  - [06/10] ARM: spitz: Use software nodes to describe audio GPIOs
    https://git.kernel.org/soc/soc/c/9d91c7c39e3c
  - [07/10] ARM: spitz: Use software nodes to describe LCD GPIOs
    https://git.kernel.org/soc/soc/c/1447c7df3820
  - [08/10] ARM: spitz: Use software nodes to describe MMC GPIOs
    https://git.kernel.org/soc/soc/c/444b89875fc0
  - [09/10] ARM: spitz: Use software nodes to describe LED GPIOs
    https://git.kernel.org/soc/soc/c/29c4e69f8e12
  - [10/10] ARM: spitz: Use software nodes for the ADS7846 touchscreen
    https://git.kernel.org/soc/soc/c/38b2482a27c8

You are awesome, thank you!