phone-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Knecht <vincent.knecht@mailoo.org>
To: Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Nicholas Roth	 <nicholas@rothemail.net>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	 phone-devel@vger.kernel.org
Subject: Re: [PATCH] media: i2c: ov8858: Add sensor's pixel matrix size
Date: Mon, 11 Aug 2025 16:30:30 +0200	[thread overview]
Message-ID: <bd5aec71222a98e51e6f0602b85d04d6ff3d6885.camel@mailoo.org> (raw)
In-Reply-To: <20250509-ov8858-crop-v1-1-403a0993c1de@mailoo.org>

Le vendredi 09 mai 2025 à 09:33 +0200, Vincent Knecht via B4 Relay a écrit :
> From: Vincent Knecht <vincent.knecht@mailoo.org>
> 
> The OV8858 pixel array is composed as:
> - vertically: 16 dummy columns, 3264 valid ones and 16 dummy columns for
>   a total of 3296 columns
> - horizontally: 24 optical black lines, 16 dummy ones, 2448 valid, 16
>   dummies and 24 optical black lines for a total of 2528 lines
> 
> Set native and active sensor pixel sizes.
> 
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> ---
>  drivers/media/i2c/ov8858.c | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/drivers/media/i2c/ov8858.c b/drivers/media/i2c/ov8858.c
> index 95f9ae7948463e95ce0b2cb58195de02ee72c02a..9a86aa46e20b48ef4bae7d70ce485985c1ba886a 100644
> --- a/drivers/media/i2c/ov8858.c
> +++ b/drivers/media/i2c/ov8858.c
> @@ -77,6 +77,14 @@
>  
>  #define REG_NULL			0xffff
>  
> +/* OV8858 native and active pixel array size */
> +#define OV8858_NATIVE_WIDTH		3296U
> +#define OV8858_NATIVE_HEIGHT		2528U
> +#define OV8858_PIXEL_ARRAY_LEFT		16U
> +#define OV8858_PIXEL_ARRAY_TOP		40U
> +#define OV8858_PIXEL_ARRAY_WIDTH	3264U
> +#define OV8858_PIXEL_ARRAY_HEIGHT	2448U
> +
>  static const char * const ov8858_supply_names[] = {
>  	"avdd",		/* Analog power */
>  	"dovdd",	/* Digital I/O power */
> @@ -1492,11 +1500,40 @@ static int ov8858_init_state(struct v4l2_subdev *sd,
>  	return 0;
>  }
>  
> +static int ov8858_get_selection(struct v4l2_subdev *sd,
> +				struct v4l2_subdev_state *sd_state,
> +				struct v4l2_subdev_selection *sel)
> +{
> +	switch (sel->target) {
> +	case V4L2_SEL_TGT_CROP:
> +		sel->r = *v4l2_subdev_state_get_crop(sd_state, 0);
> +		return 0;
> +
> +	case V4L2_SEL_TGT_NATIVE_SIZE:
> +		sel->r.top = 0;
> +		sel->r.left = 0;
> +		sel->r.width = OV8858_NATIVE_WIDTH;
> +		sel->r.height = OV8858_NATIVE_HEIGHT;
> +		return 0;
> +
> +	case V4L2_SEL_TGT_CROP_DEFAULT:
> +	case V4L2_SEL_TGT_CROP_BOUNDS:
> +		sel->r.top = OV8858_PIXEL_ARRAY_TOP;
> +		sel->r.left = OV8858_PIXEL_ARRAY_LEFT;
> +		sel->r.width = OV8858_PIXEL_ARRAY_WIDTH;
> +		sel->r.height = OV8858_PIXEL_ARRAY_HEIGHT;
> +		return 0;
> +	}
> +
> +	return -EINVAL;
> +}
> +
>  static const struct v4l2_subdev_pad_ops ov8858_pad_ops = {
>  	.enum_mbus_code = ov8858_enum_mbus_code,
>  	.enum_frame_size = ov8858_enum_frame_sizes,
>  	.get_fmt = v4l2_subdev_get_fmt,
>  	.set_fmt = ov8858_set_fmt,
> +	.get_selection = ov8858_get_selection,
>  };
>  
>  static const struct v4l2_subdev_ops ov8858_subdev_ops = {
> 
> ---
> base-commit: 37ff6e9a2ce321b7932d3987701757fb4d87b0e6
> change-id: 20250509-ov8858-crop-9c307bc9d5b6
> 
> Best regards,

Hi Sakari,

I got no feedback about this patch, is it okay ?

Thank you



      reply	other threads:[~2025-08-11 14:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09  7:33 [PATCH] media: i2c: ov8858: Add sensor's pixel matrix size Vincent Knecht via B4 Relay
2025-08-11 14:30 ` Vincent Knecht [this message]

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=bd5aec71222a98e51e6f0602b85d04d6ff3d6885.camel@mailoo.org \
    --to=vincent.knecht@mailoo.org \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nicholas@rothemail.net \
    --cc=phone-devel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).