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

Hi Jacopo,

On Tue, Mar 29, 2022 at 11:01:27AM +0200, 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>
> 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

No need for ifdefs here.

The compatible strings are also relevant on ACPI (as alternative for _HID
and _CID).

> +
>  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),

Nor of_match_ptr() here.

>  	},
>  	.probe_new = ov5670_probe,
>  	.remove = ov5670_remove,

-- 
Regards,

Sakari Ailus

  reply	other threads:[~2022-03-30  5:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29  9:01 [PATCH v3 0/8] media: i2c: ov5670: OF support, runtime_pm, regulators Jacopo Mondi
2022-03-29  9:01 ` [PATCH v3 1/8] media: dt-bindings: i2c: Document ov5670 Jacopo Mondi
2022-03-29  9:01 ` [PATCH v3 2/8] media: i2c: ov5670: Allow probing with OF Jacopo Mondi
2022-03-30  5:30   ` Sakari Ailus [this message]
2022-03-29  9:01 ` [PATCH v3 3/8] media: i2c: ov5670: Probe clocks " Jacopo Mondi
2022-03-30  5:31   ` Sakari Ailus
2022-03-29  9:01 ` [PATCH v3 4/8] media: i2c: ov5670: Probe regulators Jacopo Mondi
2022-03-29  9:01 ` [PATCH v3 5/8] media: i2c: ov5670: Probe GPIOs Jacopo Mondi
2022-03-29  9:01 ` [PATCH v3 6/8] media: i2c: ov5670: Add runtime_pm operations Jacopo Mondi
2022-03-31 10:08   ` Sakari Ailus
2022-03-31 10:33     ` Laurent Pinchart
2022-03-31 12:34       ` Sakari Ailus
2022-04-27  9:57   ` Sakari Ailus
2022-04-27  9:59     ` Sakari Ailus
2022-03-29  9:01 ` [PATCH v3 7/8] media: i2c: ov5670: Implement init_cfg Jacopo Mondi
2022-03-30  5:33   ` Sakari Ailus
2022-03-29  9:01 ` [PATCH v3 8/8] media: i2c: ov5670: Add .get_selection() support 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=YkPq6SKx5QsEU32g@valkosipuli.retiisi.eu \
    --to=sakari.ailus@iki.fi \
    --cc=chiranjeevi.rapolu@intel.com \
    --cc=jacopo@jmondi.org \
    --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 \
    /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.