提交 9ecce970 编写于 作者: H Hans de Goede

sunxi: musb: Stop treating not having a vbus-det gpio as an error

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: NHans de Goede <hdegoede@redhat.com>
Reviewed-by: NMarek Vasut <marex@denx.de>
Acked-by: NIan Campbell <ijc@hellion.org.uk>
上级 56a20854
......@@ -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);
/*
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册