From 71cbe0d681d4288d090a404273ce6b0c1c14b617 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 14 Jun 2015 17:40:37 +0200 Subject: sunxi: musb: Add id pin support When in host mode check if there is a host cable inserted into the otg port by checking the id pin. If there is no host cable return an error to make usb_lowlevel_init() exit early, rather then waiting for 1 second for a device which will never show up. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- drivers/usb/musb-new/sunxi.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/usb/musb-new') diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c index ee018c7e6e..cafb48039e 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -217,6 +217,11 @@ static int sunxi_musb_enable(struct musb *musb) printf("A charger is plugged into the OTG: "); return -ENODEV; } + ret = sunxi_usb_phy_id_detect(0); + if (ret == 1) { + printf("No host cable detected: "); + return -ENODEV; + } sunxi_usb_phy_power_on(0); /* port power on */ } -- cgit v1.2.3