xref: /freebsd/sys/contrib/device-tree/Bindings/i2c/i2c-rk3x.yaml (revision 3a3af6b2a160bea72509a9d5ef84e25906b0478a)
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          - const: rockchip,rk3399-i2c
41
42  reg:
43    maxItems: 1
44
45  interrupts:
46    maxItems: 1
47
48  clocks:
49    minItems: 1
50    items:
51      - description:
52          For older hardware (rk3066, rk3188, rk3228, rk3288)
53          there is one clock that is used both to derive the functional clock
54          for the device and as the bus clock.
55          For newer hardware (rk3399) this clock is used to derive
56          the functional clock
57      - description:
58          For newer hardware (rk3399) this is the bus clock
59
60  clock-names:
61    minItems: 1
62    items:
63      - const: i2c
64      - const: pclk
65
66  rockchip,grf:
67    $ref: /schemas/types.yaml#/definitions/phandle
68    description:
69      Required on RK3066, RK3188 the phandle of the syscon node for
70      the general register file (GRF)
71      On those SoCs an alias with the correct I2C bus ID
72      (bit offset in the GRF) is also required.
73
74  clock-frequency:
75    default: 100000
76    description:
77      SCL frequency to use (in Hz). If omitted, 100kHz is used.
78
79  i2c-scl-rising-time-ns:
80    default: 1000
81    description:
82      Number of nanoseconds the SCL signal takes to rise
83      (t(r) in I2C specification). If not specified this is assumed to be
84      the maximum the specification allows(1000 ns for Standard-mode,
85      300 ns for Fast-mode) which might cause slightly slower communication.
86
87  i2c-scl-falling-time-ns:
88    default: 300
89    description:
90      Number of nanoseconds the SCL signal takes to fall
91      (t(f) in the I2C specification). If not specified this is assumed to
92      be the maximum the specification allows (300 ns) which might cause
93      slightly slower communication.
94
95  i2c-sda-falling-time-ns:
96    default: 300
97    description:
98      Number of nanoseconds the SDA signal takes to fall
99      (t(f) in the I2C specification). If not specified we will use the SCL
100      value since they are the same in nearly all cases.
101
102required:
103  - compatible
104  - reg
105  - interrupts
106  - clocks
107  - clock-names
108
109if:
110  properties:
111    compatible:
112      contains:
113        enum:
114          - rockchip,rk3066-i2c
115          - rockchip,rk3188-i2c
116
117then:
118  required:
119    - rockchip,grf
120
121unevaluatedProperties: false
122
123examples:
124  - |
125    #include <dt-bindings/clock/rk3188-cru-common.h>
126    #include <dt-bindings/interrupt-controller/arm-gic.h>
127    #include <dt-bindings/interrupt-controller/irq.h>
128    i2c0: i2c@2002d000 {
129      compatible = "rockchip,rk3188-i2c";
130      reg = <0x2002d000 0x1000>;
131      interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
132      clocks = <&cru PCLK_I2C0>;
133      clock-names = "i2c";
134      rockchip,grf = <&grf>;
135      i2c-scl-falling-time-ns = <100>;
136      i2c-scl-rising-time-ns = <800>;
137      #address-cells = <1>;
138      #size-cells = <0>;
139    };
140