int ispstat_s_stream(struct v4l2_subdev *subdev, int enable) { struct ispstat *stat = v4l2_get_subdevdata(subdev); if (enable) { /* * Only set enable PCR bit if the module was previously * enabled through ioct. */ ispstat_try_enable(stat); } else { /* Disable PCR bit and config enable field */ ispstat_enable(stat, 0); ispstat_pcr_enable(stat, 0); dev_dbg(stat->isp->dev, "%s: module is being disabled\n", stat->subdev.name); } return 0; }
int ispstat_s_stream(struct v4l2_subdev *subdev, int enable) { struct ispstat *stat = v4l2_get_subdevdata(subdev); if (enable) { /* * Only set enable PCR bit if the module was previously * enabled through ioct. */ ispstat_try_enable(stat); } else { unsigned long flags; /* Disable PCR bit and config enable field */ ispstat_enable(stat, 0); spin_lock_irqsave(&stat->isp->stat_lock, flags); stat->ops->enable(stat, 0); spin_unlock_irqrestore(&stat->isp->stat_lock, flags); /* * If module isn't busy, a new interrupt may come or not to * set the state to DISABLED. As Histogram needs to read its * internal memory to clear it, let interrupt handler * responsible of changing state to DISABLED. If the last * interrupt is coming, it's still safe as the handler will * ignore the second time when state is already set to DISABLED. * It's necessary to synchronize Histogram with streamoff, once * the module may be considered idle before last SDMA transfer * starts if we return here. */ if (!ispstat_pcr_busy(stat)) ispstat_isr(stat); dev_dbg(stat->isp->dev, "%s: module is being disabled\n", stat->subdev.name); } return 0; }
void ispstat_isr_frame_sync(struct ispstat *stat) { ispstat_try_enable(stat); }