Example #1
0
static int fimc_g_ctrl(struct file *filp, void *fh, struct v4l2_control *c)
{
	struct fimc_control *ctrl = ((struct fimc_prv_data *)fh)->ctrl;
	int ret = -1;

	if (ctrl->cap != NULL) {
		ret = fimc_g_ctrl_capture(ctrl, c);
	} else if (ctrl->out != NULL) {
		ret = fimc_g_ctrl_output(fh, c);
	} else {
		fimc_err("%s: Invalid case\n", __func__);
		return -EINVAL;
	}

	return ret;
}
static int fimc_g_ctrl(struct file *filp, void *fh, struct v4l2_control *c)
{
	struct fimc_control *ctrl = ((struct fimc_prv_data *)fh)->ctrl;
	struct s3c_platform_fimc *pdata	= to_fimc_plat(ctrl->dev);
	int ret = -1;

	/* can get hw version at any time */
	if (c->id == V4L2_CID_FIMC_VERSION) {
		c->value = pdata->hw_ver;
		return 0;
	}

	if (ctrl->cap != NULL) {
		ret = fimc_g_ctrl_capture(fh, c);
	} else if (ctrl->out != NULL) {
		ret = fimc_g_ctrl_output(fh, c);
	} else {
		fimc_err("%s: Invalid case\n", __func__);
		return -EINVAL;
	}

	return ret;
}