[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADiBU3-ca=YMskJnp++sUHS7fTVb41prUzRtPdhJ_rrnYdzfkQ@mail.gmail.com>
Date: Mon, 11 Jul 2022 11:43:39 +0800
From: ChiYuan Huang <u0084500@...il.com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Lee Jones <lee.jones@...aro.org>,
Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
cy_huang <cy_huang@...htek.com>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>, lkml <linux-kernel@...r.kernel.org>,
linux-input@...r.kernel.org
Subject: Re: [PATCH v2 4/4] input: misc: rt5120: Add power key support
Dmitry Torokhov <dmitry.torokhov@...il.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
Powered by blists - more mailing lists