diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2009-01-07 22:05:08 +0100 |
---|---|---|
committer | Erik Andr?n <erik.andren@gmail.com> | 2009-01-07 22:05:08 +0100 |
commit | 81addebd5c8a4e038baef9281d335145168c15b1 (patch) | |
tree | 1be50072e434ed8e2ba43e01abbd699415014b48 /linux/drivers/media/video/gspca/m5602/m5602_po1030.c | |
parent | de15a6450b6928374c8c4c6d6dfdf408093a44ba (diff) | |
download | mediapointer-dvb-s2-81addebd5c8a4e038baef9281d335145168c15b1.tar.gz mediapointer-dvb-s2-81addebd5c8a4e038baef9281d335145168c15b1.tar.bz2 |
gspca - m5602-po1030: Set all v4l2 controls at sensor init
From: Erik Andr?n <erik.andren@gmail.com>
Previously many of the v4l2 ctrls were set to their initial values at resume from ram/disk. This patch enforces the values stored in the ctrl cache.
Priority: normal
Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media/video/gspca/m5602/m5602_po1030.c')
-rw-r--r-- | linux/drivers/media/video/gspca/m5602/m5602_po1030.c | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_po1030.c b/linux/drivers/media/video/gspca/m5602/m5602_po1030.c index 800b5f4cb..7ec3fbffc 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_po1030.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_po1030.c @@ -127,7 +127,7 @@ static void po1030_dump_registers(struct sd *sd); int po1030_probe(struct sd *sd) { u8 prod_id = 0, ver_id = 0, i; - s32 *sensor_settings = sd->sensor_priv; + s32 *sensor_settings; if (force_sensor) { if (force_sensor == PO1030_SENSOR) { @@ -177,11 +177,16 @@ sensor_found: for (i = 0; i < ARRAY_SIZE(po1030_ctrls); i++) sensor_settings[i] = po1030_ctrls[i].qctrl.default_value; sd->sensor_priv = sensor_settings; + + if (dump_sensor) + po1030_dump_registers(sd); + return 0; } int po1030_init(struct sd *sd) { + s32 *sensor_settings = sd->sensor_priv; int i, err = 0; /* Init the sensor */ @@ -206,10 +211,33 @@ int po1030_init(struct sd *sd) return -EINVAL; } } + if (err < 0) + return err; - if (dump_sensor) - po1030_dump_registers(sd); + err = po1030_set_exposure(&sd->gspca_dev, + sensor_settings[EXPOSURE_IDX]); + if (err < 0) + return err; + + err = po1030_set_gain(&sd->gspca_dev, sensor_settings[GAIN_IDX]); + if (err < 0) + return err; + + err = po1030_set_hflip(&sd->gspca_dev, sensor_settings[HFLIP_IDX]); + if (err < 0) + return err; + + err = po1030_set_vflip(&sd->gspca_dev, sensor_settings[VFLIP_IDX]); + if (err < 0) + return err; + + err = po1030_set_red_balance(&sd->gspca_dev, + sensor_settings[RED_BALANCE_IDX]); + if (err < 0) + return err; + err = po1030_set_red_balance(&sd->gspca_dev, + sensor_settings[BLUE_BALANCE_IDX]); return err; } |