linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices
@ 2024-02-05 13:50 Andy Shevchenko
  2024-02-05 18:36 ` [PATCH v2 " Jesus Gonzalez
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2024-02-05 13:50 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Jesus Gonzalez, lars, linux-iio, linux-kernel


On Sun, Feb 04, 2024 at 02:00:10PM +0000, Jonathan Cameron wrote:
> On Fri,  2 Feb 2024 18:30:41 +0100
> Jesus Gonzalez <jesusmgh@gmail.com> wrote:

...

> >  static const struct acpi_device_id bmi160_acpi_match[] = {
> >  	{"BMI0160", 0},
> > +	{"10EC5280", 0},
> >  	{ },
> >  };

Keep it ordered (digits are going before letters).


-- 
With Best Regards,
Andy Shevchenko



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

* [PATCH v2 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices
  2024-02-05 13:50 [PATCH 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices Andy Shevchenko
@ 2024-02-05 18:36 ` Jesus Gonzalez
  2024-02-06 12:35   ` Andy Shevchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Jesus Gonzalez @ 2024-02-05 18:36 UTC (permalink / raw)
  To: andriy.shevchenko, jic23, lars; +Cc: linux-iio, linux-kernel, Jesus Gonzalez

"10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and 
probably others) in their ACPI table as the ID for the bmi160 IMU. This 
means the bmi160_i2c driver won't bind to it, and the IMU is unavailable 
to the user. Manufacturers have been approached on several occasions to 
try getting a BIOS with a fixed ID, mostly without actual positive 
results, and since affected devices are already a few years old, this is 
not expected to change. This patch enables using the bmi160_i2c driver for 
the bmi160 IMU on these devices.

Here is the relevant extract from the DSDT of a GPD Win Max 2 (AMD 6800U
model) with the latest firmware 1.05 installed. GPD sees this as WONTFIX
with the argument of the device working with the Windows drivers.

     Scope (_SB.I2CC)
    {
        Device (BMA2)
        {
            Name (_ADR, Zero)  // _ADR: Address
            Name (_HID, "10EC5280")  // _HID: Hardware ID
            Name (_CID, "10EC5280")  // _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)
            }
        }
    }

Signed-off-by: Jesus Gonzalez <jesusmgh@gmail.com>
---
v2 patch implementing the improvements mentioned by Mr. Cameron and Mr.
Shevchenko, if I understood them correctly. Please tell me if anything
else should be changed, and I'll be happy to make a new revision.

Thank you!


 drivers/iio/imu/bmi160/bmi160_spi.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/iio/imu/bmi160/bmi160_spi.c b/drivers/iio/imu/bmi160/bmi160_spi.c
index 8b573ea99af2..f88d4b2ba79b 100644
--- a/drivers/iio/imu/bmi160/bmi160_spi.c
+++ b/drivers/iio/imu/bmi160/bmi160_spi.c
@@ -40,6 +40,14 @@ static const struct spi_device_id bmi160_spi_id[] = {
 MODULE_DEVICE_TABLE(spi, bmi160_spi_id);
 
 static const struct acpi_device_id bmi160_acpi_match[] = {
+	/* FIRMWARE BUG WORKAROUND
+	 * Some manufacturers like GPD, Lenovo or Aya used the incorrect
+	 * ID "10EC5280" for bmi160 in their DSDT. A fixed firmware is not
+	 * available as of Feb 2024 after trying to work with OEMs, and
+	 * this is not expected to change anymore since at least some of
+	 * the affected devices are from 2021/2022.
+	 */
+	{"10EC5280", 0},
 	{"BMI0160", 0},
 	{ },
 };
-- 
2.43.0


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

* Re: [PATCH v2 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices
  2024-02-05 18:36 ` [PATCH v2 " Jesus Gonzalez
@ 2024-02-06 12:35   ` Andy Shevchenko
  2024-02-06 17:11     ` [PATCH v3 " Jesus Gonzalez
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2024-02-06 12:35 UTC (permalink / raw)
  To: Jesus Gonzalez; +Cc: jic23, lars, linux-iio, linux-kernel

On Mon, Feb 05, 2024 at 07:36:20PM +0100, Jesus Gonzalez wrote:

Thank you for the update, my comments below.

First of all, it would be nice also to try to contact with Realtek and make
them aware again. Have anybody talked to them previously?

Also read this thread:
https://lore.kernel.org/linux-iio/CACAwPwYQHRcrabw9=0tvenPzAcwwW1pTaR6a+AEWBF9Hqf_wXQ@mail.gmail.com/

> "10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and 
> probably others) in their ACPI table as the ID for the bmi160 IMU. This 
> means the bmi160_i2c driver won't bind to it, and the IMU is unavailable 
> to the user. Manufacturers have been approached on several occasions to 
> try getting a BIOS with a fixed ID, mostly without actual positive 
> results, and since affected devices are already a few years old, this is 
> not expected to change. This patch enables using the bmi160_i2c driver for 
> the bmi160 IMU on these devices.

You have trailing whitespaces in each of the line.

> Here is the relevant extract from the DSDT of a GPD Win Max 2 (AMD 6800U
> model) with the latest firmware 1.05 installed. GPD sees this as WONTFIX
> with the argument of the device working with the Windows drivers.

>      Scope (_SB.I2CC)
>     {

Cut off these 2 lines.

>         Device (BMA2)
>         {
>             Name (_ADR, Zero)  // _ADR: Address
>             Name (_HID, "10EC5280")  // _HID: Hardware ID
>             Name (_CID, "10EC5280")  // _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 */
>             }

Please, cut the below...

> 
>             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 here. Replace it by ... on a single line.

>         }


>     }

