mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Francesco Lavra <flavra@baylibre.com>
To: David Lechner <dlechner@baylibre.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	linux-input@vger.kernel.org,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Jiri Kosina" <jikos@kernel.org>,
	"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>
Subject: Re: [PATCH v2 1/2] iio: add IIO_DECLARE_QUATERNION() macro
Date: Tue, 17 Mar 2026 09:03:21 +0100	[thread overview]
Message-ID: <7ec90ee310c6d765090ec39b96f76155b66a773a.camel@baylibre.com> (raw)
In-Reply-To: <b050ce49-9880-4d87-8e52-09705e7166bc@baylibre.com>

On Mon, 2026-03-16 at 14:56 -0500, David Lechner wrote:
...
> > As for the alignment, according to your patch at [1], when the repeat
> > number is not a power of two, it is (will be) rounded up to the next
> > power
> > of two (and this is consistent with what the lsm6dsx driver expects),
> > so
> > the alignment will be 8 bytes.
> 
> I think you are referring to the 8-byte alignment for the timestamp?
> 
> Patch [1] should make a difference when the timestamp is not enabled
> in a buffered read though.
> 
> When the timestamp is enabled, the buffer is going to be 16 bytes per
> sample no matter what because of the 8-byte alignment of the timestamp.
> 
> But if the timestamp is not enabled, then for 16-bit storagebits and
> repeat of 3, before the patch, the buffer would only be 6 bytes per
> sample, but after the patch would be 8 bytes per sample. This doesn't
> make a difference in the driver itself, but does make a difference to
> userspace that is reading the buffer.

I was referring to alignment in general, regardless of the timestamp being
enabled. From my understanding, the computed storage size is also used for
alignment. Anyway, yes, after [1] the storage size for the quaternion scan
element will be 8 bytes, with the last 2 bytes of each sample zeroed out.

> 
> > [1]
> > https://lore.kernel.org/linux-iio/20260307-iio-fix-timestamp-alignment-v2-4-d1d48fbadbbf@baylibre.com/

  reply	other threads:[~2026-03-17  8:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28 20:02 [PATCH v2 0/2] iio: orientation: hid-sensor-rotation: fix quaternion alignment David Lechner
2026-02-28 20:02 ` [PATCH v2 1/2] iio: add IIO_DECLARE_QUATERNION() macro David Lechner
2026-03-08  0:35   ` David Lechner
2026-03-16 19:03     ` Francesco Lavra
2026-03-16 19:56       ` David Lechner
2026-03-17  8:03         ` Francesco Lavra [this message]
2026-02-28 20:02 ` [PATCH v2 2/2] iio: orientation: hid-sensor-rotation: fix quaternion alignment David Lechner
2026-03-02  8:58 ` [PATCH v2 0/2] " Andy Shevchenko
2026-03-02 12:32   ` Nuno Sá
2026-03-02 15:52     ` David Lechner
2026-03-02 20:54       ` Jonathan Cameron

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=7ec90ee310c6d765090ec39b96f76155b66a773a.camel@baylibre.com \
    --to=flavra@baylibre.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=srinivas.pandruvada@linux.intel.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®