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