Message ID | 20240805133708.160737-4-hdegoede@redhat.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | i2c-i801 / dell-lis3lv02d: Move instantiation of lis3lv02d i2c_client from i2c-i801 to dell-lis3lv02d | expand |
On Mon, Aug 5, 2024 at 3:38 PM Hans de Goede <hdegoede@redhat.com> wrote: > > Move the SMO88xx acpi_device_ids to a new dell-smo8800-ids.h header, > so that these can be shared with the new dell-lis3lv02d code. ... > +#ifndef _DELL_SMO8800_IDS_H_ > +#define _DELL_SMO8800_IDS_H_ > + > +#include <linux/mod_devicetable.h> > + > +static const struct acpi_device_id smo8800_ids[] = { > + { "SMO8800" }, > + { "SMO8801" }, > + { "SMO8810" }, > + { "SMO8811" }, > + { "SMO8820" }, > + { "SMO8821" }, > + { "SMO8830" }, > + { "SMO8831" }, > + { } > +}; > +MODULE_DEVICE_TABLE(acpi, smo8800_ids); The macro definition is in module.h. > +#endif
Hi, On 8/5/24 10:27 PM, Andy Shevchenko wrote: > On Mon, Aug 5, 2024 at 3:38 PM Hans de Goede <hdegoede@redhat.com> wrote: >> >> Move the SMO88xx acpi_device_ids to a new dell-smo8800-ids.h header, >> so that these can be shared with the new dell-lis3lv02d code. > > ... > >> +#ifndef _DELL_SMO8800_IDS_H_ >> +#define _DELL_SMO8800_IDS_H_ >> + >> +#include <linux/mod_devicetable.h> >> + >> +static const struct acpi_device_id smo8800_ids[] = { >> + { "SMO8800" }, >> + { "SMO8801" }, >> + { "SMO8810" }, >> + { "SMO8811" }, >> + { "SMO8820" }, >> + { "SMO8821" }, >> + { "SMO8830" }, >> + { "SMO8831" }, >> + { } >> +}; >> +MODULE_DEVICE_TABLE(acpi, smo8800_ids); > > The macro definition is in module.h. Ok, I've added a #include for that for v8. Regards, Hans
diff --git a/drivers/platform/x86/dell/dell-smo8800-ids.h b/drivers/platform/x86/dell/dell-smo8800-ids.h new file mode 100644 index 000000000000..f85d8b707d85 --- /dev/null +++ b/drivers/platform/x86/dell/dell-smo8800-ids.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * ACPI SMO88XX lis3lv02d freefall / accelerometer device-ids. + * + * Copyright (C) 2012 Sonal Santan <sonal.santan@gmail.com> + * Copyright (C) 2014 Pali Rohár <pali@kernel.org> + */ +#ifndef _DELL_SMO8800_IDS_H_ +#define _DELL_SMO8800_IDS_H_ + +#include <linux/mod_devicetable.h> + +static const struct acpi_device_id smo8800_ids[] = { + { "SMO8800" }, + { "SMO8801" }, + { "SMO8810" }, + { "SMO8811" }, + { "SMO8820" }, + { "SMO8821" }, + { "SMO8830" }, + { "SMO8831" }, + { } +}; +MODULE_DEVICE_TABLE(acpi, smo8800_ids); + +#endif diff --git a/drivers/platform/x86/dell/dell-smo8800.c b/drivers/platform/x86/dell/dell-smo8800.c index f7ec17c56833..f9119ed2bd92 100644 --- a/drivers/platform/x86/dell/dell-smo8800.c +++ b/drivers/platform/x86/dell/dell-smo8800.c @@ -14,10 +14,10 @@ #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/miscdevice.h> -#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/uaccess.h> +#include "dell-smo8800-ids.h" struct smo8800_device { u32 irq; /* acpi device irq */ @@ -163,20 +163,6 @@ static void smo8800_remove(struct platform_device *device) dev_dbg(&device->dev, "device /dev/freefall unregistered\n"); } -/* NOTE: Keep this list in sync with drivers/i2c/busses/i2c-i801.c */ -static const struct acpi_device_id smo8800_ids[] = { - { "SMO8800", 0 }, - { "SMO8801", 0 }, - { "SMO8810", 0 }, - { "SMO8811", 0 }, - { "SMO8820", 0 }, - { "SMO8821", 0 }, - { "SMO8830", 0 }, - { "SMO8831", 0 }, - { "", 0 }, -}; -MODULE_DEVICE_TABLE(acpi, smo8800_ids); - static struct platform_driver smo8800_driver = { .probe = smo8800_probe, .remove_new = smo8800_remove,