Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f97b8e6b authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

media: staging: atomisp: Kill subdev s_parm abuse



Remove sensor driver's interface for setting the use case specific mode
list as well as the mode lists that are related to other than
CI_MODE_PREVIEW. This removes s_parm abuse in using driver specific values
in v4l2_streamparm.capture.capturemode. The drivers already support
[gs]_frame_interval so removing support for [gs]_parm is enough.

Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 4471109e
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -1224,37 +1224,12 @@ static int gc0310_g_parm(struct v4l2_subdev *sd,
	if (dev->fmt_idx >= 0 && dev->fmt_idx < N_RES) {
		param->parm.capture.capability = V4L2_CAP_TIMEPERFRAME;
		param->parm.capture.timeperframe.numerator = 1;
		param->parm.capture.capturemode = dev->run_mode;
		param->parm.capture.timeperframe.denominator =
			gc0310_res[dev->fmt_idx].fps;
	}
	return 0;
}

static int gc0310_s_parm(struct v4l2_subdev *sd,
			struct v4l2_streamparm *param)
{
	struct gc0310_device *dev = to_gc0310_sensor(sd);
	dev->run_mode = param->parm.capture.capturemode;

	mutex_lock(&dev->input_lock);
	switch (dev->run_mode) {
	case CI_MODE_VIDEO:
		gc0310_res = gc0310_res_video;
		N_RES = N_RES_VIDEO;
		break;
	case CI_MODE_STILL_CAPTURE:
		gc0310_res = gc0310_res_still;
		N_RES = N_RES_STILL;
		break;
	default:
		gc0310_res = gc0310_res_preview;
		N_RES = N_RES_PREVIEW;
	}
	mutex_unlock(&dev->input_lock);
	return 0;
}

