[U-Boot] [PATCH v2 2/5] dm: video: bridge: don't fail to activate bridge if reset or sleep GPIO is missing

André Przywara andre.przywara at arm.com
Thu Oct 18 00:22:20 UTC 2018


On 10/17/18 6:09 AM, Vasily Khoruzhick wrote:
> Both GPIOs are optional, so we shouldn't fail if any is missing. Without
> this fix reset is not deasserted when sleep GPIO is missing.
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>

That looks much better now, thanks.
One small thing:

> ---
>  drivers/video/bridge/video-bridge-uclass.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/bridge/video-bridge-uclass.c b/drivers/video/bridge/video-bridge-uclass.c
> index cd4959cc71..7542097769 100644
> --- a/drivers/video/bridge/video-bridge-uclass.c
> +++ b/drivers/video/bridge/video-bridge-uclass.c
> @@ -109,10 +109,16 @@ int video_bridge_set_active(struct udevice *dev, bool active)
>  	int ret;

This needs to be initialised now.

Cheers,
Andre.

>  
>  	debug("%s: %d\n", __func__, active);
> -	ret = dm_gpio_set_value(&uc_priv->sleep, !active);
> -	if (ret)
> -		return ret;
> -	if (active) {
> +	if (uc_priv->sleep.dev) {
> +		ret = dm_gpio_set_value(&uc_priv->sleep, !active);
> +		if (ret)
> +			return ret;
> +	}
> +
> +	if (!active)
> +		return 0;
> +
> +	if (uc_priv->reset.dev) {
>  		ret = dm_gpio_set_value(&uc_priv->reset, true);
>  		if (ret)
>  			return ret;
> 



More information about the U-Boot mailing list