Skip to contentSkip to conversation

media: i2c: OV5647: gate clock lane before stream on

PATCH In review Jacob Chen 4 participants 8 messages Jul 25, 2017 – Sep 11, 2017

Subsystems (4)
lore
Share & tools
lore

Jacob Chen

author
#0 lore raw

PATCH 1/1 media: i2c: OV5647: gate clock lane before stream on

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.

---
 drivers/media/i2c/ov5647.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/media/i2c/ov5647.c +9 -1
index 95ce90f..d3e6fd0 100644
@@ -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)
Signature · 1 line
2.7.4
#1 lore raw

Hi all,

2017-07-25 10:34 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 48 lines

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.

---
 drivers/media/i2c/ov5647.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/media/i2c/ov5647.c +9 -2
index 95ce90f..d3e6fd0 100644
@@ -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)
--
Quoted 2 lines

2.7.4

Can anyone comment on it?

I saw there is a same discussion in https://patchwork.kernel.org/patch/9569031/
There is a comment in i.MX CSI2 driver.
"
Configure MIPI Camera Sensor to put all Tx lanes in LP-11 state. This must be carried out by the MIPI sensor's s_power(ON) subdev op.
"
That's what this patch do, sensor driver should make sure that clock lanes are in stop state while not streaming.

#2 lore raw

Hi Jacob,

Quoted 57 lines · Jacob Chen

Hi all,

2017-07-25 10:34 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 49 lines

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.

---
 drivers/media/i2c/ov5647.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/media/i2c/ov5647.c +9 -2
index 95ce90f..d3e6fd0 100644
@@ -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)
--
Quoted 2 lines

2.7.4

Can anyone comment on it?

Quoted 9 lines

I saw there is a same discussion in https://patchwork.kernel.org/patch/9569031/
There is a comment in i.MX CSI2 driver.
"
Configure MIPI Camera Sensor to put all Tx lanes in LP-11 state. This must be carried out by the MIPI sensor's s_power(ON) subdev op.
"
That's what this patch do, sensor driver should make sure that clock lanes are in stop state while not streaming.

This is not the same, as far as I can tell. BIT(5) is just clock lane gating, as you describe above. To put the bus into LP-11 state, BIT(2) needs to be set.

regards
Philipp

#3 lore raw

Hi Philipp,

2017-08-07 16:17 GMT+08:00 Philipp Zabel <[email protected]>:

Quoted 70 lines

Hi Jacob,

Quoted 57 lines · Jacob Chen

Hi all,

2017-07-25 10:34 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 49 lines

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.

---
 drivers/media/i2c/ov5647.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/media/i2c/ov5647.c +9 -2
index 95ce90f..d3e6fd0 100644
@@ -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)
--
Quoted 2 lines

2.7.4

Can anyone comment on it?

Quoted 9 lines

I saw there is a same discussion in https://patchwork.kernel.org/patch/9569031/
There is a comment in i.MX CSI2 driver.
"
Configure MIPI Camera Sensor to put all Tx lanes in LP-11 state. This must be carried out by the MIPI sensor's s_power(ON) subdev op.
"
That's what this patch do, sensor driver should make sure that clock lanes are in stop state while not streaming.

Quoted 4 lines

This is not the same, as far as I can tell. BIT(5) is just clock lane gating, as you describe above. To put the bus into LP-11 state, BIT(2) needs to be set.

Yeah, but i double that clock lane is not in LP11 when continue clock mode is enabled.

Quoted 3 lines

regards
Philipp

#4 lore raw

Hi Jacob,

On Mon, 2017-08-07 at 19:06 +0800, Jacob Chen wrote:
[...]

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

drivers/media/i2c/ov5647.c static int ov5647_stream_on(struct v4l2_subdev *sd) · line 259

Quoted 10 lines
drivers/media/i2c/ov5647.c +4 -0
@@ -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;
+

So this clears BIT(1) (force clock lane to low power mode) and BIT(5) (gate clock lane while idle) that were set by ov5647_stream_off() during __sensor_init() due to the change below.

