All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo@jmondi.org>
To: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
Cc: Jacopo Mondi <jacopo@jmondi.org>,
	krzysztof.kozlowski@canonical.com,
	jeanmichel.hautbois@ideasonboard.com,
	laurent.pinchart@ideasonboard.com, paul.kocialkowski@bootlin.com,
	sakari.ailus@iki.fi, paul.elder@ideasonboard.com,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org (open list:OMNIVISION OV5670 SENSOR
	DRIVER)
Subject: [PATCH v2 2/8] media: i2c: ov5670: Allow probing with OF
Date: Mon, 14 Mar 2022 17:27:08 +0100	[thread overview]
Message-ID: <20220314162714.153970-3-jacopo@jmondi.org> (raw)
In-Reply-To: <20220314162714.153970-1-jacopo@jmondi.org>

The ov5670 driver currently only supports probing using ACPI matching.
Add support for OF and add a missing header inclusion.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/i2c/ov5670.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c
index 02f75c18e480..721441024598 100644
--- a/drivers/media/i2c/ov5670.c
+++ b/drivers/media/i2c/ov5670.c
@@ -3,7 +3,9 @@
 
 #include <linux/acpi.h>
 #include <linux/i2c.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/pm_runtime.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
@@ -2585,11 +2587,20 @@ static const struct acpi_device_id ov5670_acpi_ids[] = {
 MODULE_DEVICE_TABLE(acpi, ov5670_acpi_ids);
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id ov5670_of_ids[] = {
+	{ .compatible = "ovti,ov5670" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, ov5670_of_ids);
+#endif
+
 static struct i2c_driver ov5670_i2c_driver = {
 	.driver = {
 		.name = "ov5670",
 		.pm = &ov5670_pm_ops,
 		.acpi_match_table = ACPI_PTR(ov5670_acpi_ids),
+		.of_match_table = of_match_ptr(ov5670_of_ids),
 	},
 	.probe_new = ov5670_probe,
 	.remove = ov5670_remove,
-- 
2.35.1


  parent reply	other threads:[~2022-03-14 16:27 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14 16:27 [PATCH v2 0/8] media: i2c: ov5670: OF support, runtime_pm, regulators Jacopo Mondi
2022-03-14 16:27 ` [PATCH v2 1/8] media: dt-bindings: i2c: Document ov5670 Jacopo Mondi
2022-03-15  7:32   ` Krzysztof Kozlowski
2022-03-15  7:59     ` Sakari Ailus
2022-03-15  8:03       ` Krzysztof Kozlowski
2022-03-15 12:47         ` Sakari Ailus
2022-03-15 12:57           ` Krzysztof Kozlowski
2022-03-15 13:01           ` Laurent Pinchart
2022-03-15 20:30             ` Sakari Ailus
2022-03-15  8:09       ` Laurent Pinchart
2022-03-15  8:41     ` Jacopo Mondi
2022-03-14 16:27 ` Jacopo Mondi [this message]
2022-03-14 16:27 ` [PATCH v2 3/8] media: i2c: ov5670: Probe clocks with OF Jacopo Mondi
2022-03-15  8:11   ` Laurent Pinchart
2022-03-15  8:46     ` Jacopo Mondi
2022-03-15  8:52       ` Krzysztof Kozlowski
2022-03-15  8:56       ` Laurent Pinchart
2022-03-16  8:04         ` Sakari Ailus
2022-03-14 16:27 ` [PATCH v2 4/8] media: i2c: ov5670: Probe regulators Jacopo Mondi
2022-03-14 16:27 ` [PATCH v2 5/8] media: i2c: ov5670: Probe GPIOs Jacopo Mondi
2022-03-14 16:27 ` [PATCH v2 6/8] media: i2c: ov5670: Add runtime_pm operations Jacopo Mondi
2022-03-14 16:27 ` [PATCH v2 7/8] media: i2c: ov5670: Implement init_cfg Jacopo Mondi
2022-03-15  8:13   ` Laurent Pinchart
2022-03-14 16:27 ` [PATCH v2 8/8] media: i2c: ov5670: Add .get_selection() support Jacopo Mondi
2022-03-15  4:18   ` kernel test robot
2022-03-15 16:55     ` Nathan Chancellor
2022-03-15 16:55       ` Nathan Chancellor
2022-03-15  8:19   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220314162714.153970-3-jacopo@jmondi.org \
    --to=jacopo@jmondi.org \
    --cc=chiranjeevi.rapolu@intel.com \
    --cc=jeanmichel.hautbois@ideasonboard.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=paul.elder@ideasonboard.com \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=sakari.ailus@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.