Skip to contentSkip to conversation

iio: light: al3320a: Handle ACPI device CALS0001

PATCH Superseded Marius Hoch 2 participants 2 messages Apr 20, 2023 – Apr 23, 2023 IIO

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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.

---
 drivers/iio/light/al3320a.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/iio/light/al3320a.c +7 -0
index 9ff28bbf34bb..ffcb65cbc125 100644
@@ -247,11 +247,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
maintainer
#1 lore raw
Quoted 6 lines · On Thu, 20 Apr 2023 20:23:14 +0200 Marius Hoch <[email protected]> wrote:

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

Tested on a Lenovo Yoga Tablet 2 1051-F.

I made a small tweak. This driver includes of.h to get the ID table, which is less than ideal anyway. Now you've added a second table, I've switched that for mod_devicetable.h which is the include that should have been used in the first place.

Applied with that and a not in the patch description to the togreg branch of iio.git which is initially pushed out as testing for 0-day to see if it can find anything we missed.

Thanks,

Jonathan

Quoted 29 lines
---
 drivers/iio/light/al3320a.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/iio/light/al3320a.c +7 -0
index 9ff28bbf34bb..ffcb65cbc125 100644
@@ -247,11 +247,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