From: Alain Volmat <alain.volmat@foss.st.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Benjamin Mugnier <benjamin.mugnier@foss.st.com>,
Sylvain Petinot <sylvain.petinot@foss.st.com>,
<linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/7] media: i2c: st-mipid02: use active state to store pad formats
Date: Tue, 28 Nov 2023 08:26:45 +0100 [thread overview]
Message-ID: <20231128072645.GA1435577@gnbcxd0016.gnb.st.com> (raw)
In-Reply-To: <ZWWLQkjvovzJMc73@kekkonen.localdomain>
Hi Sakari,
On Tue, Nov 28, 2023 at 06:40:02AM +0000, Sakari Ailus wrote:
> On Sat, Nov 25, 2023 at 07:20:52PM +0100, Alain Volmat wrote:
> > Store formats information within pad allowing to simplify further more
> > the driver (mutex / format store within the driver structure no more
> > necessary).
> >
> > Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
>
> Applied with the following diff:
>
> diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c
> index 7af209905d7b..2cc07b3ed0da 100644
> --- a/drivers/media/i2c/st-mipid02.c
> +++ b/drivers/media/i2c/st-mipid02.c
> @@ -563,8 +563,8 @@ static const struct v4l2_mbus_framefmt default_fmt = {
> .height = 480,
> };
>
> -static int mipid02_init_cfg(struct v4l2_subdev *sd,
> - struct v4l2_subdev_state *state)
> +static int mipid02_init_state(struct v4l2_subdev *sd,
> + struct v4l2_subdev_state *state)
> {
> *v4l2_subdev_state_get_format(state, MIPID02_SINK_0) = default_fmt;
> /* MIPID02_SINK_1 isn't supported yet */
> @@ -642,7 +642,6 @@ static const struct v4l2_subdev_video_ops mipid02_video_ops = {
> };
>
> static const struct v4l2_subdev_pad_ops mipid02_pad_ops = {
> - .init_cfg = mipid02_init_cfg,
> .enum_mbus_code = mipid02_enum_mbus_code,
> .get_fmt = v4l2_subdev_get_fmt,
> .set_fmt = mipid02_set_fmt,
> @@ -653,6 +652,10 @@ static const struct v4l2_subdev_ops mipid02_subdev_ops = {
> .pad = &mipid02_pad_ops,
> };
>
> +static const struct v4l2_subdev_internal_ops mipid02_subdev_internal_ops = {
> + .init_state = mipid02_init_state,
> +};
> +
> static const struct media_entity_operations mipid02_subdev_entity_ops = {
> .link_validate = v4l2_subdev_link_validate,
> };
> @@ -851,6 +854,7 @@ static int mipid02_probe(struct i2c_client *client)
>
> bridge->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
> bridge->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE;
> + bridge->sd.internal_ops = &mipid02_subdev_internal_ops;
> bridge->sd.entity.ops = &mipid02_subdev_entity_ops;
> bridge->pad[0].flags = MEDIA_PAD_FL_SINK;
> bridge->pad[1].flags = MEDIA_PAD_FL_SINK;
>
Thanks a lot Sakari for taking care of that !!
Regards,
Alain
> --
> Sakari Ailus
next prev parent reply other threads:[~2023-11-28 7:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-25 18:20 [PATCH 0/7] media: i2c: st-mipid02: improvements / cleanups Alain Volmat
2023-11-25 18:20 ` [PATCH 1/7] media: i2c: st-mipid02: add usage of v4l2_get_link_freq Alain Volmat
2023-11-25 18:20 ` [PATCH 2/7] media: i2c: st-mipid02: don't keep track of streaming status Alain Volmat
2023-11-25 18:20 ` [PATCH 3/7] media: i2c: st-mipid02: use cci_* helpers for register access Alain Volmat
2023-11-25 18:20 ` [PATCH 4/7] media: i2c: st-mipid02: use active state to store pad formats Alain Volmat
2023-11-28 6:40 ` Sakari Ailus
2023-11-28 7:26 ` Alain Volmat [this message]
2023-11-25 18:20 ` [PATCH 5/7] media: i2c: st-mipid02: use mipi-csi macro for data-type Alain Volmat
2023-11-25 18:20 ` [PATCH 6/7] media: i2c: st-mipid02: removal of unused link_frequency variable Alain Volmat
2023-11-25 18:20 ` [PATCH 7/7] media: i2c: st-mipid02: add Y8 format support Alain Volmat
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=20231128072645.GA1435577@gnbcxd0016.gnb.st.com \
--to=alain.volmat@foss.st.com \
--cc=benjamin.mugnier@foss.st.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sylvain.petinot@foss.st.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®