From: Samuel Dionne-Riel <samuel@dionne-riel.com>
To: "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>
Cc: Samuel Dionne-Riel <samuel@dionne-riel.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/2] iio: imu: lsm6dsx: Add alternative ACPI mount matrix retrieval
Date: Sun, 1 Feb 2026 17:54:50 -0500 [thread overview]
Message-ID: <20260201225450.1649001-4-samuel@dionne-riel.com> (raw)
In-Reply-To: <20260201225450.1649001-2-samuel@dionne-riel.com>
This uses the SLA0 matrix, which is how the SMOCF05 configuration
exposes the mounting information for the accelerometer.
On a limited sample size of one (1) unit, the SLG0 matrix is the
identity matrix. It is unknown how the SLG0 mounting matrix would
logically affect the data, if it differed from the identity matrix.
After all, the IMU is mounted as one single unit, its mounting can't
differ on the gyroscope compared to the accelerometer.
The new `st_lsm6dsx_read_acpi_mount_matrix` function currently only
implements the *known* ACPI methods found in the wild, but the windows
driver seems to indicate more integration-specific methods could exist.
Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
---
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index dc78227952a7c..2278cbf2b711f 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -2635,6 +2635,13 @@ static int st_lsm6dsx_init_regulators(struct device *dev)
return 0;
}
+static bool st_lsm6dsx_read_acpi_mount_matrix(struct device *dev,
+ struct iio_mount_matrix *orientation)
+{
+ return iio_read_acpi_mount_matrix(dev, orientation, "ROTM") ||
+ iio_read_acpi_mount_matrix(dev, orientation, "SLA0");
+}
+
int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id,
struct regmap *regmap)
{
@@ -2708,7 +2715,7 @@ int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id,
return err;
}
- if (!iio_read_acpi_mount_matrix(hw->dev, &hw->orientation, "ROTM")) {
+ if (!st_lsm6dsx_read_acpi_mount_matrix(hw->dev, &hw->orientation)) {
err = iio_read_mount_matrix(hw->dev, &hw->orientation);
if (err)
return err;
--
2.51.0
next prev parent reply other threads:[~2026-02-01 22:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-01 22:54 [PATCH v2 0/2] iio: imu: lsm6dsx: Support SMOCF05 ACPI ID Samuel Dionne-Riel
2026-02-01 22:54 ` [PATCH v2 1/2] iio: imu: lsm6dsx: Support SMOCF05 ACPI ID for LSM6DS3TR-C Samuel Dionne-Riel
2026-02-03 11:35 ` Andy Shevchenko
2026-02-01 22:54 ` Samuel Dionne-Riel [this message]
2026-02-03 11:32 ` [PATCH v2 2/2] iio: imu: lsm6dsx: Add alternative ACPI mount matrix retrieval Andy Shevchenko
2026-02-03 11:39 ` [PATCH v2 0/2] iio: imu: lsm6dsx: Support SMOCF05 ACPI ID Andy Shevchenko
2026-02-03 11:42 ` Andy Shevchenko
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=20260201225450.1649001-4-samuel@dionne-riel.com \
--to=samuel@dionne-riel.com \
--cc=andy@kernel.org \
--cc=dlechner@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 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®