From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Jai Luthra <jai.luthra@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Tommaso Merciai <tomm.merciai@gmail.com>
Subject: Re: [PATCH v2 8/8] media: imx335: Switch to {enable,disable}_streams
Date: Thu, 11 Sep 2025 12:46:07 +0100 [thread overview]
Message-ID: <175759116755.1246375.6132980092125123604@ping.linuxembedded.co.uk> (raw)
In-Reply-To: <20250911-imx335_binning-v2-8-30a28df74df6@ideasonboard.com>
Quoting Jai Luthra (2025-09-11 09:14:24)
> Switch from s_stream to enable_streams and disable_streams callbacks.
>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> ---
> drivers/media/i2c/imx335.c | 53 +++++++++++++++++++++-------------------------
> 1 file changed, 24 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c
> index c985edab7e2a965ccd9427b013cbb3fa8778de2b..a1af70d050bca79255ac9303e8508de919bc4fdc 100644
> --- a/drivers/media/i2c/imx335.c
> +++ b/drivers/media/i2c/imx335.c
> @@ -1019,13 +1019,19 @@ static int imx335_set_framefmt(struct imx335 *imx335)
> }
>
> /**
> - * imx335_start_streaming() - Start sensor stream
> - * @imx335: pointer to imx335 device
> + * imx335_enable_streams() - Enable sensor streams
> + * @sd: V4L2 subdevice
> + * @state: V4L2 subdevice state
> + * @pad: The pad to enable
> + * @streams_mask: Bitmask of streams to enable
> *
> * Return: 0 if successful, error code otherwise.
> */
> -static int imx335_start_streaming(struct imx335 *imx335)
> +static int imx335_enable_streams(struct v4l2_subdev *sd,
> + struct v4l2_subdev_state *state, u32 pad,
> + u64 streams_mask)
> {
> + struct imx335 *imx335 = to_imx335(sd);
> const struct imx335_reg_list *reg_list;
> int ret;
>
> @@ -1099,37 +1105,24 @@ static int imx335_start_streaming(struct imx335 *imx335)
> }
>
> /**
> - * imx335_stop_streaming() - Stop sensor stream
> - * @imx335: pointer to imx335 device
> - */
> -static void imx335_stop_streaming(struct imx335 *imx335)
> -{
> - cci_write(imx335->cci, IMX335_REG_MODE_SELECT,
> - IMX335_MODE_STANDBY, NULL);
> - pm_runtime_put(imx335->dev);
> -}
> -
> -/**
> - * imx335_set_stream() - Enable sensor streaming
> - * @sd: pointer to imx335 subdevice
> - * @enable: set to enable sensor streaming
> + * imx335_disable_streams() - Disable sensor streams
> + * @sd: V4L2 subdevice
> + * @state: V4L2 subdevice state
> + * @pad: The pad to disable
> + * @streams_mask: Bitmask of streams to disable
> *
> * Return: 0 if successful, error code otherwise.
> */
> -static int imx335_set_stream(struct v4l2_subdev *sd, int enable)
> +static int imx335_disable_streams(struct v4l2_subdev *sd,
> + struct v4l2_subdev_state *state, u32 pad,
> + u64 streams_mask)
> {
> struct imx335 *imx335 = to_imx335(sd);
> - struct v4l2_subdev_state *state;
> - int ret = 0;
> -
> - state = v4l2_subdev_lock_and_get_active_state(sd);
> -
> - if (enable)
> - ret = imx335_start_streaming(imx335);
> - else
> - imx335_stop_streaming(imx335);
> + int ret;
>
> - v4l2_subdev_unlock_state(state);
> + ret = cci_write(imx335->cci, IMX335_REG_MODE_SELECT,
> + IMX335_MODE_STANDBY, NULL);
> + pm_runtime_put(imx335->dev);
>
> return ret;
> }
> @@ -1249,7 +1242,7 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
>
> /* V4l2 subdevice ops */
> static const struct v4l2_subdev_video_ops imx335_video_ops = {
> - .s_stream = imx335_set_stream,
> + .s_stream = v4l2_subdev_s_stream_helper,
> };
>
> static const struct v4l2_subdev_pad_ops imx335_pad_ops = {
> @@ -1259,6 +1252,8 @@ static const struct v4l2_subdev_pad_ops imx335_pad_ops = {
> .set_selection = imx335_get_selection,
> .get_fmt = v4l2_subdev_get_fmt,
> .set_fmt = imx335_set_pad_format,
> + .enable_streams = imx335_enable_streams,
> + .disable_streams = imx335_disable_streams,
> };
>
> static const struct v4l2_subdev_ops imx335_subdev_ops = {
>
> --
> 2.51.0
>
prev parent reply other threads:[~2025-09-11 11:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 8:14 [PATCH v2 0/8] media: imx335: Vflip, active state and binning support Jai Luthra
2025-09-11 8:14 ` [PATCH v2 1/8] media: imx335: Rectify name of mode struct Jai Luthra
2025-09-11 8:14 ` [PATCH v2 2/8] media: imx335: Support vertical flip Jai Luthra
2025-09-11 8:14 ` [PATCH v2 3/8] media: imx335: Update the native pixel array width Jai Luthra
2025-09-11 8:14 ` [PATCH v2 4/8] media: imx335: Update HBLANK range on mode change Jai Luthra
2025-09-11 8:14 ` [PATCH v2 5/8] media: imx335: Handle runtime PM in leaf functions Jai Luthra
2025-09-11 11:14 ` Kieran Bingham
2025-09-15 6:28 ` Jai Luthra
2025-09-11 8:14 ` [PATCH v2 6/8] media: imx355: Use subdev active state Jai Luthra
2025-09-11 14:30 ` Kieran Bingham
2025-09-11 8:14 ` [PATCH v2 7/8] media: imx335: Support 2x2 binning Jai Luthra
2025-09-11 11:51 ` Kieran Bingham
2025-09-11 8:14 ` [PATCH v2 8/8] media: imx335: Switch to {enable,disable}_streams Jai Luthra
2025-09-11 11:46 ` Kieran Bingham [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=175759116755.1246375.6132980092125123604@ping.linuxembedded.co.uk \
--to=kieran.bingham@ideasonboard.com \
--cc=jai.luthra@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tomm.merciai@gmail.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®