All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] iio: imu: bmi270: Match PNP ID found on newer GPD firmware
@ 2025-08-15 10:43 ` Cryolitia PukNgae via B4 Relay
  0 siblings, 0 replies; 3+ messages in thread
From: Cryolitia PukNgae @ 2025-08-15 10:43 UTC (permalink / raw)
  To: Alex Lanzano, Jonathan Cameron, Lars-Peter Clausen, David Lechner,
	Nuno Sá, Andy Shevchenko
  Cc: linux-iio, linux-kernel, Yao Zi, WangYuli, Jun Zhan, Niecheng1,
	Cryolitia PukNgae

GPD devices originally used BMI160 sensors with the "BMI0160" PNP ID.
When they switched to BMI260 sensors in newer hardware, they reused
the existing Windows driver which accepts both "BMI0160" and "BMI0260"
IDs. Consequently, they kept "BMI0160" in DSDT tables for new BMI260
devices, causing driver mismatches in Linux.

1. GPD updated BIOS v0.40+[1] for newer devices to report "BMI0260" for
BMI260 sensors to avoid loading bmi160 driver on Linux. While this
isn't Bosch's VID;
2. Bosch's official Windows driver uses "BMI0260" as a compatible ID
3. We're seeing real devices shipping with "BMI0260" in DSDT

The DSDT excerpt of GPD G1619-04 with BIOS v0.40:

Scope (_SB.I2CC)
{
    Device (BMA2)
    {
        Name (_ADR, Zero)  // _ADR: Address
        Name (_HID, "BMI0260")  // _HID: Hardware ID
        Name (_CID, "BMI0260")  // _CID: Compatible ID
        Name (_DDN, "Accelerometer")  // _DDN: DOS Device Name
        Name (_UID, One)  // _UID: Unique ID
        Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
        {
            Name (RBUF, ResourceTemplate ()
            {
                I2cSerialBusV2 (0x0069, ControllerInitiated, 0x00061A80,
                    AddressingMode7Bit, "\\_SB.I2CC",
                    0x00, ResourceConsumer, , Exclusive,
                    )
            })
            Return (RBUF) /* \_SB_.I2CC.BMA2._CRS.RBUF */
        }

        OperationRegion (CMS2, SystemIO, 0x72, 0x02)
        Field (CMS2, ByteAcc, NoLock, Preserve)
        {
            IND2,   8,
            DAT2,   8
        }

        IndexField (IND2, DAT2, ByteAcc, NoLock, Preserve)
        {
            Offset (0x74),
            BACS,   32
        }

        Method (ROMS, 0, NotSerialized)
        {
            Name (RBUF, Package (0x03)
            {
                "0 -1 0",
                "-1 0 0",
                "0 0 -1"
            })
            Return (RBUF) /* \_SB_.I2CC.BMA2.ROMS.RBUF */
        }

        Method (CALS, 1, NotSerialized)
        {
            Local0 = Arg0
            If (((Local0 == Zero) || (Local0 == Ones)))
            {
                Return (Local0)
            }
            Else
            {
                BACS = Local0
            }
        }

        Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            Return (0x0F)
        }
    }
}

1. http://download.softwincn.com/WIN%20Max%202024/Max2-7840-BIOS-V0.41.zip

Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
---
Changes in v2:
- Improve commit message
- Add DSDT table
- Link to v1: https://lore.kernel.org/r/20250730-bmi270-gpd-acpi-v1-1-1ffc85b17266@uniontech.com
---
 drivers/iio/imu/bmi270/bmi270_i2c.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/imu/bmi270/bmi270_i2c.c b/drivers/iio/imu/bmi270/bmi270_i2c.c
index c77839b03a969f6f149c025a0305c4b9b8ac6571..b909a421ad0176ee414f2f96ff09db2297586ded 100644
--- a/drivers/iio/imu/bmi270/bmi270_i2c.c
+++ b/drivers/iio/imu/bmi270/bmi270_i2c.c
@@ -41,6 +41,8 @@ static const struct i2c_device_id bmi270_i2c_id[] = {
 static const struct acpi_device_id bmi270_acpi_match[] = {
 	/* GPD Win Mini, Aya Neo AIR Pro, OXP Mini Pro, etc. */
 	{ "BMI0160",  (kernel_ulong_t)&bmi260_chip_info },
+	/* GPD Win Max 2 2023(sincice BIOS v0.40), etc. */
+	{ "BMI0260",  (kernel_ulong_t)&bmi260_chip_info },
 	{ }
 };
 

---
base-commit: 24ea63ea387714634813359e2c8e0e6c36952f73
change-id: 20250206-bmi270-gpd-acpi-de4d12bce567

Best regards,
-- 
Cryolitia PukNgae <cryolitia@uniontech.com>


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

* [PATCH v2] iio: imu: bmi270: Match PNP ID found on newer GPD firmware
@ 2025-08-15 10:43 ` Cryolitia PukNgae via B4 Relay
  0 siblings, 0 replies; 3+ messages in thread
