gpio-uniphier.txt 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. UniPhier GPIO controller
  2. Required properties:
  3. - compatible: Should be "socionext,uniphier-gpio".
  4. - reg: Specifies offset and length of the register set for the device.
  5. - gpio-controller: Marks the device node as a GPIO controller.
  6. - #gpio-cells: Should be 2. The first cell is the pin number and the second
  7. cell is used to specify optional parameters.
  8. - interrupt-controller: Marks the device node as an interrupt controller.
  9. - #interrupt-cells: Should be 2. The first cell defines the interrupt number.
  10. The second cell bits[3:0] is used to specify trigger type as follows:
  11. 1 = low-to-high edge triggered
  12. 2 = high-to-low edge triggered
  13. 4 = active high level-sensitive
  14. 8 = active low level-sensitive
  15. Valid combinations are 1, 2, 3, 4, 8.
  16. - ngpios: Specifies the number of GPIO lines.
  17. - gpio-ranges: Mapping to pin controller pins (as described in gpio.txt)
  18. - socionext,interrupt-ranges: Specifies an interrupt number mapping between
  19. this GPIO controller and its interrupt parent, in the form of arbitrary
  20. number of <child-interrupt-base parent-interrupt-base length> triplets.
  21. Optional properties:
  22. - gpio-ranges-group-names: Used for named gpio ranges (as described in gpio.txt)
  23. Example:
  24. gpio: gpio@55000000 {
  25. compatible = "socionext,uniphier-gpio";
  26. reg = <0x55000000 0x200>;
  27. interrupt-parent = <&aidet>;
  28. interrupt-controller;
  29. #interrupt-cells = <2>;
  30. gpio-controller;
  31. #gpio-cells = <2>;
  32. gpio-ranges = <&pinctrl 0 0 0>;
  33. gpio-ranges-group-names = "gpio_range";
  34. ngpios = <248>;
  35. socionext,interrupt-ranges = <0 48 16>, <16 154 5>, <21 217 3>;
  36. };
  37. Consumer Example:
  38. sdhci0_pwrseq {
  39. compatible = "mmc-pwrseq-emmc";
  40. reset-gpios = <&gpio UNIPHIER_GPIO_PORT(29, 4) GPIO_ACTIVE_LOW>;
  41. };
  42. Please note UNIPHIER_GPIO_PORT(29, 4) represents PORT294 in the SoC document.
  43. Unfortunately, only the one's place is octal in the port numbering. (That is,
  44. PORT 8, 9, 18, 19, 28, 29, ... are missing.) UNIPHIER_GPIO_PORT() is a helper
  45. macro to calculate 29 * 8 + 4.