linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Tianshu Qiu <tian.shu.qiu@intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Bingbu Cao <bingbu.cao@intel.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 2/4] media: ov2740: Add camera orientation and sensor rotation controls
Date: Fri, 29 Nov 2024 14:23:02 +0100	[thread overview]
Message-ID: <Z0nANsKWa3p+5xAz@linux.intel.com> (raw)
In-Reply-To: <20241128152338.4583-3-hdegoede@redhat.com>

On Thu, Nov 28, 2024 at 04:23:36PM +0100, Hans de Goede wrote:
> Add camera orientation and sensor rotation controls using
> the v4l2_fwnode_device_parse() and v4l2_ctrl_new_fwnode_properties()
> helpers.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>

> ---
>  drivers/media/i2c/ov2740.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c
> index e7a611967b40..998e1977978d 100644
> --- a/drivers/media/i2c/ov2740.c
> +++ b/drivers/media/i2c/ov2740.c
> @@ -755,15 +755,17 @@ static const struct v4l2_ctrl_ops ov2740_ctrl_ops = {
>  
>  static int ov2740_init_controls(struct ov2740 *ov2740)
>  {
> +	struct i2c_client *client = v4l2_get_subdevdata(&ov2740->sd);
>  	struct v4l2_ctrl_handler *ctrl_hdlr;
>  	const struct ov2740_mode *cur_mode;
>  	s64 exposure_max, h_blank, pixel_rate;
>  	u32 vblank_min, vblank_max, vblank_default;
> +	struct v4l2_fwnode_device_properties props;
>  	int size;
>  	int ret;
>  
>  	ctrl_hdlr = &ov2740->ctrl_handler;
> -	ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8);
> +	ret = v4l2_ctrl_handler_init(ctrl_hdlr, 10);
>  	if (ret)
>  		return ret;
>  
> @@ -813,6 +815,13 @@ static int ov2740_init_controls(struct ov2740 *ov2740)
>  				     V4L2_CID_TEST_PATTERN,
>  				     ARRAY_SIZE(ov2740_test_pattern_menu) - 1,
>  				     0, 0, ov2740_test_pattern_menu);
> +
> +	ret = v4l2_fwnode_device_parse(&client->dev, &props);
> +	if (ret)
> +		return ret;
> +
> +	v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &ov2740_ctrl_ops, &props);
> +
>  	if (ctrl_hdlr->error) {
>  		v4l2_ctrl_handler_free(ctrl_hdlr);
>  		return ctrl_hdlr->error;
> -- 
> 2.47.0
> 
> 

  parent reply	other threads:[~2024-11-29 13:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28 15:23 [PATCH 0/4] media: ov2740: Various improvements Hans de Goede
2024-11-28 15:23 ` [PATCH 1/4] media: ov2740: Debug log chip ID Hans de Goede
2024-11-28 16:38   ` Ricardo Ribalda Delgado
2024-11-28 22:49     ` Ricardo Ribalda Delgado
2024-11-29 13:22   ` Stanislaw Gruszka
2024-11-28 15:23 ` [PATCH 2/4] media: ov2740: Add camera orientation and sensor rotation controls Hans de Goede
2024-11-28 16:44   ` Ricardo Ribalda Delgado
2024-12-15 22:47     ` Hans de Goede
2024-11-29 13:23   ` Stanislaw Gruszka [this message]
2024-11-28 15:23 ` [PATCH 3/4] media: ov2740: Add powerdown GPIO support Hans de Goede
2024-11-28 16:53   ` Ricardo Ribalda Delgado
2024-12-20 11:35     ` Hans de Goede
2024-12-20 12:30       ` Ricardo Ribalda Delgado
2024-11-29 13:23   ` Stanislaw Gruszka
2024-11-28 15:23 ` [PATCH 4/4] media: ov2740: Add regulator support Hans de Goede
2024-11-28 16:50   ` Ricardo Ribalda Delgado
2024-12-13  9:05     ` Sakari Ailus
2024-11-29 13:24   ` Stanislaw Gruszka
2024-12-13  9:04   ` Sakari Ailus
2024-12-20 11:40     ` Hans de Goede

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=Z0nANsKWa3p+5xAz@linux.intel.com \
    --to=stanislaw.gruszka@linux.intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tian.shu.qiu@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;
as well as URLs for NNTP newsgroup(s).