* [PATCH] ACPI: scan: Ignore MAGN0001
@ 2023-04-21 16:27 Marius Hoch
2023-04-21 18:07 ` Hans de Goede
0 siblings, 1 reply; 3+ messages in thread
From: Marius Hoch @ 2023-04-21 16:27 UTC (permalink / raw)
To: Rafael J. Wysocki, Len Brown, linux-acpi, linux-kernel
Cc: Hans de Goede, Marius Hoch
The LSM303D on the Lenovo Yoga Tablet 2 series is present
as both ACCL0001 and MAGN0001. As we can only ever register an
i2c client for one of them, ignore MAGN0001.
Currently this errors:
i2c i2c-4: Failed to register i2c client MAGN0001:00 at 0x1d (-16)
Tested on a Lenovo Yoga Tablet 2 1051-F.
Signed-off-by: Marius Hoch <mail@mariushoch.de>
---
drivers/acpi/scan.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 0c6f06abe3f4..d21c411e9719 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1730,6 +1730,12 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
*/
{"BCM4752", },
{"LNV4752", },
+ /*
+ * The LSM303D on the Lenovo Yoga Tablet 2 series is present
+ * as both ACCL0001 and MAGN0001. As we can only ever register an
+ * i2c client for one of them, ignore MAGN0001.
+ */
+ {"MAGN0001", },
{}
};
base-commit: cb0856346a60fe3eb837ba5e73588a41f81ac05f
--
2.40.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ACPI: scan: Ignore MAGN0001
2023-04-21 16:27 [PATCH] ACPI: scan: Ignore MAGN0001 Marius Hoch
@ 2023-04-21 18:07 ` Hans de Goede
2023-04-22 16:47 ` Marius Hoch
0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2023-04-21 18:07 UTC (permalink / raw)
To: Marius Hoch, Rafael J. Wysocki, Len Brown, linux-acpi, linux-kernel
Hi Marius,
On 4/21/23 18:27, Marius Hoch wrote:
> The LSM303D on the Lenovo Yoga Tablet 2 series is present
> as both ACCL0001 and MAGN0001. As we can only ever register an
> i2c client for one of them, ignore MAGN0001.
>
> Currently this errors:
> i2c i2c-4: Failed to register i2c client MAGN0001:00 at 0x1d (-16)
>
> Tested on a Lenovo Yoga Tablet 2 1051-F.
>
> Signed-off-by: Marius Hoch <mail@mariushoch.de>
By adding the HID to the ignore_serial_bus_ids[] list, you are
causing the ACPI code to instead instantiate a platform_device
for it.
This will successfully silence the error you are trying to silence,
but I don't think it really is what you intent / want to do ?
IMHO it would be better to add a NOT_PRESENT_ENTRY_HID() entry
to the override_status_ids[] table in drivers/acpi/x86/utils.c,
this will override the return of _STA, causing neither a
platform_device not an i2c_client to get instantiated for
the duplicate MAGN0001 device.
(please keep the comment above the entry why the entry is there)
Regards,
Hans
> ---
> drivers/acpi/scan.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index 0c6f06abe3f4..d21c411e9719 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -1730,6 +1730,12 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
> */
> {"BCM4752", },
> {"LNV4752", },
> + /*
> + * The LSM303D on the Lenovo Yoga Tablet 2 series is present
> + * as both ACCL0001 and MAGN0001. As we can only ever register an
> + * i2c client for one of them, ignore MAGN0001.
> + */
> + {"MAGN0001", },
> {}
> };
>
>
> base-commit: cb0856346a60fe3eb837ba5e73588a41f81ac05f
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ACPI: scan: Ignore MAGN0001
2023-04-21 18:07 ` Hans de Goede
@ 2023-04-22 16:47 ` Marius Hoch
0 siblings, 0 replies; 3+ messages in thread
From: Marius Hoch @ 2023-04-22 16:47 UTC (permalink / raw)
To: Hans de Goede, Rafael J. Wysocki, Len Brown, linux-acpi, linux-kernel
Hi Hans,
On 21/04/2023 20:07, Hans de Goede wrote:
> Hi Marius,
>
> On 4/21/23 18:27, Marius Hoch wrote:
>> The LSM303D on the Lenovo Yoga Tablet 2 series is present
>> as both ACCL0001 and MAGN0001. As we can only ever register an
>> i2c client for one of them, ignore MAGN0001.
>>
>> Currently this errors:
>> i2c i2c-4: Failed to register i2c client MAGN0001:00 at 0x1d (-16)
>>
>> Tested on a Lenovo Yoga Tablet 2 1051-F.
>>
>> Signed-off-by: Marius Hoch <mail@mariushoch.de>
> By adding the HID to the ignore_serial_bus_ids[] list, you are
> causing the ACPI code to instead instantiate a platform_device
> for it.
>
> This will successfully silence the error you are trying to silence,
> but I don't think it really is what you intent / want to do ?
It is not, no. Given we will only ever care for ACCL0001, we can
entirely skip MAGN0001.
>
> IMHO it would be better to add a NOT_PRESENT_ENTRY_HID() entry
> to the override_status_ids[] table in drivers/acpi/x86/utils.c,
> this will override the return of _STA, causing neither a
> platform_device not an i2c_client to get instantiated for
> the duplicate MAGN0001 device.
That sounds much better, thanks for the pointer!
I've send a new patch (20230422164401.5986-1-mail@mariushoch.de).
Cheers,
Marius
>
> (please keep the comment above the entry why the entry is there)
>
> Regards,
>
> Hans
>
>
>
>
>
>
>
>> ---
>> drivers/acpi/scan.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
>> index 0c6f06abe3f4..d21c411e9719 100644
>> --- a/drivers/acpi/scan.c
>> +++ b/drivers/acpi/scan.c
>> @@ -1730,6 +1730,12 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
>> */
>> {"BCM4752", },
>> {"LNV4752", },
>> + /*
>> + * The LSM303D on the Lenovo Yoga Tablet 2 series is present
>> + * as both ACCL0001 and MAGN0001. As we can only ever register an
>> + * i2c client for one of them, ignore MAGN0001.
>> + */
>> + {"MAGN0001", },
>> {}
>> };
>>
>>
>> base-commit: cb0856346a60fe3eb837ba5e73588a41f81ac05f
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-22 16:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21 16:27 [PATCH] ACPI: scan: Ignore MAGN0001 Marius Hoch
2023-04-21 18:07 ` Hans de Goede
2023-04-22 16:47 ` Marius Hoch
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®