public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] iio: light: al3320a: Handle ACPI device CALS0001
@ 2023-04-20 23:26 Marius Hoch
  2023-04-21  9:36 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Marius Hoch @ 2023-04-20 23:26 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, linux-iio, linux-kernel
  Cc: Hans de Goede, Marius Hoch

This sensor can be found as CALS0001 on the Lenovo Yoga
Tablet 2 series.

Tested on a Lenovo Yoga Tablet 2 1051-F.

Signed-off-by: Marius Hoch <mail@mariushoch.de>
---
v2: Explicitly include <linux/mod_devicetable.h> (don't rely on
linux/i2c.h including it)
---
 drivers/iio/light/al3320a.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/iio/light/al3320a.c b/drivers/iio/light/al3320a.c
index 9ff28bbf34bb..36214d790f71 100644
--- a/drivers/iio/light/al3320a.c
+++ b/drivers/iio/light/al3320a.c
@@ -16,6 +16,7 @@
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/mod_devicetable.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -247,11 +248,18 @@ static const struct of_device_id al3320a_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, al3320a_of_match);
 
+static const struct acpi_device_id al3320a_acpi_match[] = {
+	{"CALS0001"},
+	{ },
+};
+MODULE_DEVICE_TABLE(acpi, al3320a_acpi_match);
+
 static struct i2c_driver al3320a_driver = {
 	.driver = {
 		.name = AL3320A_DRV_NAME,
 		.of_match_table = al3320a_of_match,
 		.pm = pm_sleep_ptr(&al3320a_pm_ops),
+		.acpi_match_table = al3320a_acpi_match,
 	},
 	.probe_new	= al3320a_probe,
 	.id_table	= al3320a_id,

base-commit: cb0856346a60fe3eb837ba5e73588a41f81ac05f
-- 
2.39.2


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

end of thread, other threads:[~2023-04-23 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-20 23:26 [PATCH v2] iio: light: al3320a: Handle ACPI device CALS0001 Marius Hoch
2023-04-21  9:36 ` Hans de Goede
2023-04-23 11:11   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox