All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: rcar-csi2: Update D-PHY startup on V4M
@ 2024-12-10 15:54 Niklas Söderlund
  2024-12-12  7:20 ` Sakari Ailus
  0 siblings, 1 reply; 4+ messages in thread
From: Niklas Söderlund @ 2024-12-10 15:54 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab, linux-media,
	linux-renesas-soc
  Cc: Niklas Söderlund

The latest datasheet (Rev.0.70) updates the D-PHY start-up sequence for
D-PHY operation. Unfortunately the datasheet do not add any additional
documentation on the magic values.

This have been tested together with the MAX96724 available on the single
board test platform and it works as expected.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/renesas/rcar-csi2.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c
index 27ffdd28cbf7..5f62f26a6b6f 100644
--- a/drivers/media/platform/renesas/rcar-csi2.c
+++ b/drivers/media/platform/renesas/rcar-csi2.c
@@ -1349,15 +1349,15 @@ static int rcsi2_init_common_v4m(struct rcar_csi2 *priv, unsigned int mbps)
 	static const struct phtw_value step2[] = {
 		{ .data = 0x00, .code = 0x00 },
 		{ .data = 0x80, .code = 0xe0 },
-		{ .data = 0x01, .code = 0xe1 },
+		{ .data = 0x31, .code = 0xe1 },
 		{ .data = 0x06, .code = 0x00 },
-		{ .data = 0x0f, .code = 0x11 },
+		{ .data = 0x11, .code = 0x11 },
 		{ .data = 0x08, .code = 0x00 },
-		{ .data = 0x0f, .code = 0x11 },
+		{ .data = 0x11, .code = 0x11 },
 		{ .data = 0x0a, .code = 0x00 },
-		{ .data = 0x0f, .code = 0x11 },
+		{ .data = 0x11, .code = 0x11 },
 		{ .data = 0x0c, .code = 0x00 },
-		{ .data = 0x0f, .code = 0x11 },
+		{ .data = 0x11, .code = 0x11 },
 		{ .data = 0x01, .code = 0x00 },
 		{ .data = 0x31, .code = 0xaa },
 		{ .data = 0x05, .code = 0x00 },
@@ -1370,6 +1370,11 @@ static int rcsi2_init_common_v4m(struct rcar_csi2 *priv, unsigned int mbps)
 		{ .data = 0x05, .code = 0x09 },
 	};
 
+	static const struct phtw_value step3[] = {
+		{ .data = 0x01, .code = 0x00 },
+		{ .data = 0x06, .code = 0xab },
+	};
+
 	if (priv->info->hsfreqrange) {
 		ret = rcsi2_set_phypll(priv, mbps);
 		if (ret)
@@ -1400,7 +1405,7 @@ static int rcsi2_init_common_v4m(struct rcar_csi2 *priv, unsigned int mbps)
 			return ret;
 	}
 
-	return ret;
+	return rcsi2_phtw_write_array(priv, step3, ARRAY_SIZE(step3));
 }
 
 static int rcsi2_start_receiver_v4m(struct rcar_csi2 *priv,
-- 
2.47.1


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

* Re: [PATCH] media: rcar-csi2: Update D-PHY startup on V4M
  2024-12-10 15:54 [PATCH] media: rcar-csi2: Update D-PHY startup on V4M Niklas Söderlund
@ 2024-12-12  7:20 ` Sakari Ailus
  2024-12-12 10:04   ` Niklas Söderlund
  0 siblings, 1 reply; 4+ messages in thread
From: Sakari Ailus @ 2024-12-12  7:20 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Mauro Carvalho Chehab, linux-media, linux-renesas-soc

Hej Niklas,

On Tue, Dec 10, 2024 at 04:54:00PM +0100, Niklas Söderlund wrote:
> The latest datasheet (Rev.0.70) updates the D-PHY start-up sequence for
> D-PHY operation. Unfortunately the datasheet do not add any additional
> documentation on the magic values.
> 
> This have been tested together with the MAX96724 available on the single
> board test platform and it works as expected.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

This looks like a fix. Is there a need to backport it?

-- 
Regards,

Sakari Ailus

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

* Re: [PATCH] media: rcar-csi2: Update D-PHY startup on V4M
  2024-12-12  7:20 ` Sakari Ailus
@ 2024-12-12 10:04   ` Niklas Söderlund
  2024-12-12 11:21     ` Sakari Ailus
  0 siblings, 1 reply; 4+ messages in thread
From: Niklas Söderlund @ 2024-12-12 10:04 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: Mauro Carvalho Chehab, linux-media, linux-renesas-soc

Hej Sakari,

On 2024-12-12 07:20:15 +0000, Sakari Ailus wrote:
> Hej Niklas,
> 
> On Tue, Dec 10, 2024 at 04:54:00PM +0100, Niklas Söderlund wrote:
> > The latest datasheet (Rev.0.70) updates the D-PHY start-up sequence for
> > D-PHY operation. Unfortunately the datasheet do not add any additional
> > documentation on the magic values.
> > 
> > This have been tested together with the MAX96724 available on the single
> > board test platform and it works as expected.
> > 
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> This looks like a fix. Is there a need to backport it?

It's an update to the start-up sequence. Both the old and new sequence 
works in testing. As the datasheet don't document the magic values it's 
hard to tell if this is a real fix or not.

On the other hand, the DTS changes needed to use this device on R-Car 
V4M are still pending upstream merge so we have no in-tree users of this 
device. I don't think we need to backport this change.

-- 
Kind Regards,
Niklas Söderlund

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

* Re: [PATCH] media: rcar-csi2: Update D-PHY startup on V4M
  2024-12-12 10:04   ` Niklas Söderlund
@ 2024-12-12 11:21     ` Sakari Ailus
  0 siblings, 0 replies; 4+ messages in thread
From: Sakari Ailus @ 2024-12-12 11:21 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Mauro Carvalho Chehab, linux-media, linux-renesas-soc

Hejssan,

On Thu, Dec 12, 2024 at 11:04:45AM +0100, Niklas Söderlund wrote:
> Hej Sakari,
> 
> On 2024-12-12 07:20:15 +0000, Sakari Ailus wrote:
> > Hej Niklas,
> > 
> > On Tue, Dec 10, 2024 at 04:54:00PM +0100, Niklas Söderlund wrote:
> > > The latest datasheet (Rev.0.70) updates the D-PHY start-up sequence for
> > > D-PHY operation. Unfortunately the datasheet do not add any additional
> > > documentation on the magic values.
> > > 
> > > This have been tested together with the MAX96724 available on the single
> > > board test platform and it works as expected.
> > > 
> > > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > 
> > This looks like a fix. Is there a need to backport it?
> 
> It's an update to the start-up sequence. Both the old and new sequence 
> works in testing. As the datasheet don't document the magic values it's 
> hard to tell if this is a real fix or not.
> 
> On the other hand, the DTS changes needed to use this device on R-Car 
> V4M are still pending upstream merge so we have no in-tree users of this 
> device. I don't think we need to backport this change.

Ack. Thanks for confirming this.

-- 
Sakari Ailus

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

end of thread, other threads:[~2024-12-12 11:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-10 15:54 [PATCH] media: rcar-csi2: Update D-PHY startup on V4M Niklas Söderlund
2024-12-12  7:20 ` Sakari Ailus
2024-12-12 10:04   ` Niklas Söderlund
2024-12-12 11:21     ` Sakari Ailus

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.