1e1b2dc70SSimon ArlottBroadcom BCM2835 GPIO (and pinmux) controller
2e1b2dc70SSimon Arlott
3e1b2dc70SSimon ArlottThe BCM2835 GPIO module is a combined GPIO controller, (GPIO) interrupt
4e1b2dc70SSimon Arlottcontroller, and pinmux/control device.
5e1b2dc70SSimon Arlott
6e1b2dc70SSimon ArlottRequired properties:
7e1b2dc70SSimon Arlott- compatible: "brcm,bcm2835-gpio"
8372c1d6dSMasanari Iida- reg: Should contain the physical address of the GPIO module's registers.
9e1b2dc70SSimon Arlott- gpio-controller: Marks the device node as a GPIO controller.
10e1b2dc70SSimon Arlott- #gpio-cells : Should be two. The first cell is the pin number and the
11e1b2dc70SSimon Arlott  second cell is used to specify optional parameters:
12e1b2dc70SSimon Arlott  - bit 0 specifies polarity (0 for normal, 1 for inverted)
13e1b2dc70SSimon Arlott- interrupts : The interrupt outputs from the controller. One interrupt per
14e1b2dc70SSimon Arlott  individual bank followed by the "all banks" interrupt.
15e1b2dc70SSimon Arlott- interrupt-controller: Marks the device node as an interrupt controller.
16e1b2dc70SSimon Arlott- #interrupt-cells : Should be 2.
17e1b2dc70SSimon Arlott  The first cell is the GPIO number.
18e1b2dc70SSimon Arlott  The second cell is used to specify flags:
19e1b2dc70SSimon Arlott    bits[3:0] trigger type and level flags:
20e1b2dc70SSimon Arlott      1 = low-to-high edge triggered.
21e1b2dc70SSimon Arlott      2 = high-to-low edge triggered.
22e1b2dc70SSimon Arlott      4 = active high level-sensitive.
23e1b2dc70SSimon Arlott      8 = active low level-sensitive.
24e1b2dc70SSimon Arlott    Valid combinations are 1, 2, 3, 4, 8.
25e1b2dc70SSimon Arlott
26e1b2dc70SSimon ArlottPlease refer to ../gpio/gpio.txt for a general description of GPIO bindings.
27e1b2dc70SSimon Arlott
28e1b2dc70SSimon ArlottPlease refer to pinctrl-bindings.txt in this directory for details of the
29e1b2dc70SSimon Arlottcommon pinctrl bindings used by client devices, including the meaning of the
30e1b2dc70SSimon Arlottphrase "pin configuration node".
31e1b2dc70SSimon Arlott
32e1b2dc70SSimon ArlottEach pin configuration node lists the pin(s) to which it applies, and one or
33e1b2dc70SSimon Arlottmore of the mux function to select on those pin(s), and pull-up/down
34e1b2dc70SSimon Arlottconfiguration. Each subnode only affects those parameters that are explicitly
35e1b2dc70SSimon Arlottlisted. In other words, a subnode that lists only a mux function implies no
36e1b2dc70SSimon Arlottinformation about any pull configuration. Similarly, a subnode that lists only
37e1b2dc70SSimon Arlotta pul parameter implies no information about the mux function.
38e1b2dc70SSimon Arlott
39e61941d1SMatheus CastelloThe BCM2835 pin configuration and multiplexing supports the generic bindings.
40e61941d1SMatheus CastelloFor details on each properties, you can refer to ./pinctrl-bindings.txt.
41e61941d1SMatheus Castello
42e61941d1SMatheus CastelloRequired sub-node properties:
43e61941d1SMatheus Castello  - pins
44e61941d1SMatheus Castello  - function
45e61941d1SMatheus Castello
46e61941d1SMatheus CastelloOptional sub-node properties:
47e61941d1SMatheus Castello  - bias-disable
48e61941d1SMatheus Castello  - bias-pull-up
49e61941d1SMatheus Castello  - bias-pull-down
50e61941d1SMatheus Castello  - output-high
51e61941d1SMatheus Castello  - output-low
52e61941d1SMatheus Castello
53e61941d1SMatheus CastelloLegacy pin configuration and multiplexing binding:
54e61941d1SMatheus Castello*** (Its use is deprecated, use generic multiplexing and configuration
55e61941d1SMatheus Castellobindings instead)
56e61941d1SMatheus Castello
57e1b2dc70SSimon ArlottRequired subnode-properties:
58e1b2dc70SSimon Arlott- brcm,pins: An array of cells. Each cell contains the ID of a pin. Valid IDs
59e1b2dc70SSimon Arlott  are the integer GPIO IDs; 0==GPIO0, 1==GPIO1, ... 53==GPIO53.
60e1b2dc70SSimon Arlott
61e1b2dc70SSimon ArlottOptional subnode-properties:
62e1b2dc70SSimon Arlott- brcm,function: Integer, containing the function to mux to the pin(s):
63e1b2dc70SSimon Arlott  0: GPIO in
64e1b2dc70SSimon Arlott  1: GPIO out
65e1b2dc70SSimon Arlott  2: alt5
66e1b2dc70SSimon Arlott  3: alt4
67e1b2dc70SSimon Arlott  4: alt0
68e1b2dc70SSimon Arlott  5: alt1
69e1b2dc70SSimon Arlott  6: alt2
70e1b2dc70SSimon Arlott  7: alt3
71e1b2dc70SSimon Arlott- brcm,pull: Integer, representing the pull-down/up to apply to the pin(s):
72e1b2dc70SSimon Arlott  0: none
73e1b2dc70SSimon Arlott  1: down
74e1b2dc70SSimon Arlott  2: up
75e1b2dc70SSimon Arlott
76e1b2dc70SSimon ArlottEach of brcm,function and brcm,pull may contain either a single value which
77e1b2dc70SSimon Arlottwill be applied to all pins in brcm,pins, or 1 value for each entry in
78e1b2dc70SSimon Arlottbrcm,pins.
79e1b2dc70SSimon Arlott
80e1b2dc70SSimon ArlottExample:
81e1b2dc70SSimon Arlott
82e1b2dc70SSimon Arlott	gpio: gpio {
83e1b2dc70SSimon Arlott		compatible = "brcm,bcm2835-gpio";
84e1b2dc70SSimon Arlott		reg = <0x2200000 0xb4>;
85e1b2dc70SSimon Arlott		interrupts = <2 17>, <2 19>, <2 18>, <2 20>;
86e1b2dc70SSimon Arlott
87e1b2dc70SSimon Arlott		gpio-controller;
88e1b2dc70SSimon Arlott		#gpio-cells = <2>;
89e1b2dc70SSimon Arlott
90e1b2dc70SSimon Arlott		interrupt-controller;
91e1b2dc70SSimon Arlott		#interrupt-cells = <2>;
92e1b2dc70SSimon Arlott	};
93