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>
This commit is contained in:
Hans de Goede
2015-04-25 17:25:14 +02:00
parent a536077def
commit 2fcf033d36
23 changed files with 222 additions and 173 deletions

View File

@@ -216,4 +216,17 @@ int sunxi_name_to_gpio_bank(const char *name);
int sunxi_name_to_gpio(const char *name);
#define name_to_gpio(name) sunxi_name_to_gpio(name)
#if !defined CONFIG_SPL_BUILD && defined CONFIG_AXP_GPIO
int axp_gpio_init(void);
#else
static inline int axp_gpio_init(void) { return 0; }
#endif
struct udevice;
int axp_gpio_direction_input(struct udevice *dev, unsigned offset);
int axp_gpio_direction_output(struct udevice *dev, unsigned offset, int val);
int axp_gpio_get_value(struct udevice *dev, unsigned offset);
int axp_gpio_set_value(struct udevice *dev, unsigned offset, int val);
#endif /* _SUNXI_GPIO_H */