xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/gpio/microchip,pic32-gpio.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun* Microchip PIC32 GPIO devices (PIO).
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunRequired properties:
4*4882a593Smuzhiyun - compatible: "microchip,pic32mzda-gpio"
5*4882a593Smuzhiyun - reg: Base address and length for the device.
6*4882a593Smuzhiyun - interrupts: The port interrupt shared by all pins.
7*4882a593Smuzhiyun - gpio-controller: Marks the port as GPIO controller.
8*4882a593Smuzhiyun - #gpio-cells: Two. The first cell is the pin number and
9*4882a593Smuzhiyun   the second cell is used to specify the gpio polarity as defined in
10*4882a593Smuzhiyun   defined in <dt-bindings/gpio/gpio.h>:
11*4882a593Smuzhiyun      0 = GPIO_ACTIVE_HIGH
12*4882a593Smuzhiyun      1 = GPIO_ACTIVE_LOW
13*4882a593Smuzhiyun      2 = GPIO_OPEN_DRAIN
14*4882a593Smuzhiyun - interrupt-controller: Marks the device node as an interrupt controller.
15*4882a593Smuzhiyun - #interrupt-cells: Two. The first cell is the GPIO number and second cell
16*4882a593Smuzhiyun   is used to specify the trigger type as defined in
17*4882a593Smuzhiyun   <dt-bindings/interrupt-controller/irq.h>:
18*4882a593Smuzhiyun      IRQ_TYPE_EDGE_RISING
19*4882a593Smuzhiyun      IRQ_TYPE_EDGE_FALLING
20*4882a593Smuzhiyun      IRQ_TYPE_EDGE_BOTH
21*4882a593Smuzhiyun - clocks: Clock specifier (see clock bindings for details).
22*4882a593Smuzhiyun - microchip,gpio-bank: Specifies which bank a controller owns.
23*4882a593Smuzhiyun - gpio-ranges: Interaction with the PINCTRL subsystem.
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunExample:
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun/* PORTA */
28*4882a593Smuzhiyungpio0: gpio0@1f860000 {
29*4882a593Smuzhiyun	compatible = "microchip,pic32mzda-gpio";
30*4882a593Smuzhiyun	reg = <0x1f860000 0x100>;
31*4882a593Smuzhiyun	interrupts = <118 IRQ_TYPE_LEVEL_HIGH>;
32*4882a593Smuzhiyun	#gpio-cells = <2>;
33*4882a593Smuzhiyun	gpio-controller;
34*4882a593Smuzhiyun	interrupt-controller;
35*4882a593Smuzhiyun	#interrupt-cells = <2>;
36*4882a593Smuzhiyun	clocks = <&rootclk PB4CLK>;
37*4882a593Smuzhiyun	microchip,gpio-bank = <0>;
38*4882a593Smuzhiyun	gpio-ranges = <&pic32_pinctrl 0 0 16>;
39*4882a593Smuzhiyun};
40*4882a593Smuzhiyun
41*4882a593Smuzhiyunkeys {
42*4882a593Smuzhiyun	...
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun	button@sw1 {
45*4882a593Smuzhiyun		label = "ESC";
46*4882a593Smuzhiyun		linux,code = <1>;
47*4882a593Smuzhiyun		gpios = <&gpio0 12 0>;
48*4882a593Smuzhiyun	};
49*4882a593Smuzhiyun};
50