xref: /freebsd/sys/contrib/device-tree/Bindings/i2c/i2c-mt65xx.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
1d5b0e70fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2d5b0e70fSEmmanuel Vadot%YAML 1.2
3d5b0e70fSEmmanuel Vadot---
4d5b0e70fSEmmanuel Vadot$id: http://devicetree.org/schemas/i2c/i2c-mt65xx.yaml#
5d5b0e70fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6d5b0e70fSEmmanuel Vadot
7d5b0e70fSEmmanuel Vadottitle: MediaTek I2C controller
8d5b0e70fSEmmanuel Vadot
9d5b0e70fSEmmanuel Vadotdescription:
10d5b0e70fSEmmanuel Vadot  This driver interfaces with the native I2C controller present in
11d5b0e70fSEmmanuel Vadot  various MediaTek SoCs.
12d5b0e70fSEmmanuel Vadot
13d5b0e70fSEmmanuel VadotallOf:
14d5b0e70fSEmmanuel Vadot  - $ref: /schemas/i2c/i2c-controller.yaml#
15d5b0e70fSEmmanuel Vadot
16d5b0e70fSEmmanuel Vadotmaintainers:
17d5b0e70fSEmmanuel Vadot  - Qii Wang <qii.wang@mediatek.com>
18d5b0e70fSEmmanuel Vadot
19d5b0e70fSEmmanuel Vadotproperties:
20d5b0e70fSEmmanuel Vadot  compatible:
21d5b0e70fSEmmanuel Vadot    oneOf:
22d5b0e70fSEmmanuel Vadot      - const: mediatek,mt2712-i2c
23d5b0e70fSEmmanuel Vadot      - const: mediatek,mt6577-i2c
24d5b0e70fSEmmanuel Vadot      - const: mediatek,mt6589-i2c
25d5b0e70fSEmmanuel Vadot      - const: mediatek,mt7622-i2c
26*fac71e4eSEmmanuel Vadot      - const: mediatek,mt7981-i2c
278bab661aSEmmanuel Vadot      - const: mediatek,mt7986-i2c
28d5b0e70fSEmmanuel Vadot      - const: mediatek,mt8168-i2c
29d5b0e70fSEmmanuel Vadot      - const: mediatek,mt8173-i2c
30d5b0e70fSEmmanuel Vadot      - const: mediatek,mt8183-i2c
31d5b0e70fSEmmanuel Vadot      - const: mediatek,mt8186-i2c
32b97ee269SEmmanuel Vadot      - const: mediatek,mt8188-i2c
33d5b0e70fSEmmanuel Vadot      - const: mediatek,mt8192-i2c
34d5b0e70fSEmmanuel Vadot      - items:
35d5b0e70fSEmmanuel Vadot          - enum:
36d5b0e70fSEmmanuel Vadot              - mediatek,mt7629-i2c
37d5b0e70fSEmmanuel Vadot              - mediatek,mt8516-i2c
38d5b0e70fSEmmanuel Vadot          - const: mediatek,mt2712-i2c
39d5b0e70fSEmmanuel Vadot      - items:
40d5b0e70fSEmmanuel Vadot          - enum:
41d5b0e70fSEmmanuel Vadot              - mediatek,mt2701-i2c
42d5b0e70fSEmmanuel Vadot              - mediatek,mt6797-i2c
43d5b0e70fSEmmanuel Vadot              - mediatek,mt7623-i2c
44d5b0e70fSEmmanuel Vadot          - const: mediatek,mt6577-i2c
45d5b0e70fSEmmanuel Vadot      - items:
46d5b0e70fSEmmanuel Vadot          - enum:
47cb7aa33aSEmmanuel Vadot              - mediatek,mt8365-i2c
48cb7aa33aSEmmanuel Vadot          - const: mediatek,mt8168-i2c
49cb7aa33aSEmmanuel Vadot      - items:
50cb7aa33aSEmmanuel Vadot          - enum:
51*fac71e4eSEmmanuel Vadot              - mediatek,mt6795-i2c
52*fac71e4eSEmmanuel Vadot          - const: mediatek,mt8173-i2c
53*fac71e4eSEmmanuel Vadot      - items:
54*fac71e4eSEmmanuel Vadot          - enum:
55d5b0e70fSEmmanuel Vadot              - mediatek,mt8195-i2c
56d5b0e70fSEmmanuel Vadot          - const: mediatek,mt8192-i2c
57d5b0e70fSEmmanuel Vadot
58d5b0e70fSEmmanuel Vadot  reg:
59d5b0e70fSEmmanuel Vadot    items:
60d5b0e70fSEmmanuel Vadot      - description: Physical base address
61d5b0e70fSEmmanuel Vadot      - description: DMA base address
62d5b0e70fSEmmanuel Vadot
63d5b0e70fSEmmanuel Vadot  interrupts:
64d5b0e70fSEmmanuel Vadot    maxItems: 1
65d5b0e70fSEmmanuel Vadot
66d5b0e70fSEmmanuel Vadot  clocks:
67d5b0e70fSEmmanuel Vadot    minItems: 2
68d5b0e70fSEmmanuel Vadot    items:
69d5b0e70fSEmmanuel Vadot      - description: Main clock for I2C bus
70d5b0e70fSEmmanuel Vadot      - description: Clock for I2C via DMA
71d5b0e70fSEmmanuel Vadot      - description: Bus arbitrator clock
72d5b0e70fSEmmanuel Vadot      - description: Clock for I2C from PMIC
73d5b0e70fSEmmanuel Vadot
74d5b0e70fSEmmanuel Vadot  clock-names:
75d5b0e70fSEmmanuel Vadot    minItems: 2
76d5b0e70fSEmmanuel Vadot    items:
77d5b0e70fSEmmanuel Vadot      - const: main
78d5b0e70fSEmmanuel Vadot      - const: dma
79d5b0e70fSEmmanuel Vadot      - const: arb
80d5b0e70fSEmmanuel Vadot      - const: pmic
81d5b0e70fSEmmanuel Vadot
82d5b0e70fSEmmanuel Vadot  clock-div:
83d5b0e70fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
84d5b0e70fSEmmanuel Vadot    description: Frequency divider of clock source in I2C module
85d5b0e70fSEmmanuel Vadot
86d5b0e70fSEmmanuel Vadot  clock-frequency:
87d5b0e70fSEmmanuel Vadot    default: 100000
88d5b0e70fSEmmanuel Vadot    description:
89d5b0e70fSEmmanuel Vadot      SCL frequency to use (in Hz). If omitted, 100kHz is used.
90d5b0e70fSEmmanuel Vadot
91d5b0e70fSEmmanuel Vadot  mediatek,have-pmic:
92d5b0e70fSEmmanuel Vadot    description: Platform controls I2C from PMIC side
93d5b0e70fSEmmanuel Vadot    type: boolean
94d5b0e70fSEmmanuel Vadot
95d5b0e70fSEmmanuel Vadot  mediatek,use-push-pull:
96d5b0e70fSEmmanuel Vadot    description: Use push-pull mode I/O config
97d5b0e70fSEmmanuel Vadot    type: boolean
98d5b0e70fSEmmanuel Vadot
99d5b0e70fSEmmanuel Vadot  vbus-supply:
100d5b0e70fSEmmanuel Vadot    description: Phandle to the regulator providing power to SCL/SDA
101d5b0e70fSEmmanuel Vadot
102d5b0e70fSEmmanuel Vadotrequired:
103d5b0e70fSEmmanuel Vadot  - compatible
104d5b0e70fSEmmanuel Vadot  - reg
105d5b0e70fSEmmanuel Vadot  - clocks
106d5b0e70fSEmmanuel Vadot  - clock-names
107d5b0e70fSEmmanuel Vadot  - clock-div
108d5b0e70fSEmmanuel Vadot  - interrupts
109d5b0e70fSEmmanuel Vadot
110d5b0e70fSEmmanuel VadotunevaluatedProperties: false
111d5b0e70fSEmmanuel Vadot
112d5b0e70fSEmmanuel Vadotexamples:
113d5b0e70fSEmmanuel Vadot  - |
114d5b0e70fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
115d5b0e70fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
116d5b0e70fSEmmanuel Vadot
117d5b0e70fSEmmanuel Vadot    i2c0: i2c@1100d000 {
118d5b0e70fSEmmanuel Vadot      compatible = "mediatek,mt6577-i2c";
119d5b0e70fSEmmanuel Vadot      reg = <0x1100d000 0x70>, <0x11000300 0x80>;
120d5b0e70fSEmmanuel Vadot      interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_LOW>;
121d5b0e70fSEmmanuel Vadot      clocks = <&i2c0_ck>, <&ap_dma_ck>;
122d5b0e70fSEmmanuel Vadot      clock-names = "main", "dma";
123d5b0e70fSEmmanuel Vadot      clock-div = <16>;
124d5b0e70fSEmmanuel Vadot      clock-frequency = <400000>;
125d5b0e70fSEmmanuel Vadot      mediatek,have-pmic;
126d5b0e70fSEmmanuel Vadot
127d5b0e70fSEmmanuel Vadot      #address-cells = <1>;
128d5b0e70fSEmmanuel Vadot      #size-cells = <0>;
129d5b0e70fSEmmanuel Vadot    };
130