From: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>,
Sylvain Petinot <sylvain.petinot@foss.st.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: <linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Subject: [PATCH v3 3/4] media: i2c: vd55g1: Setup sensor external clock before patching
Date: Wed, 11 Jun 2025 10:48:32 +0200 [thread overview]
Message-ID: <20250611-fix_vd55g1-v3-3-ef4ecf15ddbc@foss.st.com> (raw)
In-Reply-To: <20250611-fix_vd55g1-v3-0-ef4ecf15ddbc@foss.st.com>
Proper clock configuration is required to advance through FSM states.
Prior than this having a different clock value than default sensor's
value was used (12 MHz) could prevent the sensor from booting.
Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
---
drivers/media/i2c/vd55g1.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
index 336dc3c85ac9e695f22aa524e0df6138dc76e45c..dec6e3e231d54a742bdd08ff2a506c152bb89429 100644
--- a/drivers/media/i2c/vd55g1.c
+++ b/drivers/media/i2c/vd55g1.c
@@ -1038,8 +1038,6 @@ static int vd55g1_enable_streams(struct v4l2_subdev *sd,
if (ret < 0)
return ret;
- vd55g1_write(sensor, VD55G1_REG_EXT_CLOCK, sensor->xclk_freq, &ret);
-
/* Configure output */
vd55g1_write(sensor, VD55G1_REG_MIPI_DATA_RATE,
sensor->mipi_rate, &ret);
@@ -1613,6 +1611,9 @@ static int vd55g1_power_on(struct device *dev)
goto disable_clock;
}
+ /* Setup clock now to advance through system FSM states */
+ vd55g1_write(sensor, VD55G1_REG_EXT_CLOCK, sensor->xclk_freq, &ret);
+
ret = vd55g1_patch(sensor);
if (ret) {
dev_err(dev, "Sensor patch failed %d\n", ret);
--
2.25.1
next prev parent reply other threads:[~2025-06-11 9:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 8:48 [PATCH v3 0/4] media: i2c: vd55g1: Miscellaneous fixes Benjamin Mugnier
2025-06-11 8:48 ` [PATCH v3 1/4] media: i2c: vd55g1: Fix RATE macros not being expressed in bps Benjamin Mugnier
2025-06-11 8:48 ` [PATCH v3 2/4] media: i2c: vd55g1: Fix return code in vd55g1_enable_streams error path Benjamin Mugnier
2025-06-12 6:24 ` Sakari Ailus
2025-06-12 14:43 ` Benjamin Mugnier
2025-06-11 8:48 ` Benjamin Mugnier [this message]
2025-06-11 8:48 ` [PATCH v3 4/4] media: i2c: vd55g1: Use first index of mbus codes array as default Benjamin Mugnier
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=20250611-fix_vd55g1-v3-3-ef4ecf15ddbc@foss.st.com \
--to=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®