[U-Boot] [PATCH 4/4] sunxi: axp221: Use vbus-available rather then vbus-usable for vbus-detect

Hans de Goede hdegoede at redhat.com
Fri Mar 27 22:06:43 CET 2015


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 at redhat.com>
---
 drivers/power/axp221.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c
index f758a75..dc3a7f1 100644
--- a/drivers/power/axp221.c
+++ b/drivers/power/axp221.c
@@ -424,7 +424,7 @@ int axp_gpio_get_value(unsigned int pin)
 		if (ret)
 			return ret;
 
-		return !!(val & AXP221_POWER_STATUS_VBUS_USABLE);
+		return !!(val & AXP221_POWER_STATUS_VBUS_AVAIL);
 	default:
 		return -EINVAL;
 	}
-- 
2.3.4



More information about the U-Boot mailing list