Re: [PATCH 1/4] media: i2c: imx415: Add get_mbus_config() pad operation support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexander

On Wed, 19 Feb 2025 at 09:57, Alexander Shiyan
<eagle.alexander923@xxxxxxxxx> wrote:
>
> Allow the driver to report static media bus configuration using
> pad get_mbus_config() operation.
>
> Signed-off-by: Alexander Shiyan <eagle.alexander923@xxxxxxxxx>
> ---
>  drivers/media/i2c/imx415.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/drivers/media/i2c/imx415.c b/drivers/media/i2c/imx415.c
> index 9f37779bd611..16a52900c61c 100644
> --- a/drivers/media/i2c/imx415.c
> +++ b/drivers/media/i2c/imx415.c
> @@ -1076,6 +1076,18 @@ static int imx415_init_state(struct v4l2_subdev *sd,
>         return 0;
>  }
>
> +static int imx415_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad_id,
> +                                 struct v4l2_mbus_config *config)
> +{
> +       struct imx415 *sensor = to_imx415(sd);
> +
> +       config->type = V4L2_MBUS_CSI2_DPHY;
> +       config->bus.mipi_csi2.flags = 0;
> +       config->bus.mipi_csi2.num_data_lanes = sensor->num_data_lanes;

I'll let others confirm, but I believe the expectation is that the
platform configuration would set this for both sensor and CSI2
receiver.
get_mbus_config is only used where the number of lanes can dynamically change.

I'm also trying to find confirmation in the IMX415 datasheet of
whether it drops to LP for the clock lane or not. If it does, then you
want to set V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK in the flags field.
It's not obviously mentioned, so I may resort to getting an
oscilloscope out on it.

  Dave

> +
> +       return 0;
> +}
> +
>  static const struct v4l2_subdev_video_ops imx415_subdev_video_ops = {
>         .s_stream = imx415_s_stream,
>  };
> @@ -1086,6 +1098,7 @@ static const struct v4l2_subdev_pad_ops imx415_subdev_pad_ops = {
>         .get_fmt = v4l2_subdev_get_fmt,
>         .set_fmt = imx415_set_format,
>         .get_selection = imx415_get_selection,
> +       .get_mbus_config = imx415_get_mbus_config,
>  };
>
>  static const struct v4l2_subdev_ops imx415_subdev_ops = {
> --
> 2.39.1
>
>




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux