mbox series

[V2,0/6] pinctrl: support platform (e.g. DT) stored pins, groups & functions

Message ID 20211124230439.17531-1-zajec5@gmail.com (mailing list archive)
Headers show
Series pinctrl: support platform (e.g. DT) stored pins, groups & functions | expand

Message

Rafał Miłecki Nov. 24, 2021, 11:04 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

Two weeks ago I sent
[PATCH RFC] dt-bindings: pinctrl: support specifying pins
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20211110231436.8866-1-zajec5@gmail.com/

and week ago I sent
[PATCH 0/5] pinctrl: allow storing pins, groups & functions in DT
https://patchwork.ozlabs.org/project/linux-gpio/list/?series=272685

Initially I planned to allow putting some pinctrl hw details in DT and
later that evolved into a slightly more generic API.

Again:
Please note it's about describing hardware elements and not actual
programming way. It may be used with pinctrl-single.c one day but it's
designed as a generic solution for data.

Patches 1-5 are for linux-pinctrl.git. Patch 6 I found worth including
as DT big example. It can go through Linus with Florian's Ack or I can
send it to Florian later.

Rafał Miłecki (6):
  dt-bindings: pinctrl: support specifying pins, groups & functions
  dt-bindings: pinctrl: brcm,ns-pinmux: extend example
  pinctrl: prepare API for reading pins, groups & functions
  pinctrl: support reading pins, groups & functions from DT
  pinctrl: bcm: pinctrl-ns: supoprt DT specified pins, groups &
    functions
  ARM: dts: BCM5301X: add pinctrl pins, groups & functions

 .../bindings/pinctrl/brcm,ns-pinmux.yaml      |  24 +++-
 .../devicetree/bindings/pinctrl/pinctrl.yaml  |  40 ++++++
 arch/arm/boot/dts/bcm4709.dtsi                |  67 +++++++++
 arch/arm/boot/dts/bcm47094.dtsi               |  11 +-
 arch/arm/boot/dts/bcm5301x.dtsi               | 109 +++++++++++++++
 drivers/pinctrl/bcm/pinctrl-ns.c              |  90 ++++++++----
 drivers/pinctrl/core.c                        |  18 +++
 drivers/pinctrl/core.h                        |   4 +
 drivers/pinctrl/devicetree.c                  | 131 ++++++++++++++++++
 drivers/pinctrl/devicetree.h                  |  29 ++++
 drivers/pinctrl/pinmux.c                      |  10 ++
 drivers/pinctrl/pinmux.h                      |   2 +
 12 files changed, 494 insertions(+), 41 deletions(-)

Comments

Andy Shevchenko Nov. 25, 2021, 9:58 a.m. UTC | #1
On Thu, Nov 25, 2021 at 1:04 AM Rafał Miłecki <zajec5@gmail.com> wrote:
>
> From: Rafał Miłecki <rafal@milecki.pl>
>
> Two weeks ago I sent
> [PATCH RFC] dt-bindings: pinctrl: support specifying pins
> https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20211110231436.8866-1-zajec5@gmail.com/
>
> and week ago I sent
> [PATCH 0/5] pinctrl: allow storing pins, groups & functions in DT
> https://patchwork.ozlabs.org/project/linux-gpio/list/?series=272685
>
> Initially I planned to allow putting some pinctrl hw details in DT and
> later that evolved into a slightly more generic API.
>
> Again:
> Please note it's about describing hardware elements and not actual
> programming way. It may be used with pinctrl-single.c one day but it's
> designed as a generic solution for data.
>
> Patches 1-5 are for linux-pinctrl.git. Patch 6 I found worth including
> as DT big example. It can go through Linus with Florian's Ack or I can
> send it to Florian later.

Thank you for an update! What I would like to see in the cover letter
and esp. in the updated documentation of the pin control subsystem is
the architectural (design) point of view. There is no sense to discuss
the following patches without a big picture. For example, should we
allow some of the DT information to be passed on ACPI based platforms
(due to OF related enumeration of the devices in ACPI environment, see
PRP0001 for the details)? Or i.o.w. Do all these properties make sense
only in the realm of the provider? I believe it's true for pin
controller devices and false for consumer devices, so, the question
is, does pin controller device support any type of hogs or it's only
property of GPIO? It's all not clear to me with this cover letter and
absence of the documentation.

Besides that, consider test cases to be added (OF has its unittest
built-in into the kernel).
Rafał Miłecki Dec. 9, 2021, 2:30 p.m. UTC | #2
On 25.11.2021 10:58, Andy Shevchenko wrote:
> Besides that, consider test cases to be added (OF has its unittest
> built-in into the kernel).

I'm confused here. We indeed have drivers/of/unittest.c but that seems
to cover in-kernel DT API. All kind of of_*() helper functions.

What I add is a simple binding support. I don't extend kernel API. What
possibly should I add to unit tests?