diff options
Diffstat (limited to 'src/soc/mediatek/mt8183/i2c.c')
-rw-r--r-- | src/soc/mediatek/mt8183/i2c.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/soc/mediatek/mt8183/i2c.c b/src/soc/mediatek/mt8183/i2c.c index 3e53a72c5e..193f4b912b 100644 --- a/src/soc/mediatek/mt8183/i2c.c +++ b/src/soc/mediatek/mt8183/i2c.c @@ -2,12 +2,9 @@ #include <assert.h> #include <device/mmio.h> -#include <soc/pll.h> #include <soc/i2c.h> #include <soc/gpio.h> -#define I2C_CLK_HZ (UNIVPLL_HZ / 20) - struct mtk_i2c mtk_i2c_bus_controller[] = { /* i2c0 setting */ { @@ -52,7 +49,8 @@ struct mtk_i2c mtk_i2c_bus_controller[] = { }, }; -#define I2C_BUS_NUMBER ARRAY_SIZE(mtk_i2c_bus_controller) +_Static_assert(ARRAY_SIZE(mtk_i2c_bus_controller) == I2C_BUS_NUMBER, + "Wrong size of mtk_i2c_bus_controller"); struct pad_func { gpio_t gpio; @@ -103,7 +101,7 @@ static void mtk_i2c_set_gpio_pinmux(uint8_t bus) } } -static void mtk_i2c_speed_init(uint8_t bus) +static void mtk_i2c_speed_init_soc(uint8_t bus) { uint8_t step_div; const uint8_t clock_div = 5; @@ -132,7 +130,7 @@ static void mtk_i2c_speed_init(uint8_t bus) void mtk_i2c_bus_init(uint8_t bus) { - mtk_i2c_speed_init(bus); + mtk_i2c_speed_init_soc(bus); mtk_i2c_set_gpio_pinmux(bus); } |