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