Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: Document GPIO hogging mechanism

Add GPIO hogging documentation to gpio.txt

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Benoit Parrot and committed by
Linus Walleij
6b516a10 f625d460

+30
+30
Documentation/devicetree/bindings/gpio/gpio.txt
··· 116 116 property, and a #gpio-cells integer property, which indicates the number of 117 117 cells in a gpio-specifier. 118 118 119 + The GPIO chip may contain GPIO hog definitions. GPIO hogging is a mechanism 120 + providing automatic GPIO request and configuration as part of the 121 + gpio-controller's driver probe function. 122 + 123 + Each GPIO hog definition is represented as a child node of the GPIO controller. 124 + Required properties: 125 + - gpio-hog: A property specifying that this child node represent a GPIO hog. 126 + - gpios: Store the GPIO information (id, flags, ...). Shall contain the 127 + number of cells specified in its parent node (GPIO controller 128 + node). 129 + Only one of the following properties scanned in the order shown below. 130 + This means that when multiple properties are present they will be searched 131 + in the order presented below and the first match is taken as the intended 132 + configuration. 133 + - input: A property specifying to set the GPIO direction as input. 134 + - output-low A property specifying to set the GPIO direction as output with 135 + the value low. 136 + - output-high A property specifying to set the GPIO direction as output with 137 + the value high. 138 + 139 + Optional properties: 140 + - line-name: The GPIO label name. If not present the node name is used. 141 + 119 142 Example of two SOC GPIO banks defined as gpio-controller nodes: 120 143 121 144 qe_pio_a: gpio-controller@1400 { ··· 146 123 reg = <0x1400 0x18>; 147 124 gpio-controller; 148 125 #gpio-cells = <2>; 126 + 127 + line_b { 128 + gpio-hog; 129 + gpios = <6 0>; 130 + output-low; 131 + line-name = "foo-bar-gpio"; 132 + }; 149 133 }; 150 134 151 135 qe_pio_e: gpio-controller@1460 {