Exemplo n.º 1
0
static int fimc_is_ssx_video_close(struct file *file)
{
	int ret = 0;
	int refcount;
	struct fimc_is_video_ctx *vctx = file->private_data;
	struct fimc_is_video *video;
	struct fimc_is_device_sensor *device;

	BUG_ON(!vctx);
	BUG_ON(!GET_VIDEO(vctx));
	BUG_ON(!GET_DEVICE(vctx));

	video = GET_VIDEO(vctx);
	device = GET_DEVICE(vctx);

	ret = fimc_is_sensor_close(device);
	if (ret)
		merr("fimc_is_sensor_close is fail(%d)", device, ret);

	ret = fimc_is_video_close(vctx);
	if (ret)
		merr("fimc_is_video_close is fail(%d)", device, ret);

	refcount = close_vctx(file, video, vctx);
	if (refcount < 0)
		merr("close_vctx is fail(%d)", device, refcount);

	minfo("[SS%d:V] %s(%d):%d\n", device, GET_SSX_ID(video), __func__, refcount, ret);

	return ret;
}
Exemplo n.º 2
0
static int fimc_is_sen_video_close(struct file *file)
{
	int ret = 0;
	struct fimc_is_video *video = NULL;
	struct fimc_is_video_ctx *vctx = NULL;
	struct fimc_is_device_sensor *device = NULL;

	BUG_ON(!file);

	vctx = file->private_data;
	if (!vctx) {
		err("vctx is NULL");
		ret = -EINVAL;
		goto p_err;
	}

	video = vctx->video;
	if (!video) {
		merr("video is NULL", vctx);
		ret = -EINVAL;
		goto p_err;
	}

	info("[SS0:V:%d] %s\n", vctx->instance, __func__);

	device = vctx->device;
	if (!device) {
		merr("device is NULL", vctx);
		ret = -EINVAL;
		goto p_err;
	}

	ret = fimc_is_sensor_close(device);
	if (ret)
		err("fimc_is_sensor_close is fail(%d)", ret);

	ret = fimc_is_video_close(vctx);
	if (ret)
		err("fimc_is_video_close is fail(%d)", ret);

	ret = close_vctx(file, video, vctx);
	if (ret)
		err("close_vctx is fail(%d)", ret);

p_err:
	return ret;
}
static int fimc_is_bayer_video_close(struct file *file)
{
	struct fimc_is_video_sensor *video = file->private_data;
	struct fimc_is_video_common *common = &video->common;
	struct fimc_is_device_sensor *sensor = common->device;

	printk(KERN_INFO "%s\n", __func__);

	if (test_bit(FIMC_IS_VIDEO_STREAM_ON, &common->state))
		clear_bit(FIMC_IS_VIDEO_STREAM_ON, &common->state);

	file->private_data = 0;
	fimc_is_sensor_close(sensor);
	fimc_is_video_close(&video->common, sensor->framemgr);

	return 0;
}