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