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 <[email protected]>

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
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to