From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Arnav Kapoor <kapoorarnav43@gmail.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Mudit Sharma" <muditsharma.info@gmail.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: light: bh1745: fix 16-bit register accesses
Date: Tue, 17 Nov 2026 12:51:49 +0200 [thread overview]
Message-ID: <avwxxbyzHP8tCgkV@ashevche-desk.local> (raw)
In-Reply-To: <20261117104152.137597-1-kapoorarnav43@gmail.com>
On Tue, Nov 17, 2026 at 04:11:52PM +0530, Arnav Kapoor wrote:
> On Tue, Nov 17, 2026 at 12:21:42PM +0200, Andy Shevchenko wrote:
> > On Tue, Nov 17, 2026 at 01:12:10AM +0530, Arnav Kapoor wrote:
...
> > > - bh1745_trigger_handler() stores the raw bytes in a u16 although the
> > > scan type is IIO_CPU.
> >
> > I didn't get this, what's the problem here?
> The handler does regmap_bulk_read(..., &value, 2) into a u16 and puts
> that straight into scan.chans[], so the buffer gets the register bytes
> as they come off the bus, LSB first. The channels declare
> .endianness = IIO_CPU, so user space reads each sample as a native u16.
> That is right on little-endian, but on big-endian every sample comes
> out byte-swapped. The patch reads into an __le16 and stores
> le16_to_cpu(value), so the data matches IIO_CPU on both.
>
> I'll reword that bullet in v2 to say this directly.
Yes, please do.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-11-17 10:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 19:42 Arnav Kapoor
2026-11-17 10:21 ` Andy Shevchenko
2026-11-17 10:41 ` Arnav Kapoor
2026-11-17 10:51 ` Andy Shevchenko [this message]
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=avwxxbyzHP8tCgkV@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=kapoorarnav43@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=muditsharma.info@gmail.com \
--cc=nuno.sa@analog.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®