summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-04-22 16:27:01 +0200
committerHans de Goede <hdegoede@redhat.com>2015-05-04 16:51:53 +0200
commit12ce15538a4512834138ee4d0ded416286ec46ad (patch)
tree1d705a27a97fb5b9ac671e03384024fae521efbc /include
parent746c087bd3538dc2c2b744e44815a3d5ce94e3bc (diff)
downloadu-boot-imx-12ce15538a4512834138ee4d0ded416286ec46ad.zip
u-boot-imx-12ce15538a4512834138ee4d0ded416286ec46ad.tar.gz
u-boot-imx-12ce15538a4512834138ee4d0ded416286ec46ad.tar.bz2
sunxi: axp: Change axp_gpio_foo prototypes to match gpio uclass ops
Change the axp_gpio_foo function prototypes to match the gpio uclass op prototypes, this is a preparation patch for moving the axp gpio code to a separate driver-model gpio driver. Note that the ugly calls with a NULL udev pointer in drivers/gpio/sunxi_gpio.c this adds are removed in a later patch. 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')
-rw-r--r--include/axp209.h10
-rw-r--r--include/axp221.h10
2 files changed, 12 insertions, 8 deletions
diff --git a/include/axp209.h b/include/axp209.h
index d36da41..fe4a169 100644
--- a/include/axp209.h
+++ b/include/axp209.h
@@ -4,6 +4,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+struct udevice;
+
enum axp209_reg {
AXP209_POWER_STATUS = 0x00,
AXP209_CHIP_VERSION = 0x03,
@@ -53,7 +55,7 @@ extern int axp209_init(void);
extern int axp209_poweron_by_dc(void);
extern int axp209_power_button(void);
-extern int axp_gpio_direction_input(unsigned int pin);
-extern int axp_gpio_direction_output(unsigned int pin, unsigned int val);
-extern int axp_gpio_get_value(unsigned int pin);
-extern int axp_gpio_set_value(unsigned int pin, unsigned int val);
+extern int axp_gpio_direction_input(struct udevice *dev, unsigned offset);
+extern int axp_gpio_direction_output(struct udevice *dev, unsigned offset, int val);
+extern int axp_gpio_get_value(struct udevice *dev, unsigned offset);
+extern int axp_gpio_set_value(struct udevice *dev, unsigned offset, int val);
diff --git a/include/axp221.h b/include/axp221.h
index 0aac04d..e826ca8 100644
--- a/include/axp221.h
+++ b/include/axp221.h
@@ -6,6 +6,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+struct udevice;
+
#define AXP221_CHIP_ADDR 0x68
#define AXP221_CTRL_ADDR 0x3e
#define AXP221_INIT_DATA 0x3e
@@ -80,7 +82,7 @@ int axp221_set_eldo(int eldo_num, unsigned int mvolt);
int axp221_init(void);
int axp221_get_sid(unsigned int *sid);
-int axp_gpio_direction_input(unsigned int pin);
-int axp_gpio_direction_output(unsigned int pin, unsigned int val);
-int axp_gpio_get_value(unsigned int pin);
-int axp_gpio_set_value(unsigned int pin, unsigned int val);
+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);