Skip to contentSkip to conversation

iio: light: al3320a: Handle ACPI device CALS0001

PATCH In review Marius Hoch 3 participants 3 messages Apr 20, 2023 – Apr 23, 2023 IIO

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iio: light: al3320a: Handle ACPI device CALS0001

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

Tested on a Lenovo Yoga Tablet 2 1051-F.

---
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(+)
drivers/iio/light/al3320a.c +8 -0
index 9ff28bbf34bb..36214d790f71 100644
@@ -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

Signature · 1 line
2.39.2
Tested-by Reviewed-by on v2 1/1
#1 lore raw

Hi,

Quoted 9 lines · 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.

---
v2: Explicitly include <linux/mod_devicetable.h> (don't rely on linux/i2c.h including it)

Thanks, the patch looks good to me and I have tested this successfully on a Lenovo Yoga Tablet 2 851F :

Regards,

Hans

Quoted 37 lines
---
 drivers/iio/light/al3320a.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/iio/light/al3320a.c +8 -0
index 9ff28bbf34bb..36214d790f71 100644
@@ -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

maintainer
#2 lore raw
Quoted 16 lines · On Fri, 21 Apr 2023 11:36:51 +0200 Hans de Goede <[email protected]> wrote:

Hi,

Quoted 9 lines · 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.

---
v2: Explicitly include <linux/mod_devicetable.h> (don't rely on linux/i2c.h including it)

Thanks, the patch looks good to me and I have tested this successfully on a Lenovo Yoga Tablet 2 851F :

Quoted 8 lines

Regards,

Hans

Ah.. I'll drop previous edited version that did the same thing.

In general if you are going to send a new version of a patch when there has been not response to previous one, please just reply yourself to that original thread.

Anyhow, now applied this one.

Thanks,

Jonathan

Quoted 40 lines
Quoted 39 lines

---
 drivers/iio/light/al3320a.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/iio/light/al3320a.c +8 -0
index 9ff28bbf34bb..36214d790f71 100644
@@ -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