Is there a reason, btw, that this driver is full of magic register addresses and values? A few #defines would make this a lot more readable.

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
drivers/media/i2c/ov5647.c +4 -0
        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;
        }
 
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

drivers/media/i2c/ov5647.c static int __sensor_init(struct v4l2_subdev *sd) · line 331

Quoted 2 lines
drivers/media/i2c/ov5647.c +1 -1
-       return ov5647_write(sd, 0x4800, 0x04);
+       return ov5647_stream_off(sd);

I see now that BIT(2) (keep bus in LP-11 while idle) is and was always set. So the change is that initially, additionally to LP-11 mode, the clock lane is gated and forced into low power mode, as well?

Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
Quoted 6 lines
drivers/media/i2c/ov5647.c +0 -1
 }
 
 static int ov5647_sensor_power(struct v4l2_subdev *sd, int on)
--

2.7.4

Can anyone comment on it?

I saw there is a same discussion in https://patchwork.kernel.org/patch/9569031/
There is a comment in i.MX CSI2 driver.
"
Configure MIPI Camera Sensor to put all Tx lanes in LP-11 state. This must be carried out by the MIPI sensor's s_power(ON) subdev op.
"
That's what this patch do, sensor driver should make sure that clock lanes are in stop state while not streaming.

Quoted 7 lines
Quoted 4 lines

This is not the same, as far as I can tell. BIT(5) is just clock lane gating, as you describe above. To put the bus into LP-11 state, BIT(2) needs to be set.

Yeah, but i double that clock lane is not in LP11 when continue clock mode is enabled.

If indeed LP-11 state is not achieved while the sensor is idle, as long as BIT(5) is cleared, I think this patch is correct.

regards
Philipp

#5 lore raw

Hi all,

I'm new here, I got to be Maintainer of this driver by the old Maintainer recommendation. Still getting the hang of it :)

Quoted 19 lines · Philipp Zabel

Hi Jacob,

On Mon, 2017-08-07 at 19:06 +0800, Jacob Chen wrote:
[...]

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

drivers/media/i2c/ov5647.c static int ov5647_stream_on(struct v4l2_subdev *sd) · line 259

Quoted 10 lines
drivers/media/i2c/ov5647.c +4 -0
@@ -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;
+

So this clears BIT(1) (force clock lane to low power mode) and BIT(5) (gate clock lane while idle) that were set by ov5647_stream_off() during __sensor_init() due to the change below.

Quoted 4 lines

Is there a reason, btw, that this driver is full of magic register addresses and values? A few #defines would make this a lot more readable.

For what I can see I agree that a few register name setting could be done.

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
drivers/media/i2c/ov5647.c +4 -0
        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;
        }
 
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

drivers/media/i2c/ov5647.c static int __sensor_init(struct v4l2_subdev *sd) · line 331

Quoted 2 lines
drivers/media/i2c/ov5647.c +1 -1
-       return ov5647_write(sd, 0x4800, 0x04);
+       return ov5647_stream_off(sd);

I see now that BIT(2) (keep bus in LP-11 while idle) is and was always set. So the change is that initially, additionally to LP-11 mode, the clock lane is gated and forced into low power mode, as well?

This is my interpretation as well.

Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
Quoted 6 lines
drivers/media/i2c/ov5647.c +0 -1
 }
 
 static int ov5647_sensor_power(struct v4l2_subdev *sd, int on)
--

2.7.4

Can anyone comment on it?

I saw there is a same discussion in https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.kernel.org_patch_9569031_&d=DwICaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=eMn12aiiNuIDjtRi5xEzC7tWJkpra2vl_XYFVvfxIGE&m=eortcRXje2uLyZNI_-Uw3Ur_z24tb-e4pZfom7WhdE0&s=6sLc76bhjR0IdaA3ArZ7F7slgtcyGz8pDTzAF_CBLno&e=
There is a comment in i.MX CSI2 driver.
"
Configure MIPI Camera Sensor to put all Tx lanes in LP-11 state.
This must be carried out by the MIPI sensor's s_power(ON) subdev
op.
"
That's what this patch do, sensor driver should make sure that clock
lanes are in stop state while not streaming.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

