162306a36Sopenharmony_ciBroadcom BCM2835 GPIO (and pinmux) controller 262306a36Sopenharmony_ci 362306a36Sopenharmony_ciThe BCM2835 GPIO module is a combined GPIO controller, (GPIO) interrupt 462306a36Sopenharmony_cicontroller, and pinmux/control device. 562306a36Sopenharmony_ci 662306a36Sopenharmony_ciRequired properties: 762306a36Sopenharmony_ci- compatible: "brcm,bcm2835-gpio" 862306a36Sopenharmony_ci- compatible: should be one of: 962306a36Sopenharmony_ci "brcm,bcm2835-gpio" - BCM2835 compatible pinctrl 1062306a36Sopenharmony_ci "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl 1162306a36Sopenharmony_ci "brcm,bcm2711-gpio" - BCM2711 compatible pinctrl 1262306a36Sopenharmony_ci "brcm,bcm7211-gpio" - BCM7211 compatible pinctrl 1362306a36Sopenharmony_ci- reg: Should contain the physical address of the GPIO module's registers. 1462306a36Sopenharmony_ci- gpio-controller: Marks the device node as a GPIO controller. 1562306a36Sopenharmony_ci- #gpio-cells : Should be two. The first cell is the pin number and the 1662306a36Sopenharmony_ci second cell is used to specify optional parameters: 1762306a36Sopenharmony_ci - bit 0 specifies polarity (0 for normal, 1 for inverted) 1862306a36Sopenharmony_ci- interrupts : The interrupt outputs from the controller. One interrupt per 1962306a36Sopenharmony_ci individual bank followed by the "all banks" interrupt. For BCM7211, an 2062306a36Sopenharmony_ci additional set of per-bank interrupt line and an "all banks" wake-up 2162306a36Sopenharmony_ci interrupt may be specified. 2262306a36Sopenharmony_ci- interrupt-controller: Marks the device node as an interrupt controller. 2362306a36Sopenharmony_ci- #interrupt-cells : Should be 2. 2462306a36Sopenharmony_ci The first cell is the GPIO number. 2562306a36Sopenharmony_ci The second cell is used to specify flags: 2662306a36Sopenharmony_ci bits[3:0] trigger type and level flags: 2762306a36Sopenharmony_ci 1 = low-to-high edge triggered. 2862306a36Sopenharmony_ci 2 = high-to-low edge triggered. 2962306a36Sopenharmony_ci 4 = active high level-sensitive. 3062306a36Sopenharmony_ci 8 = active low level-sensitive. 3162306a36Sopenharmony_ci Valid combinations are 1, 2, 3, 4, 8. 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ciPlease refer to ../gpio/gpio.txt for a general description of GPIO bindings. 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ciPlease refer to pinctrl-bindings.txt in this directory for details of the 3662306a36Sopenharmony_cicommon pinctrl bindings used by client devices, including the meaning of the 3762306a36Sopenharmony_ciphrase "pin configuration node". 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ciEach pin configuration node lists the pin(s) to which it applies, and one or 4062306a36Sopenharmony_cimore of the mux function to select on those pin(s), and pull-up/down 4162306a36Sopenharmony_ciconfiguration. Each subnode only affects those parameters that are explicitly 4262306a36Sopenharmony_cilisted. In other words, a subnode that lists only a mux function implies no 4362306a36Sopenharmony_ciinformation about any pull configuration. Similarly, a subnode that lists only 4462306a36Sopenharmony_cia pul parameter implies no information about the mux function. 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ciThe BCM2835 pin configuration and multiplexing supports the generic bindings. 4762306a36Sopenharmony_ciFor details on each properties, you can refer to ./pinctrl-bindings.txt. 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ciRequired sub-node properties: 5062306a36Sopenharmony_ci - pins 5162306a36Sopenharmony_ci - function 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ciOptional sub-node properties: 5462306a36Sopenharmony_ci - bias-disable 5562306a36Sopenharmony_ci - bias-pull-up 5662306a36Sopenharmony_ci - bias-pull-down 5762306a36Sopenharmony_ci - output-high 5862306a36Sopenharmony_ci - output-low 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ciLegacy pin configuration and multiplexing binding: 6162306a36Sopenharmony_ci*** (Its use is deprecated, use generic multiplexing and configuration 6262306a36Sopenharmony_cibindings instead) 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ciRequired subnode-properties: 6562306a36Sopenharmony_ci- brcm,pins: An array of cells. Each cell contains the ID of a pin. Valid IDs 6662306a36Sopenharmony_ci are the integer GPIO IDs; 0==GPIO0, 1==GPIO1, ... 53==GPIO53. 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ciOptional subnode-properties: 6962306a36Sopenharmony_ci- brcm,function: Integer, containing the function to mux to the pin(s): 7062306a36Sopenharmony_ci 0: GPIO in 7162306a36Sopenharmony_ci 1: GPIO out 7262306a36Sopenharmony_ci 2: alt5 7362306a36Sopenharmony_ci 3: alt4 7462306a36Sopenharmony_ci 4: alt0 7562306a36Sopenharmony_ci 5: alt1 7662306a36Sopenharmony_ci 6: alt2 7762306a36Sopenharmony_ci 7: alt3 7862306a36Sopenharmony_ci- brcm,pull: Integer, representing the pull-down/up to apply to the pin(s): 7962306a36Sopenharmony_ci 0: none 8062306a36Sopenharmony_ci 1: down 8162306a36Sopenharmony_ci 2: up 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ciEach of brcm,function and brcm,pull may contain either a single value which 8462306a36Sopenharmony_ciwill be applied to all pins in brcm,pins, or 1 value for each entry in 8562306a36Sopenharmony_cibrcm,pins. 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ciExample: 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci gpio: gpio { 9062306a36Sopenharmony_ci compatible = "brcm,bcm2835-gpio"; 9162306a36Sopenharmony_ci reg = <0x2200000 0xb4>; 9262306a36Sopenharmony_ci interrupts = <2 17>, <2 19>, <2 18>, <2 20>; 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_ci gpio-controller; 9562306a36Sopenharmony_ci #gpio-cells = <2>; 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci interrupt-controller; 9862306a36Sopenharmony_ci #interrupt-cells = <2>; 9962306a36Sopenharmony_ci }; 100