static int gc0310_g_frame_interval(struct v4l2_subdev *sd,
				   struct v4l2_subdev_frame_interval *interval)
{
@@ -1314,7 +1289,6 @@ static const struct v4l2_subdev_sensor_ops gc0310_sensor_ops = {
static const struct v4l2_subdev_video_ops gc0310_video_ops = {
	.s_stream = gc0310_s_stream,
	.g_parm = gc0310_g_parm,
	.s_parm = gc0310_s_parm,
	.g_frame_interval = gc0310_g_frame_interval,
};

+0 −26
Original line number Diff line number Diff line
@@ -964,37 +964,12 @@ static int gc2235_g_parm(struct v4l2_subdev *sd,
	if (dev->fmt_idx >= 0 && dev->fmt_idx < N_RES) {
		param->parm.capture.capability = V4L2_CAP_TIMEPERFRAME;
		param->parm.capture.timeperframe.numerator = 1;
		param->parm.capture.capturemode = dev->run_mode;
		param->parm.capture.timeperframe.denominator =
			gc2235_res[dev->fmt_idx].fps;
	}
	return 0;
}

static int gc2235_s_parm(struct v4l2_subdev *sd,
			struct v4l2_streamparm *param)
{
	struct gc2235_device *dev = to_gc2235_sensor(sd);
	dev->run_mode = param->parm.capture.capturemode;

	mutex_lock(&dev->input_lock);
	switch (dev->run_mode) {
	case CI_MODE_VIDEO:
		gc2235_res = gc2235_res_video;
		N_RES = N_RES_VIDEO;
		break;
	case CI_MODE_STILL_CAPTURE:
		gc2235_res = gc2235_res_still;
		N_RES = N_RES_STILL;
		break;
	default:
		gc2235_res = gc2235_res_preview;
		N_RES = N_RES_PREVIEW;
	}
	mutex_unlock(&dev->input_lock);
	return 0;
}

static int gc2235_g_frame_interval(struct v4l2_subdev *sd,
				   struct v4l2_subdev_frame_interval *interval)
{
@@ -1053,7 +1028,6 @@ static const struct v4l2_subdev_sensor_ops gc2235_sensor_ops = {
static const struct v4l2_subdev_video_ops gc2235_video_ops = {
	.s_stream = gc2235_s_stream,
	.g_parm = gc2235_g_parm,
	.s_parm = gc2235_s_parm,
	.g_frame_interval = gc2235_g_frame_interval,
};

+0 −29
Original line number Diff line number Diff line
@@ -1300,40 +1300,12 @@ static int ov2680_g_parm(struct v4l2_subdev *sd,
	if (dev->fmt_idx >= 0 && dev->fmt_idx < N_RES) {
		param->parm.capture.capability = V4L2_CAP_TIMEPERFRAME;
		param->parm.capture.timeperframe.numerator = 1;
		param->parm.capture.capturemode = dev->run_mode;
		param->parm.capture.timeperframe.denominator =
			ov2680_res[dev->fmt_idx].fps;
	}
	return 0;
}

static int ov2680_s_parm(struct v4l2_subdev *sd,
			struct v4l2_streamparm *param)
{
	struct ov2680_device *dev = to_ov2680_sensor(sd);
	struct i2c_client *client = v4l2_get_subdevdata(sd);
	dev->run_mode = param->parm.capture.capturemode;

	v4l2_info(client, "\n%s:run_mode :%x\n", __func__, dev->run_mode);

	mutex_lock(&dev->input_lock);
	switch (dev->run_mode) {
	case CI_MODE_VIDEO:
		ov2680_res = ov2680_res_video;
		N_RES = N_RES_VIDEO;
		break;
	case CI_MODE_STILL_CAPTURE:
		ov2680_res = ov2680_res_still;
		N_RES = N_RES_STILL;
		break;
	default:
		ov2680_res = ov2680_res_preview;
		N_RES = N_RES_PREVIEW;
	}
	mutex_unlock(&dev->input_lock);
	return 0;
}

static int ov2680_g_frame_interval(struct v4l2_subdev *sd,
				   struct v4l2_subdev_frame_interval *interval)
{
@@ -1388,7 +1360,6 @@ static int ov2680_g_skip_frames(struct v4l2_subdev *sd, u32 *frames)
static const struct v4l2_subdev_video_ops ov2680_video_ops = {
	.s_stream = ov2680_s_stream,
	.g_parm = ov2680_g_parm,
	.s_parm = ov2680_s_parm,
	.g_frame_interval = ov2680_g_frame_interval,
};

+0 −26
Original line number Diff line number Diff line
@@ -1103,37 +1103,12 @@ static int ov2722_g_parm(struct v4l2_subdev *sd,
	if (dev->fmt_idx >= 0 && dev->fmt_idx < N_RES) {
		param->parm.capture.capability = V4L2_CAP_TIMEPERFRAME;
		param->parm.capture.timeperframe.numerator = 1;
		param->parm.capture.capturemode = dev->run_mode;
		param->parm.capture.timeperframe.denominator =
			ov2722_res[dev->fmt_idx].fps;
	}
	return 0;
}

static int ov2722_s_parm(struct v4l2_subdev *sd,
			struct v4l2_streamparm *param)
{
	struct ov2722_device *dev = to_ov2722_sensor(sd);
	dev->run_mode = param->parm.capture.capturemode;

	mutex_lock(&dev->input_lock);
	switch (dev->run_mode) {
	case CI_MODE_VIDEO:
		ov2722_res = ov2722_res_video;
		N_RES = N_RES_VIDEO;
		break;
	case CI_MODE_STILL_CAPTURE:
		ov2722_res = ov2722_res_still;
		N_RES = N_RES_STILL;
		break;
	default:
		ov2722_res = ov2722_res_preview;
		N_RES = N_RES_PREVIEW;
	}
	mutex_unlock(&dev->input_lock);
	return 0;
}

static int ov2722_g_frame_interval(struct v4l2_subdev *sd,
				   struct v4l2_subdev_frame_interval *interval)
{
@@ -1193,7 +1168,6 @@ static const struct v4l2_subdev_sensor_ops ov2722_sensor_ops = {
static const struct v4l2_subdev_video_ops ov2722_video_ops = {
	.s_stream = ov2722_s_stream,
	.g_parm = ov2722_g_parm,
	.s_parm = ov2722_s_parm,
	.g_frame_interval = ov2722_g_frame_interval,
};

+0 −43
Original line number Diff line number Diff line
@@ -150,7 +150,6 @@ struct gc0310_device {
	struct camera_sensor_platform_data *platform_data;
	int vt_pix_clk_freq_mhz;
	int fmt_idx;
	int run_mode;
	u8 res;
	u8 type;
};
@@ -400,48 +399,6 @@ struct gc0310_resolution gc0310_res_preview[] = {
};
#define N_RES_PREVIEW (ARRAY_SIZE(gc0310_res_preview))

struct gc0310_resolution gc0310_res_still[] = {
	{
		.desc = "gc0310_VGA_30fps",
		.width = 656, // 648,
		.height = 496, // 488,
		.fps = 30,
		//.pix_clk_freq = 73,
		.used = 0,
#if 0
		.pixels_per_line = 0x0314,
		.lines_per_frame = 0x0213,
#endif
		.bin_factor_x = 1,
		.bin_factor_y = 1,
		.bin_mode = 0,
		.skip_frames = 2,
		.regs = gc0310_VGA_30fps,
	},
};
#define N_RES_STILL (ARRAY_SIZE(gc0310_res_still))

struct gc0310_resolution gc0310_res_video[] = {
	{
		.desc = "gc0310_VGA_30fps",
		.width = 656, // 648,
		.height = 496, // 488,
		.fps = 30,
		//.pix_clk_freq = 73,
		.used = 0,
#if 0
		.pixels_per_line = 0x0314,
		.lines_per_frame = 0x0213,
#endif
		.bin_factor_x = 1,
		.bin_factor_y = 1,
		.bin_mode = 0,
		.skip_frames = 2,
		.regs = gc0310_VGA_30fps,
	},
};
#define N_RES_VIDEO (ARRAY_SIZE(gc0310_res_video))

static struct gc0310_resolution *gc0310_res = gc0310_res_preview;
static unsigned long N_RES = N_RES_PREVIEW;
#endif
Loading