Exemplo n.º 1
0
static int fimc_lite_close(struct file *file)
{
	struct fimc_lite *fimc = video_drvdata(file);
	int ret;

	if (mutex_lock_interruptible(&fimc->lock))
		return -ERESTARTSYS;

	if (--fimc->ref_count == 0 && fimc->out_path == FIMC_IO_DMA) {
		clear_bit(ST_FLITE_IN_USE, &fimc->state);
		fimc_lite_stop_capture(fimc, false);
		fimc_pipeline_shutdown(&fimc->pipeline);
		clear_bit(ST_FLITE_SUSPENDED, &fimc->state);
	}

	pm_runtime_put(&fimc->pdev->dev);
	platform_sysmmu_off(&fimc->pdev->dev);
	if (fimc->ref_count == 0)
		vb2_queue_release(&fimc->vb_queue);

	ret = v4l2_fh_release(file);

	mutex_unlock(&fimc->lock);
	return ret;
}
Exemplo n.º 2
0
static int fimc_capture_close(struct file *file)
{
	struct fimc_dev *fimc = video_drvdata(file);
	int ret;

	dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state);

	if (mutex_lock_interruptible(&fimc->lock))
		return -ERESTARTSYS;

	if (--fimc->vid_cap.refcnt == 0) {
		clear_bit(ST_CAPT_BUSY, &fimc->state);
		fimc_stop_capture(fimc, false);
		fimc_pipeline_shutdown(&fimc->pipeline);
		clear_bit(ST_CAPT_SUSPENDED, &fimc->state);
	}

	pm_runtime_put(&fimc->pdev->dev);

	if (fimc->vid_cap.refcnt == 0) {
		vb2_queue_release(&fimc->vid_cap.vbq);
		fimc_ctrls_delete(fimc->vid_cap.ctx);
	}

	ret = v4l2_fh_release(file);

	mutex_unlock(&fimc->lock);
	return ret;
}
Exemplo n.º 3
0
int fimc_capture_suspend(struct fimc_dev *fimc)
{
	bool suspend = fimc_capture_busy(fimc);

	int ret = fimc_stop_capture(fimc, suspend);
	if (ret)
		return ret;
	return fimc_pipeline_shutdown(fimc);
}
Exemplo n.º 4
0
static int fimc_lite_suspend(struct device *dev)
{
	struct fimc_lite *fimc = dev_get_drvdata(dev);
	bool suspend = test_bit(ST_FLITE_IN_USE, &fimc->state);
	int ret;

	if (test_and_set_bit(ST_LPM, &fimc->state))
		return 0;

	ret = fimc_lite_stop_capture(fimc, suspend);
	if (ret < 0 || !fimc_lite_active(fimc))
		return ret;

	return fimc_pipeline_shutdown(&fimc->pipeline);
}
Exemplo n.º 5
0
static int fimc_capture_close(struct file *file)
{
	struct fimc_dev *fimc = video_drvdata(file);

	dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state);

	if (--fimc->vid_cap.refcnt == 0) {
		clear_bit(ST_CAPT_BUSY, &fimc->state);
		fimc_stop_capture(fimc, false);
		fimc_pipeline_shutdown(fimc);
		clear_bit(ST_CAPT_SUSPENDED, &fimc->state);
	}

	pm_runtime_put(&fimc->pdev->dev);

	if (fimc->vid_cap.refcnt == 0) {
		vb2_queue_release(&fimc->vid_cap.vbq);
		fimc_ctrls_delete(fimc->vid_cap.ctx);
	}
	return v4l2_fh_release(file);
}