aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/gpio/gpio.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/devicetree/bindings/gpio/gpio.txt')
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio.txt40
1 files changed, 38 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt
index 6cec6ff20d2e..0c85bb6e3a80 100644
--- a/Documentation/devicetree/bindings/gpio/gpio.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio.txt
@@ -87,8 +87,10 @@ controllers. The gpio-ranges property described below represents this, and
87contains information structures as follows: 87contains information structures as follows:
88 88
89 gpio-range-list ::= <single-gpio-range> [gpio-range-list] 89 gpio-range-list ::= <single-gpio-range> [gpio-range-list]
90 single-gpio-range ::= 90 single-gpio-range ::= <numeric-gpio-range> | <named-gpio-range>
91 numeric-gpio-range ::=
91 <pinctrl-phandle> <gpio-base> <pinctrl-base> <count> 92 <pinctrl-phandle> <gpio-base> <pinctrl-base> <count>
93 named-gpio-range ::= <pinctrl-phandle> <gpio-base> '<0 0>'
92 gpio-phandle : phandle to pin controller node. 94 gpio-phandle : phandle to pin controller node.
93 gpio-base : Base GPIO ID in the GPIO controller 95 gpio-base : Base GPIO ID in the GPIO controller
94 pinctrl-base : Base pinctrl pin ID in the pin controller 96 pinctrl-base : Base pinctrl pin ID in the pin controller
@@ -97,6 +99,19 @@ contains information structures as follows:
97The "pin controller node" mentioned above must conform to the bindings 99The "pin controller node" mentioned above must conform to the bindings
98described in ../pinctrl/pinctrl-bindings.txt. 100described in ../pinctrl/pinctrl-bindings.txt.
99 101
102In case named gpio ranges are used (ranges with both <pinctrl-base> and
103<count> set to 0), the property gpio-ranges-group-names contains one string
104for every single-gpio-range in gpio-ranges:
105 gpiorange-names-list ::= <gpiorange-name> [gpiorange-names-list]
106 gpiorange-name : Name of the pingroup associated to the GPIO range in
107 the respective pin controller.
108
109Elements of gpiorange-names-list corresponding to numeric ranges contain
110the empty string. Elements of gpiorange-names-list corresponding to named
111ranges contain the name of a pin group defined in the respective pin
112controller. The number of pins/GPIOs in the range is the number of pins in
113that pin group.
114
100Previous versions of this binding required all pin controller nodes that 115Previous versions of this binding required all pin controller nodes that
101were referenced by any gpio-ranges property to contain a property named 116were referenced by any gpio-ranges property to contain a property named
102#gpio-range-cells with value <3>. This requirement is now deprecated. 117#gpio-range-cells with value <3>. This requirement is now deprecated.
@@ -104,7 +119,7 @@ However, that property may still exist in older device trees for
104compatibility reasons, and would still be required even in new device 119compatibility reasons, and would still be required even in new device
105trees that need to be compatible with older software. 120trees that need to be compatible with older software.
106 121
107Example: 122Example 1:
108 123
109 qe_pio_e: gpio-controller@1460 { 124 qe_pio_e: gpio-controller@1460 {
110 #gpio-cells = <2>; 125 #gpio-cells = <2>;
@@ -117,3 +132,24 @@ Example:
117Here, a single GPIO controller has GPIOs 0..9 routed to pin controller 132Here, a single GPIO controller has GPIOs 0..9 routed to pin controller
118pinctrl1's pins 20..29, and GPIOs 10..19 routed to pin controller pinctrl2's 133pinctrl1's pins 20..29, and GPIOs 10..19 routed to pin controller pinctrl2's
119pins 50..59. 134pins 50..59.
135
136Example 2:
137
138 gpio_pio_i: gpio-controller@14B0 {
139 #gpio-cells = <2>;
140 compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
141 reg = <0x1480 0x18>;
142 gpio-controller;
143 gpio-ranges = <&pinctrl1 0 20 10>,
144 <&pinctrl2 10 0 0>,
145 <&pinctrl1 15 0 10>,
146 <&pinctrl2 25 0 0>;
147 gpio-ranges-group-names = "",
148 "foo",
149 "",
150 "bar";
151 };
152
153Here, three GPIO ranges are defined wrt. two pin controllers. pinctrl1 GPIO
154ranges are defined using pin numbers whereas the GPIO ranges wrt. pinctrl2
155are named "foo" and "bar".