Skip to content

Commit 1b48006

Browse files
Kewei Xuwsakernel
authored andcommitted
i2c: mediatek: add i2c compatible for MT8188
Add i2c compatible for MT8188 and added mt_i2c_regs_v3[], since MT8188 i2c OFFSET_SLAVE_ADDR register changed from 0x04 to 0x94. Signed-off-by: Kewei Xu <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Qii Wang <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 3a8b542 commit 1b48006

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

drivers/i2c/busses/i2c-mt65xx.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,35 @@ static const u16 mt_i2c_regs_v2[] = {
229229
[OFFSET_DCM_EN] = 0xf88,
230230
};
231231

232+
static const u16 mt_i2c_regs_v3[] = {
233+
[OFFSET_DATA_PORT] = 0x0,
234+
[OFFSET_INTR_MASK] = 0x8,
235+
[OFFSET_INTR_STAT] = 0xc,
236+
[OFFSET_CONTROL] = 0x10,
237+
[OFFSET_TRANSFER_LEN] = 0x14,
238+
[OFFSET_TRANSAC_LEN] = 0x18,
239+
[OFFSET_DELAY_LEN] = 0x1c,
240+
[OFFSET_TIMING] = 0x20,
241+
[OFFSET_START] = 0x24,
242+
[OFFSET_EXT_CONF] = 0x28,
243+
[OFFSET_LTIMING] = 0x2c,
244+
[OFFSET_HS] = 0x30,
245+
[OFFSET_IO_CONFIG] = 0x34,
246+
[OFFSET_FIFO_ADDR_CLR] = 0x38,
247+
[OFFSET_SDA_TIMING] = 0x3c,
248+
[OFFSET_TRANSFER_LEN_AUX] = 0x44,
249+
[OFFSET_CLOCK_DIV] = 0x48,
250+
[OFFSET_SOFTRESET] = 0x50,
251+
[OFFSET_MULTI_DMA] = 0x8c,
252+
[OFFSET_SCL_MIS_COMP_POINT] = 0x90,
253+
[OFFSET_SLAVE_ADDR] = 0x94,
254+
[OFFSET_DEBUGSTAT] = 0xe4,
255+
[OFFSET_DEBUGCTRL] = 0xe8,
256+
[OFFSET_FIFO_STAT] = 0xf4,
257+
[OFFSET_FIFO_THRESH] = 0xf8,
258+
[OFFSET_DCM_EN] = 0xf88,
259+
};
260+
232261
struct mtk_i2c_compatible {
233262
const struct i2c_adapter_quirks *quirks;
234263
const u16 *regs;
@@ -442,6 +471,19 @@ static const struct mtk_i2c_compatible mt8186_compat = {
442471
.max_dma_support = 36,
443472
};
444473

474+
static const struct mtk_i2c_compatible mt8188_compat = {
475+
.regs = mt_i2c_regs_v3,
476+
.pmic_i2c = 0,
477+
.dcm = 0,
478+
.auto_restart = 1,
479+
.aux_len_reg = 1,
480+
.timing_adjust = 1,
481+
.dma_sync = 0,
482+
.ltiming_adjust = 1,
483+
.apdma_sync = 1,
484+
.max_dma_support = 36,
485+
};
486+
445487
static const struct mtk_i2c_compatible mt8192_compat = {
446488
.quirks = &mt8183_i2c_quirks,
447489
.regs = mt_i2c_regs_v2,
@@ -465,6 +507,7 @@ static const struct of_device_id mtk_i2c_of_match[] = {
465507
{ .compatible = "mediatek,mt8173-i2c", .data = &mt8173_compat },
466508
{ .compatible = "mediatek,mt8183-i2c", .data = &mt8183_compat },
467509
{ .compatible = "mediatek,mt8186-i2c", .data = &mt8186_compat },
510+
{ .compatible = "mediatek,mt8188-i2c", .data = &mt8188_compat },
468511
{ .compatible = "mediatek,mt8192-i2c", .data = &mt8192_compat },
469512
{}
470513
};

0 commit comments

Comments
 (0)