From: Cryolitia PukNgae via B4 Relay @ 2025-08-15 10:43 UTC (permalink / raw)
  To: Alex Lanzano, Jonathan Cameron, Lars-Peter Clausen, David Lechner,
	Nuno Sá, Andy Shevchenko
  Cc: linux-iio, linux-kernel, Yao Zi, WangYuli, Jun Zhan, Niecheng1,
	Cryolitia PukNgae

From: Cryolitia PukNgae <cryolitia@uniontech.com>

GPD devices originally used BMI160 sensors with the "BMI0160" PNP ID.
When they switched to BMI260 sensors in newer hardware, they reused
the existing Windows driver which accepts both "BMI0160" and "BMI0260"
IDs. Consequently, they kept "BMI0160" in DSDT tables for new BMI260
devices, causing driver mismatches in Linux.

1. GPD updated BIOS v0.40+[1] for newer devices to report "BMI0260" for
BMI260 sensors to avoid loading bmi160 driver on Linux. While this
isn't Bosch's VID;
2. Bosch's official Windows driver uses "BMI0260" as a compatible ID
3. We're seeing real devices shipping with "BMI0260" in DSDT

The DSDT excerpt of GPD G1619-04 with BIOS v0.40:

Scope (_SB.I2CC)
{
    Device (BMA2)
    {
        Name (_ADR, Zero)  // _ADR: Address
        Name (_HID, "BMI0260")  // _HID: Hardware ID
        Name (_CID, "BMI0260")  // _CID: Compatible ID
        Name (_DDN, "Accelerometer")  // _DDN: DOS Device Name
        Name (_UID, One)  // _UID: Unique ID
        Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
        {
            Name (RBUF, ResourceTemplate ()
            {
                I2cSerialBusV2 (0x0069, ControllerInitiated, 0x00061A80,
                    AddressingMode7Bit, "\\_SB.I2CC",
                    0x00, ResourceConsumer, , Exclusive,
                    )
            })
            Return (RBUF) /* \_SB_.I2CC.BMA2._CRS.RBUF */
        }

        OperationRegion (CMS2, SystemIO, 0x72, 0x02)
        Field (CMS2, ByteAcc, NoLock, Preserve)
        {
            IND2,   8,
            DAT2,   8
        }

        IndexField (IND2, DAT2, ByteAcc, NoLock, Preserve)
        {
            Offset (0x74),
            BACS,   32
        }

        Method (ROMS, 0, NotSerialized)
        {
            Name (RBUF, Package (0x03)
            {
                "0 -1 0",
                "-1 0 0",
                "0 0 -1"
            })
            Return (RBUF) /* \_SB_.I2CC.BMA2.ROMS.RBUF */
        }

        Method (CALS, 1, NotSerialized)
        {
            Local0 = Arg0
            If (((Local0 == Zero) || (Local0 == Ones)))
            {
                Return (Local0)
            }
            Else
            {
                BACS = Local0
            }
        }

        Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            Return (0x0F)
        }
    }
}

1. http://download.softwincn.com/WIN%20Max%202024/Max2-7840-BIOS-V0.41.zip

Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
---
Changes in v2:
- Improve commit message
- Add DSDT table
- Link to v1: https://lore.kernel.org/r/20250730-bmi270-gpd-acpi-v1-1-1ffc85b17266@uniontech.com
---
 drivers/iio/imu/bmi270/bmi270_i2c.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/imu/bmi270/bmi270_i2c.c b/drivers/iio/imu/bmi270/bmi270_i2c.c
