From 60879db1480a780ca0be9895ed266b5c812397fd Mon Sep 17 00:00:00 2001 From: Erik Andr?n Date: Thu, 8 Jan 2009 22:11:05 +0100 Subject: gspca - m5602-mt9m111: Set the cached v4l2 ctrl values From: Erik Andr?n When we resume the machine we want the previously set values, not the default values. Fix this for the mt9m111 sensor Priority: normal Signed-off-by: Erik Andr?n --- linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c') diff --git a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c index 519548d07..8700f37de 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c @@ -136,12 +136,16 @@ sensor_found: sensor_settings[i] = mt9m111_ctrls[i].qctrl.default_value; sd->sensor_priv = sensor_settings; + if (dump_sensor) + mt9m111_dump_registers(sd); + return 0; } int mt9m111_init(struct sd *sd) { int i, err = 0; + s32 *sensor_settings = sd->sensor_priv; /* Init the sensor */ for (i = 0; i < ARRAY_SIZE(init_mt9m111) && !err; i++) { @@ -159,10 +163,17 @@ int mt9m111_init(struct sd *sd) } } - if (dump_sensor) - mt9m111_dump_registers(sd); + err = mt9m111_set_vflip(&sd->gspca_dev, sensor_settings[VFLIP_IDX]); + if (err < 0) + return err; + + err = mt9m111_set_hflip(&sd->gspca_dev, sensor_settings[HFLIP_IDX]); + if (err < 0) + return err; + + err = mt9m111_set_gain(&sd->gspca_dev, sensor_settings[GAIN_IDX]); - return (err < 0) ? err : 0; + return err; } void mt9m111_disconnect(struct sd *sd) -- cgit v1.2.3