From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Andreas Kemnade <andreas@kemnade.info>,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
hdegoede@redhat.com, u.kleine-koenig@pengutronix.de,
siebren.vroegindeweij@hotmail.com, linux-input@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Input: ektf2127 - add ektf2232 support
Date: Thu, 2 May 2024 16:10:17 -0700 [thread overview]
Message-ID: <ZjQdWdpmqoXhJeek@google.com> (raw)
In-Reply-To: <CAHp75Vd1A8sy2Oky9TENUTAj0SCCyVQ8Zh49AN3X7t9cK2F+iw@mail.gmail.com>
On Thu, May 02, 2024 at 10:16:01PM +0300, Andy Shevchenko wrote:
> On Thu, May 2, 2024 at 9:58 PM Andreas Kemnade <andreas@kemnade.info> wrote:
> >
> > The chip is similar, but has status bits at different positions,
> > so use the correct bits.
>
> ...
>
> > + if (ts->shifted_status) {
Instead of the flag I think it would be better if you had
ts->status_shift and did
status = buf[7] >> ts->status_shift;
ektf2127_report2_contact(ts, 0, &buf[1], status & BIT(0));
ektf2127_report2_contact(ts, 1, &buf[4], status & BIT(1));
> > + ektf2127_report2_contact(ts, 0, &buf[1], !!(buf[7] & 1));
> > + ektf2127_report2_contact(ts, 1, &buf[4], !!(buf[7] & 2));
>
> BIT(0)
> BIT(1)
>
> > + } else {
> > + ektf2127_report2_contact(ts, 0, &buf[1], !!(buf[7] & 2));
> > + ektf2127_report2_contact(ts, 1, &buf[4], !!(buf[7] & 4));
>
> BIT(1)
> BIT(2)
>
> > + }
>
> ...
>
> > + if (dev->of_node &&
> > + of_device_is_compatible(dev->of_node, "elan,ektf2232"))
>
> if (device_is_compatible(...))
Actually I think this better come from data obtained via
device_get_match_data().
>
> > + ts->shifted_status = true;
>
Thanks.
--
Dmitry
next prev parent reply other threads:[~2024-05-02 23:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-02 18:58 [PATCH 0/2] Input: Add ektf2232 support Andreas Kemnade
2024-05-02 18:58 ` [PATCH 1/2] dt-bindings: touchscreen: convert elan,ektf2127 to json-schema Andreas Kemnade
2024-05-03 7:07 ` Krzysztof Kozlowski
2024-05-02 18:58 ` [PATCH 2/2] Input: ektf2127 - add ektf2232 support Andreas Kemnade
2024-05-02 19:16 ` Andy Shevchenko
2024-05-02 23:10 ` Dmitry Torokhov [this message]
2024-05-03 3:37 ` Andy Shevchenko
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=ZjQdWdpmqoXhJeek@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=andreas@kemnade.info \
--cc=andy.shevchenko@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hdegoede@redhat.com \
--cc=krzk+dt@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=siebren.vroegindeweij@hotmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox