[PATCH 5/8] gpio: mvebu_gpio: Add .request and .rfree methods for Armada 38x

Stefan Roese sr at denx.de
Thu Jul 28 08:28:30 CEST 2022


On 25.07.22 13:56, Pali Rohár wrote:
> To use particular pin GPIO, it needs to be first switched to GPIO by
> pinctrl. Use pinctrl_gpio_request() and pinctrl_gpio_free() for this
> purpose.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   drivers/gpio/mvebu_gpio.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpio/mvebu_gpio.c b/drivers/gpio/mvebu_gpio.c
> index 4c1c68ee19ed..888ccfe4d13e 100644
> --- a/drivers/gpio/mvebu_gpio.c
> +++ b/drivers/gpio/mvebu_gpio.c
> @@ -5,6 +5,7 @@
>   
>   #include <common.h>
>   #include <dm.h>
> +#include <dm/pinctrl.h>
>   #include <asm/gpio.h>
>   #include <asm/io.h>
>   #include <errno.h>
> @@ -99,6 +100,10 @@ static int mvebu_gpio_probe(struct udevice *dev)
>   }
>   
>   static const struct dm_gpio_ops mvebu_gpio_ops = {
> +#if CONFIG_IS_ENABLED(PINCTRL_ARMADA_38X)
> +	.request		= pinctrl_gpio_request,
> +	.rfree			= pinctrl_gpio_free,
> +#endif
>   	.direction_input	= mvebu_gpio_direction_input,
>   	.direction_output	= mvebu_gpio_direction_output,
>   	.get_function		= mvebu_gpio_get_function,

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list