GPIO and PINCTRL drivers question

Simon Glass sjg at chromium.org
Wed Aug 3 20:13:51 CEST 2022


Hi Oleh,

On Wed, 3 Aug 2022 at 05:11, Oleh Kravchenko <oleg at 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


More information about the U-Boot mailing list