GPIO and PINCTRL drivers question

Hi all, I'm looking for advice on properly implementing GPIO and PINCTRL drivers. My SoC provides the possibility to enable a pull-up/down resistor for specific GPIO. And drive strength for GPIO can have four possible states.
The question is, where should I implement this functionality?
I'm confused by dt-bindings/gpio/gpio.h because it has a few macros - GPIO_PULL_UP - GPIO_PULL_DOWN
Should I keep everything in the pinctrl driver? Or should I implement pull-up/down in GPIO driver to support these macros and Drive Strength in pinctrl driver?

Hi Oleh,
On Wed, 3 Aug 2022 at 05:11, Oleh Kravchenko oleg@kaa.org.ua wrote:
Hi all, I'm looking for advice on properly implementing GPIO and PINCTRL drivers. My SoC provides the possibility to enable a pull-up/down resistor for specific GPIO. And drive strength for GPIO can have four possible states.
The question is, where should I implement this functionality?
I'm confused by dt-bindings/gpio/gpio.h because it has a few macros
- GPIO_PULL_UP
- GPIO_PULL_DOWN
Should I keep everything in the pinctrl driver? Or should I implement pull-up/down in GPIO driver to support these macros and Drive Strength in pinctrl driver?
IMO the pinctrl should happen in the pinctrl driver. For pull-up/down you can make your GPIO driver call into the pinctrl driver to make the change. There are various approaches used in the tree, though.
Regards, Simon
participants (2)
-
Oleh Kravchenko
-
Simon Glass