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