static int fimc_is_ssx_video_open(struct file *file) { int ret = 0; struct fimc_is_video *video; struct fimc_is_video_ctx *vctx; struct fimc_is_device_sensor *device; struct fimc_is_resourcemgr *resourcemgr; vctx = NULL; video = video_drvdata(file); device = container_of(video, struct fimc_is_device_sensor, video); resourcemgr = video->resourcemgr; if (!resourcemgr) { err("resourcemgr is NULL"); ret = -EINVAL; goto p_err; } ret = fimc_is_resource_open(resourcemgr, video->id - FIMC_IS_VIDEO_SS0_NUM, NULL); if (ret) { err("fimc_is_resource_open is fail(%d)", ret); goto p_err; } minfo("[SS%d:V] %s\n", device, video->id, __func__); ret = open_vctx(file, video, &vctx, device->instance, FRAMEMGR_ID_SSX); if (ret) { merr("open_vctx is fail(%d)", device, ret); goto p_err; } ret = fimc_is_video_open(vctx, device, VIDEO_SSX_READY_BUFFERS, video, &fimc_is_ssx_qops, &fimc_is_sensor_ops); if (ret) { merr("fimc_is_video_open is fail(%d)", device, ret); close_vctx(file, video, vctx); goto p_err; } ret = fimc_is_sensor_open(device, vctx); if (ret) { merr("fimc_is_ssx_open is fail(%d)", device, ret); close_vctx(file, video, vctx); goto p_err; } p_err: return ret; }
static int fimc_is_bayer_video_open(struct file *file) { struct fimc_is_core *core = video_drvdata(file); struct fimc_is_video_sensor *video = &core->video_sensor; struct fimc_is_device_sensor *sensor = &core->sensor; dbg_sensor("%s\n", __func__); file->private_data = video; fimc_is_video_open(&video->common, sensor, VIDEO_SENSOR_READY_BUFFERS); fimc_is_sensor_open(sensor); return 0; }
static int fimc_is_sen_video_open(struct file *file) { int ret = 0; struct fimc_is_video *video; struct fimc_is_video_ctx *vctx; struct fimc_is_device_sensor *device; vctx = NULL; video = video_drvdata(file); device = container_of(video, struct fimc_is_device_sensor, video); ret = open_vctx(file, video, &vctx, FRAMEMGR_ID_INVALID, FRAMEMGR_ID_SENSOR); if (ret) { err("open_vctx is fail(%d)", ret); goto p_err; } info("[SS%d:V:%d] %s\n", video->id, vctx->instance, __func__); ret = fimc_is_video_open(vctx, device, VIDEO_SENSOR_READY_BUFFERS, video, FIMC_IS_VIDEO_TYPE_CAPTURE, &fimc_is_sen_qops, NULL, NULL); if (ret) { merr("fimc_is_video_open is fail(%d)", vctx, ret); close_vctx(file, video, vctx); goto p_err; } ret = fimc_is_sensor_open(device, vctx); if (ret) { merr("fimc_is_sen_open is fail(%d)", vctx, ret); close_vctx(file, video, vctx); goto p_err; } p_err: return ret; }
static int fimc_is_ss1_video_open(struct file *file) { int ret = 0; struct fimc_is_core *core = video_drvdata(file); struct fimc_is_video *video = &core->video_ss1; struct fimc_is_video_ctx *vctx = NULL; struct fimc_is_device_sensor *device = NULL; ret = open_vctx(file, video, &vctx, FRAMEMGR_ID_INVALID, FRAMEMGR_ID_SS1); if (ret) { err("open_vctx is fail(%d)", ret); goto p_err; } pr_info("[SS1:V:%d] %s\n", vctx->instance, __func__); device = &core->sensor[1]; device->instance = 1; fimc_is_video_open(vctx, device, VIDEO_SENSOR_READY_BUFFERS, video, FIMC_IS_VIDEO_TYPE_CAPTURE, &fimc_is_ss1_qops, NULL, &fimc_is_ischain_sub_ops, core->mem.vb2->ops); ret = fimc_is_sensor_open(device, vctx); if (ret < 0) { err("fimc_is_sensor_open is fail"); close_vctx(file, video, vctx); goto p_err; } p_err: return ret; }