As per above (this is part of Scope, so drop it as well).

...

> +	/* FIRMWARE BUG WORKAROUND
> +	 * Some manufacturers like GPD, Lenovo or Aya used the incorrect
> +	 * ID "10EC5280" for bmi160 in their DSDT. A fixed firmware is not
> +	 * available as of Feb 2024 after trying to work with OEMs, and
> +	 * this is not expected to change anymore since at least some of
> +	 * the affected devices are from 2021/2022.
> +	 */
> +	{"10EC5280", 0},

 /*
  * Please, use the correct style of
  * multi-line comments, like in this
  * example.
  */

-- 
With Best Regards,
Andy Shevchenko



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

* [PATCH v3 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices
  2024-02-06 12:35   ` Andy Shevchenko
@ 2024-02-06 17:11     ` Jesus Gonzalez
  2024-02-07 13:54       ` Andy Shevchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Jesus Gonzalez @ 2024-02-06 17:11 UTC (permalink / raw)
  To: andriy.shevchenko, jic23, lars; +Cc: linux-iio, linux-kernel, Jesus Gonzalez

"10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and
probably others) in their ACPI table as the ID for the bmi160 IMU. This
means the bmi160_i2c driver won't bind to it, and the IMU is unavailable
to the user. Manufacturers have been approached on several occasions to
try getting a BIOS with a fixed ID, mostly without actual positive
results, and since affected devices are already a few years old, this is
not expected to change. This patch enables using the bmi160_i2c driver for
the bmi160 IMU on these devices.

Here is the relevant extract from the DSDT of a GPD Win Max 2 (AMD 6800U
model) with the latest firmware 1.05 installed. GPD sees this as WONTFIX
with the argument of the device working with the Windows drivers.

	Device (BMA2)
	{
	    Name (_ADR, Zero)  // _ADR: Address
	    Name (_HID, "10EC5280")  // _HID: Hardware ID
	    Name (_CID, "10EC5280")  // _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 */
	    }
	    
	    ...
	    
	}

Signed-off-by: Jesus Gonzalez <jesusmgh@gmail.com>
---
v3: - Add ID to the actual i2c driver instead of the spi driver
(Mistake while manually transferring change to clean master, lesson learned)
    - Move comment to outside of the function as per coding style
    - Adapt comment style to standard multi-line comment style
    - Reduce unnecessary noise from DSDT in the explanation body


 drivers/iio/imu/bmi160/bmi160_i2c.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c
index 81652c08e644..fc72445204e6 100644
--- a/drivers/iio/imu/bmi160/bmi160_i2c.c
+++ b/drivers/iio/imu/bmi160/bmi160_i2c.c
@@ -42,7 +42,16 @@ static const struct i2c_device_id bmi160_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, bmi160_i2c_id);
 
+/*
+ * FIRMWARE BUG WORKAROUND: ID "10EC5280"
+ * Some manufacturers like GPD, Lenovo or Aya used the incorrect
+ * ID "10EC5280" for bmi160 in their DSDT. A fixed firmware is not
+ * available as of Feb 2024 after trying to work with OEMs, and
+ * this is not expected to change anymore since at least some of
+ * the affected devices are from 2021/2022.
+ */
 static const struct acpi_device_id bmi160_acpi_match[] = {
+	{"10EC5280", 0},
 	{"BMI0160", 0},
 	{ },
 };
-- 
2.43.0


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

* Re: [PATCH v3 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices
  2024-02-06 17:11     ` [PATCH v3 " Jesus Gonzalez
@ 2024-02-07 13:54       ` Andy Shevchenko
  2024-02-07 19:55         ` [PATCH v4 " Jesus Gonzalez
  0 siblings, 1 reply; 9+ messages in thread
From: Andy Shevchenko @ 2024-02-07 13:54 UTC (permalink / raw)
  To: Jesus Gonzalez; +Cc: jic23, lars, linux-iio, linux-kernel

On Tue, Feb 06, 2024 at 06:11:33PM +0100, Jesus Gonzalez wrote:
> "10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and
> probably others) in their ACPI table as the ID for the bmi160 IMU. This
> means the bmi160_i2c driver won't bind to it, and the IMU is unavailable
> to the user. Manufacturers have been approached on several occasions to
> try getting a BIOS with a fixed ID, mostly without actual positive
> results, and since affected devices are already a few years old, this is
> not expected to change. This patch enables using the bmi160_i2c driver for
> the bmi160 IMU on these devices.
> 
> Here is the relevant extract from the DSDT of a GPD Win Max 2 (AMD 6800U
> model) with the latest firmware 1.05 installed. GPD sees this as WONTFIX
> with the argument of the device working with the Windows drivers.
> 
> 	Device (BMA2)
> 	{
> 	    Name (_ADR, Zero)  // _ADR: Address
> 	    Name (_HID, "10EC5280")  // _HID: Hardware ID
> 	    Name (_CID, "10EC5280")  // _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 */
> 	    }
> 	    
> 	    ...
> 	    
> 	}

...

> +/*
> + * FIRMWARE BUG WORKAROUND: ID "10EC5280"
> + * Some manufacturers like GPD, Lenovo or Aya used the incorrect
> + * ID "10EC5280" for bmi160 in their DSDT. A fixed firmware is not
> + * available as of Feb 2024 after trying to work with OEMs, and
> + * this is not expected to change anymore since at least some of
> + * the affected devices are from 2021/2022.
> + */

The location of the comment is wrong, it should be...

>  static const struct acpi_device_id bmi160_acpi_match[] = {

...here as you have had it previously. Just make sure it properly formed.

Maybe Jonathan can amend when applying, dunno.

> +	{"10EC5280", 0},
>  	{"BMI0160", 0},
>  	{ },

With the comment in the proper location,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



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

* [PATCH v4 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices
  2024-02-07 13:54       ` Andy Shevchenko
@ 2024-02-07 19:55         ` Jesus Gonzalez
  2024-02-08 10:58           ` Andy Shevchenko
  2024-02-10 16:02           ` Jonathan Cameron
  0 siblings, 2 replies; 9+ messages in thread
From: Jesus Gonzalez @ 2024-02-07 19:55 UTC (permalink / raw)
  To: andriy.shevchenko, jic23, lars; +Cc: linux-iio, linux-kernel, Jesus Gonzalez

"10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and
probably others) in their ACPI table as the ID for the bmi160 IMU. This
means the bmi160_i2c driver won't bind to it, and the IMU is unavailable
to the user. Manufacturers have been approached on several occasions to
try getting a BIOS with a fixed ID, mostly without actual positive
results, and since affected devices are already a few years old, this is
not expected to change. This patch enables using the bmi160_i2c driver for
the bmi160 IMU on these devices.

Here is the relevant extract from the DSDT of a GPD Win Max 2 (AMD 6800U
model) with the latest firmware 1.05 installed. GPD sees this as WONTFIX
with the argument of the device working with the Windows drivers.

	Device (BMA2)
	{
	    Name (_ADR, Zero)  // _ADR: Address
	    Name (_HID, "10EC5280")  // _HID: Hardware ID
	    Name (_CID, "10EC5280")  // _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 */
	    }
	    
	    ...
	    
	}

Signed-off-by: Jesus Gonzalez <jesusmgh@gmail.com>
---
v4: Moved comment back to relevant position inside function

 drivers/iio/imu/bmi160/bmi160_i2c.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c
index 81652c08e644..a081305254db 100644
--- a/drivers/iio/imu/bmi160/bmi160_i2c.c
+++ b/drivers/iio/imu/bmi160/bmi160_i2c.c
@@ -43,6 +43,15 @@ static const struct i2c_device_id bmi160_i2c_id[] = {
 MODULE_DEVICE_TABLE(i2c, bmi160_i2c_id);
 
 static const struct acpi_device_id bmi160_acpi_match[] = {
+	/*
+	 * FIRMWARE BUG WORKAROUND
+	 * Some manufacturers like GPD, Lenovo or Aya used the incorrect
+	 * ID "10EC5280" for bmi160 in their DSDT. A fixed firmware is not
+	 * available as of Feb 2024 after trying to work with OEMs, and
+	 * this is not expected to change anymore since at least some of
+	 * the affected devices are from 2021/2022.
+	 */
+	{"10EC5280", 0},
 	{"BMI0160", 0},
 	{ },
 };
-- 
2.43.0


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

* Re: [PATCH v4 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices
  2024-02-07 19:55         ` [PATCH v4 " Jesus Gonzalez
@ 2024-02-08 10:58           ` Andy Shevchenko
  2024-02-10 16:02           ` Jonathan Cameron
  1 sibling, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2024-02-08 10:58 UTC (permalink / raw)
  To: Jesus Gonzalez; +Cc: jic23, lars, linux-iio, linux-kernel

On Wed, Feb 07, 2024 at 08:55:50PM +0100, Jesus Gonzalez wrote:
> "10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and
> probably others) in their ACPI table as the ID for the bmi160 IMU. This
> means the bmi160_i2c driver won't bind to it, and the IMU is unavailable
> to the user. Manufacturers have been approached on several occasions to
> try getting a BIOS with a fixed ID, mostly without actual positive
> results, and since affected devices are already a few years old, this is
> not expected to change. This patch enables using the bmi160_i2c driver for
> the bmi160 IMU on these devices.
> 
> Here is the relevant extract from the DSDT of a GPD Win Max 2 (AMD 6800U
> model) with the latest firmware 1.05 installed. GPD sees this as WONTFIX
> with the argument of the device working with the Windows drivers.
> 
> 	Device (BMA2)
> 	{
> 	    Name (_ADR, Zero)  // _ADR: Address
> 	    Name (_HID, "10EC5280")  // _HID: Hardware ID
> 	    Name (_CID, "10EC5280")  // _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 */
> 	    }
> 	    
> 	    ...
> 	    
> 	}

(It's your responsibility to carry on the tags you got in case you send a new
 version. But for the sake of constructive feedback I'll give it once more this
 time, so no need to send a new version.)

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

> Signed-off-by: Jesus Gonzalez <jesusmgh@gmail.com>
> ---
> v4: Moved comment back to relevant position inside function
> 
>  drivers/iio/imu/bmi160/bmi160_i2c.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c
> index 81652c08e644..a081305254db 100644
> --- a/drivers/iio/imu/bmi160/bmi160_i2c.c
> +++ b/drivers/iio/imu/bmi160/bmi160_i2c.c
> @@ -43,6 +43,15 @@ static const struct i2c_device_id bmi160_i2c_id[] = {
>  MODULE_DEVICE_TABLE(i2c, bmi160_i2c_id);
>  
>  static const struct acpi_device_id bmi160_acpi_match[] = {
> +	/*
> +	 * FIRMWARE BUG WORKAROUND
> +	 * Some manufacturers like GPD, Lenovo or Aya used the incorrect
> +	 * ID "10EC5280" for bmi160 in their DSDT. A fixed firmware is not
> +	 * available as of Feb 2024 after trying to work with OEMs, and
> +	 * this is not expected to change anymore since at least some of
> +	 * the affected devices are from 2021/2022.
> +	 */
> +	{"10EC5280", 0},
>  	{"BMI0160", 0},
>  	{ },
>  };
> -- 
> 2.43.0
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices
  2024-02-07 19:55         ` [PATCH v4 " Jesus Gonzalez
  2024-02-08 10:58           ` Andy Shevchenko
@ 2024-02-10 16:02           ` Jonathan Cameron
  2024-02-19 19:16             ` Jesus Miguel Gonzalez Herrero
  1 sibling, 1 reply; 9+ messages in thread
From: Jonathan Cameron @ 2024-02-10 16:02 UTC (permalink / raw)
  To: Jesus Gonzalez; +Cc: andriy.shevchenko, lars, linux-iio, linux-kernel

On Wed,  7 Feb 2024 20:55:50 +0100
Jesus Gonzalez <jesusmgh@gmail.com> wrote:

> "10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and
> probably others) in their ACPI table as the ID for the bmi160 IMU. This
> means the bmi160_i2c driver won't bind to it, and the IMU is unavailable
> to the user. Manufacturers have been approached on several occasions to
> try getting a BIOS with a fixed ID, mostly without actual positive
> results, and since affected devices are already a few years old, this is
> not expected to change. This patch enables using the bmi160_i2c driver for
> the bmi160 IMU on these devices.
> 
> Here is the relevant extract from the DSDT of a GPD Win Max 2 (AMD 6800U
> model) with the latest firmware 1.05 installed. GPD sees this as WONTFIX
> with the argument of the device working with the Windows drivers.
> 
> 	Device (BMA2)
> 	{
> 	    Name (_ADR, Zero)  // _ADR: Address
> 	    Name (_HID, "10EC5280")  // _HID: Hardware ID
> 	    Name (_CID, "10EC5280")  // _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 */
> 	    }
> 	    
> 	    ...
> 	    
> 	}
> 
> Signed-off-by: Jesus Gonzalez <jesusmgh@gmail.com>
For future reference don't send a new version in reply to the old one.
It makes a big mess in many people's email clients
if we get lots of versions.  The patch naming is enough to associate
the different versions.

Applied to the togreg branch of iio.git and pushed out as testing for 0-day
to take a look at it.

Thanks,

Jonathan

> ---
> v4: Moved comment back to relevant position inside function
> 
>  drivers/iio/imu/bmi160/bmi160_i2c.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c
> index 81652c08e644..a081305254db 100644
> --- a/drivers/iio/imu/bmi160/bmi160_i2c.c
> +++ b/drivers/iio/imu/bmi160/bmi160_i2c.c
> @@ -43,6 +43,15 @@ static const struct i2c_device_id bmi160_i2c_id[] = {
>  MODULE_DEVICE_TABLE(i2c, bmi160_i2c_id);
>  
>  static const struct acpi_device_id bmi160_acpi_match[] = {
> +	/*
> +	 * FIRMWARE BUG WORKAROUND
> +	 * Some manufacturers like GPD, Lenovo or Aya used the incorrect
> +	 * ID "10EC5280" for bmi160 in their DSDT. A fixed firmware is not
> +	 * available as of Feb 2024 after trying to work with OEMs, and
> +	 * this is not expected to change anymore since at least some of
> +	 * the affected devices are from 2021/2022.
> +	 */
> +	{"10EC5280", 0},
>  	{"BMI0160", 0},
>  	{ },
>  };


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

* Re: [PATCH v4 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices
  2024-02-10 16:02           ` Jonathan Cameron
@ 2024-02-19 19:16             ` Jesus Miguel Gonzalez Herrero
  0 siblings, 0 replies; 9+ messages in thread
From: Jesus Miguel Gonzalez Herrero @ 2024-02-19 19:16 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: andriy.shevchenko, lars, linux-iio, linux-kernel

Please excuse the late answer.

Thank you both, Mr. Cameron and Mr. Shevchenko, for guiding me through this.

I'll keep an eye on git, and make sure to remember your advice on any 
future submissions.

Best regards,

Jesus Gonzalez

>> "10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and
>> probably others) in their ACPI table as the ID for the bmi160 IMU. This
>> means the bmi160_i2c driver won't bind to it, and the IMU is unavailable
>> to the user. Manufacturers have been approached on several occasions to
>> try getting a BIOS with a fixed ID, mostly without actual positive
>> results, and since affected devices are already a few years old, this is
>> not expected to change. This patch enables using the bmi160_i2c driver for
>> the bmi160 IMU on these devices.
>>
>> Here is the relevant extract from the DSDT of a GPD Win Max 2 (AMD 6800U
>> model) with the latest firmware 1.05 installed. GPD sees this as WONTFIX
>> with the argument of the device working with the Windows drivers.
>>
>> 	Device (BMA2)
>> 	{
>> 	    Name (_ADR, Zero)  // _ADR: Address
>> 	    Name (_HID, "10EC5280")  // _HID: Hardware ID
>> 	    Name (_CID, "10EC5280")  // _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 */
>> 	    }
>> 	
>> 	    ...
>> 	
>> 	}
>>
>> Signed-off-by: Jesus Gonzalez <jesusmgh@gmail.com>
> For future reference don't send a new version in reply to the old one.
> It makes a big mess in many people's email clients
> if we get lots of versions.  The patch naming is enough to associate
> the different versions.
>
> Applied to the togreg branch of iio.git and pushed out as testing for 0-day
> to take a look at it.
>
> Thanks,
>
> Jonathan
>
>> ---
>> v4: Moved comment back to relevant position inside function
>>
>>   drivers/iio/imu/bmi160/bmi160_i2c.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c
>> index 81652c08e644..a081305254db 100644
>> --- a/drivers/iio/imu/bmi160/bmi160_i2c.c
>> +++ b/drivers/iio/imu/bmi160/bmi160_i2c.c
>> @@ -43,6 +43,15 @@ static const struct i2c_device_id bmi160_i2c_id[] = {
>>   MODULE_DEVICE_TABLE(i2c, bmi160_i2c_id);
>>   
>>   static const struct acpi_device_id bmi160_acpi_match[] = {
>> +	/*
>> +	 * FIRMWARE BUG WORKAROUND
>> +	 * Some manufacturers like GPD, Lenovo or Aya used the incorrect
>> +	 * ID "10EC5280" for bmi160 in their DSDT. A fixed firmware is not
>> +	 * available as of Feb 2024 after trying to work with OEMs, and
>> +	 * this is not expected to change anymore since at least some of
>> +	 * the affected devices are from 2021/2022.
>> +	 */
>> +	{"10EC5280", 0},
>>   	{"BMI0160", 0},
>>   	{ },
>>   };

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

end of thread, other threads:[~2024-02-19 19:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-05 13:50 [PATCH 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices Andy Shevchenko
2024-02-05 18:36 ` [PATCH v2 " Jesus Gonzalez
2024-02-06 12:35   ` Andy Shevchenko
2024-02-06 17:11     ` [PATCH v3 " Jesus Gonzalez
2024-02-07 13:54       ` Andy Shevchenko
2024-02-07 19:55         ` [PATCH v4 " Jesus Gonzalez
2024-02-08 10:58           ` Andy Shevchenko
2024-02-10 16:02           ` Jonathan Cameron
2024-02-19 19:16             ` Jesus Miguel Gonzalez Herrero

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).