ACPI / gpio: Add support for naming GPIOs
authorMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 21 Oct 2016 14:21:32 +0000 (17:21 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 24 Oct 2016 14:33:11 +0000 (16:33 +0200)
Now that we have the new helper function that sets nice names for GPIO
lines based on "gpio-line-names" device property, we can take advantage of
this in acpi_gpiochip_add().

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Documentation/acpi/gpio-properties.txt
drivers/gpio/gpiolib-acpi.c

index d9076af271f5d05fa8864d50c31e37756cafcb27..2aff0349facd6e4f289b7df28f3ea6b3e1dced40 100644 (file)
@@ -98,6 +98,18 @@ Example:
       }
   })
 
+- gpio-line-names
+
+Example:
+
+  Package () {
+      "gpio-line-names",
+      Package () {
+          "SPI0_CS_N", "EXP2_INT", "MUX6_IO", "UART0_RXD", "MUX7_IO",
+          "LVL_C_A1", "MUX0_IO", "SPI1_MISO"
+      }
+  }
+
 See Documentation/devicetree/bindings/gpio/gpio.txt for more information
 about these properties.
 
index 4f46982ce982fabfb63727f10878f928a60bd9bb..53266ef120086e57a2bb54c3ec5bc14954b98176 100644 (file)
@@ -957,6 +957,9 @@ void acpi_gpiochip_add(struct gpio_chip *chip)
                return;
        }
 
+       if (!chip->names)
+               devprop_gpiochip_set_names(chip);
+
        acpi_gpiochip_request_regions(acpi_gpio);
        acpi_gpiochip_scan_gpios(acpi_gpio);
        acpi_walk_dep_device_list(handle);