mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 (Minisforum V3 / V3 SE)
@ 2026-09-28 17:50 Jared Wuerzburger
  2026-09-28 17:50 ` [PATCH v4 1/2] iio: imu: st_lsm6dsx: Use C99 initializers in ACPI match table Jared Wuerzburger
  2026-09-28 17:50 ` [PATCH v4 2/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 for LSM6DS3TR-C Jared Wuerzburger
  0 siblings, 2 replies; 5+ messages in thread
From: Jared Wuerzburger @ 2026-09-28 17:50 UTC (permalink / raw)
  To: Jonathan Cameron, Lorenzo Bianconi
  Cc: Andy Shevchenko, David Lechner, Nuno Sá,
	Andy Shevchenko, Samuel Dionne-Riel, linux-iio, linux-kernel

Hi,

This adds the SMOCF05 ACPI ID used by the Minisforum V3 and V3 SE
tablets for their LSM6DS3TR-C, picking up Samuel's series [1][2].
Without it the accelerometer and gyroscope are missing unless the user
carries a DSDT override [3].

Changes since v3 [4]:
 - 1/2: convert the ACPI match table to C99 initializers instead of
   only dropping the trailing commas (Andy).
 - 2/2: explain in the changelog why the firmware's SLA0 matrix is not
   used and the orientation comes from hwdb (Andy); drop the pointer
   to the cover letter (Andy); Link: -> Closes: (Andy).
 - Assisted-by: LLM (Andy).

A correction to the v3 cover letter: SLA0 applied via hwdb gives correct
rotation but inverted tilt (it follows the Windows convention, see 2/2).
The correct matrix is -1 0 0; 0 -1 0; 0 0 1. The systemd hwdb entry [5]
was merged with SLA0 and has since been fixed [6].

The full STS device from the V3 BIOS (1.06), identical on the V3 SE:

      Device (STS)
      {
          Name (_HID, EisaId ("SMOCF05"))
          Name (_CID, EisaId ("SMOCF05"))
          Name (_UID, Zero)
          Method (_STA, 0, NotSerialized)
          {
              Return (0x0F)
          }

          Method (_CRS, 0, NotSerialized)
          {
              Name (RBUF, ResourceTemplate ()
              {
                  I2cSerialBusV2 (0x006A, ControllerInitiated, 0x00061A80,
                      AddressingMode7Bit, "\\_SB.I2CD",
                      0x00, ResourceConsumer, , Exclusive,
                      RawDataBuffer (0x04)
                      {
                          0x53, 0x4C, 0x41, 0x30
                      })
                  I2cSerialBusV2 (0x006A, ControllerInitiated, 0x00061A80,
                      AddressingMode7Bit, "\\_SB.I2CD",
                      0x00, ResourceConsumer, , Exclusive,
                      RawDataBuffer (0x04)
                      {
                          0x53, 0x4C, 0x47, 0x30
                      })
                  GpioInt (Edge, ActiveHigh, Exclusive, PullNone, 0x0000,
                      "\\_SB.GPIO", 0x00, ResourceConsumer, ,
                      RawDataBuffer (0x04)
                      {
                          0x53, 0x4C, 0x41, 0x30
                      })
                      {
                          0x0009
                      }
              })
              Return (RBUF) /* \_SB_.I2CD.STS_._CRS.RBUF */
          }

          Method (SLA0, 0, NotSerialized)
          {
              Name (RBUF, Package (0x03)
              {
                  "-1 0 0",
                  "0 -1 0",
                  "0 0 -1"
              })
              Return (RBUF) /* \_SB_.I2CD.STS_.SLA0.RBUF */
          }

          Method (SLG0, 0, NotSerialized)
          {
              Name (RBUF, Package (0x03)
              {
                  "1 0 0",
                  "0 1 0",
                  "0 0 1"
              })
              Return (RBUF) /* \_SB_.I2CD.STS_.SLG0.RBUF */
          }
      }

Thanks to Samuel for the original series and to Andy for the reviews.

[1] v1: https://lore.kernel.org/linux-iio/20251223025351.3099978-2-samuel@dionne-riel.com/
[2] v2: https://lore.kernel.org/linux-iio/20260201225450.1649001-2-samuel@dionne-riel.com/
[3] https://github.com/mudkipme/awesome-minisforum-v3/issues/2
[4] v3: https://lore.kernel.org/linux-iio/20260927220559.24169-1-jwuerz@gmail.com/
[5] https://github.com/systemd/systemd/pull/43935
[6] https://github.com/systemd/systemd/pull/43941

Jared Wuerzburger (1):
  iio: imu: st_lsm6dsx: Use C99 initializers in ACPI match table

Samuel Dionne-Riel (1):
  iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 for LSM6DS3TR-C

 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


base-commit: a3b3580713f3ac5a32dc2874ee546828977a1d68
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v4 1/2] iio: imu: st_lsm6dsx: Use C99 initializers in ACPI match table
  2026-09-28 17:50 [PATCH v4 0/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 (Minisforum V3 / V3 SE) Jared Wuerzburger
@ 2026-09-28 17:50 ` Jared Wuerzburger
  2026-09-28 17:59   ` Andy Shevchenko
  2026-09-28 17:50 ` [PATCH v4 2/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 for LSM6DS3TR-C Jared Wuerzburger
  1 sibling, 1 reply; 5+ messages in thread
From: Jared Wuerzburger @ 2026-09-28 17:50 UTC (permalink / raw)
  To: Jonathan Cameron, Lorenzo Bianconi
  Cc: Andy Shevchenko, David Lechner, Nuno Sá,
	Andy Shevchenko, Samuel Dionne-Riel, linux-iio, linux-kernel

Convert the ACPI match table to designated initializers, in line with
the ongoing effort to do so for all ID tables. This also drops the
trailing comma after the last member of each entry, which is only
useful when more members may follow.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://lore.kernel.org/linux-iio/aroutl04Q99mqJor@ashevche-desk.local/
Assisted-by: LLM
Signed-off-by: Jared Wuerzburger <jwuerz@gmail.com>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
index edec898cb1..c4097ce2bf 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
@@ -143,8 +143,8 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
 MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
 
 static const struct acpi_device_id st_lsm6dsx_i2c_acpi_match[] = {
-	{ "SMO8B30", ST_LSM6DS3TRC_ID, },
-	{ "SMOCF00", ST_LSM6DSO_ID, },
+	{ .id = "SMO8B30", .driver_data = ST_LSM6DS3TRC_ID },
+	{ .id = "SMOCF00", .driver_data = ST_LSM6DSO_ID },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, st_lsm6dsx_i2c_acpi_match);
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v4 2/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 for LSM6DS3TR-C
  2026-09-28 17:50 [PATCH v4 0/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 (Minisforum V3 / V3 SE) Jared Wuerzburger
  2026-09-28 17:50 ` [PATCH v4 1/2] iio: imu: st_lsm6dsx: Use C99 initializers in ACPI match table Jared Wuerzburger
@ 2026-09-28 17:50 ` Jared Wuerzburger
  2026-09-28 18:04   ` Andy Shevchenko
  1 sibling, 1 reply; 5+ messages in thread
From: Jared Wuerzburger @ 2026-09-28 17:50 UTC (permalink / raw)
  To: Jonathan Cameron, Lorenzo Bianconi
  Cc: Andy Shevchenko, David Lechner, Nuno Sá,
	Andy Shevchenko, Samuel Dionne-Riel, linux-iio, linux-kernel

From: Samuel Dionne-Riel <samuel@dionne-riel.com>

The Minisforum V3 and V3 SE tablets declare their ST LSM6DS3TR-C IMU in
the DSDT with the hardware ID SMOCF05 instead of SMO8B30, so the driver
never binds and the accelerometer and gyroscope are missing. The
Windows driver (version 1.0.4.3) binds the LSM6DS3TR-C to both IDs.

Relevant part of the DSDT, identical on both models:

  Scope (_SB.I2CD) { Device (STS) {
    Name (_HID, EisaId ("SMOCF05"))
    Name (_CID, EisaId ("SMOCF05"))
    _CRS: I2cSerialBusV2 (0x006A, ..., "\\_SB.I2CD")  vendor data "SLA0"
          I2cSerialBusV2 (0x006A, ..., "\\_SB.I2CD")  vendor data "SLG0"
          GpioInt (Edge, ActiveHigh, ..., "\\_SB.GPIO") { 9 }  "SLA0"
    Method (SLA0): "-1 0 0", "0 -1 0", "0 0 -1"
    Method (SLG0): "1 0 0", "0 1 0", "0 0 1"
  } }

Both I2C resources describe the same address; the I2C core uses the
first one.

The vendor-specific SLA0/SLG0 methods are not parsed, because SLA0 is
not usable as a mount matrix as it is. Its X and Y signs are right, but
it also negates Z. It follows the Windows sensor convention, which
reports Z = -1g with the screen facing up, while iio-sensor-proxy uses
the same X and Y signs but expects Z = +1g in that posture. Applied as
a mount matrix, SLA0 gives correct screen rotation, but iio-sensor-proxy
reports the tilt inverted. The actual mounting is a plain 180 degree
rotation about Z (-1 0 0; 0 -1 0; 0 0 1), with which orientation and
tilt are both right. As for SMOCF00, the matrix is therefore provided
by the systemd hwdb instead.

Tested on:
 - V3 SE (Ryzen 7 7735U, BIOS 1.03) with this change.
 - V3 (Ryzen 7 8840U, BIOS 1.06), kernel 7.2.7, with this change and
   the stock firmware tables. The driver binds to i2c-SMOCF05:00, the
   WHO_AM_I check passes (0x6a), and both lsm6ds3tr-c_accel and
   lsm6ds3tr-c_gyro are registered. Screen auto-rotation and tilt work
   with iio-sensor-proxy and the matrix above (checked with the device
   renamed to SMO8B30 via a DSDT override, i.e. the same
   ST_LSM6DS3TRC_ID driver data).

Closes: https://github.com/mudkipme/awesome-minisforum-v3/issues/2
Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
[Jared Wuerzburger: rewrote the changelog with the DSDT excerpt, test
 results and mount matrix rationale, converted the entry to C99
 initializers, dropped the mount matrix patch]
Assisted-by: LLM
Signed-off-by: Jared Wuerzburger <jwuerz@gmail.com>
---

Notes:
    Jonathan, when applying, could you add a Link: to this series? The
    cover letter has the full DSDT excerpt, too long for the changelog.

 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
index c4097ce2bf..11e5ec3798 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
@@ -145,6 +145,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
 static const struct acpi_device_id st_lsm6dsx_i2c_acpi_match[] = {
 	{ .id = "SMO8B30", .driver_data = ST_LSM6DS3TRC_ID },
 	{ .id = "SMOCF00", .driver_data = ST_LSM6DSO_ID },
+	{ .id = "SMOCF05", .driver_data = ST_LSM6DS3TRC_ID },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, st_lsm6dsx_i2c_acpi_match);
-- 
2.55.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 1/2] iio: imu: st_lsm6dsx: Use C99 initializers in ACPI match table
  2026-09-28 17:50 ` [PATCH v4 1/2] iio: imu: st_lsm6dsx: Use C99 initializers in ACPI match table Jared Wuerzburger
@ 2026-09-28 17:59   ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2026-09-28 17:59 UTC (permalink / raw)
  To: Jared Wuerzburger
  Cc: Jonathan Cameron, Lorenzo Bianconi, Andy Shevchenko,
	David Lechner, Nuno Sá,
	Andy Shevchenko, Samuel Dionne-Riel, linux-iio, linux-kernel

On Mon, Sep 28, 2026 at 8:52 PM Jared Wuerzburger <jwuerz@gmail.com> wrote:
>
> Convert the ACPI match table to designated initializers, in line with
> the ongoing effort to do so for all ID tables. This also drops the
> trailing comma after the last member of each entry, which is only
> useful when more members may follow.

> Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>

> Link: https://lore.kernel.org/linux-iio/aroutl04Q99mqJor@ashevche-desk.local/

No Link for the suggestion.

> Assisted-by: LLM
> Signed-off-by: Jared Wuerzburger <jwuerz@gmail.com>
> ---

With that tag being dropped,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v4 2/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 for LSM6DS3TR-C
  2026-09-28 17:50 ` [PATCH v4 2/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 for LSM6DS3TR-C Jared Wuerzburger
@ 2026-09-28 18:04   ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2026-09-28 18:04 UTC (permalink / raw)
  To: Jared Wuerzburger
  Cc: Jonathan Cameron, Lorenzo Bianconi, Andy Shevchenko,
	David Lechner, Nuno Sá,
	Andy Shevchenko, Samuel Dionne-Riel, linux-iio, linux-kernel

On Mon, Sep 28, 2026 at 8:52 PM Jared Wuerzburger <jwuerz@gmail.com> wrote:
>
> From: Samuel Dionne-Riel <samuel@dionne-riel.com>
>
> The Minisforum V3 and V3 SE tablets declare their ST LSM6DS3TR-C IMU in
> the DSDT with the hardware ID SMOCF05 instead of SMO8B30, so the driver
> never binds and the accelerometer and gyroscope are missing. The
> Windows driver (version 1.0.4.3) binds the LSM6DS3TR-C to both IDs.


> Relevant part of the DSDT, identical on both models:
>
>   Scope (_SB.I2CD) { Device (STS) {
>     Name (_HID, EisaId ("SMOCF05"))
>     Name (_CID, EisaId ("SMOCF05"))
>     _CRS: I2cSerialBusV2 (0x006A, ..., "\\_SB.I2CD")  vendor data "SLA0"
>           I2cSerialBusV2 (0x006A, ..., "\\_SB.I2CD")  vendor data "SLG0"
>           GpioInt (Edge, ActiveHigh, ..., "\\_SB.GPIO") { 9 }  "SLA0"
>     Method (SLA0): "-1 0 0", "0 -1 0", "0 0 -1"
>     Method (SLG0): "1 0 0", "0 1 0", "0 0 1"
>   } }

Drop this paragraph completely, that's what the cover letter already
carried out.

> Both I2C resources describe the same address; the I2C core uses the
> first one.
>
> The vendor-specific SLA0/SLG0 methods are not parsed, because SLA0 is
> not usable as a mount matrix as it is. Its X and Y signs are right, but
> it also negates Z. It follows the Windows sensor convention, which
> reports Z = -1g with the screen facing up, while iio-sensor-proxy uses
> the same X and Y signs but expects Z = +1g in that posture. Applied as
> a mount matrix, SLA0 gives correct screen rotation, but iio-sensor-proxy
> reports the tilt inverted. The actual mounting is a plain 180 degree
> rotation about Z (-1 0 0; 0 -1 0; 0 0 1), with which orientation and
> tilt are both right. As for SMOCF00, the matrix is therefore provided
> by the systemd hwdb instead.
>
> Tested on:
>  - V3 SE (Ryzen 7 7735U, BIOS 1.03) with this change.
>  - V3 (Ryzen 7 8840U, BIOS 1.06), kernel 7.2.7, with this change and
>    the stock firmware tables. The driver binds to i2c-SMOCF05:00, the
>    WHO_AM_I check passes (0x6a), and both lsm6ds3tr-c_accel and
>    lsm6ds3tr-c_gyro are registered. Screen auto-rotation and tilt work
>    with iio-sensor-proxy and the matrix above (checked with the device
>    renamed to SMO8B30 via a DSDT override, i.e. the same
>    ST_LSM6DS3TRC_ID driver data).
>
> Closes: https://github.com/mudkipme/awesome-minisforum-v3/issues/2
> Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
> [Jared Wuerzburger: rewrote

> the changelog with the DSDT excerpt,

This will be dropped :-)

> test  results and mount matrix rationale,

> converted the entry to C99  initializers,

Not sure if it's important enough to be mentioned, but up to you as
it's indeed what was done with the change.

> dropped the mount matrix patch]
> Assisted-by: LLM
> Signed-off-by: Jared Wuerzburger <jwuerz@gmail.com>
> ---
>
> Notes:
>     Jonathan, when applying, could you add a Link: to this series? The
>     cover letter has the full DSDT excerpt, too long for the changelog.

...or even use `b4 shazam -M ...`

So, with the DSDT excerpt dropped from the commit message (and the
respective update in the tag block) feel free to add

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

--
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-28 18:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-28 17:50 [PATCH v4 0/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 (Minisforum V3 / V3 SE) Jared Wuerzburger
2026-09-28 17:50 ` [PATCH v4 1/2] iio: imu: st_lsm6dsx: Use C99 initializers in ACPI match table Jared Wuerzburger
2026-09-28 17:59   ` Andy Shevchenko
2026-09-28 17:50 ` [PATCH v4 2/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 for LSM6DS3TR-C Jared Wuerzburger
2026-09-28 18:04   ` Andy Shevchenko

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®