From: David Lechner <dlechner@baylibre.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Parthiban Nallathambi" <pn@denx.de>,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: light: vcnl4035: fix scan buffer on big-endian
Date: Mon, 16 Mar 2026 09:37:53 -0500 [thread overview]
Message-ID: <b8ed1390-7bd5-4f6f-8975-5aceb72cde0b@baylibre.com> (raw)
In-Reply-To: <abfYN9gszSSb83J9@ashevche-desk.local>
On 3/16/26 5:15 AM, Andy Shevchenko wrote:
> On Sat, Mar 14, 2026 at 05:18:10PM -0500, David Lechner wrote:
>> Rework vcnl4035_trigger_consumer_handler() so that we are not passing
>> what should be a u16 value as an int * to regmap_read(). This won't
>> work on bit endian systems.
>>
>> Instead, add a new unsigned int variable to pass to regmap_read(). Then
>> copy that value into the buffer struct.
>>
>> The buffer array is replaced with a struct since there is only one value
>> being read. This allows us to use the correct u16 data type and has a
>> side-effect of simplifying the alignment specification.
>>
>> Also fix the endianness of the scan format from little-endian to CPU
>> endianness. Since we are using regmap to read the value, it will be
>> CPU-endian.
>
> ...
>
>> - iio_push_to_buffers_with_timestamp(indio_dev, buffer,
>> - iio_get_time_ns(indio_dev));
>> +
>> + buffer.als_data = val;
>> + iio_push_to_buffers_with_timestamp(indio_dev, &buffer,
>> + iio_get_time_ns(indio_dev));
>
> Do you have plans to drop this old API as well?
>
Eventually, yes. My plan is to wait for fixes to go through first.
next prev parent reply other threads:[~2026-03-16 14:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 22:18 [PATCH] iio: light: vcnl4035: fix scan buffer on big-endian David Lechner
2026-03-16 10:15 ` Andy Shevchenko
2026-03-16 14:37 ` David Lechner [this message]
2026-03-21 21:01 ` Jonathan Cameron
2026-03-16 10:42 ` Markus Elfring
2026-03-16 14:40 ` David Lechner
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=b8ed1390-7bd5-4f6f-8975-5aceb72cde0b@baylibre.com \
--to=dlechner@baylibre.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=pn@denx.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