aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2011-06-03 13:07:16 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-06-28 17:35:53 -0400
commitbf859f84a19f8e562af4a990a287b5e3edabc572 (patch)
treec458e053f099fa3cd0cc3a298a60e0891826c8cc /Documentation/devicetree
parent33300571b1111264fd0c5701733f7576323f3e35 (diff)
gpio/dt: Refine GPIO device tree binding
Allow for multiple named gpio properties Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'Documentation/devicetree')
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio.txt46
1 files changed, 37 insertions, 9 deletions
diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt
index edaa84d288a1..4e16ba4feab0 100644
--- a/Documentation/devicetree/bindings/gpio/gpio.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio.txt
@@ -4,17 +4,45 @@ Specifying GPIO information for devices
41) gpios property 41) gpios property
5----------------- 5-----------------
6 6
7Nodes that makes use of GPIOs should define them using `gpios' property, 7Nodes that makes use of GPIOs should specify them using one or more
8format of which is: <&gpio-controller1-phandle gpio1-specifier 8properties, each containing a 'gpio-list':
9 &gpio-controller2-phandle gpio2-specifier
10 0 /* holes are permitted, means no GPIO 3 */
11 &gpio-controller4-phandle gpio4-specifier
12 ...>;
13 9
14Note that gpio-specifier length is controller dependent. 10 gpio-list ::= <single-gpio> [gpio-list]
11 single-gpio ::= <gpio-phandle> <gpio-specifier>
12 gpio-phandle : phandle to gpio controller node
13 gpio-specifier : Array of #gpio-cells specifying specific gpio
14 (controller specific)
15
16GPIO properties should be named "[<name>-]gpios". Exact
17meaning of each gpios property must be documented in the device tree
18binding for each device.
19
20For example, the following could be used to describe gpios pins to use
21as chip select lines; with chip selects 0, 1 and 3 populated, and chip
22select 2 left empty:
23
24 gpio1: gpio1 {
25 gpio-controller
26 #gpio-cells = <2>;
27 };
28 gpio2: gpio2 {
29 gpio-controller
30 #gpio-cells = <1>;
31 };
32 [...]
33 chipsel-gpios = <&gpio1 12 0>,
34 <&gpio1 13 0>,
35 <0>, /* holes are permitted, means no GPIO 2 */
36 <&gpio2 2>;
37
38Note that gpio-specifier length is controller dependent. In the
39above example, &gpio1 uses 2 cells to specify a gpio, while &gpio2
40only uses one.
15 41
16gpio-specifier may encode: bank, pin position inside the bank, 42gpio-specifier may encode: bank, pin position inside the bank,
17whether pin is open-drain and whether pin is logically inverted. 43whether pin is open-drain and whether pin is logically inverted.
44Exact meaning of each specifier cell is controller specific, and must
45be documented in the device tree binding for the device.
18 46
19Example of the node using GPIOs: 47Example of the node using GPIOs:
20 48
@@ -28,8 +56,8 @@ and empty GPIO flags as accepted by the "qe_pio_e" gpio-controller.
282) gpio-controller nodes 562) gpio-controller nodes
29------------------------ 57------------------------
30 58
31Every GPIO controller node must have #gpio-cells property defined, 59Every GPIO controller node must both an empty "gpio-controller"
32this information will be used to translate gpio-specifiers. 60property, and have #gpio-cells contain the size of the gpio-specifier.
33 61
34Example of two SOC GPIO banks defined as gpio-controller nodes: 62Example of two SOC GPIO banks defined as gpio-controller nodes:
35 63