media: i2c: Add ACPI support to ov8865
authorDaniel Scally <djrscally@gmail.com>
Tue, 23 Nov 2021 00:00:03 +0000 (01:00 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 30 Nov 2021 09:52:18 +0000 (10:52 +0100)
The ov8865 sensor is sometimes found on x86 platforms enumerated via ACPI.
Add an ACPI match table to the driver so that it's probed on those
platforms.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/ov8865.c

index fe064e7..9f1c0d6 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/i2c.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/of_graph.h>
 #include <linux/pm_runtime.h>
@@ -2948,6 +2949,12 @@ static const struct dev_pm_ops ov8865_pm_ops = {
        SET_RUNTIME_PM_OPS(ov8865_suspend, ov8865_resume, NULL)
 };
 
+static const struct acpi_device_id ov8865_acpi_match[] = {
+       {"INT347A"},
+       { }
+};
+MODULE_DEVICE_TABLE(acpi, ov8865_acpi_match);
+
 static const struct of_device_id ov8865_of_match[] = {
        { .compatible = "ovti,ov8865" },
        { }
@@ -2958,6 +2965,7 @@ static struct i2c_driver ov8865_driver = {
        .driver = {
                .name = "ov8865",
                .of_match_table = ov8865_of_match,
+               .acpi_match_table = ov8865_acpi_match,
                .pm = &ov8865_pm_ops,
        },
        .probe_new = ov8865_probe,