Commit 8b3332b2 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab
Browse files

media: atomisp: Remove custom ATOMISP_IOC_ISP_MAKERNOTE ioctl



This ioctl simply returns a couple of fixed sensor parameters.

With libcamera these fixed parameters are instead stored in a table
with sensor-name to parameters mappings (camera_sensor_properties.cpp),
so this custom ioctl is not necessary; and it currently has no users.

Remove the ioctl and also remove the custom v4l2-ctrls underpinning
the ioctl.

This is part of a patch-series which tries to remove atomisp specific /
custom code from the sensor drivers, with as end goal to make the atomisp
drivers regular camera sensor drivers.

Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 94afce19
Loading
Loading
Loading
Loading
+0 −63
Original line number Diff line number Diff line
@@ -241,27 +241,6 @@ static int gc0310_write_reg_array(struct i2c_client *client,
	return __gc0310_flush_reg_array(client, &ctrl);
}

static int gc0310_g_focal(struct v4l2_subdev *sd, s32 *val)
{
	*val = (GC0310_FOCAL_LENGTH_NUM << 16) | GC0310_FOCAL_LENGTH_DEM;
	return 0;
}

static int gc0310_g_fnumber(struct v4l2_subdev *sd, s32 *val)
{
	/*const f number for imx*/
	*val = (GC0310_F_NUMBER_DEFAULT_NUM << 16) | GC0310_F_NUMBER_DEM;
	return 0;
}

static int gc0310_g_fnumber_range(struct v4l2_subdev *sd, s32 *val)
{
	*val = (GC0310_F_NUMBER_DEFAULT_NUM << 24) |
	       (GC0310_F_NUMBER_DEM << 16) |
	       (GC0310_F_NUMBER_DEFAULT_NUM << 8) | GC0310_F_NUMBER_DEM;
	return 0;
}

