Skip to content

Commit

Permalink
media: rkisp1: Move sensor .s_stream() call to ISP
Browse files Browse the repository at this point in the history
Move the calls to the active sensor's .s_stream() operation to the ISP
subdev's .s_stream(). This groups all handling of the active sensor in
one place, preparing for a rework of that code.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Dafna Hirschfeld <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
pinchartl authored and mchehab committed Jul 17, 2022
1 parent fc890f0 commit deaf112
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 1 addition & 11 deletions drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,11 +926,8 @@ static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap)
* If the other capture is streaming, isp and sensor nodes shouldn't
* be disabled, skip them.
*/
if (rkisp1->pipe.streaming_count < 2) {
v4l2_subdev_call(rkisp1->active_sensor->sd, video, s_stream,
false);
if (rkisp1->pipe.streaming_count < 2)
v4l2_subdev_call(&rkisp1->isp.sd, video, s_stream, false);
}

v4l2_subdev_call(&rkisp1->resizer_devs[cap->id].sd, video, s_stream,
false);
Expand Down Expand Up @@ -966,15 +963,8 @@ static int rkisp1_pipeline_stream_enable(struct rkisp1_capture *cap)
if (ret)
goto err_disable_rsz;

ret = v4l2_subdev_call(rkisp1->active_sensor->sd, video, s_stream,
true);
if (ret)
goto err_disable_isp;

return 0;

err_disable_isp:
v4l2_subdev_call(&rkisp1->isp.sd, video, s_stream, false);
err_disable_rsz:
v4l2_subdev_call(&rkisp1->resizer_devs[cap->id].sd, video, s_stream,
false);
Expand Down
11 changes: 11 additions & 0 deletions drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,9 @@ static int rkisp1_isp_s_stream(struct v4l2_subdev *sd, int enable)
int ret = 0;

if (!enable) {
v4l2_subdev_call(rkisp1->active_sensor->sd, video, s_stream,
false);

rkisp1_isp_stop(rkisp1);
rkisp1_mipi_csi2_stop(rkisp1->active_sensor);
return 0;
Expand Down Expand Up @@ -886,6 +889,14 @@ static int rkisp1_isp_s_stream(struct v4l2_subdev *sd, int enable)

rkisp1_isp_start(rkisp1);

ret = v4l2_subdev_call(rkisp1->active_sensor->sd, video, s_stream,
true);
if (ret) {
rkisp1_isp_stop(rkisp1);
rkisp1_mipi_csi2_stop(rkisp1->active_sensor);
goto mutex_unlock;
}

mutex_unlock:
mutex_unlock(&isp->ops_lock);
return ret;
Expand Down

0 comments on commit deaf112

Please sign in to comment.