summaryrefslogtreecommitdiffstats
path: root/include/axp152.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-04-25 17:25:14 +0200
committerHans de Goede <hdegoede@redhat.com>2015-05-04 16:51:53 +0200
commit2fcf033d36618da4c86de135a0d447fd3bbaf8ea (patch)
tree0439c47cc2e63fa98e4c347f233c9dafcaa12c7b /include/axp152.h
parenta536077def0295966452f290f7ce8f391e079966 (diff)
downloadblackbird-obmc-uboot-2fcf033d36618da4c86de135a0d447fd3bbaf8ea.tar.gz
blackbird-obmc-uboot-2fcf033d36618da4c86de135a0d447fd3bbaf8ea.zip
sunxi: axp: Move axp gpio code to a separate axpi-gpio driver
Move the axp-gpio code out of the drivers/power/axp*.c code, and into a new separate axpi-gpio driver. This change drops supports for the gpio3 pin on the axp209, as that requires special handling, and no boards are using it. Besides cleaning things up by moving the code to a separate driver, as a bonus this change also adds support for the (non vusb) gpio pins on the axp221 and the gpio pins on the axp152. The new axp-gpio driver gets its own Kconfig option, and is only enabled on boards which need it. Besides that it only gets enabled in the regular u-boot build and not for the SPL as we never need it in the SPL. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'include/axp152.h')
-rw-r--r--include/axp152.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/axp152.h b/include/axp152.h
index 9d205f8d3a..c3aef77210 100644
--- a/include/axp152.h
+++ b/include/axp152.h
@@ -15,6 +15,17 @@ enum axp152_reg {
#define AXP152_POWEROFF (1 << 7)
+/* For axp_gpio.c */
+#define AXP_GPIO0_CTRL 0x90
+#define AXP_GPIO1_CTRL 0x91
+#define AXP_GPIO2_CTRL 0x92
+#define AXP_GPIO3_CTRL 0x93
+#define AXP_GPIO_CTRL_OUTPUT_LOW 0x00 /* Drive pin low */
+#define AXP_GPIO_CTRL_OUTPUT_HIGH 0x01 /* Drive pin high */
+#define AXP_GPIO_CTRL_INPUT 0x02 /* Input */
+#define AXP_GPIO_STATE 0x97
+#define AXP_GPIO_STATE_OFFSET 0
+
int axp152_set_dcdc2(int mvolt);
int axp152_set_dcdc3(int mvolt);
int axp152_set_dcdc4(int mvolt);
OpenPOWER on IntegriCloud