i2c-rk3x.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. # SPDX-License-Identifier: GPL-2.0
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/i2c/i2c-rk3x.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Rockchip RK3xxx I2C controller
  7. description:
  8. This driver interfaces with the native I2C controller present in Rockchip
  9. RK3xxx SoCs.
  10. allOf:
  11. - $ref: /schemas/i2c/i2c-controller.yaml#
  12. maintainers:
  13. - Heiko Stuebner <heiko@sntech.de>
  14. # Everything else is described in the common file
  15. properties:
  16. compatible:
  17. oneOf:
  18. - const: rockchip,rv1108-i2c
  19. - const: rockchip,rk3066-i2c
  20. - const: rockchip,rk3188-i2c
  21. - const: rockchip,rk3228-i2c
  22. - const: rockchip,rk3288-i2c
  23. - const: rockchip,rk3399-i2c
  24. - items:
  25. - enum:
  26. - rockchip,rk3036-i2c
  27. - rockchip,rk3128-i2c
  28. - rockchip,rk3368-i2c
  29. - const: rockchip,rk3288-i2c
  30. - items:
  31. - enum:
  32. - rockchip,px30-i2c
  33. - rockchip,rk3308-i2c
  34. - rockchip,rk3328-i2c
  35. - rockchip,rk3506-i2c
  36. - rockchip,rk3528-i2c
  37. - rockchip,rk3562-i2c
  38. - rockchip,rk3568-i2c
  39. - rockchip,rk3576-i2c
  40. - rockchip,rk3588-i2c
  41. - rockchip,rv1126-i2c
  42. - const: rockchip,rk3399-i2c
  43. reg:
  44. maxItems: 1
  45. interrupts:
  46. maxItems: 1
  47. clocks:
  48. minItems: 1
  49. items:
  50. - description:
  51. For older hardware (rk3066, rk3188, rk3228, rk3288)
  52. there is one clock that is used both to derive the functional clock
  53. for the device and as the bus clock.
  54. For newer hardware (rk3399) this clock is used to derive
  55. the functional clock
  56. - description:
  57. For newer hardware (rk3399) this is the bus clock
  58. clock-names:
  59. minItems: 1
  60. items:
  61. - const: i2c
  62. - const: pclk
  63. rockchip,grf:
  64. $ref: /schemas/types.yaml#/definitions/phandle
  65. description:
  66. Required on RK3066, RK3188 the phandle of the syscon node for
  67. the general register file (GRF)
  68. On those SoCs an alias with the correct I2C bus ID
  69. (bit offset in the GRF) is also required.
  70. clock-frequency:
  71. default: 100000
  72. description:
  73. SCL frequency to use (in Hz). If omitted, 100kHz is used.
  74. i2c-scl-rising-time-ns:
  75. default: 1000
  76. description:
  77. Number of nanoseconds the SCL signal takes to rise
  78. (t(r) in I2C specification). If not specified this is assumed to be
  79. the maximum the specification allows(1000 ns for Standard-mode,
  80. 300 ns for Fast-mode) which might cause slightly slower communication.
  81. i2c-scl-falling-time-ns:
  82. default: 300
  83. description:
  84. Number of nanoseconds the SCL signal takes to fall
  85. (t(f) in the I2C specification). If not specified this is assumed to
  86. be the maximum the specification allows (300 ns) which might cause
  87. slightly slower communication.
  88. i2c-sda-falling-time-ns:
  89. default: 300
  90. description:
  91. Number of nanoseconds the SDA signal takes to fall
  92. (t(f) in the I2C specification). If not specified we will use the SCL
  93. value since they are the same in nearly all cases.
  94. power-domains:
  95. maxItems: 1
  96. required:
  97. - compatible
  98. - reg
  99. - interrupts
  100. - clocks
  101. - clock-names
  102. if:
  103. properties:
  104. compatible:
  105. contains:
  106. enum:
  107. - rockchip,rk3066-i2c
  108. - rockchip,rk3188-i2c
  109. then:
  110. required:
  111. - rockchip,grf
  112. unevaluatedProperties: false
  113. examples:
  114. - |
  115. #include <dt-bindings/clock/rk3188-cru-common.h>
  116. #include <dt-bindings/interrupt-controller/arm-gic.h>
  117. #include <dt-bindings/interrupt-controller/irq.h>
  118. i2c0: i2c@2002d000 {
  119. compatible = "rockchip,rk3188-i2c";
  120. reg = <0x2002d000 0x1000>;
  121. interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
  122. clocks = <&cru PCLK_I2C0>;
  123. clock-names = "i2c";
  124. rockchip,grf = <&grf>;
  125. i2c-scl-falling-time-ns = <100>;
  126. i2c-scl-rising-time-ns = <800>;
  127. #address-cells = <1>;
  128. #size-cells = <0>;
  129. };