* [PATCH] Input: gpio-keys - Detect long press events in sleep mode
@ 2025-05-06 5:58 Hua Li
2025-05-12 7:57 ` lihua -
0 siblings, 1 reply; 5+ messages in thread
From: Hua Li @ 2025-05-06 5:58 UTC (permalink / raw)
To: dmitry.torokhov, hdegoede, javier.carrasco.cruz, zack.rusin,
namcao, andriy.shevchenko, tglx
Cc: linux-input, linux-kernel, Hua Li
Previously, long pressing the gpio key could only detect short press
events and could not report long press events in sleep mode, we need
to recognize long press events in sleep mode and fix this issue.
Signed-off-by: Hua Li <lihua@huaqin.corp-partner.google.com>
---
drivers/input/keyboard/gpio_keys.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 5c39a217b94c..b546f38ecf8f 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -426,6 +426,8 @@ static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id)
* handler to run.
*/
input_report_key(bdata->input, button->code, 1);
+ input_sync(bdata->input);
+ return IRQ_HANDLED;
}
}
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: gpio-keys - Detect long press events in sleep mode
2025-05-06 5:58 [PATCH] Input: gpio-keys - Detect long press events in sleep mode Hua Li
@ 2025-05-12 7:57 ` lihua -
2025-05-12 8:50 ` Andy Shevchenko
0 siblings, 1 reply; 5+ messages in thread
From: lihua - @ 2025-05-12 7:57 UTC (permalink / raw)
To: dmitry.torokhov, hdegoede, javier.carrasco.cruz, zack.rusin,
namcao, andriy.shevchenko, tglx
Cc: linux-input, linux-kernel
Hello, All linux team members:
Could you please review this modification as soon as possible?
On Tue, May 6, 2025 at 1:58 PM Hua Li
<lihua@huaqin.corp-partner.google.com> wrote:
>
> Previously, long pressing the gpio key could only detect short press
> events and could not report long press events in sleep mode, we need
> to recognize long press events in sleep mode and fix this issue.
>
> Signed-off-by: Hua Li <lihua@huaqin.corp-partner.google.com>
> ---
> drivers/input/keyboard/gpio_keys.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index 5c39a217b94c..b546f38ecf8f 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -426,6 +426,8 @@ static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id)
> * handler to run.
> */
> input_report_key(bdata->input, button->code, 1);
> + input_sync(bdata->input);
> + return IRQ_HANDLED;
> }
> }
>
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: gpio-keys - Detect long press events in sleep mode
2025-05-12 7:57 ` lihua -
@ 2025-05-12 8:50 ` Andy Shevchenko
2025-05-15 18:57 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-05-12 8:50 UTC (permalink / raw)
To: lihua -
Cc: dmitry.torokhov, hdegoede, javier.carrasco.cruz, zack.rusin,
namcao, tglx, linux-input, linux-kernel
On Mon, May 12, 2025 at 03:57:17PM +0800, lihua - wrote:
First of all, do not top-post!
> Hello, All linux team members:
> Could you please review this modification as soon as possible?
You even haven't waited for a full week...
If it's an (important) fix, made it look so (Fixes: tag, Cc: stable@, etc).
> On Tue, May 6, 2025 at 1:58 PM Hua Li
> <lihua@huaqin.corp-partner.google.com> wrote:
> >
> > Previously, long pressing the gpio key could only detect short press
> > events and could not report long press events in sleep mode, we need
> > to recognize long press events in sleep mode and fix this issue.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: gpio-keys - Detect long press events in sleep mode
2025-05-12 8:50 ` Andy Shevchenko
@ 2025-05-15 18:57 ` Dmitry Torokhov
2025-05-15 19:01 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2025-05-15 18:57 UTC (permalink / raw)
To: Andy Shevchenko
Cc: lihua -, hdegoede, javier.carrasco.cruz, zack.rusin, namcao, tglx,
linux-input, linux-kernel
On Mon, May 12, 2025 at 11:50:15AM +0300, Andy Shevchenko wrote:
> On Mon, May 12, 2025 at 03:57:17PM +0800, lihua - wrote:
>
> First of all, do not top-post!
>
> > Hello, All linux team members:
> > Could you please review this modification as soon as possible?
>
> You even haven't waited for a full week...
>
> If it's an (important) fix, made it look so (Fixes: tag, Cc: stable@, etc).
I can see that missing input_sync() might hurt, but the patch
description makes no sense. The driver does not really differentiate
between long and sort press.
Please provide a better explanation how missing sync interferes with
your use case.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: gpio-keys - Detect long press events in sleep mode
2025-05-15 18:57 ` Dmitry Torokhov
@ 2025-05-15 19:01 ` Dmitry Torokhov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2025-05-15 19:01 UTC (permalink / raw)
To: Andy Shevchenko
Cc: lihua -, hdegoede, javier.carrasco.cruz, zack.rusin, namcao, tglx,
linux-input, linux-kernel
On Thu, May 15, 2025 at 11:57:58AM -0700, Dmitry Torokhov wrote:
> On Mon, May 12, 2025 at 11:50:15AM +0300, Andy Shevchenko wrote:
> > On Mon, May 12, 2025 at 03:57:17PM +0800, lihua - wrote:
> >
> > First of all, do not top-post!
> >
> > > Hello, All linux team members:
> > > Could you please review this modification as soon as possible?
> >
> > You even haven't waited for a full week...
> >
> > If it's an (important) fix, made it look so (Fixes: tag, Cc: stable@, etc).
>
> I can see that missing input_sync() might hurt, but the patch
> description makes no sense. The driver does not really differentiate
> between long and sort press.
>
> Please provide a better explanation how missing sync interferes with
> your use case.
Also simply returning from the interrupt handler is wrong: what happens
if you simulate the key press, but the button is indeed released by the
time the handler runs? What will generate the release? The button will
appear "stuck".
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-05-15 19:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-06 5:58 [PATCH] Input: gpio-keys - Detect long press events in sleep mode Hua Li
2025-05-12 7:57 ` lihua -
2025-05-12 8:50 ` Andy Shevchenko
2025-05-15 18:57 ` Dmitry Torokhov
2025-05-15 19:01 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox