]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sunxi: gpio: Add temporary implementation of name_to_gpio()
authorSimon Glass <sjg@chromium.org>
Sat, 18 Apr 2015 17:33:43 +0000 (11:33 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:35:19 +0000 (22:35 +0200)
Until sunxi moves to device tree (e.g. for USB) we need to convert named
GPIOs to numbers. Add a function to do this.

This fixes the USB / EHCI support not working on the LinkSprite pcDuino3
(which uses devicemodel).

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/gpio/sunxi_gpio.c

index 29301c43d092a9e70de35c817cc41bab127f4877..89209dfa871a99548d3fb8fae6a6b3652857d60c 100644 (file)
@@ -172,6 +172,17 @@ int sunxi_name_to_gpio(const char *name)
 #endif
 
 #ifdef CONFIG_DM_GPIO
+/* TODO(sjg@chromium.org): Remove this function and use device tree */
+int sunxi_name_to_gpio(const char *name)
+{
+       unsigned int gpio;
+       int ret;
+
+       ret = gpio_lookup_name(name, NULL, NULL, &gpio);
+
+       return ret ? ret : gpio;
+}
+
 static int sunxi_gpio_direction_input(struct udevice *dev, unsigned offset)
 {
        struct sunxi_gpio_platdata *plat = dev_get_platdata(dev);