diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2009-01-08 22:11:05 +0100 |
---|---|---|
committer | Erik Andr?n <erik.andren@gmail.com> | 2009-01-08 22:11:05 +0100 |
commit | 60879db1480a780ca0be9895ed266b5c812397fd (patch) | |
tree | 62e51c0ca98c5a27175d78ff07a554e6e5b7c90b /linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c | |
parent | 617c15eff1b6db4e52c5147c9ab5f1650badd05a (diff) | |
download | mediapointer-dvb-s2-60879db1480a780ca0be9895ed266b5c812397fd.tar.gz mediapointer-dvb-s2-60879db1480a780ca0be9895ed266b5c812397fd.tar.bz2 |
gspca - m5602-mt9m111: Set the cached v4l2 ctrl values
From: Erik Andr?n <erik.andren@gmail.com>
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 <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c')
-rw-r--r-- | linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c | 17 |
1 files changed, 14 insertions, 3 deletions
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) |