linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: i2c: OV5647: gate clock lane before stream on
@ 2017-07-25  2:34 Jacob Chen
  2017-08-07  7:11 ` Jacob Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Jacob Chen @ 2017-07-25  2:34 UTC (permalink / raw)
  To: linux-rockchip
  Cc: linux-kernel, roliveir, linux-media, mchehab, vladimir_zapolskiy,
	hans.verkuil, sakari.ailus, Jacob Chen

According to datasheet, BIT5 in reg-0x4800 are used to
enable/disable clock lane gate.

It's wrong to make clock lane free running before
sensor stream on was called, while the mipi phy
are not initialized.

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
---
 drivers/media/i2c/ov5647.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index 95ce90f..d3e6fd0 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -253,6 +253,10 @@ static int ov5647_stream_on(struct v4l2_subdev *sd)
 {
 	int ret;
 
+	ret = ov5647_write(sd, 0x4800, 0x04);
+	if (ret < 0)
+		return ret;
+
 	ret = ov5647_write(sd, 0x4202, 0x00);
 	if (ret < 0)
 		return ret;
@@ -264,6 +268,10 @@ static int ov5647_stream_off(struct v4l2_subdev *sd)
 {
 	int ret;
 
+	ret = ov5647_write(sd, 0x4800, 0x25);
+	if (ret < 0)
+		return ret;
+
 	ret = ov5647_write(sd, 0x4202, 0x0f);
 	if (ret < 0)
 		return ret;
@@ -320,7 +328,7 @@ static int __sensor_init(struct v4l2_subdev *sd)
 			return ret;
 	}
 
-	return ov5647_write(sd, 0x4800, 0x04);
+	return ov5647_stream_off(sd);
 }
 
 static int ov5647_sensor_power(struct v4l2_subdev *sd, int on)
-- 
2.7.4

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

end of thread, other threads:[~2017-09-11  1:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-25  2:34 [PATCH] media: i2c: OV5647: gate clock lane before stream on Jacob Chen
2017-08-07  7:11 ` Jacob Chen
2017-08-07  8:17   ` Philipp Zabel
2017-08-07 11:06     ` Jacob Chen
2017-08-07 12:26       ` Philipp Zabel
2017-08-07 14:48         ` Luis Oliveira
2017-08-08  2:01           ` Jacob Chen
2017-09-11  1:59           ` Jacob Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).