linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/4] gpio: add SCMI pinctrl based driver
@ 2023-10-02  2:15 AKASHI Takahiro
  2023-10-02  2:15 ` [RFC 1/4] pinctrl: define PIN_CONFIG_INPUT AKASHI Takahiro
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: AKASHI Takahiro @ 2023-10-02  2:15 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, linus.walleij
  Cc: Oleksii_Moisieiev, linux-arm-kernel, devicetree, linux-kernel,
	linux-gpio, AKASHI Takahiro

I'm currently working on implementing SCMI pinctrl/gpio drivers
on U-Boot[1]. Although the pinctrl driver for the kernel[2] was submitted
by EPAM, it doesn't contain the gpio driver and I believe that we should
discuss a couple of points on the kernel side to finalize my design for
U-Boot. 

So this RFC is intended for reviews, especially to raise some issues.
(Please note that I have *never* tested the code because I don't have
any real hardware to test SCMI on it.)

1) how to obtain a value on an input pin
   All the existing gpio drivers are set to obtain a value on an input
   pin by accessing the hardware directly. In SCMI case, however, this is
   just impossible in its nature and must be supported via a protocol
   using "Input-value" configuration type. (See the spec[3], table-23.)

   The current pinconf framework is missing the feature (the pinconf
   parameter and a helper function). See patch#1 and #2.

   Please note that there is an issue around the pin configuration in
   EPAM's current pinctrl driver as I commented[4].

2) DT bindings
   I would like to propose a generic binding for SCMI pinctrl based
   gpio driver. This allows a "consumer" driver to handle gpio input pins
   like as other normal gpio controllers provide. (patch#4)

3) generic GPIO driver
   Based on (2), I tried to prototype a generic driver in patch#3.
   As you can see, there is no SCMI-specific line of code as a set of
   existing helper functions, except (1), seem to be enough to implement
   required interfaces.
   So I'm not sure whether the driver should has a "compatibles" property
   of "arm,scmi-gpio-generic".

I will appreciate any comments.

-Takahiro Akashi

[1] https://lists.denx.de/pipermail/u-boot/2023-September/529765.html
[2] https://lkml.iu.edu/hypermail/linux/kernel/2308.1/01082.html
[3] https://developer.arm.com/documentation/den0056/
[4] https://lkml.iu.edu/hypermail/linux/kernel/2308.2/07483.html

AKASHI Takahiro (4):
  pinctrl: define PIN_CONFIG_INPUT
  pinctrl: add pinctrl_gpio_get_config()
  gpio: scmi: add SCMI pinctrl based gpio driver
  dt-bindings: gpio: Add bindings for SCMI pinctrl based gpio

 .../bindings/gpio/arm,scmi-gpio.yaml          |  71 ++++++++
 drivers/gpio/Kconfig                          |   8 +
 drivers/gpio/Makefile                         |   1 +
 drivers/gpio/gpio-scmi.c                      | 154 ++++++++++++++++++
 drivers/pinctrl/core.c                        |  19 +++
 include/linux/pinctrl/consumer.h              |   8 +
 include/linux/pinctrl/pinconf-generic.h       |   3 +
 7 files changed, 264 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/arm,scmi-gpio.yaml
 create mode 100644 drivers/gpio/gpio-scmi.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-10-05  2:42 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-02  2:15 [RFC 0/4] gpio: add SCMI pinctrl based driver AKASHI Takahiro
2023-10-02  2:15 ` [RFC 1/4] pinctrl: define PIN_CONFIG_INPUT AKASHI Takahiro
2023-10-03 20:49   ` Linus Walleij
2023-10-04  6:54     ` AKASHI Takahiro
2023-10-02  2:16 ` [RFC 2/4] pinctrl: add pinctrl_gpio_get_config() AKASHI Takahiro
2023-10-03 20:52   ` Linus Walleij
2023-10-02  2:16 ` [RFC 3/4] gpio: scmi: add SCMI pinctrl based gpio driver AKASHI Takahiro
2023-10-03 21:35   ` Linus Walleij
2023-10-04  6:53     ` AKASHI Takahiro
2023-10-04  8:35       ` Linus Walleij
2023-10-05  2:42         ` AKASHI Takahiro
2023-10-02  2:16 ` [RFC 4/4] dt-bindings: gpio: Add bindings for SCMI pinctrl based gpio AKASHI Takahiro
2023-10-02  3:25   ` Rob Herring
2023-10-02 14:41   ` Rob Herring
2023-10-02 14:58     ` Cristian Marussi
2023-10-03  1:34       ` AKASHI Takahiro
2023-10-03  0:41     ` AKASHI Takahiro
2023-10-03  8:43       ` Krzysztof Kozlowski
2023-10-03 13:16   ` Linus Walleij
2023-10-04  7:08     ` AKASHI Takahiro

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).