summaryrefslogtreecommitdiff
path: root/include/axp221.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-01-11 19:58:03 +0100
committerHans de Goede <hdegoede@redhat.com>2015-01-14 14:56:40 +0100
commit2abac6213d9d05c34fba7dcaa2934668774008a7 (patch)
tree4232558f135a6f0fd620c11f6d4650de087ceb09 /include/axp221.h
parent3c781190d11ca44752562867d76ccfb8d0a45ac3 (diff)
downloadu-boot-imx-2abac6213d9d05c34fba7dcaa2934668774008a7.zip
u-boot-imx-2abac6213d9d05c34fba7dcaa2934668774008a7.tar.gz
u-boot-imx-2abac6213d9d05c34fba7dcaa2934668774008a7.tar.bz2
sunxi: axp221: Add support for controlling the drivebus pin
The axp221 / axp223's N_VBUSEN pin can be configured as an output rather then an input, add axp_drivebus_enable() and _disable() functions to set the pin in output mode and control it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'include/axp221.h')
-rw-r--r--include/axp221.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/axp221.h b/include/axp221.h
index e9552f6..e6639f1 100644
--- a/include/axp221.h
+++ b/include/axp221.h
@@ -45,11 +45,18 @@
#define AXP221_ALDO1_CTRL 0x28
#define AXP221_ALDO2_CTRL 0x29
#define AXP221_ALDO3_CTRL 0x2a
+#define AXP221_VBUS_IPSOUT 0x30
+#define AXP221_VBUS_IPSOUT_DRIVEBUS (1 << 2)
+#define AXP221_MISC_CTRL 0x8f
+#define AXP221_MISC_CTRL_N_VBUSEN_FUNC (1 << 4)
#define AXP221_PAGE 0xff
/* Page 1 addresses */
#define AXP221_SID 0x20
+/* We support drivebus control */
+#define AXP_DRIVEBUS
+
int axp221_set_dcdc1(unsigned int mvolt);
int axp221_set_dcdc2(unsigned int mvolt);
int axp221_set_dcdc3(unsigned int mvolt);
@@ -64,3 +71,5 @@ int axp221_set_aldo2(unsigned int mvolt);
int axp221_set_aldo3(unsigned int mvolt);
int axp221_init(void);
int axp221_get_sid(unsigned int *sid);
+int axp_drivebus_enable(void);
+int axp_drivebus_disable(void);