diff options
Diffstat (limited to 'Documentation/devicetree/bindings/gpio/gpio.txt')
-rw-r--r-- | Documentation/devicetree/bindings/gpio/gpio.txt | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt index 4e16ba4feab0..a33628759d36 100644 --- a/Documentation/devicetree/bindings/gpio/gpio.txt +++ b/Documentation/devicetree/bindings/gpio/gpio.txt | |||
@@ -75,4 +75,40 @@ Example of two SOC GPIO banks defined as gpio-controller nodes: | |||
75 | gpio-controller; | 75 | gpio-controller; |
76 | }; | 76 | }; |
77 | 77 | ||
78 | 2.1) gpio-controller and pinctrl subsystem | ||
79 | ------------------------------------------ | ||
78 | 80 | ||
81 | gpio-controller on a SOC might be tightly coupled with the pinctrl | ||
82 | subsystem, in the sense that the pins can be used by other functions | ||
83 | together with optional gpio feature. | ||
84 | |||
85 | While the pin allocation is totally managed by the pin ctrl subsystem, | ||
86 | gpio (under gpiolib) is still maintained by gpio drivers. It may happen | ||
87 | that different pin ranges in a SoC is managed by different gpio drivers. | ||
88 | |||
89 | This makes it logical to let gpio drivers announce their pin ranges to | ||
90 | the pin ctrl subsystem and call 'pinctrl_request_gpio' in order to | ||
91 | request the corresponding pin before any gpio usage. | ||
92 | |||
93 | For this, the gpio controller can use a pinctrl phandle and pins to | ||
94 | announce the pinrange to the pin ctrl subsystem. For example, | ||
95 | |||
96 | qe_pio_e: gpio-controller@1460 { | ||
97 | #gpio-cells = <2>; | ||
98 | compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank"; | ||
99 | reg = <0x1460 0x18>; | ||
100 | gpio-controller; | ||
101 | gpio-ranges = <&pinctrl1 20 10>, <&pinctrl2 50 20>; | ||
102 | |||
103 | } | ||
104 | |||
105 | where, | ||
106 | &pinctrl1 and &pinctrl2 is the phandle to the pinctrl DT node. | ||
107 | |||
108 | Next values specify the base pin and number of pins for the range | ||
109 | handled by 'qe_pio_e' gpio. In the given example from base pin 20 to | ||
110 | pin 29 under pinctrl1 and pin 50 to pin 69 under pinctrl2 is handled | ||
111 | by this gpio controller. | ||
112 | |||
113 | The pinctrl node must have "#gpio-range-cells" property to show number of | ||
114 | arguments to pass with phandle from gpio controllers node. | ||