[PATCH 2/2] Input: mtk-pmic-keys - fix MT6357 long-press reset bits

From: Ilia Snezhkov via B4 Relay

Date: Wed Nov 25 2026 - 19:07:28 EST


From: Ilia Snezhkov <iasnezhkov@xxxxxxxxx>

The home key entry of mt6357_regs passes MTK_PMIC_HOMEKEY_INDEX, the
array index 1, as its reset enable mask, so the driver writes BIT(0) of
TOP_RST_MISC for the home key. The other two bits come from the MT6397
layout: BIT(6) for the power key and GENMASK(9, 8) for the long-press
time.

MT6357 shares TOP_RST_MISC at 0x14c with MT6358, and MediaTek's
downstream mtk-pmic-keys driver programs it with the same layout as
MT6358: power key reset enable at bit 9, home key at bit 8 and a two-bit
long-press time at bits 13:12. On MT6358 and MT6366, bit 0 of this
register is RG_WDTRSTB_EN, the PMIC watchdog reset enable (coreboot
pmic_wdt_set()), so with the default mediatek,long-press-mode = <0>
the probe very likely disables the PMIC watchdog reset on MT6357 too.

Use the MT6358 layout for MT6357.

Found and drafted with an AI coding assistant while bringing up MT6789.

Fixes: 297770ec5c93 ("Input: mtk-pmic-keys: add MT6357 support")
Signed-off-by: Ilia Snezhkov <iasnezhkov@xxxxxxxxx>
---

Notes:
Not tested on MT6357 hardware: the layout comes from MediaTek's
downstream driver and from the MT6358/MT6366 sources cited in 1/2.
Not compile-tested in this form; the change only swaps constants.

drivers/input/keyboard/mtk-pmic-keys.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
index 422a1f4..39cdb50 100644
--- a/drivers/input/keyboard/mtk-pmic-keys.c
+++ b/drivers/input/keyboard/mtk-pmic-keys.c
@@ -101,13 +101,13 @@ static const struct mtk_pmic_regs mt6357_regs = {
.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
MTK_PMIC_KEYS_REGS(MT6357_TOPSTATUS,
0x2, MT6357_PSC_TOP_INT_CON0, 0x5,
- MTK_PMIC_PWRKEY_RST),
+ MTK_PMIC_MT6358_PWRKEY_RST),
.keys_regs[MTK_PMIC_HOMEKEY_INDEX] =
MTK_PMIC_KEYS_REGS(MT6357_TOPSTATUS,
0x8, MT6357_PSC_TOP_INT_CON0, 0xa,
- MTK_PMIC_HOMEKEY_INDEX),
+ MTK_PMIC_MT6358_HOMEKEY_RST),
.pmic_rst_reg = MT6357_TOP_RST_MISC,
- .rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
+ .rst_lprst_mask = MTK_PMIC_MT6358_RST_DU_MASK,
};

static const struct mtk_pmic_regs mt6358_regs = {
--
2.54.0 (Apple Git-157)