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