[PATCH 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq

Julien Massot posted 3 patches 2 months ago
There is a newer version of this series
[PATCH 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
Posted by Julien Massot 2 months ago
A recent commit in linux-next added support for key events.
However, the key release event is not properly handled: only key press events
are generated, leaving key states stuck in "pressed".

This patch ensures that both key press and key release events are properly
emitted by handling the release logic correctly.

Note: the code was introduced in linux-next by commit
bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359 PMIC keys")
and is not yet present in mainline.

Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
 drivers/input/keyboard/mtk-pmic-keys.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
index 50e2e792c91d2626d3f282d04a1db60845827ef2..0f9a589306482265f1f65c5a100b3f4aba0a2ed3 100644
--- a/drivers/input/keyboard/mtk-pmic-keys.c
+++ b/drivers/input/keyboard/mtk-pmic-keys.c
@@ -129,6 +129,7 @@ static const struct mtk_pmic_regs mt6359_regs = {
 				   MTK_PMIC_HOMEKEY_RST),
 	.pmic_rst_reg = MT6359_TOP_RST_MISC,
 	.rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
+	.key_release_irq = true,
 };
 
 struct mtk_pmic_keys_info {

-- 
2.50.1
Re: [PATCH 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
Posted by kernel test robot 2 months ago
Hi Julien,

kernel test robot noticed the following build errors:

[auto build test ERROR on b9ddaa95fd283bce7041550ddbbe7e764c477110]

url:    https://github.com/intel-lab-lkp/linux/commits/Julien-Massot/Input-mtk-pmic-keys-MT6359-has-a-specific-release-irq/20250801-211817
base:   b9ddaa95fd283bce7041550ddbbe7e764c477110
patch link:    https://lore.kernel.org/r/20250801-radxa-nio-12-l-gpio-v1-1-d0840f85d2c8%40collabora.com
patch subject: [PATCH 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
config: arc-randconfig-002-20250802 (https://download.01.org/0day-ci/archive/20250802/202508020802.nZBo2mGV-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 14.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250802/202508020802.nZBo2mGV-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508020802.nZBo2mGV-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> drivers/input/keyboard/mtk-pmic-keys.c:132:10: error: 'const struct mtk_pmic_regs' has no member named 'key_release_irq'
     132 |         .key_release_irq = true,
         |          ^~~~~~~~~~~~~~~
>> drivers/input/keyboard/mtk-pmic-keys.c:132:28: warning: excess elements in struct initializer
     132 |         .key_release_irq = true,
         |                            ^~~~
   drivers/input/keyboard/mtk-pmic-keys.c:132:28: note: (near initialization for 'mt6359_regs')


vim +132 drivers/input/keyboard/mtk-pmic-keys.c

   120	
   121	static const struct mtk_pmic_regs mt6359_regs = {
   122		.keys_regs[MTK_PMIC_PWRKEY_INDEX] =
   123			MTK_PMIC_KEYS_REGS(MT6359_TOPSTATUS,
   124					   0x2, MT6359_PSC_TOP_INT_CON0, 0x5,
   125					   MTK_PMIC_PWRKEY_RST),
   126		.keys_regs[MTK_PMIC_HOMEKEY_INDEX] =
   127			MTK_PMIC_KEYS_REGS(MT6359_TOPSTATUS,
   128					   0x8, MT6359_PSC_TOP_INT_CON0, 0xa,
   129					   MTK_PMIC_HOMEKEY_RST),
   130		.pmic_rst_reg = MT6359_TOP_RST_MISC,
   131		.rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
 > 132		.key_release_irq = true,
   133	};
   134	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
Posted by AngeloGioacchino Del Regno 2 months ago
Il 01/08/25 15:16, Julien Massot ha scritto:
> A recent commit in linux-next added support for key events.
> However, the key release event is not properly handled: only key press events
> are generated, leaving key states stuck in "pressed".
> 
> This patch ensures that both key press and key release events are properly
> emitted by handling the release logic correctly.
> 
> Note: the code was introduced in linux-next by commit
> bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359 PMIC keys")
> and is not yet present in mainline.
> 
> Signed-off-by: Julien Massot <julien.massot@collabora.com>

Well, you are effectively fixing the commit that you pointed out, so this needs

Fixes: bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359 PMIC keys")

and

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Cheers,
Angelo
Re: [PATCH 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
Posted by Dmitry Torokhov 1 month, 4 weeks ago
On Mon, Aug 04, 2025 at 10:05:21AM +0200, AngeloGioacchino Del Regno wrote:
> Il 01/08/25 15:16, Julien Massot ha scritto:
> > A recent commit in linux-next added support for key events.
> > However, the key release event is not properly handled: only key press events
> > are generated, leaving key states stuck in "pressed".
> > 
> > This patch ensures that both key press and key release events are properly
> > emitted by handling the release logic correctly.
> > 
> > Note: the code was introduced in linux-next by commit
> > bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359 PMIC keys")
> > and is not yet present in mainline.
> > 
> > Signed-off-by: Julien Massot <julien.massot@collabora.com>
> 
> Well, you are effectively fixing the commit that you pointed out, so this needs
> 
> Fixes: bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359 PMIC keys")
> 
> and
> 
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

I am really interested in how exactly this was developed, tested, and
reviewed...

Thanks.

-- 
Dmitry
Re: [PATCH 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
Posted by Julien Massot 1 month, 1 week ago
Hi Dmitry

On Wed, 2025-08-06 at 09:49 -0700, Dmitry Torokhov wrote:
> On Mon, Aug 04, 2025 at 10:05:21AM +0200, AngeloGioacchino Del Regno
> wrote:
> > Il 01/08/25 15:16, Julien Massot ha scritto:
> > > A recent commit in linux-next added support for key events.
> > > However, the key release event is not properly handled: only key
> > > press events
> > > are generated, leaving key states stuck in "pressed".
> > > 
> > > This patch ensures that both key press and key release events are
> > > properly
> > > emitted by handling the release logic correctly.
> > > 
> > > Note: the code was introduced in linux-next by commit
> > > bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359 PMIC
> > > keys")
> > > and is not yet present in mainline.
> > > 
> > > Signed-off-by: Julien Massot <julien.massot@collabora.com>
> > 
> > Well, you are effectively fixing the commit that you pointed out, so
> > this needs
> > 
> > Fixes: bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359
> > PMIC keys")
> > 
> > and
> > 
> > Reviewed-by: AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com>
> 
> I am really interested in how exactly this was developed, tested, and
> reviewed...
> 
> Thanks.

You are right, the issue comes from my side.
I prepared the patch against a slightly different tree, which led to the
discrepancy. I’ll respin it on top of the current linux-next and re-test
it properly to ensure the fix behaves as expected.

Thanks for catching this, and thanks for your time.
Julien