Re: [PATCH v3] iio: accel: adxl345: Add ACPI HID table

From: Andy Shevchenko
Date: Tue Feb 15 2022 - 03:28:22 EST


On Tue, Feb 15, 2022 at 6:20 AM Kai-Heng Feng
<kai.heng.feng@xxxxxxxxxxxxx> wrote:
>
> x86 boards may use ACPI HID "ADS0345" for adxl345 device.
>
> Analog replied:
> "ADS034X is not a valid PNP ID. ADS0345 would be.
> I'm not aware that this ID is already taken.
> Feel free to submit a mainline Linux input mailing list patch."
>
> So add an ACPI match table for that accordingly.

Thank you for the update, my comments below.

...

> @@ -41,6 +41,7 @@ static int adxl345_i2c_probe(struct i2c_client *client,
> static const struct i2c_device_id adxl345_i2c_id[] = {
> { "adxl345", ADXL345 },
> { "adxl375", ADXL375 },

> + { "ADS0345:00", ADXL345 },
> { }
> };
>

This is wrong. First of all, on the left side you put the device
instance name (which must not be in the ID tables, since the device
instance name is "ID + instance number"). Second, the motivation of
this is not clear, if the device is enumerated by ACPI, why do you
care about board code?

Just don't add anything to this table.

The rest is good, but consider doing the same for _spi part of the driver.

--
With Best Regards,
Andy Shevchenko