diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-06-14 15:40:37 (GMT) |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2015-07-25 09:22:55 (GMT) |
commit | 71cbe0d681d4288d090a404273ce6b0c1c14b617 (patch) | |
tree | a603b63d897f5ab5b8be7031a143f2558e70c4af | |
parent | b41972e7d17fb920cc50db5b363209685b1251e5 (diff) | |
download | u-boot-71cbe0d681d4288d090a404273ce6b0c1c14b617.tar.xz |
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 <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
-rw-r--r-- | configs/Ippo_q8h_v1_2_a33_1024x600_defconfig | 1 | ||||
-rw-r--r-- | configs/Ippo_q8h_v1_2_defconfig | 1 | ||||
-rw-r--r-- | configs/Ippo_q8h_v5_defconfig | 1 | ||||
-rw-r--r-- | drivers/usb/musb-new/sunxi.c | 5 |
4 files changed, 8 insertions, 0 deletions
diff --git a/configs/Ippo_q8h_v1_2_a33_1024x600_defconfig b/configs/Ippo_q8h_v1_2_a33_1024x600_defconfig index 012a25b..fda7683 100644 --- a/configs/Ippo_q8h_v1_2_a33_1024x600_defconfig +++ b/configs/Ippo_q8h_v1_2_a33_1024x600_defconfig @@ -5,6 +5,7 @@ CONFIG_DRAM_CLK=480 CONFIG_DRAM_ZQ=15291 CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE" CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT" +CONFIG_USB0_ID_DET="PH8" CONFIG_AXP_GPIO=y CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:51000,le:159,ri:160,up:22,lo:12,hs:1,vs:1,sync:3,vmode:0" CONFIG_VIDEO_LCD_DCLK_PHASE=0 diff --git a/configs/Ippo_q8h_v1_2_defconfig b/configs/Ippo_q8h_v1_2_defconfig index 783467b..490cbe2 100644 --- a/configs/Ippo_q8h_v1_2_defconfig +++ b/configs/Ippo_q8h_v1_2_defconfig @@ -5,6 +5,7 @@ CONFIG_DRAM_CLK=432 CONFIG_DRAM_ZQ=63306 CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE" CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT" +CONFIG_USB0_ID_DET="PH8" CONFIG_AXP_GPIO=y CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:167,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0" CONFIG_VIDEO_LCD_DCLK_PHASE=0 diff --git a/configs/Ippo_q8h_v5_defconfig b/configs/Ippo_q8h_v5_defconfig index 29e3c89..aa1eb69 100644 --- a/configs/Ippo_q8h_v5_defconfig +++ b/configs/Ippo_q8h_v5_defconfig @@ -5,6 +5,7 @@ CONFIG_DRAM_CLK=480 CONFIG_DRAM_ZQ=63351 CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE" CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT" +CONFIG_USB0_ID_DET="PH8" CONFIG_AXP_GPIO=y CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:168,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0" CONFIG_VIDEO_LCD_DCLK_PHASE=0 diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c index ee018c7..cafb480 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 */ } |