]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
phy-sun4i-usb: Only check vbus-det on power-on on boards with vbus-det
authorHans de Goede <hdegoede@redhat.com>
Fri, 31 Jul 2015 08:01:42 +0000 (10:01 +0200)
committerKishon Vijay Abraham I <kishon@ti.com>
Mon, 3 Aug 2015 13:05:08 +0000 (18:35 +0530)
data->vbus_det is always 1 on boards without a (working) vbus-det, skip
the vbus_det test on such boards.

This fixes the sun4i usb phy code never turning on Vbus on such boards.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-sun4i-usb.c

index 27ae89e0d3ca07679367fdc25dcb988e552ad7b7..e2eb688d82f5addeebaee52eb07e93e38a35034f 100644 (file)
@@ -328,7 +328,8 @@ static int sun4i_usb_phy_power_on(struct phy *_phy)
                return 0;
 
        /* For phy0 only turn on Vbus if we don't have an ext. Vbus */
-       if (phy->index == 0 && data->vbus_det)
+       if (phy->index == 0 && sun4i_usb_phy0_have_vbus_det(data) &&
+                               data->vbus_det)
                return 0;
 
        ret = regulator_enable(phy->vbus);