dt-bindings: gpio: gpio-axp209: add pinctrl features
authorQuentin Schulz <quentin.schulz@free-electrons.com>
Tue, 5 Dec 2017 14:46:42 +0000 (15:46 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 7 Dec 2017 09:06:24 +0000 (10:06 +0100)
The X-Powers AXP209 has 3 GPIOs. GPIO0/1 can each act either as a GPIO,
an ADC or a LDO regulator. GPIO2 can only act as a GPIO.

This adds the pinctrl features to the driver so GPIO0/1 can be used as
ADC or LDO regulator.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Documentation/devicetree/bindings/gpio/gpio-axp209.txt

index a661130..0d77597 100644 (file)
@@ -1,8 +1,13 @@
-AXP209 GPIO controller
+AXP209 GPIO & pinctrl controller
 
 This driver follows the usual GPIO bindings found in
 Documentation/devicetree/bindings/gpio/gpio.txt
 
+This driver follows the usual pinctrl bindings found in
+Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
+
+This driver employs the per-pin muxing pattern.
+
 Required properties:
 - compatible: Should be "x-powers,axp209-gpio"
 - #gpio-cells: Should be two. The first cell is the pin number and the
@@ -28,3 +33,32 @@ axp209: pmic@34 {
                #gpio-cells = <2>;
        };
 };
+
+The GPIOs can be muxed to other functions and therefore, must be a subnode of
+axp_gpio.
+
+Example:
+
+&axp_gpio {
+       gpio0_adc: gpio0-adc {
+               pins = "GPIO0";
+               function = "adc";
+       };
+};
+
+&example_node {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gpio0_adc>;
+};
+
+GPIOs and their functions
+-------------------------
+
+Each GPIO is independent from the other (i.e. GPIO0 in gpio_in function does
+not force GPIO1 and GPIO2 to be in gpio_in function as well).
+
+GPIO   |       Functions
+------------------------
+GPIO0  |       gpio_in, gpio_out, ldo, adc
+GPIO1  |       gpio_in, gpio_out, ldo, adc
+GPIO2  |       gpio_in, gpio_out