0001 # SPDX-License-Identifier: GPL-2.0
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/i2c/i2c-rk3x.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Rockchip RK3xxx I2C controller
0008
0009 description:
0010 This driver interfaces with the native I2C controller present in Rockchip
0011 RK3xxx SoCs.
0012
0013 allOf:
0014 - $ref: /schemas/i2c/i2c-controller.yaml#
0015
0016 maintainers:
0017 - Heiko Stuebner <heiko@sntech.de>
0018
0019 # Everything else is described in the common file
0020 properties:
0021 compatible:
0022 oneOf:
0023 - const: rockchip,rv1108-i2c
0024 - const: rockchip,rk3066-i2c
0025 - const: rockchip,rk3188-i2c
0026 - const: rockchip,rk3228-i2c
0027 - const: rockchip,rk3288-i2c
0028 - const: rockchip,rk3399-i2c
0029 - items:
0030 - enum:
0031 - rockchip,rk3036-i2c
0032 - rockchip,rk3368-i2c
0033 - const: rockchip,rk3288-i2c
0034 - items:
0035 - enum:
0036 - rockchip,px30-i2c
0037 - rockchip,rk3308-i2c
0038 - rockchip,rk3328-i2c
0039 - rockchip,rk3568-i2c
0040 - rockchip,rk3588-i2c
0041 - rockchip,rv1126-i2c
0042 - const: rockchip,rk3399-i2c
0043
0044 reg:
0045 maxItems: 1
0046
0047 interrupts:
0048 maxItems: 1
0049
0050 clocks:
0051 minItems: 1
0052 items:
0053 - description:
0054 For older hardware (rk3066, rk3188, rk3228, rk3288)
0055 there is one clock that is used both to derive the functional clock
0056 for the device and as the bus clock.
0057 For newer hardware (rk3399) this clock is used to derive
0058 the functional clock
0059 - description:
0060 For newer hardware (rk3399) this is the bus clock
0061
0062 clock-names:
0063 minItems: 1
0064 items:
0065 - const: i2c
0066 - const: pclk
0067
0068 rockchip,grf:
0069 $ref: /schemas/types.yaml#/definitions/phandle
0070 description:
0071 Required on RK3066, RK3188 the phandle of the syscon node for
0072 the general register file (GRF)
0073 On those SoCs an alias with the correct I2C bus ID
0074 (bit offset in the GRF) is also required.
0075
0076 clock-frequency:
0077 default: 100000
0078 description:
0079 SCL frequency to use (in Hz). If omitted, 100kHz is used.
0080
0081 i2c-scl-rising-time-ns:
0082 default: 1000
0083 description:
0084 Number of nanoseconds the SCL signal takes to rise
0085 (t(r) in I2C specification). If not specified this is assumed to be
0086 the maximum the specification allows(1000 ns for Standard-mode,
0087 300 ns for Fast-mode) which might cause slightly slower communication.
0088
0089 i2c-scl-falling-time-ns:
0090 default: 300
0091 description:
0092 Number of nanoseconds the SCL signal takes to fall
0093 (t(f) in the I2C specification). If not specified this is assumed to
0094 be the maximum the specification allows (300 ns) which might cause
0095 slightly slower communication.
0096
0097 i2c-sda-falling-time-ns:
0098 default: 300
0099 description:
0100 Number of nanoseconds the SDA signal takes to fall
0101 (t(f) in the I2C specification). If not specified we will use the SCL
0102 value since they are the same in nearly all cases.
0103
0104 required:
0105 - compatible
0106 - reg
0107 - interrupts
0108 - clocks
0109 - clock-names
0110
0111 if:
0112 properties:
0113 compatible:
0114 contains:
0115 enum:
0116 - rockchip,rk3066-i2c
0117 - rockchip,rk3188-i2c
0118
0119 then:
0120 required:
0121 - rockchip,grf
0122
0123 unevaluatedProperties: false
0124
0125 examples:
0126 - |
0127 #include <dt-bindings/clock/rk3188-cru-common.h>
0128 #include <dt-bindings/interrupt-controller/arm-gic.h>
0129 #include <dt-bindings/interrupt-controller/irq.h>
0130 i2c0: i2c@2002d000 {
0131 compatible = "rockchip,rk3188-i2c";
0132 reg = <0x2002d000 0x1000>;
0133 interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
0134 clocks = <&cru PCLK_I2C0>;
0135 clock-names = "i2c";
0136 rockchip,grf = <&grf>;
0137 i2c-scl-falling-time-ns = <100>;
0138 i2c-scl-rising-time-ns = <800>;
0139 #address-cells = <1>;
0140 #size-cells = <0>;
0141 };