lkml.org 
[lkml]   [2022]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 4/4] input: misc: rt5120: Add power key support
Dmitry Torokhov <dmitry.torokhov@gmail.com> 於 2022年7月9日 週六 中午12:53寫道:
>
> Hi ChiYuan,
>
> On Wed, Jun 22, 2022 at 06:01:44PM +0800, cy_huang wrote:
> > +
> > + is_pressed = !(stat & RT5120_PWRKEYSTAT_MASK);
> > +
> > + if ((is_pressed && irq == priv->press_irq) ||
> > + (!is_pressed && irq == priv->release_irq)) {
> > + input_report_key(priv->input, KEY_POWER, is_pressed);
> > + input_sync(priv->input);
> > + }
> > +
>
> What is the reason for checking both the status and interrupt? Can we
> simply say:
>
Just to make sure 'press/release' to matche the current state.
In the IC design, it already guarantee press/release interrupt with 50
millisecond debounce time.
But if irq is delayed handling, press and release irq will all be checked.
Although irq is one by one, but in that case, pwrkey button up will be
reported twice.
I'm not sure whether this case exists or not.
>
> input_report_key(priv->input, KEY_POWER,
> !(stat & RT5120_PWRKEYSTAT_MASK));
> input_sync(priv->input);
>
> ?
>
Yes, but how about the above comment? Is that case 'don't care'?
> Thanks.
>
> --
> Dmitry

\
 
 \ /
  Last update: 2022-07-11 05:45    [W:0.052 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site