Yidi Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85839?usp=email )
Change subject: soc/mediatek/mt8196: Correct the argument type of MT6363 ......................................................................
soc/mediatek/mt8196: Correct the argument type of MT6363
Correct the argument type of the mt6363_sdmadc_read API and the return value type of the mt6363_read16 API.
TEST=Build pass BUG=b:317009620
Change-Id: I0f768e23473fa924245d90ab1e4fa383ec437db3 Signed-off-by: Hope Wang hope.wang@mediatek.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/85839 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Yidi Lin yidilin@google.com Reviewed-by: Yu-Ping Wu yupingso@google.com --- M src/mainboard/google/rauru/boardid.c M src/soc/mediatek/common/include/soc/mt6363.h M src/soc/mediatek/common/include/soc/mt6363_sdmadc.h M src/soc/mediatek/common/mt6363.c M src/soc/mediatek/common/mt6363_sdmadc.c 5 files changed, 6 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved Yidi Lin: Looks good to me, approved
diff --git a/src/mainboard/google/rauru/boardid.c b/src/mainboard/google/rauru/boardid.c index e3e0979..fc0230d 100644 --- a/src/mainboard/google/rauru/boardid.c +++ b/src/mainboard/google/rauru/boardid.c @@ -38,7 +38,7 @@
static uint32_t get_adc_index(unsigned int channel) { - int value; + u32 value;
mt6363_sdmadc_read(channel, &value, SDMADC_OPEN, AUXADC_VAL_PROCESSED); assert(channel < ARRAY_SIZE(adc_voltages)); diff --git a/src/soc/mediatek/common/include/soc/mt6363.h b/src/soc/mediatek/common/include/soc/mt6363.h index 19b23d4..4659119 100644 --- a/src/soc/mediatek/common/include/soc/mt6363.h +++ b/src/soc/mediatek/common/include/soc/mt6363.h @@ -108,7 +108,7 @@ void mt6363_enable_vram_digrf(bool enable); void mt6363_enable_vram_mdfe(bool enable); void mt6363_init_pmif_arb(void); -u32 mt6363_read16(u32 reg); +u16 mt6363_read16(u32 reg); void mt6363_write8(u32 reg, u8 reg_val); void mt6363_write_field(u32 reg, u32 val, u32 mask, u32 shift); void mt6363_init_setting(void); diff --git a/src/soc/mediatek/common/include/soc/mt6363_sdmadc.h b/src/soc/mediatek/common/include/soc/mt6363_sdmadc.h index ae990c9..8735824 100644 --- a/src/soc/mediatek/common/include/soc/mt6363_sdmadc.h +++ b/src/soc/mediatek/common/include/soc/mt6363_sdmadc.h @@ -84,7 +84,7 @@ } sdmadc_hw_info; };
-int mt6363_sdmadc_read(enum auxadc_channel channel, int *val, enum sdmadc_pures pures, +int mt6363_sdmadc_read(enum auxadc_channel channel, u32 *val, enum sdmadc_pures pures, enum auxadc_val_type type);
#endif /* __MT6363_SDMADC_H__ */ diff --git a/src/soc/mediatek/common/mt6363.c b/src/soc/mediatek/common/mt6363.c index 20ef9f0..b16f6b1 100644 --- a/src/soc/mediatek/common/mt6363.c +++ b/src/soc/mediatek/common/mt6363.c @@ -25,7 +25,7 @@ };
static struct pmif *pmif_arb; -u32 mt6363_read16(u32 reg) +u16 mt6363_read16(u32 reg) { u16 rdata = 0;
diff --git a/src/soc/mediatek/common/mt6363_sdmadc.c b/src/soc/mediatek/common/mt6363_sdmadc.c index eb4b978..647423d 100644 --- a/src/soc/mediatek/common/mt6363_sdmadc.c +++ b/src/soc/mediatek/common/mt6363_sdmadc.c @@ -61,11 +61,11 @@ _Static_assert(ARRAY_SIZE(mt6363_sdmadc_chan_specs) == AUXADC_CHAN_MAX, "Wrong array size for mt6363_sdmadc_chan_specs");
-int mt6363_sdmadc_read(enum auxadc_channel channel, int *val, +int mt6363_sdmadc_read(enum auxadc_channel channel, u32 *val, enum sdmadc_pures pures, enum auxadc_val_type type) { u8 wdata; - u32 regval; + u16 regval; u32 elapsed = 0; const struct auxadc_chan_spec *chan;