From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: cy_huang <u0084500@gmail.com>
Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
lee.jones@linaro.org, broonie@kernel.org, lgirdwood@gmail.com,
cy_huang@richtek.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH v2 4/4] input: misc: rt5120: Add power key support
Date: Fri, 8 Jul 2022 21:53:43 -0700 [thread overview]
Message-ID: <YskJ1wAp0rV9qFRM@google.com> (raw)
In-Reply-To: <1655892104-10874-5-git-send-email-u0084500@gmail.com>
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:
input_report_key(priv->input, KEY_POWER,
!(stat & RT5120_PWRKEYSTAT_MASK));
input_sync(priv->input);
?
Thanks.
--
Dmitry
next prev parent reply other threads:[~2022-07-09 4:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 10:01 [PATCH v2 0/4] Add Richtek RT5120 PMIC support cy_huang
2022-06-22 10:01 ` [PATCH v2 1/4] dt-binding: mfd: " cy_huang
2022-06-22 14:48 ` Krzysztof Kozlowski
2022-06-22 10:01 ` [PATCH v2 2/4] mfd: rt5120: Add Richtek " cy_huang
2022-06-27 14:22 ` Lee Jones
2022-06-27 14:56 ` ChiYuan Huang
2022-07-01 6:57 ` ChiYuan Huang
2022-07-01 7:37 ` Lee Jones
2022-07-01 9:56 ` ChiYuan Huang
2022-07-04 9:14 ` ChiYuan Huang
2022-07-04 9:54 ` Lee Jones
2022-07-05 3:04 ` ChiYuan Huang
2022-06-22 10:01 ` [PATCH v2 3/4] regulator: rt5120: Add PMIC regulator support cy_huang
2022-06-22 10:01 ` [PATCH v2 4/4] input: misc: rt5120: Add power key support cy_huang
2022-07-09 4:53 ` Dmitry Torokhov [this message]
2022-07-11 3:43 ` ChiYuan Huang
2022-06-23 13:23 ` (subset) [PATCH v2 0/4] Add Richtek RT5120 PMIC support Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YskJ1wAp0rV9qFRM@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=broonie@kernel.org \
--cc=cy_huang@richtek.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=u0084500@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.