summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/zc3xx.c
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-08-04 06:07:23 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 23:43:02 -0300
commitc39da6a37566733d703bbd9a489fe39e95ea4df1 (patch)
treea05e5343becddc3a00248e9aac6b536267a968c3 /drivers/media/video/gspca/zc3xx.c
parent6d31450544c75d99e1f4dbb21d5db6b2ca6ada4d (diff)
downloadtalos-op-linux-c39da6a37566733d703bbd9a489fe39e95ea4df1.tar.gz
talos-op-linux-c39da6a37566733d703bbd9a489fe39e95ea4df1.zip
V4L/DVB: gspca - zc3xx: Do the sensor probe at resume time
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/zc3xx.c')
-rw-r--r--drivers/media/video/gspca/zc3xx.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index a9af568305ac..2743ed47d9b7 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -6572,6 +6572,24 @@ static int sd_config(struct gspca_dev *gspca_dev,
const struct usb_device_id *id)
{
struct sd *sd = (struct sd *) gspca_dev;
+
+ /* define some sensors from the vendor/product */
+ sd->sensor = id->driver_info;
+
+ sd->sharpness = SHARPNESS_DEF;
+ sd->brightness = BRIGHTNESS_DEF;
+ sd->contrast = CONTRAST_DEF;
+ sd->autogain = AUTOGAIN_DEF;
+ sd->lightfreq = FREQ_DEF;
+ sd->quality = QUALITY_DEF;
+
+ return 0;
+}
+
+/* this function is called at probe and resume time */
+static int sd_init(struct gspca_dev *gspca_dev)
+{
+ struct sd *sd = (struct sd *) gspca_dev;
struct cam *cam;
int sensor;
static const u8 gamma[SENSOR_MAX] = {
@@ -6617,9 +6635,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
[SENSOR_TAS5130C_VF0250] = 1,
};
- /* define some sensors from the vendor/product */
- sd->sharpness = SHARPNESS_DEF;
- sd->sensor = id->driver_info;
sensor = zcxx_probeSensor(gspca_dev);
if (sensor >= 0)
PDEBUG(D_PROBE, "probe sensor -> %04x", sensor);
@@ -6775,12 +6790,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
cam->nmodes = ARRAY_SIZE(broken_vga_mode);
break;
}
- sd->brightness = BRIGHTNESS_DEF;
- sd->contrast = CONTRAST_DEF;
sd->gamma = gamma[sd->sensor];
- sd->autogain = AUTOGAIN_DEF;
- sd->lightfreq = FREQ_DEF;
- sd->quality = QUALITY_DEF;
switch (sd->sensor) {
case SENSOR_HV7131B:
@@ -6790,15 +6800,9 @@ static int sd_config(struct gspca_dev *gspca_dev,
break;
}
- return gspca_dev->usb_err;
-}
-
-/* this function is called at probe and resume time */
-static int sd_init(struct gspca_dev *gspca_dev)
-{
/* switch off the led */
reg_w(gspca_dev, 0x01, 0x0000);
- return 0;
+ return gspca_dev->usb_err;
}
static int sd_start(struct gspca_dev *gspca_dev)
OpenPOWER on IntegriCloud