diff options
Diffstat (limited to 'Documentation/devicetree/bindings/gpio/gpio.txt')
-rw-r--r-- | Documentation/devicetree/bindings/gpio/gpio.txt | 40 |
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 | |||
87 | contains information structures as follows: | 87 | contains 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: | |||
97 | The "pin controller node" mentioned above must conform to the bindings | 99 | The "pin controller node" mentioned above must conform to the bindings |
98 | described in ../pinctrl/pinctrl-bindings.txt. | 100 | described in ../pinctrl/pinctrl-bindings.txt. |
99 | 101 | ||
102 | In 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 | ||
104 | for 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 | |||
109 | Elements of gpiorange-names-list corresponding to numeric ranges contain | ||
110 | the empty string. Elements of gpiorange-names-list corresponding to named | ||
111 | ranges contain the name of a pin group defined in the respective pin | ||
112 | controller. The number of pins/GPIOs in the range is the number of pins in | ||
113 | that pin group. | ||
114 | |||
100 | Previous versions of this binding required all pin controller nodes that | 115 | Previous versions of this binding required all pin controller nodes that |
101 | were referenced by any gpio-ranges property to contain a property named | 116 | were 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 | |||
104 | compatibility reasons, and would still be required even in new device | 119 | compatibility reasons, and would still be required even in new device |
105 | trees that need to be compatible with older software. | 120 | trees that need to be compatible with older software. |
106 | 121 | ||
107 | Example: | 122 | Example 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: | |||
117 | Here, a single GPIO controller has GPIOs 0..9 routed to pin controller | 132 | Here, a single GPIO controller has GPIOs 0..9 routed to pin controller |
118 | pinctrl1's pins 20..29, and GPIOs 10..19 routed to pin controller pinctrl2's | 133 | pinctrl1's pins 20..29, and GPIOs 10..19 routed to pin controller pinctrl2's |
119 | pins 50..59. | 134 | pins 50..59. |
135 | |||
136 | Example 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 | |||
153 | Here, three GPIO ranges are defined wrt. two pin controllers. pinctrl1 GPIO | ||
154 | ranges are defined using pin numbers whereas the GPIO ranges wrt. pinctrl2 | ||
155 | are named "foo" and "bar". | ||