summaryrefslogtreecommitdiff
path: root/drivers/gpio/axp_gpio.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-04-26 12:19:37 +0300
committerHans de Goede <hdegoede@redhat.com>2015-05-04 17:51:54 +0300
commit421b32b8808a4d3dc59e84c69fc23b5d62302272 (patch)
treed3fdee1f1487a71fa4339d0c8e8ac397272248ab /drivers/gpio/axp_gpio.c
parentd17e1577a203e486d8a15bfa015a6410d99079de (diff)
downloadu-boot-421b32b8808a4d3dc59e84c69fc23b5d62302272.tar.xz
sunxi: axp: Remove non driver-model support from the axp gpio code
Now that all sunxi boards are using driver-model for gpio (*), we can remove the non driver-model support from the axp gpio code, and the glue to call into the axp gpio code from the sunxi_gpio non driver-model code. *) For the regular u-boot build, SPL still uses non driver-model gpio for now, but the SPL never uses axp gpios support and we were already not building axp-gpio support for 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 'drivers/gpio/axp_gpio.c')
-rw-r--r--drivers/gpio/axp_gpio.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/gpio/axp_gpio.c b/drivers/gpio/axp_gpio.c
index 55f20a34b6..2e97cc39d6 100644
--- a/drivers/gpio/axp_gpio.c
+++ b/drivers/gpio/axp_gpio.c
@@ -26,6 +26,8 @@
#error Unknown AXP model
#endif
+static int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val);
+
static u8 axp_get_gpio_ctrl_reg(unsigned pin)
{
switch (pin) {
@@ -41,7 +43,7 @@ static u8 axp_get_gpio_ctrl_reg(unsigned pin)
return 0;
}
-int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
+static int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
{
u8 reg;
@@ -59,7 +61,8 @@ int axp_gpio_direction_input(struct udevice *dev, unsigned pin)
}
}
-int axp_gpio_direction_output(struct udevice *dev, unsigned pin, int val)
+static int axp_gpio_direction_output(struct udevice *dev, unsigned pin,
+ int val)
{
__maybe_unused int ret;
u8 reg;
@@ -84,7 +87,7 @@ int axp_gpio_direction_output(struct udevice *dev, unsigned pin, int val)
}
}
-int axp_gpio_get_value(struct udevice *dev, unsigned pin)
+static int axp_gpio_get_value(struct udevice *dev, unsigned pin)
{
u8 reg, val, mask;
int ret;
@@ -116,7 +119,7 @@ int axp_gpio_get_value(struct udevice *dev, unsigned pin)
return (val & mask) ? 1 : 0;
}
-int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
+static int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
{
u8 reg;
@@ -140,7 +143,6 @@ int axp_gpio_set_value(struct udevice *dev, unsigned pin, int val)
}
}
-#ifdef CONFIG_DM_GPIO
static const struct dm_gpio_ops gpio_axp_ops = {
.direction_input = axp_gpio_direction_input,
.direction_output = axp_gpio_direction_output,
@@ -165,23 +167,20 @@ U_BOOT_DRIVER(gpio_axp) = {
.ops = &gpio_axp_ops,
.probe = gpio_axp_probe,
};
-#endif
int axp_gpio_init(void)
{
- __maybe_unused struct udevice *dev;
+ struct udevice *dev;
int ret;
ret = pmic_bus_init();
if (ret)
return ret;
-#ifdef CONFIG_DM_GPIO
/* There is no devicetree support for the axp yet, so bind directly */
ret = device_bind_driver(dm_root(), "gpio_axp", "AXP-gpio", &dev);
if (ret)
return ret;
-#endif
return 0;
}