Merge branch 'patch/musb-charging' into allwinner

This commit is contained in:
Samuel Holland 2022-05-25 22:51:58 -05:00
commit d5173c07ea

View File

@ -241,18 +241,18 @@ static int sunxi_musb_enable(struct musb *musb)
musb_writeb(musb->mregs, USBC_REG_o_VEND0, 0);
if (is_host_enabled(musb)) {
ret = sun4i_usb_phy_vbus_detect(&glue->phy);
if (ret == 1) {
printf("A charger is plugged into the OTG: ");
return -ENODEV;
}
ret = sun4i_usb_phy_id_detect(&glue->phy);
if (ret == 1) {
printf("No host cable detected: ");
return -ENODEV;
}
ret = sun4i_usb_phy_vbus_detect(&glue->phy);
if (ret == 1) {
printf("A charger is plugged into the OTG: not enabling VBUS\n");
return 0;
}
ret = generic_phy_power_on(&glue->phy);
if (ret) {
pr_debug("failed to power on USB PHY\n");