Skip to contentSkip to conversation

iio:light:apds9960 add detection for MSHW0184 ACPI device in apds9960 driver

PATCH In review Max Leiter 3 participants 3 messages Dec 20, 2020 – Dec 21, 2020 IIO

lore
Share & tools
lore

Max Leiter

author
#0 lore raw

PATCH 1/1 iio:light:apds9960 add detection for MSHW0184 ACPI device in apds9960 driver

The device is used in the Microsoft Surface Book 3 and Surface Pro 7

---
 drivers/iio/light/apds9960.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/iio/light/apds9960.c +8 -0
index 9afb3fcc74e6..20719141c03a 100644
@@ -8,6 +8,7 @@
  * TODO: gesture + proximity calib offsets
  */
 
+#include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -1113,6 +1114,12 @@ static const struct i2c_device_id apds9960_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, apds9960_id);
 
+static const struct acpi_device_id apds9960_acpi_match[] = {
+	{ "MSHW0184" },
+	{ }
+};
+MODULE_DEVICE_TABLE(acpi, apds9960_acpi_match);
+
 static const struct of_device_id apds9960_of_match[] = {
 	{ .compatible = "avago,apds9960" },
 	{ }
@@ -1124,6 +1131,7 @@ static struct i2c_driver apds9960_driver = {
 		.name	= APDS9960_DRV_NAME,
 		.of_match_table = apds9960_of_match,
 		.pm	= &apds9960_pm_ops,
+		.acpi_match_table = apds9960_acpi_match,
 	},
 	.probe		= apds9960_probe,
 	.remove		= apds9960_remove,
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Max Leiter

The device is used in the Microsoft Surface Book 3 and Surface Pro 7

Quoted 40 lines
---
 drivers/iio/light/apds9960.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/iio/light/apds9960.c +8 -1
index 9afb3fcc74e6..20719141c03a 100644
@@ -8,6 +8,7 @@
  * TODO: gesture + proximity calib offsets
  */
 
+#include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -1113,6 +1114,12 @@ static const struct i2c_device_id apds9960_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, apds9960_id);
 
+static const struct acpi_device_id apds9960_acpi_match[] = {
+       { "MSHW0184" },
+       { }
+};
+MODULE_DEVICE_TABLE(acpi, apds9960_acpi_match);
+
 static const struct of_device_id apds9960_of_match[] = {
        { .compatible = "avago,apds9960" },
        { }
@@ -1124,6 +1131,7 @@ static struct i2c_driver apds9960_driver = {
                .name   = APDS9960_DRV_NAME,
                .of_match_table = apds9960_of_match,
                .pm     = &apds9960_pm_ops,
+               .acpi_match_table = apds9960_acpi_match,
        },
        .probe          = apds9960_probe,
        .remove         = apds9960_remove,
--

2.29.2

maintainer
#2 lore raw
Quoted 7 lines · On Sun, 20 Dec 2020 14:05:17 -0800 Matt Ranostay <[email protected]>…
Quoted 4 lines · Max Leiter

The device is used in the Microsoft Surface Book 3 and Surface Pro 7

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to see if we missed anything.

Thanks,

Jonathan

Quoted 41 lines
Quoted 41 lines
---
 drivers/iio/light/apds9960.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/iio/light/apds9960.c +8 -1
index 9afb3fcc74e6..20719141c03a 100644
@@ -8,6 +8,7 @@
  * TODO: gesture + proximity calib offsets
  */
 
+#include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -1113,6 +1114,12 @@ static const struct i2c_device_id apds9960_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, apds9960_id);
 
+static const struct acpi_device_id apds9960_acpi_match[] = {
+       { "MSHW0184" },
+       { }
+};
+MODULE_DEVICE_TABLE(acpi, apds9960_acpi_match);
+
 static const struct of_device_id apds9960_of_match[] = {
        { .compatible = "avago,apds9960" },
        { }
@@ -1124,6 +1131,7 @@ static struct i2c_driver apds9960_driver = {
                .name   = APDS9960_DRV_NAME,
                .of_match_table = apds9960_of_match,
                .pm     = &apds9960_pm_ops,
+               .acpi_match_table = apds9960_acpi_match,
        },
        .probe          = apds9960_probe,
        .remove         = apds9960_remove,
--

2.29.2