iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 (Minisforum V3 / V3 SE)
Subsystems (2)
v4 cover iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 (Minisforum V3 / V3 SE)
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/[email protected]/
[2] v2: https://lore.kernel.org/linux-iio/[email protected]/
[3] https://github.com/mudkipme/awesome-minisforum-v3/issues/2
[4] v3: https://lore.kernel.org/linux-iio/[email protected]/
[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
Signature · 1 line
2.55.0
PATCH v4 1/2 iio: imu: st_lsm6dsx: Use C99 initializers in ACPI match table
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.
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c +2 -2
@@ -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);
Signature · 1 line
2.55.0
Re: [PATCH v4 1/2] iio: imu: st_lsm6dsx: Use C99 initializers in ACPI match table
Quoted 9 lines · Jared Wuerzburger
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 <[email protected]>
No Link for the suggestion.
Quoted 3 lines
Assisted-by LLMSigned-off-by Jared Wuerzburger <[email protected]>---
With that tag being dropped,
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH v4 2/2 iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 for LSM6DS3TR-C
In reply to Jared WuerzburgerFrom: Samuel Dionne-Riel <[email protected]>
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).
[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]
---
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(+)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c +1 -0
@@ -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);
Signature · 1 line
2.55.0
Re: [PATCH v4 2/2] iio: imu: st_lsm6dsx: Add ACPI ID SMOCF05 for LSM6DS3TR-C
Quoted 11 lines · Jared Wuerzburger
From: Samuel Dionne-Riel <[email protected]>
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:
Quoted 9 lines
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.
Quoted 24 lines
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, theWHO_AM_Icheck 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 sameST_LSM6DS3TRC_IDdriver data).
Quoted 5 lines
Signed-off-by Samuel Dionne-Riel <[email protected]>[Jared Wuerzburger: rewrote
the changelog with the DSDT excerpt,
This will be dropped :-)
Quoted 3 lines
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.
Quoted 8 lines
dropped the mount matrix patch]
Assisted-by LLMSigned-off-by Jared Wuerzburger <[email protected]>---
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
--
With Best Regards,
Andy Shevchenko