From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: laurent.pinchart@ideasonboard.com,
Tianshu Qiu <tian.shu.qiu@intel.com>,
Bingbu Cao <bingbu.cao@intel.com>,
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
Jacopo Mondi <jacopo+renesas@jmondi.org>,
Rui Miguel Silva <rmfrfs@gmail.com>,
Martin Kepplinger <martink@posteo.de>
Subject: [PATCH v2 05/12] media: ccs: Switch to init_cfg
Date: Mon, 18 Sep 2023 15:51:31 +0300 [thread overview]
Message-ID: <20230918125138.90002-6-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20230918125138.90002-1-sakari.ailus@linux.intel.com>
Use init_cfg() instead of manually setting up defaults during probe and
file handle open.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/i2c/ccs/ccs-core.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index 3fed071b65ab..db461b0e49c8 100644
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -2945,7 +2945,6 @@ static int ccs_identify_module(struct ccs_sensor *sensor)
}
static const struct v4l2_subdev_ops ccs_ops;
-static const struct v4l2_subdev_internal_ops ccs_internal_ops;
static const struct media_entity_operations ccs_entity_ops;
static int ccs_register_subdev(struct ccs_sensor *sensor,
@@ -3076,13 +3075,12 @@ static void ccs_create_subdev(struct ccs_sensor *sensor,
if (ssd == sensor->src)
return;
- ssd->sd.internal_ops = &ccs_internal_ops;
ssd->sd.owner = THIS_MODULE;
ssd->sd.dev = &client->dev;
v4l2_set_subdevdata(&ssd->sd, client);
}
-static int ccs_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
+static int ccs_init_cfg(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state)
{
struct ccs_subdev *ssd = to_ccs_subdev(sd);
struct ccs_sensor *sensor = ssd->sensor;
@@ -3092,9 +3090,9 @@ static int ccs_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
for (i = 0; i < ssd->npads; i++) {
struct v4l2_mbus_framefmt *try_fmt =
- v4l2_subdev_get_try_format(sd, fh->state, i);
+ v4l2_subdev_get_try_format(sd, sd_state, i);
struct v4l2_rect *try_crop =
- v4l2_subdev_get_try_crop(sd, fh->state, i);
+ v4l2_subdev_get_try_crop(sd, sd_state, i);
struct v4l2_rect *try_comp;
ccs_get_native_size(ssd, try_crop);
@@ -3107,7 +3105,7 @@ static int ccs_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
if (ssd == sensor->pixel_array)
continue;
- try_comp = v4l2_subdev_get_try_compose(sd, fh->state, i);
+ try_comp = v4l2_subdev_get_try_compose(sd, sd_state, i);
*try_comp = *try_crop;
}
@@ -3123,6 +3121,7 @@ static const struct v4l2_subdev_video_ops ccs_video_ops = {
};
static const struct v4l2_subdev_pad_ops ccs_pad_ops = {
+ .init_cfg = ccs_init_cfg,
.enum_mbus_code = ccs_enum_mbus_code,
.get_fmt = ccs_get_format,
.set_fmt = ccs_set_format,
@@ -3148,11 +3147,6 @@ static const struct media_entity_operations ccs_entity_ops = {
static const struct v4l2_subdev_internal_ops ccs_internal_src_ops = {
.registered = ccs_registered,
.unregistered = ccs_unregistered,
- .open = ccs_open,
-};
-
-static const struct v4l2_subdev_internal_ops ccs_internal_ops = {
- .open = ccs_open,
};
/* -----------------------------------------------------------------------------
--
2.39.2
next prev parent reply other threads:[~2023-09-18 12:53 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 12:51 [PATCH v2 00/12] Small fixes and cleanups (ov2740 and ccs) Sakari Ailus
2023-09-18 12:51 ` [PATCH v2 01/12] media: Documentation: Align numbered list, make it a proper ReST Sakari Ailus
2023-09-18 12:51 ` [PATCH v2 02/12] media: ccs: Fix driver quirk struct documentation Sakari Ailus
2023-09-18 12:51 ` [PATCH v2 03/12] media: ccs: Correctly initialise try compose rectangle Sakari Ailus
2023-09-18 12:51 ` [PATCH v2 04/12] media: ccs: Correct error handling in ccs_register_subdev Sakari Ailus
2023-09-18 12:51 ` Sakari Ailus [this message]
2023-09-18 13:53 ` [PATCH v2 05/12] media: ccs: Switch to init_cfg Laurent Pinchart
2023-09-18 12:51 ` [PATCH v2 06/12] media: ccs: Use sub-device active state Sakari Ailus
2023-09-18 13:59 ` Laurent Pinchart
2023-09-19 10:29 ` Sakari Ailus
2023-09-19 13:42 ` Laurent Pinchart
2023-09-18 12:51 ` [PATCH v2 07/12] media: ov2740: Enable runtime PM before registering the async subdev Sakari Ailus
2023-09-18 13:27 ` Laurent Pinchart
2023-09-18 12:51 ` [PATCH v2 08/12] media: ov2740: Use sub-device active state Sakari Ailus
2023-09-18 12:51 ` [PATCH v2 09/12] media: ov2740: Return -EPROBE_DEFER if no endpoint is found Sakari Ailus
2023-09-18 13:24 ` Laurent Pinchart
2023-09-19 10:11 ` Sakari Ailus
2023-09-18 12:51 ` [PATCH v2 10/12] media: v4l: subdev: Clear frame descriptor before get_frame_desc Sakari Ailus
2023-09-18 13:30 ` Laurent Pinchart
2023-09-19 8:04 ` Tomi Valkeinen
2023-09-18 12:51 ` [PATCH v2 11/12] media: v4l: subdev: Print debug information on frame descriptor Sakari Ailus
2023-09-18 13:39 ` Laurent Pinchart
2023-09-19 8:19 ` Tomi Valkeinen
2023-09-19 10:21 ` Sakari Ailus
2023-09-18 12:51 ` [PATCH v2 12/12] media: mc: Check pad flag validity Sakari Ailus
2023-09-18 13:48 ` Laurent Pinchart
2023-09-19 10:24 ` Sakari Ailus
2023-09-19 10:37 ` Laurent Pinchart
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=20230918125138.90002-6-sakari.ailus@linux.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=bingbu.cao@intel.com \
--cc=jacopo+renesas@jmondi.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=martink@posteo.de \
--cc=rmfrfs@gmail.com \
--cc=tian.shu.qiu@intel.com \
--cc=tomi.valkeinen@ideasonboard.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