microchip,pic32-gpio.txt 1.4 KB

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