mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
Merge branch 'patch/musb-charging' into allwinner
This commit is contained in:
commit
d5173c07ea
@ -241,18 +241,18 @@ static int sunxi_musb_enable(struct musb *musb)
|
|||||||
musb_writeb(musb->mregs, USBC_REG_o_VEND0, 0);
|
musb_writeb(musb->mregs, USBC_REG_o_VEND0, 0);
|
||||||
|
|
||||||
if (is_host_enabled(musb)) {
|
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);
|
ret = sun4i_usb_phy_id_detect(&glue->phy);
|
||||||
if (ret == 1) {
|
if (ret == 1) {
|
||||||
printf("No host cable detected: ");
|
printf("No host cable detected: ");
|
||||||
return -ENODEV;
|
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);
|
ret = generic_phy_power_on(&glue->phy);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_debug("failed to power on USB PHY\n");
|
pr_debug("failed to power on USB PHY\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user