From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: Francesco Lavra <flavra@baylibre.com>
Cc: "Lorenzo Bianconi" <lorenzo@kernel.org>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org
Subject: Re: [PATCH v9 6/6] iio: imu: st_lsm6dsx: Add support for rotation sensor
Date: Wed, 25 Mar 2026 14:55:26 +0000 [thread overview]
Message-ID: <20260325145526.000071ad@huawei.com> (raw)
In-Reply-To: <20260324084808.654118-1-flavra@baylibre.com>
On Tue, 24 Mar 2026 09:48:07 +0100
Francesco Lavra <flavra@baylibre.com> wrote:
> Some IMU chips in the LSM6DSX family have sensor fusion features that
> combine data from the accelerometer and gyroscope. One of these features
> generates rotation vector data and makes it available in the hardware
> FIFO as a quaternion (more specifically, the X, Y and Z components of the
> quaternion vector, expressed as 16-bit half-precision floating-point
> numbers).
>
> Add support for a new sensor instance that allows receiving sensor fusion
> data, by defining a new struct st_lsm6dsx_fusion_settings (which contains
> chip-specific details for the sensor fusion functionality), and adding this
> struct as a new field in struct st_lsm6dsx_settings. In st_lsm6dsx_core.c,
> populate this new struct for the LSM6DSV and LSM6DSV16X chips, and add the
> logic to initialize an additional IIO device if this struct is populated
> for the hardware type being probed.
> Note: a new IIO device is being defined (as opposed to adding channels to
> an existing device) because the rate at which sensor fusion data is
> generated may not match the data rate from any of the existing devices.
>
> Tested on LSM6DSV16X.
>
> Signed-off-by: Francesco Lavra <flavra@baylibre.com>
> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
One trivial thing. But don't resend for that. Assuming nothing else comes
up I'll tweak it whilst applying. Same for Andy's line wrap comment.
thanks,
Jonathan
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c
> new file mode 100644
> index 000000000000..9fb3e19e4a55
> --- /dev/null
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c
> @@ -0,0 +1,243 @@
> +
> +int st_lsm6dsx_fusion_set_odr(struct st_lsm6dsx_sensor *sensor, bool enable)
> +{
> + struct st_lsm6dsx_hw *hw = sensor->hw;
> + int err;
> +
> + guard(mutex)(&hw->page_lock);
> +
> + err = st_lsm6dsx_fusion_page_enable(hw);
> + if (err)
> + return err;
> +
> + err = st_lsm6dsx_fusion_set_odr_locked(sensor, enable);
> + if (err) {
> + st_lsm6dsx_fusion_page_disable(hw);
> + return err;
> + }
> +
> + return st_lsm6dsx_fusion_page_disable(hw);
> +
> +out:
Stray. If nothing else comes up I'll drop this whilst applying.
> +}
next prev parent reply other threads:[~2026-03-25 14:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 8:46 [PATCH v9 0/6] imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-03-24 8:47 ` [PATCH v9 1/6] iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO Francesco Lavra
2026-03-24 12:17 ` Andy Shevchenko
2026-03-25 19:55 ` Jonathan Cameron
2026-03-24 8:47 ` [PATCH v9 2/6] iio: Replace 'sign' field with union in struct iio_scan_type Francesco Lavra
2026-03-24 8:47 ` [PATCH v9 3/6] iio: tools: Add support for floating-point types in buffer scan elements Francesco Lavra
2026-03-24 8:47 ` [PATCH v9 4/6] iio: ABI: Add support for floating-point numbers " Francesco Lavra
2026-03-24 8:47 ` [PATCH v9 5/6] iio: ABI: Add quaternion axis modifier Francesco Lavra
2026-03-24 8:48 ` [PATCH v9 6/6] iio: imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-03-25 14:55 ` Jonathan Cameron [this message]
2026-03-25 20:08 ` Jonathan Cameron
2026-03-25 19:20 ` kernel test robot
2026-03-25 20:25 ` kernel test robot
2026-03-25 21:52 ` kernel test robot
2026-04-12 15:29 ` [PATCH v9 0/6] " 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=20260325145526.000071ad@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=flavra@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.