@@ -1767,6 +1767,11 @@ static int ccs_enable_streams(struct v4l2_subdev *subdev,
if (pad != CCS_PAD_SRC)
return -EINVAL;
+ if (sensor->streaming) {
+ sensor->streaming |= streams_mask;
+ return 0;
+ }
+
rval = ccs_pm_get_init(sensor);
if (rval)
return rval;
@@ -1888,7 +1893,7 @@ static int ccs_enable_streams(struct v4l2_subdev *subdev,
rval = ccs_write(sensor, MODE_SELECT, CCS_MODE_SELECT_STREAMING);
- sensor->streaming = true;
+ sensor->streaming |= streams_mask;
return 0;
@@ -1910,6 +1915,10 @@ static int ccs_disable_streams(struct v4l2_subdev *subdev,
if (pad != CCS_PAD_SRC)
return -EINVAL;
+ sensor->streaming &= ~streams_mask;
+ if (sensor->streaming)
+ return 0;
+
rval = ccs_write(sensor, MODE_SELECT, CCS_MODE_SELECT_SOFTWARE_STANDBY);
if (rval)
return rval;
@@ -1918,7 +1927,6 @@ static int ccs_disable_streams(struct v4l2_subdev *subdev,
if (rval)
dev_err(&client->dev, "post_streamoff quirks failed\n");
- sensor->streaming = false;
pm_runtime_mark_last_busy(&client->dev);
pm_runtime_put_autosuspend(&client->dev);
@@ -3526,7 +3534,6 @@ static int ccs_probe(struct i2c_client *client)
goto out_cleanup;
}
- sensor->streaming = false;
sensor->dev_init_done = true;
sensor->handler_setup_needed = true;
@@ -236,7 +236,7 @@ struct ccs_sensor {
u16 image_start; /* image data start line */
u16 visible_pixel_start; /* start pixel of the visible image */
- bool streaming;
+ u8 streaming;
bool dev_init_done;
bool handler_setup_needed;
u8 compressed_min_bpp;