diff mbox series

[17/28] media: ov2680: Add support for ACPI enumeration

Message ID 20230607164712.63579-18-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series media: ov2680: Bugfixes + ACPI + selection(crop-tgt) API support | expand

Commit Message

Hans de Goede June 7, 2023, 4:47 p.m. UTC
Add an acpi_match_table now that all the other bits necessary for
ACPI support are in place.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/media/i2c/ov2680.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Andy Shevchenko June 7, 2023, 8:57 p.m. UTC | #1
On Wed, Jun 07, 2023 at 06:47:01PM +0200, Hans de Goede wrote:
> Add an acpi_match_table now that all the other bits necessary for
> ACPI support are in place.

...

>  		.name  = "ov2680",
>  		.pm = pm_sleep_ptr(&ov2680_pm_ops),

>  		.of_match_table	= of_match_ptr(ov2680_dt_ids),

Side note. If we don't have OF dependency, this may provoke defined but not
used. That's why I eagerly remove of_match_ptr() from the ID tables.

Besides that, however might not be applicable right now, this will allow
to use PRP0001 ACPI HID.

> +		.acpi_match_table = ov2680_acpi_ids,
>  	},
>  	.probe_new	= ov2680_probe,
>  	.remove		= ov2680_remove,
diff mbox series

Patch

diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c
index 9fa92b4f1307..190c58caae11 100644
--- a/drivers/media/i2c/ov2680.c
+++ b/drivers/media/i2c/ov2680.c
@@ -900,11 +900,18 @@  static const struct of_device_id ov2680_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, ov2680_dt_ids);
 
+static const struct acpi_device_id ov2680_acpi_ids[] = {
+	{ "OVTI2680" },
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(acpi, ov2680_acpi_ids);
+
 static struct i2c_driver ov2680_i2c_driver = {
 	.driver = {
 		.name  = "ov2680",
 		.pm = pm_sleep_ptr(&ov2680_pm_ops),
 		.of_match_table	= of_match_ptr(ov2680_dt_ids),
+		.acpi_match_table = ov2680_acpi_ids,
 	},
 	.probe_new	= ov2680_probe,
 	.remove		= ov2680_remove,