Skip to content
Permalink
Browse files
media: i2c: ap1302: Add a flag to check the streaming status
Add a flag to check the streaming status of ISP and avoid calling
stream on logic multiple times. Updating the registers of ISP when
ISP is in streaming state will cause errors.

Signed-off-by: Anil Kumar Mamidala <anil.mamidala@xilinx.com>
  • Loading branch information
Anil Kumar Mamidala authored and Michal Simek committed Jul 14, 2021
1 parent 8237edd commit f6f032f82f0a13def702a0154df535db88f43391
Showing 1 changed file with 6 additions and 0 deletions.
@@ -408,6 +408,7 @@ struct ap1302_device {
struct media_pad pads[AP1302_PAD_MAX];
struct ap1302_format formats[AP1302_PAD_MAX];
unsigned int width_factor;
bool streaming;

struct v4l2_ctrl_handler ctrls;

@@ -1211,8 +1212,10 @@ static int ap1302_stall(struct ap1302_device *ap1302, bool stall)
if (ret < 0)
return ret;

ap1302->streaming = false;
return 0;
} else {
ap1302->streaming = true;
return ap1302_write(ap1302, AP1302_SYS_START,
AP1302_SYS_START_PLL_LOCK |
AP1302_SYS_START_STALL_STATUS |
@@ -1670,6 +1673,9 @@ static int ap1302_s_stream(struct v4l2_subdev *sd, int enable)

mutex_lock(&ap1302->lock);

if (enable == ap1302->streaming)
goto done;

if (enable) {
ret = ap1302_configure(ap1302);
if (ret < 0)

0 comments on commit f6f032f

Please sign in to comment.