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

Commit e4cc4fcc authored by Erik Andr?n's avatar Erik Andr?n Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (11411): gspca - m5602: Rework v4l ctrl handling in all sensors



Previously, all sensors allocated a part of a large ctrl vector.
Define this vector separately for each sensor instead.

Signed-off-by: default avatarErik Andrén <erik.andren@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent e335f224
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -8,4 +8,3 @@ gspca_m5602-objs := m5602_core.o \
		    m5602_s5k4aa.o

EXTRA_CFLAGS += -Idrivers/media/video/gspca
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ struct sd {
	char *name;

	/* A pointer to the currently connected sensor */
	struct m5602_sensor *sensor;
	const struct m5602_sensor *sensor;

	struct sd_desc *desc;

+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ int mt9m111_probe(struct sd *sd)
	sd->gspca_dev.cam.cam_mode = mt9m111.modes;
	sd->gspca_dev.cam.nmodes = mt9m111.nmodes;
	sd->desc->ctrls = mt9m111.ctrls;
	sd->desc->nctrls = mt9m111.nctrls;
	sd->desc->nctrls = ARRAY_SIZE(mt9m111_ctrls);
	return 0;
}

+12 −13
Original line number Diff line number Diff line
@@ -94,18 +94,7 @@ int mt9m111_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
int mt9m111_get_gain(struct gspca_dev *gspca_dev, __s32 *val);
int mt9m111_set_gain(struct gspca_dev *gspca_dev, __s32 val);

static struct m5602_sensor mt9m111 = {
	.name = "MT9M111",

	.i2c_slave_id = 0xba,
	.i2c_regW = 2,

	.probe = mt9m111_probe,
	.init = mt9m111_init,
	.power_down = mt9m111_power_down,

	.nctrls = 3,
	.ctrls = {
const static struct ctrl mt9m111_ctrls[] = {
	{
		{
			.id		= V4L2_CID_VFLIP,
@@ -144,7 +133,17 @@ static struct m5602_sensor mt9m111 = {
		.set = mt9m111_set_gain,
		.get = mt9m111_get_gain
	}
	},
};

static struct m5602_sensor mt9m111 = {
	.name = "MT9M111",

	.i2c_slave_id = 0xba,
	.i2c_regW = 2,

	.probe = mt9m111_probe,
	.init = mt9m111_init,
	.power_down = mt9m111_power_down,

	.nmodes = 1,
	.modes = {
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ int ov9650_probe(struct sd *sd)
	sd->gspca_dev.cam.cam_mode = ov9650.modes;
	sd->gspca_dev.cam.nmodes = ov9650.nmodes;
	sd->desc->ctrls = ov9650.ctrls;
	sd->desc->nctrls = ov9650.nctrls;
	sd->desc->nctrls = ARRAY_SIZE(ov9650_ctrls);
	return 0;
}

Loading