summaryrefslogtreecommitdiffstats
path: root/drivers/power
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 /drivers/power
parent746c087bd3538dc2c2b744e44815a3d5ce94e3bc (diff)
downloadtalos-obmc-uboot-12ce15538a4512834138ee4d0ded416286ec46ad.tar.gz
talos-obmc-uboot-12ce15538a4512834138ee4d0ded416286ec46ad.zip
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 'drivers/power')
-rw-r--r--drivers/power/axp209.c10
-rw-r--r--drivers/power/axp221.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/power/axp209.c b/drivers/power/axp209.c
index 1d7be4991a..98c214fa7a 100644
--- a/drivers/power/axp209.c
+++ b/drivers/power/axp209.c
@@ -167,7 +167,7 @@ static u8 axp209_get_gpio_ctrl_reg(unsigned int pin)
return 0;
}
-int axp_gpio_direction_input(unsigned int pin)
+int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
{
if (pin == SUNXI_GPIO_AXP0_VBUS_DETECT)
return 0;
@@ -179,7 +179,7 @@ int axp_gpio_direction_input(unsigned int pin)
return axp209_write(reg, val);
}
-int axp_gpio_direction_output(unsigned int pin, unsigned int val)
+int axp_gpio_direction_output(struct udevice *dev, unsigned pin, int val)
{
u8 reg = axp209_get_gpio_ctrl_reg(pin);
@@ -194,7 +194,7 @@ int axp_gpio_direction_output(unsigned int pin, unsigned int val)
return axp209_write(reg, val);
}
-int axp_gpio_get_value(unsigned int pin)
+int axp_gpio_get_value(struct udevice *dev, unsigned pin)
{
u8 val, mask;
int rc;
@@ -215,7 +215,7 @@ int axp_gpio_get_value(unsigned int pin)
return (val & mask) ? 1 : 0;
}
-int axp_gpio_set_value(unsigned int pin, unsigned int val)
+int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
{
- return axp_gpio_direction_output(pin, val);
+ return axp_gpio_direction_output(dev, pin, val);
}
diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c
index dc3a7f19bd..4970ab46ee 100644
--- a/drivers/power/axp221.c
+++ b/drivers/power/axp221.c
@@ -386,7 +386,7 @@ int axp221_get_sid(unsigned int *sid)
return 0;
}
-int axp_gpio_direction_input(unsigned int pin)
+int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
{
switch (pin) {
case SUNXI_GPIO_AXP0_VBUS_DETECT:
@@ -396,7 +396,7 @@ int axp_gpio_direction_input(unsigned int pin)
}
}
-int axp_gpio_direction_output(unsigned int pin, unsigned int val)
+int axp_gpio_direction_output(struct udevice *dev, unsigned pin, int val)
{
int ret;
@@ -407,13 +407,13 @@ int axp_gpio_direction_output(unsigned int pin, unsigned int val)
if (ret)
return ret;
- return axp_gpio_set_value(pin, val);
+ return axp_gpio_set_value(dev, pin, val);
default:
return -EINVAL;
}
}
-int axp_gpio_get_value(unsigned int pin)
+int axp_gpio_get_value(struct udevice *dev, unsigned pin)
{
int ret;
u8 val;
@@ -430,7 +430,7 @@ int axp_gpio_get_value(unsigned int pin)
}
}
-int axp_gpio_set_value(unsigned int pin, unsigned int val)
+int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
{
int ret;
OpenPOWER on IntegriCloud