From 9d321588d04843621af4cddff411ddcee88fe682 Mon Sep 17 00:00:00 2001 From: Rex-BC Chen Date: Wed, 3 Nov 2021 11:28:23 +0800 Subject: soc/mediatek: move i2c function to common folder Move mtk_i2c_max_step_cnt, mtk_i2c_check_ac_timing, mtk_i2c_speed_init and mtk_i2c_calculate_speed to common folder to share with MT8186. TEST=test on tomato ok TEST=emerge-asurada coreboot BUG=b:202871018 Signed-off-by: Rex-BC Chen Change-Id: I4a702741c763bf9261cea90d0d71c08b6e28c261 Reviewed-on: https://review.coreboot.org/c/coreboot/+/59295 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu --- src/soc/mediatek/mt8183/include/soc/i2c.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/soc/mediatek/mt8183/include') diff --git a/src/soc/mediatek/mt8183/include/soc/i2c.h b/src/soc/mediatek/mt8183/include/soc/i2c.h index e70cf47958..ebe75facce 100644 --- a/src/soc/mediatek/mt8183/include/soc/i2c.h +++ b/src/soc/mediatek/mt8183/include/soc/i2c.h @@ -4,6 +4,7 @@ #define SOC_MEDIATEK_MT8183_I2C_H #include +#include /* I2C Register */ struct mt_i2c_regs { @@ -39,6 +40,10 @@ struct mt_i2c_regs { uint32_t rollback; }; +#define I2C_CLK_HZ (UNIVPLL_HZ / 20) +#define I2C_BUS_NUMBER 7 +#define MAX_CLOCK_DIV 32 + check_member(mt_i2c_regs, multi_dma, 0xf8c); void mtk_i2c_bus_init(uint8_t bus); -- cgit v1.2.3