From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jacopo Mondi <jacopo@jmondi.org>
Cc: Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>,
jeanmichel.hautbois@ideasonboard.com,
paul.kocialkowski@bootlin.com, sakari.ailus@iki.fi,
paul.elder@ideasonboard.com,
Mauro Carvalho Chehab <mchehab@kernel.org>,
"open list:OMNIVISION OV5670 SENSOR DRIVER"
<linux-media@vger.kernel.org>
Subject: Re: [PATCH 2/6] media: i2c: ov5670: Allow probing with OF
Date: Mon, 14 Mar 2022 10:50:24 +0200 [thread overview]
Message-ID: <Yi8B0MiUUNlfL5Ld@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20220314084208.ndamzsmki465uoor@uno.localdomain>
Hi Jacopo,
On Mon, Mar 14, 2022 at 09:42:08AM +0100, Jacopo Mondi wrote:
> On Sun, Mar 13, 2022 at 04:33:12PM +0200, Laurent Pinchart wrote:
> > On Thu, Mar 10, 2022 at 02:08:25PM +0100, Jacopo Mondi wrote:
> > > 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>
> > > ---
> > > drivers/media/i2c/ov5670.c | 9 +++++++++
> > > 1 file changed, 9 insertions(+)
> > >
> > > diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c
> > > index 02f75c18e480..39786f3c9489 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>
> > > @@ -2583,6 +2585,12 @@ static const struct acpi_device_id ov5670_acpi_ids[] = {
> > > };
> > >
> > > MODULE_DEVICE_TABLE(acpi, ov5670_acpi_ids);
> > > +#elif defined CONFIG_OF
> >
> > This should be
> >
> > #ifdef CONFIG_OF
> > ...
> > #endif
> >
> > to support kernels compiled with both CONFIG_ACPI and CONFIG_OF.
>
> Actually, as kernel test robot reported, I should declare the id
> tables unconditionally, and let of_match_ptr() and ACPI_PTR() macros
> expand to NULL if the corresponding symbol is not defined
With a __maybe_unused that should work too. I don't mind either way.
>
> https://patchwork.linuxtv.org/project/linux-media/patch/20220310130829.96001-3-jacopo@jmondi.org/#135841
>
> > With this fixed,
> >
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> Thanks
>
> > > +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 = {
> > > @@ -2590,6 +2598,7 @@ static struct i2c_driver ov5670_i2c_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,
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2022-03-14 8:50 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 13:08 [PATCH 0/6] media: i2c: ov5670: OF support, runtime_pm, regulators Jacopo Mondi
2022-03-10 13:08 ` [PATCH 1/6] media: dt-bindings: i2c: Document ov5670 Jacopo Mondi
2022-03-10 14:29 ` Krzysztof Kozlowski
2022-03-10 17:16 ` Jacopo Mondi
2022-03-10 17:26 ` Krzysztof Kozlowski
2022-03-10 23:30 ` Rob Herring
2022-03-11 16:05 ` Jacopo Mondi
2022-03-11 16:11 ` Krzysztof Kozlowski
2022-03-11 18:00 ` Jacopo Mondi
2022-03-12 10:30 ` Krzysztof Kozlowski
2022-03-13 14:30 ` Laurent Pinchart
2022-03-10 13:08 ` [PATCH 2/6] media: i2c: ov5670: Allow probing with OF Jacopo Mondi
2022-03-10 18:16 ` kernel test robot
2022-03-10 20:29 ` kernel test robot
2022-03-10 20:39 ` kernel test robot
2022-03-13 14:33 ` Laurent Pinchart
2022-03-14 8:42 ` Jacopo Mondi
2022-03-14 8:50 ` Laurent Pinchart [this message]
2022-03-14 8:51 ` Laurent Pinchart
2022-03-10 13:08 ` [PATCH 3/6] media: i2c: ov5670: Probe regulators Jacopo Mondi
2022-03-13 14:35 ` Laurent Pinchart
2022-03-10 13:08 ` [PATCH 4/6] media: i2c: ov5670: Probe GPIOs Jacopo Mondi
2022-03-13 14:36 ` Laurent Pinchart
2022-03-10 13:08 ` [PATCH 5/6] media: i2c: ov5670: Add runtime_pm operations Jacopo Mondi
2022-03-13 14:42 ` Laurent Pinchart
2022-03-10 13:08 ` [PATCH 6/6] media: i2c: ov5670: Add .get_selection() support Jacopo Mondi
2022-03-13 14:44 ` Laurent Pinchart
2022-03-14 13:30 ` Jacopo Mondi
2022-03-14 13:40 ` Jacopo Mondi
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=Yi8B0MiUUNlfL5Ld@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=chiranjeevi.rapolu@intel.com \
--cc=jacopo@jmondi.org \
--cc=jeanmichel.hautbois@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.