mediatek: copy patches-6.1 to patches-6.6
[openwrt/staging/981213.git] / target / linux / mediatek / patches-6.6 / 854-v6.4-i2c-mediatek-add-support-for-MT7981-SoC.patch
1 From f69f3d662ba3bf999c36d9ac1e684540c4487bc3 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Mon, 10 Apr 2023 17:19:38 +0100
4 Subject: [PATCH 15/16] i2c: mediatek: add support for MT7981 SoC
5
6 Add support for the I2C units found in the MediaTek MT7981 and MT7988
7 SoCs. Just like other recent MediaTek I2C units that also uses v3
8 register offsets (which differ from v2 only by OFFSET_SLAVE_ADDR being
9 0x94 instead of 0x4).
10
11 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
12 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
13 Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
14 Signed-off-by: Wolfram Sang <wsa@kernel.org>
15 ---
16 drivers/i2c/busses/i2c-mt65xx.c | 13 +++++++++++++
17 1 file changed, 13 insertions(+)
18
19 --- a/drivers/i2c/busses/i2c-mt65xx.c
20 +++ b/drivers/i2c/busses/i2c-mt65xx.c
21 @@ -431,6 +431,18 @@ static const struct mtk_i2c_compatible m
22 .max_dma_support = 33,
23 };
24
25 +static const struct mtk_i2c_compatible mt7981_compat = {
26 + .regs = mt_i2c_regs_v3,
27 + .pmic_i2c = 0,
28 + .dcm = 0,
29 + .auto_restart = 1,
30 + .aux_len_reg = 1,
31 + .timing_adjust = 1,
32 + .dma_sync = 1,
33 + .ltiming_adjust = 1,
34 + .max_dma_support = 33
35 +};
36 +
37 static const struct mtk_i2c_compatible mt7986_compat = {
38 .quirks = &mt7622_i2c_quirks,
39 .regs = mt_i2c_regs_v1,
40 @@ -516,6 +528,7 @@ static const struct of_device_id mtk_i2c
41 { .compatible = "mediatek,mt6577-i2c", .data = &mt6577_compat },
42 { .compatible = "mediatek,mt6589-i2c", .data = &mt6589_compat },
43 { .compatible = "mediatek,mt7622-i2c", .data = &mt7622_compat },
44 + { .compatible = "mediatek,mt7981-i2c", .data = &mt7981_compat },
45 { .compatible = "mediatek,mt7986-i2c", .data = &mt7986_compat },
46 { .compatible = "mediatek,mt8168-i2c", .data = &mt8168_compat },
47 { .compatible = "mediatek,mt8173-i2c", .data = &mt8173_compat },