From 3eb39a1a335ed381186a2ac44e30dfc4e9107935 Mon Sep 17 00:00:00 2001 From: Lu Tang Date: Fri, 17 Jan 2025 15:30:43 +0800 Subject: [PATCH] soc/mediatek/common: Fix wrong write API for protect_key_setting When writing key_protect_setting to PMIC, PMIC expects receiving 1 byte per write. PMIC would receive unexpected zero byte if using mt6685_write16. Fix the write operation by using mt6685_write8. TEST=Build pass. BUG=b:388666377 Signed-off-by: Lu Tang Change-Id: Ib6e79642e813e7a1f0d38243e9c4db5a699cc9e3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/86035 Reviewed-by: Yu-Ping Wu Reviewed-by: Yidi Lin Tested-by: build bot (Jenkins) --- src/soc/mediatek/common/mt6685.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/soc/mediatek/common/mt6685.c b/src/soc/mediatek/common/mt6685.c index 7d17556261..0d43c7bade 100644 --- a/src/soc/mediatek/common/mt6685.c +++ b/src/soc/mediatek/common/mt6685.c @@ -74,8 +74,8 @@ static const struct mt6685_key_setting key_protect_setting[] = { static void mt6685_unlock(bool unlock) { for (int i = 0; i < ARRAY_SIZE(key_protect_setting); i++) - mt6685_write16(key_protect_setting[i].addr, - unlock ? key_protect_setting[i].val : 0); + mt6685_write8(key_protect_setting[i].addr, + unlock ? key_protect_setting[i].val : 0); } void mt6685_init_pmif_arb(void)