socionext,uniphier-gpio.yaml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/gpio/socionext,uniphier-gpio.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: UniPhier GPIO controller
  7. maintainers:
  8. - Masahiro Yamada <yamada.masahiro@socionext.com>
  9. properties:
  10. $nodename:
  11. pattern: "^gpio@[0-9a-f]+$"
  12. compatible:
  13. const: socionext,uniphier-gpio
  14. reg:
  15. maxItems: 1
  16. gpio-controller: true
  17. "#gpio-cells":
  18. const: 2
  19. interrupt-controller: true
  20. "#interrupt-cells":
  21. description: |
  22. The first cell defines the interrupt number.
  23. The second cell bits[3:0] is used to specify trigger type as follows:
  24. 1 = low-to-high edge triggered
  25. 2 = high-to-low edge triggered
  26. 4 = active high level-sensitive
  27. 8 = active low level-sensitive
  28. Valid combinations are 1, 2, 3, 4, 8.
  29. const: 2
  30. ngpios:
  31. minimum: 0
  32. maximum: 512
  33. gpio-ranges: true
  34. gpio-ranges-group-names: true
  35. socionext,interrupt-ranges:
  36. description: |
  37. Specifies an interrupt number mapping between this GPIO controller and
  38. its interrupt parent, in the form of arbitrary number of
  39. <child-interrupt-base parent-interrupt-base length> triplets.
  40. $ref: /schemas/types.yaml#/definitions/uint32-matrix
  41. patternProperties:
  42. "^.+-hog(-[0-9]+)?$":
  43. type: object
  44. required:
  45. - gpio-hog
  46. required:
  47. - compatible
  48. - reg
  49. - gpio-controller
  50. - "#gpio-cells"
  51. - interrupt-controller
  52. - "#interrupt-cells"
  53. - ngpios
  54. - gpio-ranges
  55. - socionext,interrupt-ranges
  56. additionalProperties: false
  57. examples:
  58. - |
  59. #include <dt-bindings/gpio/gpio.h>
  60. #include <dt-bindings/gpio/uniphier-gpio.h>
  61. gpio: gpio@55000000 {
  62. compatible = "socionext,uniphier-gpio";
  63. reg = <0x55000000 0x200>;
  64. interrupt-parent = <&aidet>;
  65. interrupt-controller;
  66. #interrupt-cells = <2>;
  67. gpio-controller;
  68. #gpio-cells = <2>;
  69. gpio-ranges = <&pinctrl 0 0 0>;
  70. gpio-ranges-group-names = "gpio_range";
  71. ngpios = <248>;
  72. socionext,interrupt-ranges = <0 48 16>, <16 154 5>, <21 217 3>;
  73. };
  74. // Consumer:
  75. // Please note UNIPHIER_GPIO_PORT(29, 4) represents PORT294 in the SoC
  76. // document. Unfortunately, only the one's place is octal in the port
  77. // numbering. (That is, PORT 8, 9, 18, 19, 28, 29, ... do not exist.)
  78. // UNIPHIER_GPIO_PORT() is a helper macro to calculate 29 * 8 + 4.
  79. sdhci0_pwrseq {
  80. compatible = "mmc-pwrseq-emmc";
  81. reset-gpios = <&gpio UNIPHIER_GPIO_PORT(29, 4) GPIO_ACTIVE_LOW>;
  82. };