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
39e1b2dc70SSimon ArlottRequired subnode-properties:
40e1b2dc70SSimon Arlott- brcm,pins: An array of cells. Each cell contains the ID of a pin. Valid IDs
41e1b2dc70SSimon Arlott  are the integer GPIO IDs; 0==GPIO0, 1==GPIO1, ... 53==GPIO53.
42e1b2dc70SSimon Arlott
43e1b2dc70SSimon ArlottOptional subnode-properties:
44e1b2dc70SSimon Arlott- brcm,function: Integer, containing the function to mux to the pin(s):
45e1b2dc70SSimon Arlott  0: GPIO in
46e1b2dc70SSimon Arlott  1: GPIO out
47e1b2dc70SSimon Arlott  2: alt5
48e1b2dc70SSimon Arlott  3: alt4
49e1b2dc70SSimon Arlott  4: alt0
50e1b2dc70SSimon Arlott  5: alt1
51e1b2dc70SSimon Arlott  6: alt2
52e1b2dc70SSimon Arlott  7: alt3
53e1b2dc70SSimon Arlott- brcm,pull: Integer, representing the pull-down/up to apply to the pin(s):
54e1b2dc70SSimon Arlott  0: none
55e1b2dc70SSimon Arlott  1: down
56e1b2dc70SSimon Arlott  2: up
57e1b2dc70SSimon Arlott
58e1b2dc70SSimon ArlottEach of brcm,function and brcm,pull may contain either a single value which
59e1b2dc70SSimon Arlottwill be applied to all pins in brcm,pins, or 1 value for each entry in
60e1b2dc70SSimon Arlottbrcm,pins.
61e1b2dc70SSimon Arlott
62e1b2dc70SSimon ArlottExample:
63e1b2dc70SSimon Arlott
64e1b2dc70SSimon Arlott	gpio: gpio {
65e1b2dc70SSimon Arlott		compatible = "brcm,bcm2835-gpio";
66e1b2dc70SSimon Arlott		reg = <0x2200000 0xb4>;
67e1b2dc70SSimon Arlott		interrupts = <2 17>, <2 19>, <2 18>, <2 20>;
68e1b2dc70SSimon Arlott
69e1b2dc70SSimon Arlott		gpio-controller;
70e1b2dc70SSimon Arlott		#gpio-cells = <2>;
71e1b2dc70SSimon Arlott
72e1b2dc70SSimon Arlott		interrupt-controller;
73e1b2dc70SSimon Arlott		#interrupt-cells = <2>;
74e1b2dc70SSimon Arlott	};
75