]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - sys/boot/fdt/dts/bindings-gpio.txt
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / sys / boot / fdt / dts / bindings-gpio.txt
1 $FreeBSD$
2
3 GPIO configuration.
4 ===================
5
6 1. Properties for GPIO Controllers
7
8 1.1 #gpio-cells
9
10 Property:       #gpio-cells
11
12 Value type:     <u32>
13
14 Description:    The #gpio-cells property defines the number of cells required
15                 to encode a gpio specifier.
16
17
18 1.2 gpio-controller
19
20 Property:       gpio-controller
21
22 Value type:     <empty>
23
24 Description:    The presence of a gpio-controller property defines a node as a
25                 GPIO controller node.
26
27
28 1.3 pin-count
29
30 Property:       pin-count
31
32 Value type:     <u32>
33
34 Description:    The pin-count property defines the number of GPIO pins.
35
36
37 1.4 Example
38
39         GPIO: gpio@10100 {
40                 #gpio-cells = <3>;
41                 compatible = "mrvl,gpio";
42                 reg = <0x10100 0x20>;
43                 gpio-controller;
44                 interrupts = <6 7 8 9>;
45                 interrupt-parent = <&PIC>;
46                 pin-count = <50>
47         };
48
49 2. Properties for GPIO consumer nodes.
50
51 2.1 gpios
52
53 Property:       gpios
54
55 Value type:     <prop-encoded-array> encoded as arbitrary number of GPIO
56                 specifiers.
57
58 Description:    The gpios property of a device node defines the GPIO or GPIOs
59                 that are used by the device. The value of the gpios property
60                 consists of an arbitrary number of GPIO specifiers.
61                 
62                 The first cell of the GPIO specifier is phandle of the node's
63                 parent GPIO controller and remaining cells are defined by the
64                 binding describing the GPIO parent, typically include
65                 information like pin number, direction and various flags.
66
67 Example:
68                 gpios = <&GPIO 0 1 0            /* GPIO[0]:  IN,  NONE */
69                          &GPIO 1 2 0>;          /* GPIO[1]:  OUT, NONE */
70
71
72 3. "mrvl,gpio" controller GPIO specifier
73
74         <phandle pin dir flags>
75
76
77 pin:    0-MAX                           GPIO pin number.
78
79 dir:
80         1               IN              Input direction.
81         2               OUT             Output direction.
82
83 flags:
84         0x0000----      IN_NONE
85         0x0001----      IN_POL_LOW      Polarity low (inverted input value.
86         0x0002----      IN_IRQ_EDGE     Interrupt, edge triggered.
87         0x0004----      IN_IRQ_LEVEL    Interrupt, level triggered.
88         
89         0x----0000      OUT_NONE
90         0x----0001      OUT_BLINK       Blink on the pin.
91         0x----0002      OUT_OPEN_DRAIN  Open drain output line.
92         0x----0004      OUT_OPEN_SRC    Open source output line.
93
94
95 Example:
96         gpios = <&GPIO 0  1 0x00000000          /* GPIO[0]:   IN */
97                  &GPIO 1  2 0x00000000          /* GPIO[1]:   OUT */
98                  &GPIO 2  1 0x00020000          /* GPIO[2]:   IN, IRQ (edge) */
99                  &GPIO 3  1 0x00040000          /* GPIO[3]:   IN, IRQ (level) */
100                  ...
101                  &GPIO 10 2 0x00000001>;        /* GPIO[10]:  OUT, blink */