All of lore.kernel.org
 help / color / mirror / Atom feed
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 v7 08/19] media: ccs: Obtain media bus formats before initialising up sub-devices
Date: Mon,  2 Oct 2023 13:55:46 +0300	[thread overview]
Message-ID: <20231002105557.28972-9-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20231002105557.28972-1-sakari.ailus@linux.intel.com>

The available mbus codes will soon be needed earlier, at the time
sub-devices are initialisaed. This is due to calling init_cfg() op via the
v4l2_subdev_init_finalize().

Move ccs_get_mbus_formats() before ccs_init_subdev() calls.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/ccs/ccs-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index e2669e9299ab..422fb6a4a907 100644
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -3553,6 +3553,12 @@ static int ccs_probe(struct i2c_client *client)
 	sensor->pll.ext_clk_freq_hz = sensor->hwcfg.ext_clk;
 	sensor->pll.scale_n = CCS_LIM(sensor, SCALER_N_MIN);
 
+	rval = ccs_get_mbus_formats(sensor);
+	if (rval) {
+		rval = -ENODEV;
+		goto out_cleanup;
+	}
+
 	rval = ccs_init_subdev(sensor, sensor->scaler, " scaler", 2,
 			       MEDIA_ENT_F_PROC_VIDEO_SCALER);
 	if (rval)
@@ -3574,12 +3580,6 @@ static int ccs_probe(struct i2c_client *client)
 	if (rval)
 		goto out_cleanup;
 
-	rval = ccs_get_mbus_formats(sensor);
-	if (rval) {
-		rval = -ENODEV;
-		goto out_cleanup;
-	}
-
 	rval = ccs_init_late_controls(sensor);
 	if (rval) {
 		rval = -ENODEV;
-- 
2.39.2


  parent reply	other threads:[~2023-10-02 10:56 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-02 10:55 [PATCH v7 00/19] Small fixes and cleanups (ov2740 and ccs) Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 01/19] media: Documentation: Align numbered list, make it a proper ReST Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 02/19] media: ccs: Fix driver quirk struct documentation Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 03/19] media: ccs: Correctly initialise try compose rectangle Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 04/19] media: ccs: Correct error handling in ccs_register_subdev Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 05/19] media: ccs: Switch to init_cfg Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 06/19] media: ccs: Rename ccs_create_subdev as ccs_init_subdev Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 07/19] media: ccs: Move media_entity_pads_init to init from register Sakari Ailus
2023-10-02 10:55 ` Sakari Ailus [this message]
2023-10-02 10:55 ` [PATCH v7 09/19] media: ccs: Use sub-device active state Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 10/19] media: ccs: Partially revert "media: i2c: Use pm_runtime_resume_and_get()" Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 11/19] media: ccs: Drop re-entrant s_stream support Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 12/19] media: ov2740: Enable runtime PM before registering the async subdev Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 13/19] media: ov2740: Use sub-device active state Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 14/19] media: ov2740: Return -EPROBE_DEFER if no endpoint is found Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 15/19] media: v4l: subdev: Clear frame descriptor before get_frame_desc Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 16/19] media: v4l: subdev: Print debug information on frame descriptor Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 17/19] media: mc: Check pad flag validity Sakari Ailus
2024-02-01  9:17   ` Sergey Senozhatsky
2024-02-01  9:22     ` Sakari Ailus
2024-02-01  9:33       ` Sergey Senozhatsky
2024-02-01 11:05         ` Sakari Ailus
2024-02-03  5:28           ` Sergey Senozhatsky
2023-10-02 10:55 ` [PATCH v7 18/19] media: Add MIPI CSI-2 generic long packet type definition Sakari Ailus
2023-10-02 10:55 ` [PATCH v7 19/19] media: Documentation: Split camera sensor documentation Sakari Ailus
2023-10-02 11:54 ` [PATCH v7 00/19] Small fixes and cleanups (ov2740 and ccs) Sakari Ailus

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=20231002105557.28972-9-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.