Skip to contentSkip to conversation

iio: magnetometer: ak8975: Remove wrong ACPI ID

PATCH In review Andy Shevchenko 3 participants 8 messages Nov 3, 2017 – Nov 19, 2017 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: magnetometer: ak8975: Remove wrong ACPI ID

The ID is added to proper sensor by the commit 6ed5ac50a3e0 ("iio: imu: inv_mpu6050: ACPI enumeration").

Remove it from wrong place, otherwise user will get:

ak8975 i2c-INVN6500:00: mounting matrix not found: using identity... ak8975 i2c-INVN6500:00: Unexpected device

Fixes 6ed5ac50a3e0 ("iio: imu: inv_mpu6050: ACPI enumeration").
Cc Srinivas Pandruvada <[email protected]>
---
 drivers/iio/magnetometer/ak8975.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/magnetometer/ak8975.c +0 -1
index 42a827a66512..f29a00729fa0 100644
@@ -787,7 +787,6 @@ static const struct iio_info ak8975_info = {
 static const struct acpi_device_id ak_acpi_match[] = {
 	{"AK8975", AK8975},
 	{"AK8963", AK8963},
-	{"INVN6500", AK8963},
 	{"AK009911", AK09911},
 	{"AK09911", AK09911},
 	{"AK09912", AK09912},
Signature · 1 line
2.14.2
#1 lore raw
Quoted 8 lines · Andy Shevchenko

The ID is added to proper sensor by the commit 6ed5ac50a3e0 ("iio: imu: inv_mpu6050: ACPI enumeration").

Remove it from wrong place, otherwise user will get:

ak8975 i2c-INVN6500:00: mounting matrix not found: using identity... ak8975 i2c-INVN6500:00: Unexpected device

After applying I have got

inv-mpu6050-i2c i2c-INVN6500:00: mounting matrix not found: using
identity...

...

i2c i2c-4: Added multiplexed i2c bus 14
ak8975 14-000c: mounting matrix not found: using identity...

Nevertheless, I didn't try before with both drivers enabled. It might be that my fix is not needed.

Shrinivas, can you comment on this?

Quoted 20 lines
Fixes 6ed5ac50a3e0 ("iio: imu: inv_mpu6050: ACPI enumeration").
Cc Srinivas Pandruvada <[email protected]>
---
 drivers/iio/magnetometer/ak8975.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/magnetometer/ak8975.c +0 -1
index 42a827a66512..f29a00729fa0 100644
@@ -787,7 +787,6 @@ static const struct iio_info ak8975_info = {
 static const struct acpi_device_id ak_acpi_match[] = {
 	{"AK8975", AK8975},
 	{"AK8963", AK8963},
-	{"INVN6500", AK8963},
 	{"AK009911", AK09911},
 	{"AK09911", AK09911},
 	{"AK09912", AK09912},
Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#2 lore raw
Quoted 22 lines · Andy Shevchenko
Quoted 9 lines · Andy Shevchenko

The ID is added to proper sensor by the commit 6ed5ac50a3e0 ("iio: imu: inv_mpu6050: ACPI enumeration").

Remove it from wrong place, otherwise user will get:

ak8975 i2c-INVN6500:00: mounting matrix not found: using
identity...
ak8975 i2c-INVN6500:00: Unexpected device

After applying I have got

inv-mpu6050-i2c i2c-INVN6500:00: mounting matrix not found: using
identity...

...

i2c i2c-4: Added multiplexed i2c bus 14
ak8975 14-000c: mounting matrix not found: using identity...

Quoted 5 lines

Nevertheless, I didn't try before with both drivers enabled. It might be
that my fix is not needed.

Shrinivas, can you comment on this?

DSDT looks promising:

Device (SENS) {
Name (_HID, "INVN6500" /* InvenSense MPU-6500 Six Axis Gyroscope and
Accelerometer */)
...

    Name (CNF0, Package (0x04) {        
        Package (0x04) { "MPU6500", ... },   
        Package (0x04) { "MPU6500", ... },
        Package (0x04) { "AK8963", ... },

Thus it is properly enumerated IIUC.

I think the patch at the end is correct.

Quoted 24 lines
Quoted 22 lines
Fixes 6ed5ac50a3e0 ("iio: imu: inv_mpu6050: ACPI enumeration").
Cc Srinivas Pandruvada <[email protected]>
---
 drivers/iio/magnetometer/ak8975.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/magnetometer/ak8975.c +0 -1
index 42a827a66512..f29a00729fa0 100644
@@ -787,7 +787,6 @@ static const struct iio_info ak8975_info = {
 static const struct acpi_device_id ak_acpi_match[] = {
 	{"AK8975", AK8975},
 	{"AK8963", AK8963},
-	{"INVN6500", AK8963},
 	{"AK009911", AK09911},
 	{"AK09911", AK09911},
 	{"AK09912", AK09912},
Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#3 lore raw
Quoted 38 lines · Andy Shevchenko
Quoted 22 lines · Andy Shevchenko
Quoted 9 lines · Andy Shevchenko

The ID is added to proper sensor by the commit 6ed5ac50a3e0 ("iio: imu: inv_mpu6050: ACPI enumeration").

Remove it from wrong place, otherwise user will get:

ak8975 i2c-INVN6500:00: mounting matrix not found: using
identity...
ak8975 i2c-INVN6500:00: Unexpected device

After applying I have got

inv-mpu6050-i2c i2c-INVN6500:00: mounting matrix not found: using
identity...

...

i2c i2c-4: Added multiplexed i2c bus 14
ak8975 14-000c: mounting matrix not found: using identity...

Quoted 6 lines

Nevertheless, I didn't try before with both drivers enabled. It might
be
that my fix is not needed.

Shrinivas, can you comment on this?

DSDT looks promising:

Device (SENS) {
Name (_HID, "INVN6500" /* InvenSense MPU-6500 Six Axis Gyroscope
and
Accelerometer */)
...

Quoted 8 lines
    Name (CNF0, Package (0x04) {        
        Package (0x04) { "MPU6500", ... },   
        Package (0x04) { "MPU6500", ... },
        Package (0x04) { "AK8963", ... },

Thus it is properly enumerated IIUC.

I think the patch at the end is correct.

The AK8963 is using INVN6500. The reason is that this INVN 6500 has another master mode where a secondary sensor can be connected to it as an i2c slave.
So Windows config uses this mode and hence added in the same package.

But Linux INVN driver is not capable of this master mode. We use something called "bypass" mode. In this the second sensor will also be directly connected to host i2c. We have another driver handling this sensor (ak8975), so we have to add this id.

Thanks,
Srinivas

Quoted 28 lines
Quoted 26 lines
Quoted 24 lines
Fixes 6ed5ac50a3e0 ("iio: imu: inv_mpu6050: ACPI enumeration").
Cc Srinivas Pandruvada <[email protected]>
Quoted 1 line
---
 drivers/iio/magnetometer/ak8975.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/magnetometer/ak8975.c +0 -1
index 42a827a66512..f29a00729fa0 100644
@@ -787,7 +787,6 @@ static const struct iio_info ak8975_info = {
 static const struct acpi_device_id ak_acpi_match[] = {
 	{"AK8975", AK8975},
 	{"AK8963", AK8963},
-	{"INVN6500", AK8963},
 	{"AK009911", AK09911},
 	{"AK09911", AK09911},
 	{"AK09912", AK09912},
#4 lore raw
Quoted 53 lines · Srinivas Pandruvada
Quoted 38 lines · Andy Shevchenko
Quoted 22 lines · Andy Shevchenko
Quoted 9 lines · Andy Shevchenko

The ID is added to proper sensor by the commit 6ed5ac50a3e0 ("iio: imu: inv_mpu6050: ACPI enumeration").

Remove it from wrong place, otherwise user will get:

ak8975 i2c-INVN6500:00: mounting matrix not found: using
identity...
ak8975 i2c-INVN6500:00: Unexpected device

After applying I have got

inv-mpu6050-i2c i2c-INVN6500:00: mounting matrix not found: using
identity...

...

i2c i2c-4: Added multiplexed i2c bus 14
ak8975 14-000c: mounting matrix not found: using identity...

Quoted 6 lines

Nevertheless, I didn't try before with both drivers enabled. It might
be
that my fix is not needed.

Shrinivas, can you comment on this?

DSDT looks promising:

Device (SENS) {
Name (_HID, "INVN6500" /* InvenSense MPU-6500 Six Axis Gyroscope
and
Accelerometer */)
...

Quoted 8 lines
    Name (CNF0, Package (0x04) {        
        Package (0x04) { "MPU6500", ... },   
        Package (0x04) { "MPU6500", ... },
        Package (0x04) { "AK8963", ... },

Thus it is properly enumerated IIUC.

I think the patch at the end is correct.

The AK8963 is using INVN6500. The reason is that this INVN 6500 has another master mode where a secondary sensor can be connected to it as an i2c slave.
So Windows config uses this mode and hence added in the same package.

Quoted 4 lines

But Linux INVN driver is not capable of this master mode. We use something called "bypass" mode. In this the second sensor will also be directly connected to host i2c. We have another driver handling this sensor (ak8975), so we have to add this id.

But ak8975 is enumerated. See above log. So, I think the INVN6500 ID in ak 8975 driver is simple not required.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#5 lore raw
Quoted 65 lines · Andy Shevchenko
Quoted 57 lines · Srinivas Pandruvada
Quoted 40 lines · Andy Shevchenko
Quoted 23 lines · Andy Shevchenko
Quoted 9 lines · Andy Shevchenko

The ID is added to proper sensor by the commit 6ed5ac50a3e0 ("iio: imu: inv_mpu6050: ACPI enumeration").

Remove it from wrong place, otherwise user will get:

 ak8975 i2c-INVN6500:00: mounting matrix not found: using identity...
 ak8975 i2c-INVN6500:00: Unexpected device

After applying I have got

 inv-mpu6050-i2c i2c-INVN6500:00: mounting matrix not found:
using
identity...

...

 i2c i2c-4: Added multiplexed i2c bus 14
 ak8975 14-000c: mounting matrix not found: using identity...

Quoted 6 lines

Nevertheless, I didn't try before with both drivers enabled. It might
be
that my fix is not needed.

Shrinivas, can you comment on this?

DSDT looks promising:

Device (SENS) {
    Name (_HID, "INVN6500" /* InvenSense MPU-6500 Six Axis Gyroscope
and
Accelerometer */)
...

Quoted 8 lines

    Name (CNF0, Package (0x04) {
        Package (0x04) { "MPU6500", ... },
        Package (0x04) { "MPU6500", ... },
        Package (0x04) { "AK8963", ... },

Thus it is properly enumerated IIUC.

I think the patch at the end is correct.

The AK8963 is using INVN6500. The reason is that this INVN 6500 has another master mode where a secondary sensor can be connected to it as
an i2c slave.
So Windows config uses this mode and hence added in the same package.

Quoted 6 lines

But Linux INVN driver is not capable of this master mode. We use something called "bypass" mode. In this the second sensor will also be
directly connected to host i2c. We have another driver handling this
sensor (ak8975), so we have to add this id.

Quoted 3 lines

But ak8975 is enumerated. See above log. So, I think the INVN6500 ID in
ak 8975 driver is simple not required.

This is not true in all platforms. So this is required.

Thanks,
Srinivas

Quoted 1 line
#6 lore raw
Quoted 20 lines · Srinivas Pandruvada
Quoted 19 lines · Andy Shevchenko
Quoted 16 lines · Srinivas Pandruvada

The AK8963 is using INVN6500. The reason is that this INVN 6500 has
another master mode where a secondary sensor can be connected to it
as
an i2c slave.
So Windows config uses this mode and hence added in the same package.

But Linux INVN driver is not capable of this master mode. We use something called "bypass" mode. In this the second sensor will also
be
directly connected to host i2c. We have another driver handling this
sensor (ak8975), so we have to add this id.

Quoted 5 lines
Quoted 3 lines

But ak8975 is enumerated. See above log. So, I think the INVN6500 ID in
ak 8975 driver is simple not required.

This is not true in all platforms. So this is required.

Thanks for clarification. though it would be interesting to test a behaviour w/o this patch on platform I have and the one that has wrong data under CNF0 resources.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
maintainer
#7 lore raw
Quoted 25 lines · On Wed, 08 Nov 2017 18:38:39 +0200 Andy Shevchenko…
Quoted 24 lines · Srinivas Pandruvada
Quoted 22 lines · Andy Shevchenko
Quoted 9 lines · Srinivas Pandruvada

The AK8963 is using INVN6500. The reason is that this INVN 6500 has
another master mode where a secondary sensor can be connected to it
as
an i2c slave.
So Windows config uses this mode and hence added in the same package.

Quoted 7 lines

But Linux INVN driver is not capable of this master mode. We use something called "bypass" mode. In this the second sensor will also
be
directly connected to host i2c. We have another driver handling this
sensor (ak8975), so we have to add this id.

But ak8975 is enumerated. See above log. So, I think the INVN6500 ID in
ak 8975 driver is simple not required.

Quoted 6 lines
Quoted 1 line

This is not true in all platforms. So this is required.

Thanks for clarification. though it would be interesting to test a behaviour w/o this patch on platform I have and the one that has wrong data under CNF0 resources.

As this discussion seems to have concluded the patch is a bad idea I'm dropping it.

I'll add though that it would be possible to instantiate the ak8975 from the mpu6050 driver if we wanted to avoid this nasty 'hack'.

Jonathan