Commit 750d49f5a4d553d01c7c1c63f1a9c2d2980e81b5

Authored by Hans de Goede
1 parent a0e2b1b865

sunxi: axp221: Use vbus-available rather then vbus-usable for vbus-detect

vbus-usable may not get set if power is provided through both the power barrel
connector and external 5v is also present on the otg connector, at least on
boards where vbus is also controlled through the axp221-pmic.

One way to reproduce this is to bootup an Ippo-q8h board with a usb-host
cable plugged into the otg (so that it will get powered), then unplug the
usb-host cable and plug in a charger, and then do "reset" on the u-boot
console, vbus-usable will then report 0, leading to uboot trying to provide
power to the otg port even though external 5v is present, this commit fixes
this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/power/axp221.c
... ... @@ -424,7 +424,7 @@
424 424 if (ret)
425 425 return ret;
426 426  
427   - return !!(val & AXP221_POWER_STATUS_VBUS_USABLE);
  427 + return !!(val & AXP221_POWER_STATUS_VBUS_AVAIL);
428 428 default:
429 429 return -EINVAL;
430 430 }