index c77839b03a969f6f149c025a0305c4b9b8ac6571..b909a421ad0176ee414f2f96ff09db2297586ded 100644
--- a/drivers/iio/imu/bmi270/bmi270_i2c.c
+++ b/drivers/iio/imu/bmi270/bmi270_i2c.c
@@ -41,6 +41,8 @@ static const struct i2c_device_id bmi270_i2c_id[] = {
 static const struct acpi_device_id bmi270_acpi_match[] = {
 	/* GPD Win Mini, Aya Neo AIR Pro, OXP Mini Pro, etc. */
 	{ "BMI0160",  (kernel_ulong_t)&bmi260_chip_info },
+	/* GPD Win Max 2 2023(sincice BIOS v0.40), etc. */
+	{ "BMI0260",  (kernel_ulong_t)&bmi260_chip_info },
 	{ }
 };
 

---
base-commit: 24ea63ea387714634813359e2c8e0e6c36952f73
change-id: 20250206-bmi270-gpd-acpi-de4d12bce567

Best regards,
-- 
Cryolitia PukNgae <cryolitia@uniontech.com>



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

* Re: [PATCH v2] iio: imu: bmi270: Match PNP ID found on newer GPD firmware
  2025-08-15 10:43 ` Cryolitia PukNgae via B4 Relay
  (?)
@ 2025-08-20 15:09 ` Andy Shevchenko
  -1 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2025-08-20 15:09 UTC (permalink / raw)
  To: cryolitia
  Cc: Alex Lanzano, Jonathan Cameron, Lars-Peter Clausen, David Lechner,
	Nuno Sá, Andy Shevchenko, linux-iio, linux-kernel, Yao Zi,
	WangYuli, Jun Zhan, Niecheng1

On Fri, Aug 15, 2025 at 06:43:26PM +0800, Cryolitia PukNgae via B4 Relay wrote:
> From: Cryolitia PukNgae <cryolitia@uniontech.com>
> 
> GPD devices originally used BMI160 sensors with the "BMI0160" PNP ID.
> When they switched to BMI260 sensors in newer hardware, they reused
> the existing Windows driver which accepts both "BMI0160" and "BMI0260"
> IDs. Consequently, they kept "BMI0160" in DSDT tables for new BMI260
> devices, causing driver mismatches in Linux.
> 
> 1. GPD updated BIOS v0.40+[1] for newer devices to report "BMI0260" for
> BMI260 sensors to avoid loading bmi160 driver on Linux. While this
> isn't Bosch's VID;
> 2. Bosch's official Windows driver uses "BMI0260" as a compatible ID
> 3. We're seeing real devices shipping with "BMI0260" in DSDT
> 
> The DSDT excerpt of GPD G1619-04 with BIOS v0.40:
> 
> Scope (_SB.I2CC)
> {
>     Device (BMA2)
>     {
>         Name (_ADR, Zero)  // _ADR: Address
>         Name (_HID, "BMI0260")  // _HID: Hardware ID
>         Name (_CID, "BMI0260")  // _CID: Compatible ID
>         Name (_DDN, "Accelerometer")  // _DDN: DOS Device Name
>         Name (_UID, One)  // _UID: Unique ID
>         Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
>         {
>             Name (RBUF, ResourceTemplate ()
>             {
>                 I2cSerialBusV2 (0x0069, ControllerInitiated, 0x00061A80,
>                     AddressingMode7Bit, "\\_SB.I2CC",
>                     0x00, ResourceConsumer, , Exclusive,
>                     )
>             })
>             Return (RBUF) /* \_SB_.I2CC.BMA2._CRS.RBUF */
>         }

Everything from this line...

>         OperationRegion (CMS2, SystemIO, 0x72, 0x02)
>         Field (CMS2, ByteAcc, NoLock, Preserve)
>         {
>             IND2,   8,
>             DAT2,   8
>         }
> 
>         IndexField (IND2, DAT2, ByteAcc, NoLock, Preserve)
>         {
>             Offset (0x74),
>             BACS,   32
>         }
> 
>         Method (ROMS, 0, NotSerialized)
>         {
>             Name (RBUF, Package (0x03)
>             {
>                 "0 -1 0",
>                 "-1 0 0",
>                 "0 0 -1"
>             })
>             Return (RBUF) /* \_SB_.I2CC.BMA2.ROMS.RBUF */
>         }
> 
>         Method (CALS, 1, NotSerialized)
>         {
>             Local0 = Arg0
>             If (((Local0 == Zero) || (Local0 == Ones)))
>             {
>                 Return (Local0)
>             }
>             Else
>             {
>                 BACS = Local0
>             }
>         }

>         Method (_STA, 0, NotSerialized)  // _STA: Status
>         {
>             Return (0x0F)
>         }

...till this line is a noise.

>     }
> }

> 1. http://download.softwincn.com/WIN%20Max%202024/Max2-7840-BIOS-V0.41.zip
> 

Make it a Link tag.

Link: http://download.softwincn.com/WIN%20Max%202024/Max2-7840-BIOS-V0.41.zip #1
Signed-of-by: ...

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2025-08-20 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15 10:43 [PATCH v2] iio: imu: bmi270: Match PNP ID found on newer GPD firmware Cryolitia PukNgae
2025-08-15 10:43 ` Cryolitia PukNgae via B4 Relay
2025-08-20 15:09 ` Andy Shevchenko

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.