]> git.sur5r.net Git - u-boot/blobdiff - drivers/gpio/rk_gpio.c
Merge git://git.denx.de/u-boot-dm
[u-boot] / drivers / gpio / rk_gpio.c
index 64abcbaa0ac8c654fe1e7342ae783a861a0d5938..2419636c5f5d9fccb0a9daa856587cbb3901cd42 100644 (file)
@@ -10,7 +10,7 @@
 #include <common.h>
 #include <dm.h>
 #include <syscon.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
@@ -86,10 +86,6 @@ static int rockchip_gpio_get_function(struct udevice *dev, unsigned offset)
        ret = pinctrl_get_gpio_mux(priv->pinctrl, priv->bank, offset);
        if (ret)
                return ret;
-
-       /* If it's not 0, then it is not a GPIO */
-       if (ret)
-               return GPIOF_FUNC;
        is_output = readl(&regs->swport_ddr) & OFFSET_TO_BIT(offset);
 
        return is_output ? GPIOF_OUTPUT : GPIOF_INPUT;
@@ -103,8 +99,7 @@ static int rockchip_gpio_probe(struct udevice *dev)
        char *end;
        int ret;
 
-       /* This only supports RK3288 at present */
-       priv->regs = (struct rockchip_gpio_regs *)dev_get_addr(dev);
+       priv->regs = dev_read_addr_ptr(dev);
        ret = uclass_first_device_err(UCLASS_PINCTRL, &priv->pinctrl);
        if (ret)
                return ret;