From: Umang Jain <umang.jain@ideasonboard.com>
To: Kieran Bingham <kieran.bingham@ideasonboard.com>,
linux-media@vger.kernel.org, devicetree@vger.kernel.org
Cc: "Paul J. Murphy" <paul.j.murphy@intel.com>,
Daniele Alessandrelli <daniele.alessandrelli@intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/5] media: i2c: imx335: Implement get selection API
Date: Tue, 10 Oct 2023 09:46:21 +0530 [thread overview]
Message-ID: <67bb5809-5bf4-5f10-de9d-b7aee4f80117@ideasonboard.com> (raw)
In-Reply-To: <20231010005126.3425444-4-kieran.bingham@ideasonboard.com>
Hi Kieran
On 10/10/23 6:21 AM, Kieran Bingham wrote:
> Support reporting of the Sensor Native and Active pixel array areas
> through the Selection API.
>
> The implementation reports a single target crop only for the mode that
> is presently exposed by the driver.
>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
LGTM,
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
> drivers/media/i2c/imx335.c | 44 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
> index bf12b9b69fce..026777eb362e 100644
> --- a/drivers/media/i2c/imx335.c
> +++ b/drivers/media/i2c/imx335.c
> @@ -55,6 +55,14 @@
> #define IMX335_REG_MIN 0x00
> #define IMX335_REG_MAX 0xfffff
>
> +/* IMX335 native and active pixel array size. */
> +#define IMX335_NATIVE_WIDTH 2616U
> +#define IMX335_NATIVE_HEIGHT 1964U
> +#define IMX335_PIXEL_ARRAY_LEFT 12U
> +#define IMX335_PIXEL_ARRAY_TOP 12U
> +#define IMX335_PIXEL_ARRAY_WIDTH 2592U
> +#define IMX335_PIXEL_ARRAY_HEIGHT 1944U
> +
> /**
> * struct imx335_reg - imx335 sensor register
> * @address: Register address
> @@ -651,6 +659,41 @@ static int imx335_init_pad_cfg(struct v4l2_subdev *sd,
> return imx335_set_pad_format(sd, sd_state, &fmt);
> }
>
> +/**
> + * imx335_get_selection() - Selection API
> + * @sd: pointer to imx335 V4L2 sub-device structure
> + * @sd_state: V4L2 sub-device configuration
> + * @sel: V4L2 selection info
> + *
> + * Return: 0 if successful, error code otherwise.
> + */
> +static int imx335_get_selection(struct v4l2_subdev *sd,
> + struct v4l2_subdev_state *sd_state,
> + struct v4l2_subdev_selection *sel)
> +{
> + switch (sel->target) {
> + case V4L2_SEL_TGT_NATIVE_SIZE:
> + sel->r.top = 0;
> + sel->r.left = 0;
> + sel->r.width = IMX335_NATIVE_WIDTH;
> + sel->r.height = IMX335_NATIVE_HEIGHT;
> +
> + return 0;
> +
> + case V4L2_SEL_TGT_CROP:
> + case V4L2_SEL_TGT_CROP_DEFAULT:
> + case V4L2_SEL_TGT_CROP_BOUNDS:
> + sel->r.top = IMX335_PIXEL_ARRAY_TOP;
> + sel->r.left = IMX335_PIXEL_ARRAY_LEFT;
> + sel->r.width = IMX335_PIXEL_ARRAY_WIDTH;
> + sel->r.height = IMX335_PIXEL_ARRAY_HEIGHT;
> +
> + return 0;
> + }
> +
> + return -EINVAL;
> +}
> +
> /**
> * imx335_start_streaming() - Start sensor stream
> * @imx335: pointer to imx335 device
> @@ -864,6 +907,7 @@ static const struct v4l2_subdev_pad_ops imx335_pad_ops = {
> .init_cfg = imx335_init_pad_cfg,
> .enum_mbus_code = imx335_enum_mbus_code,
> .enum_frame_size = imx335_enum_frame_size,
> + .get_selection = imx335_get_selection,
> .get_fmt = imx335_get_pad_format,
> .set_fmt = imx335_set_pad_format,
> };
next prev parent reply other threads:[~2023-10-10 4:16 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20231010005126.3425444-1-kieran.bingham@ideasonboard.com>
2023-10-10 0:51 ` [PATCH 1/5] media: dt-bindings: media: imx335: Add supply bindings Kieran Bingham
2023-10-10 3:53 ` Umang Jain
2023-10-10 5:03 ` Marco Felsch
2023-10-10 6:06 ` Sakari Ailus
[not found] ` <169694430967.3973464.6599459439831458834@ping.linuxembedded.co.uk>
2023-10-11 11:01 ` Sakari Ailus
2023-10-10 17:09 ` Rob Herring
2023-10-10 0:51 ` [PATCH 2/5] media: i2c: imx335: Enable regulator supplies Kieran Bingham
2023-10-10 4:06 ` Umang Jain
2023-10-10 4:10 ` kernel test robot
2023-10-10 6:12 ` Sakari Ailus
[not found] ` <169701731909.277971.10840095252716847805@ping.linuxembedded.co.uk>
2023-10-11 11:06 ` Sakari Ailus
2023-10-10 0:51 ` [PATCH 3/5] media: i2c: imx335: Implement get selection API Kieran Bingham
2023-10-10 4:16 ` Umang Jain [this message]
2023-10-10 6:14 ` Sakari Ailus
[not found] ` <169701831889.277971.6656559808677876108@ping.linuxembedded.co.uk>
2023-10-11 11:12 ` Sakari Ailus
2023-10-10 0:51 ` [PATCH 4/5] media: i2c: imx335: Fix hblank min/max values Kieran Bingham
2023-10-10 4:15 ` Umang Jain
2023-10-10 0:51 ` [PATCH 5/5] media: i2c: imx335: Improve configuration error reporting Kieran Bingham
2023-10-10 3:36 ` Umang Jain
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=67bb5809-5bf4-5f10-de9d-b7aee4f80117@ideasonboard.com \
--to=umang.jain@ideasonboard.com \
--cc=daniele.alessandrelli@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=paul.j.murphy@intel.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
all inboxes | Powered by JetHome®