Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH] media: qcom: camss: csiphy-3ph: Make non-Gen2 PHY work again
@ 2025-04-01  8:33 Yassine Oudjana
  2025-04-01  8:40 ` Bryan O'Donoghue
  0 siblings, 1 reply; 2+ messages in thread
From: Yassine Oudjana @ 2025-04-01  8:33 UTC (permalink / raw)
  To: Robert Foss, Todor Tomov, Bryan O'Donoghue,
	Mauro Carvalho Chehab, Hans Verkuil, Vladimir Zapolskiy,
	Depeng Shao
  Cc: Yassine Oudjana, Yassine Oudjana, linux-media, linux-arm-msm,
	linux-kernel

Commit fbce0ca24c3a ("media: qcom: camss: csiphy-3ph: Move CSIPHY variables
to data field inside csiphy struct") moved a version check that was
previously guarded by a check for Gen2 to csiphy_init without moving the
Gen2 check along with it. Since it was guarded by the Gen2 check, it was
only handling versions that were Gen2 and returned -ENODEV for others since
they shouldn't pass the Gen2 check to begin with.

Check if the CSIPHY is Gen2 before running this version check and assigning
Gen2 lane regs array.

Fixes: fbce0ca24c3a ("media: qcom: camss: csiphy-3ph: Move CSIPHY variables to data field inside csiphy struct")
Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
---
 drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
index a6cc957b986e..17762aee6dba 100644
--- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
+++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c
@@ -700,6 +700,9 @@ static int csiphy_init(struct csiphy_device *csiphy)
 	csiphy->regs = regs;
 	regs->offset = 0x800;
 
+	if (!csiphy_is_gen2(csiphy->camss->res->version))
+		return 0;
+
 	switch (csiphy->camss->res->version) {
 	case CAMSS_845:
 		regs->lane_regs = &lane_regs_sdm845[0];
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-01  8:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-01  8:33 [PATCH] media: qcom: camss: csiphy-3ph: Make non-Gen2 PHY work again Yassine Oudjana
2025-04-01  8:40 ` Bryan O'Donoghue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox