[PATCH 4/4] mmc: sunxi: Use DM_GPIO flags to set pull-up

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Fri Nov 5 16:52:07 CET 2021


On 10/21/21 06:52, Samuel Holland wrote:
> Now that the sunxi_gpio driver handles pull-up/down via the driver
> model, pin configuration does not need a platform-specific function.
> 
> Signed-off-by: Samuel Holland <samuel at sholland.org>

I tested on an OrangePi PC (orangepi_pc_defconfig). The 'mmc rescan' 
command detects correctly if an SD-card is present with this series applied.

Tested-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>

> ---
> 
>   drivers/mmc/sunxi_mmc.c | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
> index c170c16d5a..955b29826f 100644
> --- a/drivers/mmc/sunxi_mmc.c
> +++ b/drivers/mmc/sunxi_mmc.c
> @@ -700,12 +700,8 @@ static int sunxi_mmc_probe(struct udevice *dev)
>   		return ret;
>   
>   	/* This GPIO is optional */
> -	if (!gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio,
> -				  GPIOD_IS_IN)) {
> -		int cd_pin = gpio_get_number(&priv->cd_gpio);
> -
> -		sunxi_gpio_set_pull(cd_pin, SUNXI_GPIO_PULL_UP);
> -	}
> +	gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio,
> +			     GPIOD_IS_IN | GPIOD_PULL_UP);
>   
>   	upriv->mmc = &plat->mmc;
>   
> 



More information about the U-Boot mailing list