mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Tarang Raval <tarang.raval@siliconsignals.io>,
	sakari.ailus@linux.intel.com
Cc: Tarang Raval <tarang.raval@siliconsignals.io>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] media: i2c: imx219: switch to {enable,disable}_streams
Date: Wed, 05 Mar 2025 09:25:21 +0000	[thread overview]
Message-ID: <174116672182.2914008.912215873023431841@ping.linuxembedded.co.uk> (raw)
In-Reply-To: <20250305061309.17911-2-tarang.raval@siliconsignals.io>

Quoting Tarang Raval (2025-03-05 06:13:08)
> Switch from s_stream to enable_streams and disable_streams callbacks.
> 
> Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
> ---
>  drivers/media/i2c/imx219.c | 43 +++++++++++++++-----------------------
>  1 file changed, 17 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
> index f662c9d75511..75d3123d47b4 100644
> --- a/drivers/media/i2c/imx219.c
> +++ b/drivers/media/i2c/imx219.c
> @@ -723,12 +723,17 @@ static int imx219_configure_lanes(struct imx219 *imx219)
>                                   ARRAY_SIZE(imx219_4lane_regs), NULL);
>  };
>  
> -static int imx219_start_streaming(struct imx219 *imx219,
> -                                 struct v4l2_subdev_state *state)
> +static int imx219_enable_streams(struct v4l2_subdev *sd,
> +                                struct v4l2_subdev_state *state, u32 pad,
> +                                u64 streams_mask)
>  {
> +       struct imx219 *imx219 = to_imx219(sd);
>         struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd);
>         int ret;
>  
> +       if (pad != 0)
> +               return -EINVAL;
> +
>         ret = pm_runtime_resume_and_get(&client->dev);
>         if (ret < 0)
>                 return ret;
> @@ -767,10 +772,6 @@ static int imx219_start_streaming(struct imx219 *imx219,
>         if (ret)
>                 goto err_rpm_put;
>  
> -       /* vflip and hflip cannot change during streaming */
> -       __v4l2_ctrl_grab(imx219->vflip, true);
> -       __v4l2_ctrl_grab(imx219->hflip, true);
> -

Why do you drop these lines? It's not mentioned in the commit message.
Are these handled somewhere else now ?

--
Kieran


>         return 0;
>  
>  err_rpm_put:
> @@ -778,37 +779,25 @@ static int imx219_start_streaming(struct imx219 *imx219,
>         return ret;
>  }
>  
> -static void imx219_stop_streaming(struct imx219 *imx219)
> +static int imx219_disable_streams(struct v4l2_subdev *sd,
> +                                 struct v4l2_subdev_state *state, u32 pad,
> +                                 u64 streams_mask)
>  {
> +       struct imx219 *imx219 = to_imx219(sd);
>         struct i2c_client *client = v4l2_get_subdevdata(&imx219->sd);
>         int ret;
>  
> +       if (pad != 0)
> +               return -EINVAL;
> +
>         /* set stream off register */
>         ret = cci_write(imx219->regmap, IMX219_REG_MODE_SELECT,
>                         IMX219_MODE_STANDBY, NULL);
>         if (ret)
>                 dev_err(&client->dev, "%s failed to set stream\n", __func__);
>  
> -       __v4l2_ctrl_grab(imx219->vflip, false);
> -       __v4l2_ctrl_grab(imx219->hflip, false);
> -
>         pm_runtime_put(&client->dev);
> -}
> -
> -static int imx219_set_stream(struct v4l2_subdev *sd, int enable)
> -{
> -       struct imx219 *imx219 = to_imx219(sd);
> -       struct v4l2_subdev_state *state;
> -       int ret = 0;
> -
> -       state = v4l2_subdev_lock_and_get_active_state(sd);
> -
> -       if (enable)
> -               ret = imx219_start_streaming(imx219, state);
> -       else
> -               imx219_stop_streaming(imx219);
>  
> -       v4l2_subdev_unlock_state(state);
>         return ret;
>  }
>  
> @@ -992,7 +981,7 @@ static int imx219_init_state(struct v4l2_subdev *sd,
>  }
>  
>  static const struct v4l2_subdev_video_ops imx219_video_ops = {
> -       .s_stream = imx219_set_stream,
> +       .s_stream = v4l2_subdev_s_stream_helper,
>  };
>  
>  static const struct v4l2_subdev_pad_ops imx219_pad_ops = {
> @@ -1001,6 +990,8 @@ static const struct v4l2_subdev_pad_ops imx219_pad_ops = {
>         .set_fmt = imx219_set_pad_format,
>         .get_selection = imx219_get_selection,
>         .enum_frame_size = imx219_enum_frame_size,
> +       .enable_streams = imx219_enable_streams,
> +       .disable_streams = imx219_disable_streams,
>  };
>  
>  static const struct v4l2_subdev_ops imx219_subdev_ops = {
> -- 
> 2.34.1
>

  reply	other threads:[~2025-03-05  9:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05  6:13 [PATCH v2 0/2] media: i2c: imx219: Minor improvements for runtime PM and stream handling Tarang Raval
2025-03-05  6:13 ` [PATCH v2 1/2] media: i2c: imx219: switch to {enable,disable}_streams Tarang Raval
2025-03-05  9:25   ` Kieran Bingham [this message]
2025-03-05 10:12     ` Tarang Raval
2025-03-05  6:13 ` [PATCH v2 2/2] media: i2c: imx219: Enable runtime PM autosuspend Tarang Raval

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=174116672182.2914008.912215873023431841@ping.linuxembedded.co.uk \
    --to=kieran.bingham@ideasonboard.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tarang.raval@siliconsignals.io \
    /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®