summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/axp221.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c
index 3e07f23..c2c3988 100644
--- a/drivers/power/axp221.c
+++ b/drivers/power/axp221.c
@@ -385,6 +385,22 @@ int axp221_get_sid(unsigned int *sid)
return 0;
}
+int axp_get_vbus(void)
+{
+ int ret;
+ u8 val;
+
+ ret = axp221_init();
+ if (ret)
+ return ret;
+
+ ret = pmic_bus_read(AXP221_POWER_STATUS, &val);
+ if (ret)
+ return ret;
+
+ return (val & AXP221_POWER_STATUS_VBUS_USABLE) ? 1 : 0;
+}
+
static int axp_drivebus_setup(void)
{
int ret;