From 97582de4487fa6caa50a60ada91f52a0e10943b8 Mon Sep 17 00:00:00 2001 From: Rex-BC Chen Date: Thu, 22 Jul 2021 11:16:15 +0800 Subject: [PATCH] mb/google/cherry: replace magic numbers by the I2C bus name When accessing I2C, we should use the official names (I2Cx) instead of magic numbers. Signed-off-by: Rex-BC Chen Change-Id: I17cc4c87f5ad26deeb5e529d1c106b697a53591b Reviewed-on: https://review.coreboot.org/c/coreboot/+/56504 Reviewed-by: Hung-Te Lin Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/mainboard/google/cherry/mainboard.c | 4 ++-- src/mainboard/google/cherry/romstage.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/mainboard/google/cherry/mainboard.c b/src/mainboard/google/cherry/mainboard.c index 5758883edb..6b29f4417b 100644 --- a/src/mainboard/google/cherry/mainboard.c +++ b/src/mainboard/google/cherry/mainboard.c @@ -125,10 +125,10 @@ static void configure_sdcard(void) MSDC1_GPIO_MODE1_2, MSDC1_GPIO_MODE1_VALUE, MSDC1_GPIO_MODE1_3, MSDC1_GPIO_MODE1_VALUE); - mtk_i2c_bus_init(7); + mtk_i2c_bus_init(I2C7); if (CONFIG(BOARD_GOOGLE_CHERRY)) - mt6360_init(7); + mt6360_init(I2C7); mainboard_enable_regulator(MTK_REGULATOR_VCCQ, 1); mainboard_enable_regulator(MTK_REGULATOR_VCC, 1); diff --git a/src/mainboard/google/cherry/romstage.c b/src/mainboard/google/cherry/romstage.c index 193d8e16ac..c11fef45dc 100644 --- a/src/mainboard/google/cherry/romstage.c +++ b/src/mainboard/google/cherry/romstage.c @@ -11,16 +11,14 @@ #include #include -#define I2C_BUS 7 - void platform_romstage_main(void) { mtk_pmif_init(); mt6359p_init(); mt6315_init(); - mtk_i2c_bus_init(I2C_BUS); + mtk_i2c_bus_init(I2C7); if (CONFIG(BOARD_GOOGLE_CHERRY)) - mt6360_init(I2C_BUS); + mt6360_init(I2C7); clk_buf_init(); rtc_boot(); mtk_dram_init();