The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: "Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"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: Sat, 21 Mar 2026 21:01:00 +0000	[thread overview]
Message-ID: <20260321210100.78ca299c@jic23-huawei> (raw)
In-Reply-To: <b8ed1390-7bd5-4f6f-8975-5aceb72cde0b@baylibre.com>

On Mon, 16 Mar 2026 09:37:53 -0500
David Lechner <dlechner@baylibre.com> wrote:

> 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.

Agreed. Given the need for backports, better to do it in two steps.
Sooner or later we'll end up backporting the new _ts() variant
(if it hasn't already happened!) but lets not rush it.

Applied and marked for stable
Thanks,

Jonathan


  reply	other threads:[~2026-03-21 21:01 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
2026-03-21 21:01     ` Jonathan Cameron [this message]
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=20260321210100.78ca299c@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --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