static int gc0310_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val)
{
	struct gc0310_device *dev = to_gc0310_sensor(sd);
@@ -596,15 +575,6 @@ static int gc0310_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
	case V4L2_CID_EXPOSURE_ABSOLUTE:
		ret = gc0310_q_exposure(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FOCAL_ABSOLUTE:
		ret = gc0310_g_focal(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FNUMBER_ABSOLUTE:
		ret = gc0310_g_fnumber(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FNUMBER_RANGE:
		ret = gc0310_g_fnumber_range(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_BIN_FACTOR_HORZ:
		ret = gc0310_g_bin_factor_x(&dev->sd, &ctrl->val);
		break;
@@ -655,39 +625,6 @@ static const struct v4l2_ctrl_config gc0310_controls[] = {
		.step = 1,
		.def = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FOCAL_ABSOLUTE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "focal length",
		.min = GC0310_FOCAL_LENGTH_DEFAULT,
		.max = GC0310_FOCAL_LENGTH_DEFAULT,
		.step = 0x01,
		.def = GC0310_FOCAL_LENGTH_DEFAULT,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FNUMBER_ABSOLUTE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "f-number",
		.min = GC0310_F_NUMBER_DEFAULT,
		.max = GC0310_F_NUMBER_DEFAULT,
		.step = 0x01,
		.def = GC0310_F_NUMBER_DEFAULT,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FNUMBER_RANGE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "f-number range",
		.min = GC0310_F_NUMBER_RANGE,
		.max = GC0310_F_NUMBER_RANGE,
		.step = 0x01,
		.def = GC0310_F_NUMBER_RANGE,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_BIN_FACTOR_HORZ,
+0 −63
Original line number Diff line number Diff line
@@ -220,27 +220,6 @@ static int gc2235_write_reg_array(struct i2c_client *client,
	return __gc2235_flush_reg_array(client, &ctrl);
}

static int gc2235_g_focal(struct v4l2_subdev *sd, s32 *val)
{
	*val = (GC2235_FOCAL_LENGTH_NUM << 16) | GC2235_FOCAL_LENGTH_DEM;
	return 0;
}

static int gc2235_g_fnumber(struct v4l2_subdev *sd, s32 *val)
{
	/* const f number for imx */
	*val = (GC2235_F_NUMBER_DEFAULT_NUM << 16) | GC2235_F_NUMBER_DEM;
	return 0;
}

static int gc2235_g_fnumber_range(struct v4l2_subdev *sd, s32 *val)
{
	*val = (GC2235_F_NUMBER_DEFAULT_NUM << 24) |
	       (GC2235_F_NUMBER_DEM << 16) |
	       (GC2235_F_NUMBER_DEFAULT_NUM << 8) | GC2235_F_NUMBER_DEM;
	return 0;
}

static int gc2235_get_intg_factor(struct i2c_client *client,
				  struct camera_mipi_info *info,
				  const struct gc2235_resolution *res)
@@ -467,15 +446,6 @@ static int gc2235_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
	case V4L2_CID_EXPOSURE_ABSOLUTE:
		ret = gc2235_q_exposure(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FOCAL_ABSOLUTE:
		ret = gc2235_g_focal(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FNUMBER_ABSOLUTE:
		ret = gc2235_g_fnumber(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FNUMBER_RANGE:
		ret = gc2235_g_fnumber_range(&dev->sd, &ctrl->val);
		break;
	default:
		ret = -EINVAL;
	}
@@ -499,39 +469,6 @@ static struct v4l2_ctrl_config gc2235_controls[] = {
		.def = 0x00,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FOCAL_ABSOLUTE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "focal length",
		.min = GC2235_FOCAL_LENGTH_DEFAULT,
		.max = GC2235_FOCAL_LENGTH_DEFAULT,
		.step = 0x01,
		.def = GC2235_FOCAL_LENGTH_DEFAULT,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FNUMBER_ABSOLUTE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "f-number",
		.min = GC2235_F_NUMBER_DEFAULT,
		.max = GC2235_F_NUMBER_DEFAULT,
		.step = 0x01,
		.def = GC2235_F_NUMBER_DEFAULT,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FNUMBER_RANGE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "f-number range",
		.min = GC2235_F_NUMBER_RANGE,
		.max = GC2235_F_NUMBER_RANGE,
		.step = 0x01,
		.def = GC2235_F_NUMBER_RANGE,
		.flags = 0,
	},
};

static int __gc2235_init(struct v4l2_subdev *sd)
+0 −64
Original line number Diff line number Diff line
@@ -841,28 +841,6 @@ static int mt9m114_set_fmt(struct v4l2_subdev *sd,
	return 0;
}

/* TODO: Update to SOC functions, remove exposure and gain */
static int mt9m114_g_focal(struct v4l2_subdev *sd, s32 *val)
{
	*val = (MT9M114_FOCAL_LENGTH_NUM << 16) | MT9M114_FOCAL_LENGTH_DEM;
	return 0;
}

static int mt9m114_g_fnumber(struct v4l2_subdev *sd, s32 *val)
{
	/* const f number for mt9m114 */
	*val = (MT9M114_F_NUMBER_DEFAULT_NUM << 16) | MT9M114_F_NUMBER_DEM;
	return 0;
}

static int mt9m114_g_fnumber_range(struct v4l2_subdev *sd, s32 *val)
{
	*val = (MT9M114_F_NUMBER_DEFAULT_NUM << 24) |
	       (MT9M114_F_NUMBER_DEM << 16) |
	       (MT9M114_F_NUMBER_DEFAULT_NUM << 8) | MT9M114_F_NUMBER_DEM;
	return 0;
}

/* Horizontal flip the image. */
static int mt9m114_g_hflip(struct v4l2_subdev *sd, s32 *val)
{
@@ -1271,15 +1249,6 @@ static int mt9m114_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
	case V4L2_CID_HFLIP:
		ret = mt9m114_g_hflip(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FOCAL_ABSOLUTE:
		ret = mt9m114_g_focal(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FNUMBER_ABSOLUTE:
		ret = mt9m114_g_fnumber(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FNUMBER_RANGE:
		ret = mt9m114_g_fnumber_range(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_EXPOSURE_ABSOLUTE:
		ret = mt9m114_g_exposure(&dev->sd, &ctrl->val);
		break;
@@ -1331,39 +1300,6 @@ static struct v4l2_ctrl_config mt9m114_controls[] = {
		.step = 1,
		.def = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FOCAL_ABSOLUTE,
		.name = "focal length",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.min = MT9M114_FOCAL_LENGTH_DEFAULT,
		.max = MT9M114_FOCAL_LENGTH_DEFAULT,
		.step = 1,
		.def = MT9M114_FOCAL_LENGTH_DEFAULT,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FNUMBER_ABSOLUTE,
		.name = "f-number",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.min = MT9M114_F_NUMBER_DEFAULT,
		.max = MT9M114_F_NUMBER_DEFAULT,
		.step = 1,
		.def = MT9M114_F_NUMBER_DEFAULT,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FNUMBER_RANGE,
		.name = "f-number range",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.min = MT9M114_F_NUMBER_RANGE,
		.max = MT9M114_F_NUMBER_RANGE,
		.step = 1,
		.def = MT9M114_F_NUMBER_RANGE,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_EXPOSURE_ABSOLUTE,
+0 −64
Original line number Diff line number Diff line
@@ -119,28 +119,6 @@ static int ov2680_write_reg_array(struct i2c_client *client,
	return 0;
}

static int ov2680_g_focal(struct v4l2_subdev *sd, s32 *val)
{
	*val = (OV2680_FOCAL_LENGTH_NUM << 16) | OV2680_FOCAL_LENGTH_DEM;
	return 0;
}

static int ov2680_g_fnumber(struct v4l2_subdev *sd, s32 *val)
{
	/* const f number for ov2680 */

	*val = (OV2680_F_NUMBER_DEFAULT_NUM << 16) | OV2680_F_NUMBER_DEM;
	return 0;
}

static int ov2680_g_fnumber_range(struct v4l2_subdev *sd, s32 *val)
{
	*val = (OV2680_F_NUMBER_DEFAULT_NUM << 24) |
	       (OV2680_F_NUMBER_DEM << 16) |
	       (OV2680_F_NUMBER_DEFAULT_NUM << 8) | OV2680_F_NUMBER_DEM;
	return 0;
}

static int ov2680_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val)
{
	struct ov2680_device *dev = to_ov2680_sensor(sd);
@@ -517,15 +495,6 @@ static int ov2680_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
	case V4L2_CID_EXPOSURE_ABSOLUTE:
		ret = ov2680_q_exposure(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FOCAL_ABSOLUTE:
		ret = ov2680_g_focal(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FNUMBER_ABSOLUTE:
		ret = ov2680_g_fnumber(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FNUMBER_RANGE:
		ret = ov2680_g_fnumber_range(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_BIN_FACTOR_HORZ:
		ret = ov2680_g_bin_factor_x(&dev->sd, &ctrl->val);
		break;
@@ -556,39 +525,6 @@ static const struct v4l2_ctrl_config ov2680_controls[] = {
		.def = 0x00,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FOCAL_ABSOLUTE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "focal length",
		.min = OV2680_FOCAL_LENGTH_DEFAULT,
		.max = OV2680_FOCAL_LENGTH_DEFAULT,
		.step = 0x01,
		.def = OV2680_FOCAL_LENGTH_DEFAULT,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FNUMBER_ABSOLUTE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "f-number",
		.min = OV2680_F_NUMBER_DEFAULT,
		.max = OV2680_F_NUMBER_DEFAULT,
		.step = 0x01,
		.def = OV2680_F_NUMBER_DEFAULT,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FNUMBER_RANGE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "f-number range",
		.min = OV2680_F_NUMBER_RANGE,
		.max = OV2680_F_NUMBER_RANGE,
		.step = 0x01,
		.def = OV2680_F_NUMBER_RANGE,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_BIN_FACTOR_HORZ,
+0 −63
Original line number Diff line number Diff line
@@ -261,27 +261,6 @@ static int ov2722_write_reg_array(struct i2c_client *client,
	return __ov2722_flush_reg_array(client, &ctrl);
}

static int ov2722_g_focal(struct v4l2_subdev *sd, s32 *val)
{
	*val = (OV2722_FOCAL_LENGTH_NUM << 16) | OV2722_FOCAL_LENGTH_DEM;
	return 0;
}

static int ov2722_g_fnumber(struct v4l2_subdev *sd, s32 *val)
{
	/*const f number for imx*/
	*val = (OV2722_F_NUMBER_DEFAULT_NUM << 16) | OV2722_F_NUMBER_DEM;
	return 0;
}

static int ov2722_g_fnumber_range(struct v4l2_subdev *sd, s32 *val)
{
	*val = (OV2722_F_NUMBER_DEFAULT_NUM << 24) |
	       (OV2722_F_NUMBER_DEM << 16) |
	       (OV2722_F_NUMBER_DEFAULT_NUM << 8) | OV2722_F_NUMBER_DEM;
	return 0;
}

static int ov2722_get_intg_factor(struct i2c_client *client,
				  struct camera_mipi_info *info,
				  const struct ov2722_resolution *res)
@@ -547,15 +526,6 @@ static int ov2722_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
	case V4L2_CID_EXPOSURE_ABSOLUTE:
		ret = ov2722_q_exposure(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FOCAL_ABSOLUTE:
		ret = ov2722_g_focal(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FNUMBER_ABSOLUTE:
		ret = ov2722_g_fnumber(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_FNUMBER_RANGE:
		ret = ov2722_g_fnumber_range(&dev->sd, &ctrl->val);
		break;
	case V4L2_CID_LINK_FREQ:
		val = dev->res->mipi_freq;
		if (val == 0)
@@ -586,39 +556,6 @@ static const struct v4l2_ctrl_config ov2722_controls[] = {
		.def = 0x00,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FOCAL_ABSOLUTE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "focal length",
		.min = OV2722_FOCAL_LENGTH_DEFAULT,
		.max = OV2722_FOCAL_LENGTH_DEFAULT,
		.step = 0x01,
		.def = OV2722_FOCAL_LENGTH_DEFAULT,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FNUMBER_ABSOLUTE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "f-number",
		.min = OV2722_F_NUMBER_DEFAULT,
		.max = OV2722_F_NUMBER_DEFAULT,
		.step = 0x01,
		.def = OV2722_F_NUMBER_DEFAULT,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_FNUMBER_RANGE,
		.type = V4L2_CTRL_TYPE_INTEGER,
		.name = "f-number range",
		.min = OV2722_F_NUMBER_RANGE,
		.max = OV2722_F_NUMBER_RANGE,
		.step = 0x01,
		.def = OV2722_F_NUMBER_RANGE,
		.flags = 0,
	},
	{
		.ops = &ctrl_ops,
		.id = V4L2_CID_LINK_FREQ,
Loading