[U-Boot] [PATCH v2] colibri_vf: Add board_usb_phy_mode function

Marek Vasut marex at denx.de
Thu Oct 29 18:25:16 CET 2015


On Thursday, October 29, 2015 at 11:15:24 AM, Sanchayan Maity wrote:
> Add board_usb_phy_mode function for detecting whether a port is
> being used as host or client using a GPIO. On Colibri Vybrid we
> provide the GPIO 102 for this very same purpose.
> 
> Signed-off-by: Sanchayan Maity <maitysanchayan at gmail.com>

Hi!

[...]

> @@ -554,4 +559,19 @@ int board_ehci_hcd_init(int port)
>  	}
>  	return 0;
>  }
> +
> +int board_usb_phy_mode(int port)
> +{
> +	switch (port) {
> +	case 0:
> +		return gpio_get_value(USB_CDET_GPIO);
> +		break;
> +	case 1:
> +		return 0;

This should return USB_INIT_DEVICE or USB_INIT_HOST .

> +		break;
> +	default:
> +		return 0;
> +		break;
> +	}
> +}
>  #endif

Best regards,
Marek Vasut


More information about the U-Boot mailing list