From: Julien Massot <julien.massot@collabora.com>
To: Changhuang Liang <changhuang.liang@starfivetech.com>,
Maxime Ripard <mripard@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Jack Zhu <jack.zhu@starfivetech.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] media: cadence: csi2rx: Add enum_mbus_code pad ops
Date: Mon, 8 Jan 2024 10:09:21 +0100 [thread overview]
Message-ID: <83fe7beb-de1a-4c71-a584-f3d205249d9d@collabora.com> (raw)
In-Reply-To: <20231211094329.9090-1-changhuang.liang@starfivetech.com>
Hi,
On 12/11/23 10:43, Changhuang Liang wrote:
> Add enum_mbus_code ioctl so that user space can know what
> formats are supported to csi2rx.
>
> Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Reviewed-by: Julien Massot <julien.massot@collabora.com>
Tested-by: Julien Massot <julien.massot@collabora.com>
> ---
> drivers/media/platform/cadence/cdns-csi2rx.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c
> index 889f4fbbafb3..7788ce0e3171 100644
> --- a/drivers/media/platform/cadence/cdns-csi2rx.c
> +++ b/drivers/media/platform/cadence/cdns-csi2rx.c
> @@ -389,6 +389,18 @@ static int csi2rx_s_stream(struct v4l2_subdev *subdev, int enable)
> return ret;
> }
>
> +static int csi2rx_enum_mbus_code(struct v4l2_subdev *subdev,
> + struct v4l2_subdev_state *state,
> + struct v4l2_subdev_mbus_code_enum *code_enum)
> +{
> + if (code_enum->index >= ARRAY_SIZE(formats))
> + return -EINVAL;
> +
> + code_enum->code = formats[code_enum->index].code;
> +
> + return 0;
> +}
> +
> static int csi2rx_set_fmt(struct v4l2_subdev *subdev,
> struct v4l2_subdev_state *state,
> struct v4l2_subdev_format *format)
> @@ -439,6 +451,7 @@ static int csi2rx_init_cfg(struct v4l2_subdev *subdev,
> }
>
> static const struct v4l2_subdev_pad_ops csi2rx_pad_ops = {
> + .enum_mbus_code = csi2rx_enum_mbus_code,
> .get_fmt = v4l2_subdev_get_fmt,
> .set_fmt = csi2rx_set_fmt,
> .init_cfg = csi2rx_init_cfg,
Regards,
--
Julien Massot
next prev parent reply other threads:[~2024-01-08 9:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-11 9:43 Changhuang Liang
2024-01-08 9:09 ` Julien Massot [this message]
2024-01-08 10:12 ` Jai Luthra
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=83fe7beb-de1a-4c71-a584-f3d205249d9d@collabora.com \
--to=julien.massot@collabora.com \
--cc=changhuang.liang@starfivetech.com \
--cc=jack.zhu@starfivetech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=mripard@kernel.org \
/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®