public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Cc: Robert Mader <robert.mader@collabora.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 1/3] media: imx258: Parse and register properties
Date: Wed, 25 Jan 2023 14:35:32 +0200	[thread overview]
Message-ID: <Y9EiFOAETqsZZePq@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20230117100603.51631-2-jacopo.mondi@ideasonboard.com>

Hi Jacopo,

Thank you for the patch.

On Tue, Jan 17, 2023 at 11:06:01AM +0100, Jacopo Mondi wrote:
> From: Robert Mader <robert.mader@collabora.com>
> 
> Analogous to e.g. the imx219. This enables propagating
> V4L2_CID_CAMERA_ORIENTATION and V4L2_CID_CAMERA_SENSOR_ROTATION
> values.
> The motivation is to allow libcamera detect these values from the

s/detect/to detect/

> device tree and propagate them further to e.g. Pipewire.
> 
> While at it, reserve space for 3 additional controls even if
> v4l2_ctrl_new_fwnode_properties() can only register 2 of
> them, to fix the existing implementation which reserve space for 8
> controls but actually registers 9.
> 
> Signed-off-by: Robert Mader <robert.mader@collabora.com>
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ----
> Changes in v2:
>  - Reserve 11 instead of 10 controls
>  - Change order of variable declaration
>  - Slightly extend description
> ---
>  drivers/media/i2c/imx258.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c
> index eab5fc1ee2f7..3b560865b657 100644
> --- a/drivers/media/i2c/imx258.c
> +++ b/drivers/media/i2c/imx258.c
> @@ -9,6 +9,7 @@
>  #include <linux/pm_runtime.h>
>  #include <media/v4l2-ctrls.h>
>  #include <media/v4l2-device.h>
> +#include <media/v4l2-fwnode.h>
>  #include <asm/unaligned.h>
>  
>  #define IMX258_REG_VALUE_08BIT		1
> @@ -1148,6 +1149,7 @@ static const struct v4l2_subdev_internal_ops imx258_internal_ops = {
>  static int imx258_init_controls(struct imx258 *imx258)
>  {
>  	struct i2c_client *client = v4l2_get_subdevdata(&imx258->sd);
> +	struct v4l2_fwnode_device_properties props;
>  	struct v4l2_ctrl_handler *ctrl_hdlr;
>  	s64 vblank_def;
>  	s64 vblank_min;
> @@ -1156,7 +1158,7 @@ static int imx258_init_controls(struct imx258 *imx258)
>  	int ret;
>  
>  	ctrl_hdlr = &imx258->ctrl_handler;
> -	ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8);
> +	ret = v4l2_ctrl_handler_init(ctrl_hdlr, 11);
>  	if (ret)
>  		return ret;
>  
> @@ -1232,6 +1234,15 @@ static int imx258_init_controls(struct imx258 *imx258)
>  		goto error;
>  	}
>  
> +	ret = v4l2_fwnode_device_parse(&client->dev, &props);
> +	if (ret)
> +		goto error;
> +
> +	ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx258_ctrl_ops,
> +					      &props);
> +	if (ret)
> +		goto error;
> +
>  	imx258->sd.ctrl_handler = ctrl_hdlr;
>  
>  	return 0;

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2023-01-25 12:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 10:06 [PATCH 0/3] media: imx258: Remove rotation=<80 requirement Jacopo Mondi
2023-01-17 10:06 ` [PATCH 1/3] media: imx258: Parse and register properties Jacopo Mondi
2023-01-25 12:35   ` Laurent Pinchart [this message]
2023-01-17 10:06 ` [PATCH 2/3] media: imx258: Register H/V flip controls Jacopo Mondi
2023-01-17 10:17   ` Sakari Ailus
2023-01-17 10:28     ` Jacopo Mondi
2023-01-25 12:49       ` Laurent Pinchart
2023-01-17 10:06 ` [PATCH 3/3] media: imx258: Remove mandatory 180 degrees rotation Jacopo Mondi
2023-01-25 12:39   ` Laurent Pinchart
2023-01-26 14:52 ` [PATCH 0/3] media: imx258: Remove rotation=<80 requirement Sakari Ailus
2023-01-26 15:48   ` Dave Stevenson
2023-01-26 16:01     ` Laurent Pinchart
2023-01-26 16:13       ` Dave Stevenson
2023-01-26 16:02     ` Sakari Ailus
2023-01-26 16:44       ` Dave Stevenson
2023-01-26 17:31       ` Jacopo Mondi
2023-01-26 17:58         ` Dave Stevenson
2023-01-26 20:03           ` Jacopo Mondi
2023-01-27 11:08             ` Dave Stevenson
2023-02-27 17:11 ` Jacopo Mondi
2023-02-27 22:09   ` Sakari Ailus
2023-03-17  9:32     ` Robert Mader
2023-03-22 12:27     ` Jacopo Mondi
2023-03-22 12:30       ` Sakari Ailus
2023-03-22 12:32         ` 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=Y9EiFOAETqsZZePq@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=robert.mader@collabora.com \
    --cc=sakari.ailus@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox