From f7a977d39a23c196d0ac53dd6278e89dc36138d0 Mon Sep 17 00:00:00 2001 From: Hope Wang Date: Tue, 31 Dec 2024 11:10:11 +0800 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/85839 Tested-by: build bot (Jenkins) Reviewed-by: Yidi Lin Reviewed-by: Yu-Ping Wu --- src/mainboard/google/rauru/boardid.c | 2 +- src/soc/mediatek/common/include/soc/mt6363.h | 2 +- src/soc/mediatek/common/include/soc/mt6363_sdmadc.h | 2 +- src/soc/mediatek/common/mt6363.c | 2 +- src/soc/mediatek/common/mt6363_sdmadc.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mainboard/google/rauru/boardid.c b/src/mainboard/google/rauru/boardid.c index e3e0979012..fc0230d4ab 100644 --- a/src/mainboard/google/rauru/boardid.c +++ b/src/mainboard/google/rauru/boardid.c @@ -38,7 +38,7 @@ static const unsigned int *adc_voltages[] = { 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 19b23d4bf5..46591191b5 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_vrf18(bool enable); 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 ae990c9cb7..873582435e 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 @@ struct auxadc_chan_spec { } 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 20ef9f05ac..b16f6b1dbc 100644 --- a/src/soc/mediatek/common/mt6363.c +++ b/src/soc/mediatek/common/mt6363.c @@ -25,7 +25,7 @@ static const struct pmic_setting key_protect_setting[] = { }; 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 eb4b9780a6..647423d13c 100644 --- a/src/soc/mediatek/common/mt6363_sdmadc.c +++ b/src/soc/mediatek/common/mt6363_sdmadc.c @@ -61,11 +61,11 @@ static const struct auxadc_chan_spec mt6363_sdmadc_chan_specs[] = { _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;