This is not the same, as far as I can tell. BIT(5) is just clock lane gating, as you describe above. To put the bus into LP-11 state, BIT(2) needs to be set.

Yeah, but i double that clock lane is not in LP11 when continue clock mode is enabled.

I think by spec it shouldn't got to stopstate in continuous clock.

Quoted 7 lines

If indeed LP-11 state is not achieved while the sensor is idle, as long as BIT(5) is cleared, I think this patch is correct.

regards
Philipp

As far as I understand, bit[5] set to 1 will force clock lane to be gated (in other words it will be forced to be in LP-11 if there are no packets to transmit). But also LP-11 must not be achieved with the BIT(5) cleared (free running mode)?

Sorry if I misunderstood something.

regards,
Luis

#6 lore raw

Hi all,

2017-08-07 22:48 GMT+08:00 Luis Oliveira <[email protected]>:

Quoted 58 lines

Hi all,

I'm new here, I got to be Maintainer of this driver by the old Maintainer recommendation. Still getting the hang of it :)

Quoted 19 lines · Philipp Zabel

Hi Jacob,

On Mon, 2017-08-07 at 19:06 +0800, Jacob Chen wrote:
[...]

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

drivers/media/i2c/ov5647.c static int ov5647_stream_on(struct v4l2_subdev *sd) · line 259

Quoted 10 lines
drivers/media/i2c/ov5647.c +4 -0
@@ -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;
+

So this clears BIT(1) (force clock lane to low power mode) and BIT(5) (gate clock lane while idle) that were set by ov5647_stream_off() during __sensor_init() due to the change below.

Quoted 4 lines

Is there a reason, btw, that this driver is full of magic register addresses and values? A few #defines would make this a lot more readable.

For what I can see I agree that a few register name setting could be done.

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
drivers/media/i2c/ov5647.c +4 -0
        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;
        }
 
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

drivers/media/i2c/ov5647.c static int __sensor_init(struct v4l2_subdev *sd) · line 331

Quoted 2 lines
drivers/media/i2c/ov5647.c +1 -1
-       return ov5647_write(sd, 0x4800, 0x04);
+       return ov5647_stream_off(sd);

I see now that BIT(2) (keep bus in LP-11 while idle) is and was always set. So the change is that initially, additionally to LP-11 mode, the clock lane is gated and forced into low power mode, as well?

Quoted 2 lines

This is my interpretation as well.

BIT(0) are not necessary, just i saw many driver have set it both with BIT(5).

Quoted 37 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
Quoted 6 lines
drivers/media/i2c/ov5647.c +0 -1
 }
 
 static int ov5647_sensor_power(struct v4l2_subdev *sd, int on)
--

2.7.4

Can anyone comment on it?

I saw there is a same discussion in https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.kernel.org_patch_9569031_&d=DwICaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=eMn12aiiNuIDjtRi5xEzC7tWJkpra2vl_XYFVvfxIGE&m=eortcRXje2uLyZNI_-Uw3Ur_z24tb-e4pZfom7WhdE0&s=6sLc76bhjR0IdaA3ArZ7F7slgtcyGz8pDTzAF_CBLno&e=
There is a comment in i.MX CSI2 driver.
"
Configure MIPI Camera Sensor to put all Tx lanes in LP-11 state.
This must be carried out by the MIPI sensor's s_power(ON) subdev
op.
"
That's what this patch do, sensor driver should make sure that clock
lanes are in stop state while not streaming.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

This is not the same, as far as I can tell. BIT(5) is just clock lane gating, as you describe above. To put the bus into LP-11 state, BIT(2) needs to be set.

Yeah, but i double that clock lane is not in LP11 when continue clock mode is enabled.

I think by spec it shouldn't got to stopstate in continuous clock.

Quoted 7 lines

If indeed LP-11 state is not achieved while the sensor is idle, as long as BIT(5) is cleared, I think this patch is correct.

regards
Philipp

Quoted 7 lines

As far as I understand, bit[5] set to 1 will force clock lane to be gated (in other words it will be forced to be in LP-11 if there are no packets to transmit). But also LP-11 must not be achieved with the BIT(5) cleared (free running mode)?

Sorry if I misunderstood something.

