Commit 2b71920e authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Jonathan Corbet

Documentation: gpio: mention that <function>-gpio has been deprecated

The gpiolib supports parsing DT properties of the form <function>-gpio
but it was only added for compatibility with older DT bindings that got
it wrong and should not be used in newer bindings.

The commit that added support for this was:

dd34c37a ("gpio: of: Allow -gpio suffix for property names")

but didn't update the documentation to explain this so it's been a source
of confusion. So let's make clear this in the GPIO documentation.
Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 55d01595
...@@ -21,8 +21,8 @@ exact way to do it depends on the GPIO controller providing the GPIOs, see the ...@@ -21,8 +21,8 @@ exact way to do it depends on the GPIO controller providing the GPIOs, see the
device tree bindings for your controller. device tree bindings for your controller.
GPIOs mappings are defined in the consumer device's node, in a property named GPIOs mappings are defined in the consumer device's node, in a property named
either <function>-gpios or <function>-gpio, where <function> is the function <function>-gpios, where <function> is the function the driver will request
the driver will request through gpiod_get(). For example: through gpiod_get(). For example:
foo_device { foo_device {
compatible = "acme,foo"; compatible = "acme,foo";
...@@ -31,9 +31,13 @@ the driver will request through gpiod_get(). For example: ...@@ -31,9 +31,13 @@ the driver will request through gpiod_get(). For example:
<&gpio 16 GPIO_ACTIVE_HIGH>, /* green */ <&gpio 16 GPIO_ACTIVE_HIGH>, /* green */
<&gpio 17 GPIO_ACTIVE_HIGH>; /* blue */ <&gpio 17 GPIO_ACTIVE_HIGH>; /* blue */
power-gpio = <&gpio 1 GPIO_ACTIVE_LOW>; power-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
}; };
Properties named <function>-gpio are also considered valid and old bindings use
it but are only supported for compatibility reasons and should not be used for
newer bindings since it has been deprecated.
This property will make GPIOs 15, 16 and 17 available to the driver under the This property will make GPIOs 15, 16 and 17 available to the driver under the
"led" function, and GPIO 1 as the "power" GPIO: "led" function, and GPIO 1 as the "power" GPIO:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment