Message ID | 1434814509-21484-3-git-send-email-hdegoede@redhat.com |
---|---|
State | Superseded |
Delegated to: | Hans de Goede |
Headers | show |
On Sat, 2015-06-20 at 17:35 +0200, Hans de Goede wrote: > 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> Acked-by: Ian Campbell <ijc@hellion.org.uk>
diff --git a/arch/arm/cpu/armv7/sunxi/usb_phy.c b/arch/arm/cpu/armv7/sunxi/usb_phy.c index 5e82ddc..4d63a74 100644 --- a/arch/arm/cpu/armv7/sunxi/usb_phy.c +++ b/arch/arm/cpu/armv7/sunxi/usb_phy.c @@ -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); /* diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c index bb88687..f091a2d 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -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; }
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> --- arch/arm/cpu/armv7/sunxi/usb_phy.c | 4 +--- drivers/usb/musb-new/sunxi.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-)