summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2015-03-09 15:44:15 +0800
committerHans de Goede <hdegoede@redhat.com>2015-03-10 15:20:25 +0100
commit1986c4ca0b250c83434aae985e74e05f96ccb1a4 (patch)
tree98f67cdd2a0cf2c70a8621899e8976c3ec2b86ca /include
parent5112703fddb0e851a11c6bc7722973522346e503 (diff)
sunxi: axp221: Add VBUS detection support
Some of the AXP PMICs support VBUS detection, i.e. checking whether VBUS power input is available and usable (supplied by an external source). A few boards use this instead of a separate GPIO to detect VBUS on USB OTG. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/axp221.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/axp221.h b/include/axp221.h
index a20e25c2f8..be6058e439 100644
--- a/include/axp221.h
+++ b/include/axp221.h
@@ -14,6 +14,9 @@
#define AXP223_RUNTIME_ADDR 0x2d
/* Page 0 addresses */
+#define AXP221_POWER_STATUS 0x00
+#define AXP221_POWER_STATUS_VBUS_AVAIL (1 << 5)
+#define AXP221_POWER_STATUS_VBUS_USABLE (1 << 4)
#define AXP221_CHIP_ID 0x03
#define AXP221_OUTPUT_CTRL1 0x10
#define AXP221_OUTPUT_CTRL1_DCDC0_EN (1 << 0)
@@ -59,6 +62,9 @@
/* Page 1 addresses */
#define AXP221_SID 0x20
+/* We support vbus detection */
+#define AXP_VBUS_DETECT
+
/* We support drivebus control */
#define AXP_DRIVEBUS
@@ -77,5 +83,6 @@ int axp221_set_aldo3(unsigned int mvolt);
int axp221_set_eldo(int eldo_num, unsigned int mvolt);
int axp221_init(void);
int axp221_get_sid(unsigned int *sid);
+int axp_get_vbus(void);
int axp_drivebus_enable(void);
int axp_drivebus_disable(void);