Skip to content

Commit c00d65e

Browse files
trettermchehab
authored andcommitted
media: imx6-mipi-csi2: use pre_streamon callback to set sensor into LP11
Step 5 expects that the sensor is in LP11 mode. Use the new pre_streamon callback to signal the sensor that it should switch into LP11. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent 9de63c9 commit c00d65e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎drivers/staging/media/imx/imx6-mipi-csi2.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,17 @@ static int csi2_start(struct csi2_dev *csi2)
382382
csi2_enable(csi2, true);
383383

384384
/* Step 5 */
385+
ret = v4l2_subdev_call(csi2->src_sd, video, pre_streamon,
386+
V4L2_SUBDEV_PRE_STREAMON_FL_MANUAL_LP);
387+
if (ret && ret != -ENOIOCTLCMD)
388+
goto err_assert_reset;
385389
csi2_dphy_wait_stopstate(csi2, lanes);
386390

387391
/* Step 6 */
388392
ret = v4l2_subdev_call(csi2->src_sd, video, s_stream, 1);
389393
ret = (ret && ret != -ENOIOCTLCMD) ? ret : 0;
390394
if (ret)
391-
goto err_assert_reset;
395+
goto err_stop_lp11;
392396

393397
/* Step 7 */
394398
ret = csi2_dphy_wait_clock_lane(csi2);
@@ -399,6 +403,8 @@ static int csi2_start(struct csi2_dev *csi2)
399403

400404
err_stop_upstream:
401405
v4l2_subdev_call(csi2->src_sd, video, s_stream, 0);
406+
err_stop_lp11:
407+
v4l2_subdev_call(csi2->src_sd, video, post_streamoff);
402408
err_assert_reset:
403409
csi2_enable(csi2, false);
404410
err_disable_clk:
@@ -410,6 +416,7 @@ static void csi2_stop(struct csi2_dev *csi2)
410416
{
411417
/* stop upstream */
412418
v4l2_subdev_call(csi2->src_sd, video, s_stream, 0);
419+
v4l2_subdev_call(csi2->src_sd, video, post_streamoff);
413420

414421
csi2_enable(csi2, false);
415422
clk_disable_unprepare(csi2->pix_clk);

0 commit comments

Comments
 (0)