]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - Bindings/i2c/i2c-rk3x.yaml
Import DTS files from Linux 5.7
[FreeBSD/FreeBSD.git] / Bindings / i2c / i2c-rk3x.yaml
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
7 title: Rockchip RK3xxx I2C controller
8
9 description:
10   This driver interfaces with the native I2C controller present in Rockchip
11   RK3xxx SoCs.
12
13 allOf:
14   - $ref: /schemas/i2c/i2c-controller.yaml#
15
16 maintainers:
17   - Heiko Stuebner <heiko@sntech.de>
18
19 # Everything else is described in the common file
20 properties:
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           - const: rockchip,rk3399-i2c
40
41   reg:
42     maxItems: 1
43
44   interrupts:
45     maxItems: 1
46
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
59   clock-names:
60     minItems: 1
61     items:
62       - const: i2c
63       - const: pclk
64
65   rockchip,grf:
66     $ref: /schemas/types.yaml#/definitions/phandle
67     description:
68       Required on RK3066, RK3188 the phandle of the syscon node for
69       the general register file (GRF)
70       On those SoCs an alias with the correct I2C bus ID
71       (bit offset in the GRF) is also required.
72
73   clock-frequency:
74     default: 100000
75     description:
76       SCL frequency to use (in Hz). If omitted, 100kHz is used.
77
78   i2c-scl-rising-time-ns:
79     default: 1000
80     description:
81       Number of nanoseconds the SCL signal takes to rise
82       (t(r) in I2C specification). If not specified this is assumed to be
83       the maximum the specification allows(1000 ns for Standard-mode,
84       300 ns for Fast-mode) which might cause slightly slower communication.
85
86   i2c-scl-falling-time-ns:
87     default: 300
88     description:
89       Number of nanoseconds the SCL signal takes to fall
90       (t(f) in the I2C specification). If not specified this is assumed to
91       be the maximum the specification allows (300 ns) which might cause
92       slightly slower communication.
93
94   i2c-sda-falling-time-ns:
95     default: 300
96     description:
97       Number of nanoseconds the SDA signal takes to fall
98       (t(f) in the I2C specification). If not specified we will use the SCL
99       value since they are the same in nearly all cases.
100
101 required:
102   - compatible
103   - reg
104   - interrupts
105   - clocks
106   - clock-names
107
108 if:
109   properties:
110     compatible:
111       contains:
112         enum:
113           - rockchip,rk3066-i2c
114           - rockchip,rk3188-i2c
115
116 then:
117   required:
118     - rockchip,grf
119
120 examples:
121   - |
122     #include <dt-bindings/clock/rk3188-cru-common.h>
123     #include <dt-bindings/interrupt-controller/arm-gic.h>
124     #include <dt-bindings/interrupt-controller/irq.h>
125     i2c0: i2c@2002d000 {
126       compatible = "rockchip,rk3188-i2c";
127       reg = <0x2002d000 0x1000>;
128       interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
129       clocks = <&cru PCLK_I2C0>;
130       clock-names = "i2c";
131       rockchip,grf = <&grf>;
132       i2c-scl-falling-time-ns = <100>;
133       i2c-scl-rising-time-ns = <800>;
134       #address-cells = <1>;
135       #size-cells = <0>;
136     };