fe5be94fca446e9466c5d4249f144250e5e52c94
[openwrt/staging/ansuel.git] /
1 From de054c03f90b3ea22bc346fbf78ac716df192b2d Mon Sep 17 00:00:00 2001
2 From: Kewei Xu <kewei.xu@mediatek.com>
3 Date: Mon, 7 Mar 2022 11:36:49 +0800
4 Subject: [PATCH 07/16] i2c: mediatek: Add i2c compatible for Mediatek MT8168
5
6 Add i2c compatible for MT8168. Compare to MT2712 i2c controller,
7 MT8168 need to synchronize signal with dma.
8
9 Signed-off-by: Kewei Xu <kewei.xu@mediatek.com>
10 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
11 Reviewed-by: Qii Wang <qii.wang@mediatek.com>
12 Signed-off-by: Wolfram Sang <wsa@kernel.org>
13 ---
14 drivers/i2c/busses/i2c-mt65xx.c | 14 ++++++++++++++
15 1 file changed, 14 insertions(+)
16
17 --- a/drivers/i2c/busses/i2c-mt65xx.c
18 +++ b/drivers/i2c/busses/i2c-mt65xx.c
19 @@ -389,6 +389,19 @@ static const struct mtk_i2c_compatible m
20 .max_dma_support = 32,
21 };
22
23 +static const struct mtk_i2c_compatible mt8168_compat = {
24 + .regs = mt_i2c_regs_v1,
25 + .pmic_i2c = 0,
26 + .dcm = 1,
27 + .auto_restart = 1,
28 + .aux_len_reg = 1,
29 + .timing_adjust = 1,
30 + .dma_sync = 1,
31 + .ltiming_adjust = 0,
32 + .apdma_sync = 0,
33 + .max_dma_support = 33,
34 +};
35 +
36 static const struct mtk_i2c_compatible mt8173_compat = {
37 .regs = mt_i2c_regs_v1,
38 .pmic_i2c = 0,
39 @@ -448,6 +461,7 @@ static const struct of_device_id mtk_i2c
40 { .compatible = "mediatek,mt6577-i2c", .data = &mt6577_compat },
41 { .compatible = "mediatek,mt6589-i2c", .data = &mt6589_compat },
42 { .compatible = "mediatek,mt7622-i2c", .data = &mt7622_compat },
43 + { .compatible = "mediatek,mt8168-i2c", .data = &mt8168_compat },
44 { .compatible = "mediatek,mt8173-i2c", .data = &mt8173_compat },
45 { .compatible = "mediatek,mt8183-i2c", .data = &mt8183_compat },
46 { .compatible = "mediatek,mt8186-i2c", .data = &mt8186_compat },