aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/gpio
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/devicetree/bindings/gpio')
-rw-r--r--Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt22
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio.txt46
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio_keys.txt36
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio_nvidia.txt8
4 files changed, 103 insertions, 9 deletions
diff --git a/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt
new file mode 100644
index 00000000000..4363ae4b3c1
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.txt
@@ -0,0 +1,22 @@
1* Freescale i.MX/MXC GPIO controller
2
3Required properties:
4- compatible : Should be "fsl,<soc>-gpio"
5- reg : Address and length of the register set for the device
6- interrupts : Should be the port interrupt shared by all 32 pins, if
7 one number. If two numbers, the first one is the interrupt shared
8 by low 16 pins and the second one is for high 16 pins.
9- gpio-controller : Marks the device node as a gpio controller.
10- #gpio-cells : Should be two. The first cell is the pin number and
11 the second cell is used to specify optional parameters (currently
12 unused).
13
14Example:
15
16gpio0: gpio@73f84000 {
17 compatible = "fsl,imx51-gpio", "fsl,imx31-gpio";
18 reg = <0x73f84000 0x4000>;
19 interrupts = <50 51>;
20 gpio-controller;
21 #gpio-cells = <2>;
22};
diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt
index edaa84d288a..4e16ba4feab 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
diff --git a/Documentation/devicetree/bindings/gpio/gpio_keys.txt b/Documentation/devicetree/bindings/gpio/gpio_keys.txt
new file mode 100644
index 00000000000..5c2c02140a6
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio_keys.txt
@@ -0,0 +1,36 @@
1Device-Tree bindings for input/gpio_keys.c keyboard driver
2
3Required properties:
4 - compatible = "gpio-keys";
5
6Optional properties:
7 - autorepeat: Boolean, Enable auto repeat feature of Linux input
8 subsystem.
9
10Each button (key) is represented as a sub-node of "gpio-keys":
11Subnode properties:
12
13 - gpios: OF device-tree gpio specification.
14 - label: Descriptive name of the key.
15 - linux,code: Keycode to emit.
16
17Optional subnode-properties:
18 - linux,input-type: Specify event type this button/key generates.
19 If not specified defaults to <1> == EV_KEY.
20 - debounce-interval: Debouncing interval time in milliseconds.
21 If not specified defaults to 5.
22 - gpio-key,wakeup: Boolean, button can wake-up the system.
23
24Example nodes:
25
26 gpio_keys {
27 compatible = "gpio-keys";
28 #address-cells = <1>;
29 #size-cells = <0>;
30 autorepeat;
31 button@21 {
32 label = "GPIO Key UP";
33 linux,code = <103>;
34 gpios = <&gpio1 0 1>;
35 };
36 ...
diff --git a/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt b/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt
new file mode 100644
index 00000000000..eb4b530d64e
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt
@@ -0,0 +1,8 @@
1NVIDIA Tegra 2 GPIO controller
2
3Required properties:
4- compatible : "nvidia,tegra20-gpio"
5- #gpio-cells : Should be two. The first cell is the pin number and the
6 second cell is used to specify optional parameters:
7 - bit 0 specifies polarity (0 for normal, 1 for inverted)
8- gpio-controller : Marks the device node as a GPIO controller.