blob: ba37f4ab4d2fd71a8ceded9dd847f82906a635fb [file] [log] [blame]
developer5d148cb2023-06-02 13:08:11 +08001From c4ad4b0aa7fb10beb510b99caba9cd027a88a723 Mon Sep 17 00:00:00 2001
2From: Sam Shih <sam.shih@mediatek.com>
3Date: Fri, 2 Jun 2023 13:06:06 +0800
4Subject: [PATCH] [slow-speed-io][999-2111-i2c-busses-add-mt7981-support.patch]
5
6---
7 drivers/i2c/busses/i2c-mt65xx.c | 15 ++++++++++++++-
8 1 file changed, 14 insertions(+), 1 deletion(-)
9
developer472dc5c2021-12-16 10:28:37 +080010diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
developer5d148cb2023-06-02 13:08:11 +080011index 14d96c876..995e8bbaf 100644
developer472dc5c2021-12-16 10:28:37 +080012--- a/drivers/i2c/busses/i2c-mt65xx.c
13+++ b/drivers/i2c/busses/i2c-mt65xx.c
14@@ -157,7 +157,7 @@ static const u16 mt_i2c_regs_v1[] = {
15
16 static const u16 mt_i2c_regs_v2[] = {
17 [OFFSET_DATA_PORT] = 0x0,
18- [OFFSET_SLAVE_ADDR] = 0x4,
19+ [OFFSET_SLAVE_ADDR] = 0x94,
20 [OFFSET_INTR_MASK] = 0x8,
21 [OFFSET_INTR_STAT] = 0xc,
22 [OFFSET_CONTROL] = 0x10,
23@@ -289,6 +289,18 @@ static const struct mtk_i2c_compatible mt7622_compat = {
24 .ltiming_adjust = 0,
25 };
26
27+static const struct mtk_i2c_compatible mt7981_compat = {
28+ .regs = mt_i2c_regs_v2,
29+ .pmic_i2c = 0,
30+ .dcm = 0,
31+ .auto_restart = 1,
32+ .aux_len_reg = 1,
33+ .support_33bits = 1,
34+ .timing_adjust = 1,
35+ .dma_sync = 1,
36+ .ltiming_adjust = 1,
37+};
38+
39 static const struct mtk_i2c_compatible mt7986_compat = {
40 .quirks = &mt7622_i2c_quirks,
41 .regs = mt_i2c_regs_v1,
42@@ -332,6 +344,7 @@ static const struct of_device_id mtk_i2c_of_match[] = {
43 { .compatible = "mediatek,mt6577-i2c", .data = &mt6577_compat },
44 { .compatible = "mediatek,mt6589-i2c", .data = &mt6589_compat },
45 { .compatible = "mediatek,mt7622-i2c", .data = &mt7622_compat },
46+ { .compatible = "mediatek,mt7981-i2c", .data = &mt7981_compat },
47 { .compatible = "mediatek,mt7986-i2c", .data = &mt7986_compat },
48 { .compatible = "mediatek,mt8173-i2c", .data = &mt8173_compat },
49 { .compatible = "mediatek,mt8183-i2c", .data = &mt8183_compat },
50--
developer5d148cb2023-06-02 13:08:11 +0800512.34.1
developer472dc5c2021-12-16 10:28:37 +080052