I do some experiments.
I didn't have instruments to test, so i just observe it through phy registers.

If BIT(5) are cleared in "ov5647_sensor_power" and do nothing about it in "ov5647_stream_on",
Phy didn't get a SoT from sensor in "ov5647_stream_on" and it keep its clock lane in lp mode.

if BIT(5) are set in "ov5647_sensor_power", and cleared in "ov5647_stream_on". Phy will get a SoT and the clock lane will enter hs mode.

So i'm pretty sure that LP-11 must not be achieved with the BIT(5) cleared.

Quoted 3 lines

regards,
Luis

#7 lore raw
In reply to Luis Oliveira

Hi Luis,

2017-08-07 22:48 GMT+08:00 Luis Oliveira <[email protected]>:

Quoted 93 lines

Hi all,

I'm new here, I got to be Maintainer of this driver by the old Maintainer recommendation. Still getting the hang of it :)

Quoted 19 lines · Philipp Zabel

Hi Jacob,

On Mon, 2017-08-07 at 19:06 +0800, Jacob Chen wrote:
[...]

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

drivers/media/i2c/ov5647.c static int ov5647_stream_on(struct v4l2_subdev *sd) · line 259

Quoted 10 lines
drivers/media/i2c/ov5647.c +4 -0
@@ -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;
+

So this clears BIT(1) (force clock lane to low power mode) and BIT(5) (gate clock lane while idle) that were set by ov5647_stream_off() during __sensor_init() due to the change below.

Quoted 4 lines

Is there a reason, btw, that this driver is full of magic register addresses and values? A few #defines would make this a lot more readable.

For what I can see I agree that a few register name setting could be done.

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
drivers/media/i2c/ov5647.c +4 -0
        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;
        }
 
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

drivers/media/i2c/ov5647.c static int __sensor_init(struct v4l2_subdev *sd) · line 331

Quoted 2 lines
drivers/media/i2c/ov5647.c +1 -1
-       return ov5647_write(sd, 0x4800, 0x04);
+       return ov5647_stream_off(sd);

I see now that BIT(2) (keep bus in LP-11 while idle) is and was always set. So the change is that initially, additionally to LP-11 mode, the clock lane is gated and forced into low power mode, as well?

This is my interpretation as well.

Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
Quoted 6 lines
drivers/media/i2c/ov5647.c +0 -1
 }
 
 static int ov5647_sensor_power(struct v4l2_subdev *sd, int on)
--

2.7.4

Can anyone comment on it?

I saw there is a same discussion in https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.kernel.org_patch_9569031_&d=DwICaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=eMn12aiiNuIDjtRi5xEzC7tWJkpra2vl_XYFVvfxIGE&m=eortcRXje2uLyZNI_-Uw3Ur_z24tb-e4pZfom7WhdE0&s=6sLc76bhjR0IdaA3ArZ7F7slgtcyGz8pDTzAF_CBLno&e=
There is a comment in i.MX CSI2 driver.
"
Configure MIPI Camera Sensor to put all Tx lanes in LP-11 state.
This must be carried out by the MIPI sensor's s_power(ON) subdev
op.
"
That's what this patch do, sensor driver should make sure that clock
lanes are in stop state while not streaming.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

This is not the same, as far as I can tell. BIT(5) is just clock lane gating, as you describe above. To put the bus into LP-11 state, BIT(2) needs to be set.

Yeah, but i double that clock lane is not in LP11 when continue clock mode is enabled.

I think by spec it shouldn't got to stopstate in continuous clock.

Quoted 4 lines

If indeed LP-11 state is not achieved while the sensor is idle, as long as BIT(5) is cleared, I think this patch is correct.

Quoted 9 lines
Quoted 3 lines

regards
Philipp

As far as I understand, bit[5] set to 1 will force clock lane to be gated (in other words it will be forced to be in LP-11 if there are no packets to transmit). But also LP-11 must not be achieved with the BIT(5) cleared (free running mode)?

Yes. When the BIT(5) is cleared, clock lane will be in continuous mode immediately,
unless BIT(0) is set.

Quoted 5 lines

Sorry if I misunderstood something.

regards,
Luis