]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sunxi: musb: Add id pin support
authorHans de Goede <hdegoede@redhat.com>
Sun, 14 Jun 2015 15:40:37 +0000 (17:40 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sat, 25 Jul 2015 09:22:55 +0000 (11:22 +0200)
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>
configs/Ippo_q8h_v1_2_a33_1024x600_defconfig
configs/Ippo_q8h_v1_2_defconfig
configs/Ippo_q8h_v5_defconfig
drivers/usb/musb-new/sunxi.c

index 012a25bc671253ee5b3816995f7f9261b000451b..fda7683a7b8b0ed35518fdb213214a0734ec86ca 100644 (file)
@@ -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
index 783467b8981b937bb88308f5836883131fbaad6b..490cbe2be8e2c2cf7b37da16a43ddea45007de8b 100644 (file)
@@ -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
index 29e3c8951051203f0b36507f4d9e5cd37f2cb057..aa1eb691e70f14198d5b55a487e6a0d25356f00b 100644 (file)
@@ -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
index ee018c7e6e76751248962430f54bf8bec59b8d80..cafb48039e3a6a5aa0f40996591f10dd4b2faa0c 100644 (file)
@@ -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 */
        }