From: Michael Tretter <m.tretter@pengutronix.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, kernel@pengutronix.de,
Khalid Talash <ktalash@topcon.com>
Subject: Re: [PATCH 1/2] Input: st1232 - read firmware version and revision
Date: Fri, 6 Feb 2026 15:50:13 +0100 [thread overview]
Message-ID: <aYX_paFYIBycCrf8@pengutronix.de> (raw)
In-Reply-To: <aYRftJPEKEWE7VhK@google.com>
Hi Dmitry,
On Thu, 05 Feb 2026 01:17:17 -0800, Dmitry Torokhov wrote:
> Hi Michael,
>
> On Fri, Jan 23, 2026 at 05:28:55PM +0100, Michael Tretter wrote:
> > +static int st1232_ts_read_fw_version(struct st1232_ts_data *ts,
> > + u8 *fw_version, u32 *fw_revision)
> > +{
> > + int error;
> > +
> > + /* select firmware version register */
> > + error = st1232_ts_read_data(ts, REG_FIRMWARE_VERSION, 1);
> > + if (error)
> > + return error;
> > + *fw_version = ts->read_buf[0];
> > +
> > + /* select firmware revision register */
> > + error = st1232_ts_read_data(ts, REG_FIRMWARE_REVISION_3, 4);
> > + if (error)
> > + return error;
> > + *fw_revision = get_unaligned_le32(ts->read_buf);
>
> Why unaligned? You are not reading at an offset and allocated memory is
> cache line aligned.
I copied what other touchscreen drivers were doing to read the version,
but missed that they either read at an offset or use a buffer on the
stack.
Should I send a v2 or can you change this to le32_to_cpu() while
applying the patch?
Thanks!
Michael
next prev parent reply other threads:[~2026-02-06 14:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 16:28 [PATCH 0/2] Input: st1232 - add support for firmware version Michael Tretter
2026-01-23 16:28 ` [PATCH 1/2] Input: st1232 - read firmware version and revision Michael Tretter
2026-02-05 9:17 ` Dmitry Torokhov
2026-02-06 14:50 ` Michael Tretter [this message]
2026-03-18 11:42 ` Michael Tretter
2026-01-23 16:28 ` [PATCH 2/2] Input: st1232 - expose firmware version via sysfs Michael Tretter
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=aYX_paFYIBycCrf8@pengutronix.de \
--to=m.tretter@pengutronix.de \
--cc=dmitry.torokhov@gmail.com \
--cc=kernel@pengutronix.de \
--cc=ktalash@topcon.com \
--cc=linux-input@vger.kernel.org \
/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