001-5.13-dt-bindings-gpio-binding-for-realtek-otto-gpio.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. From a362c0ce64866939c3daa17c76943cfed555b065 Mon Sep 17 00:00:00 2001
  2. From: Sander Vanheule <[email protected]>
  3. Date: Tue, 30 Mar 2021 19:48:42 +0200
  4. Subject: dt-bindings: gpio: Binding for Realtek Otto GPIO
  5. Add a binding description for Realtek's GPIO controller found on several
  6. of their MIPS-based SoCs (codenamed Otto), such as the RTL838x and
  7. RTL839x series of switch SoCs.
  8. A fallback binding 'realtek,otto-gpio' is provided for cases where the
  9. actual port ordering is not known yet, and enabling the interrupt
  10. controller may result in uncaught interrupts.
  11. Signed-off-by: Sander Vanheule <[email protected]>
  12. Reviewed-by: Linus Walleij <[email protected]>
  13. Reviewed-by: Rob Herring <[email protected]>
  14. Signed-off-by: Bartosz Golaszewski <[email protected]>
  15. ---
  16. .../bindings/gpio/realtek,otto-gpio.yaml | 78 ++++++++++++++++++++++
  17. 1 file changed, 78 insertions(+)
  18. create mode 100644 Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
  19. --- /dev/null
  20. +++ b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
  21. @@ -0,0 +1,78 @@
  22. +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
  23. +%YAML 1.2
  24. +---
  25. +$id: http://devicetree.org/schemas/gpio/realtek,otto-gpio.yaml#
  26. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  27. +
  28. +title: Realtek Otto GPIO controller
  29. +
  30. +maintainers:
  31. + - Sander Vanheule <[email protected]>
  32. + - Bert Vermeulen <[email protected]>
  33. +
  34. +description: |
  35. + Realtek's GPIO controller on their MIPS switch SoCs (Otto platform) consists
  36. + of two banks of 32 GPIOs. These GPIOs can generate edge-triggered interrupts.
  37. + Each bank's interrupts are cascased into one interrupt line on the parent
  38. + interrupt controller, if provided.
  39. + This binding allows defining a single bank in the devicetree. The interrupt
  40. + controller is not supported on the fallback compatible name, which only
  41. + allows for GPIO port use.
  42. +
  43. +properties:
  44. + $nodename:
  45. + pattern: "^gpio@[0-9a-f]+$"
  46. +
  47. + compatible:
  48. + items:
  49. + - enum:
  50. + - realtek,rtl8380-gpio
  51. + - realtek,rtl8390-gpio
  52. + - const: realtek,otto-gpio
  53. +
  54. + reg:
  55. + maxItems: 1
  56. +
  57. + "#gpio-cells":
  58. + const: 2
  59. +
  60. + gpio-controller: true
  61. +
  62. + ngpios:
  63. + minimum: 1
  64. + maximum: 32
  65. +
  66. + interrupt-controller: true
  67. +
  68. + "#interrupt-cells":
  69. + const: 2
  70. +
  71. + interrupts:
  72. + maxItems: 1
  73. +
  74. +required:
  75. + - compatible
  76. + - reg
  77. + - "#gpio-cells"
  78. + - gpio-controller
  79. +
  80. +additionalProperties: false
  81. +
  82. +dependencies:
  83. + interrupt-controller: [ interrupts ]
  84. +
  85. +examples:
  86. + - |
  87. + gpio@3500 {
  88. + compatible = "realtek,rtl8380-gpio", "realtek,otto-gpio";
  89. + reg = <0x3500 0x1c>;
  90. + gpio-controller;
  91. + #gpio-cells = <2>;
  92. + ngpios = <24>;
  93. + interrupt-controller;
  94. + #interrupt-cells = <2>;
  95. + interrupt-parent = <&rtlintc>;
  96. + interrupts = <23>;
  97. + };
  98. +
  99. +...