From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Vincent Knecht <vincent.knecht@mailoo.org>
Cc: Rob Herring <robh+dt@kernel.org>,
Henrik Rydberg <rydberg@bitmath.org>,
Michael Srba <Michael.Srba@seznam.cz>,
Linus Walleij <linus.walleij@linaro.org>,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH 2/2] Input: add MStar msg26xx touchscreen driver
Date: Wed, 20 Jan 2021 23:03:16 -0800 [thread overview]
Message-ID: <YAknNNgx66HDtrgQ@google.com> (raw)
In-Reply-To: <20210120180119.849588-2-vincent.knecht@mailoo.org>
Hi Vincent,
On Wed, Jan 20, 2021 at 07:01:08PM +0100, Vincent Knecht wrote:
> +struct packet {
> + u8 y_high : 4;
> + u8 x_high : 4;
This will not work on big endian devices as order of bitfields changes.
I'd recommended treating contact packet as sequence of bytes and parse,
i.e.
x = ((buf[0] & 0x0f) << 8) | buf[1];
x = ((buf[0] & 0xf0) << 4) | buf[2];
...
> + u8 x_low;
> + u8 y_low;
> + u8 pressure;
> +};
> +
> +
> +static void mstar_power_on(struct msg26xx_ts_data *msg26xx)
> +{
> + gpiod_set_value(msg26xx->reset_gpiod, 0);
> + mdelay(10);
> + gpiod_set_value(msg26xx->reset_gpiod, 1);
> + mdelay(FIRMWARE_ON_DELAY);
I am pretty sure this is incorrect. You are saying that you release the
reset line, wait a bit, and then assert it. gpiod is a logical API, with
0 being inactive and 1 being active, and here you want to activate the
reset line, wait appropriate time, release it, and wait for the device
to initialize. What does the datasheet say about reset GPIO polarity?
Thanks.
--
Dmitry
next prev parent reply other threads:[~2021-01-21 7:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 18:01 [PATCH 1/2] dt-bindings: input/touchscreen: add bindings for msg26xx Vincent Knecht
2021-01-20 18:01 ` [PATCH 2/2] Input: add MStar msg26xx touchscreen driver Vincent Knecht
2021-01-21 7:03 ` Dmitry Torokhov [this message]
2021-01-21 11:32 ` Vincent Knecht
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=YAknNNgx66HDtrgQ@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=Michael.Srba@seznam.cz \
--cc=devicetree@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=rydberg@bitmath.org \
--cc=vincent.knecht@mailoo.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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;
as well as URLs for NNTP newsgroup(s).