]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sunxi: musb: Stop treating not having a vbus-det gpio as an error
authorHans de Goede <hdegoede@redhat.com>
Thu, 18 Jun 2015 16:21:33 +0000 (18:21 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:49:06 +0000 (13:49 +0200)
On some boards the otg is wired up in host-only mode in this case we
have no vbus-det gpio.

Stop logging an error from sunxi_usb_phy_vbus_detect() in this case, and
stop treating sunxi_usb_phy_vbus_detect() returning a negative errno, as
if a charger is plugged into the otg port.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
arch/arm/cpu/armv7/sunxi/usb_phy.c
drivers/usb/musb-new/sunxi.c

index 5e82ddc505d9aeff628ff7db3ecee47a55e069a6..4d63a7449d7ced3becdd4348054047cdb5e6a9cf 100644 (file)
@@ -237,10 +237,8 @@ int sunxi_usb_phy_vbus_detect(int index)
        struct sunxi_usb_phy *phy = &sunxi_usb_phy[index];
        int err, retries = 3;
 
-       if (phy->gpio_vbus_det < 0) {
-               eprintf("Error: invalid vbus detection pin\n");
+       if (phy->gpio_vbus_det < 0)
                return phy->gpio_vbus_det;
-       }
 
        err = gpio_get_value(phy->gpio_vbus_det);
        /*
index 3542326238d59a1a5186f3b3aeb4e6549506d740..3a29b18e5f4cde07505975938d75edafe462b7c5 100644 (file)
@@ -208,7 +208,7 @@ static int sunxi_musb_enable(struct musb *musb)
 
        if (is_host_enabled(musb)) {
                ret = sunxi_usb_phy_vbus_detect(0);
-               if (ret) {
+               if (ret == 1) {
                        printf("A charger is plugged into the OTG: ");
                        return -ENODEV;
                }