aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/zc3xx.c
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-08-04 05:07:23 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 22:43:02 -0400
commitc39da6a37566733d703bbd9a489fe39e95ea4df1 (patch)
treea05e5343becddc3a00248e9aac6b536267a968c3 /drivers/media/video/gspca/zc3xx.c
parent6d31450544c75d99e1f4dbb21d5db6b2ca6ada4d (diff)
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,
6572 const struct usb_device_id *id) 6572 const struct usb_device_id *id)
6573{ 6573{
6574 struct sd *sd = (struct sd *) gspca_dev; 6574 struct sd *sd = (struct sd *) gspca_dev;
6575
6576 /* define some sensors from the vendor/product */
6577 sd->sensor = id->driver_info;
6578
6579 sd->sharpness = SHARPNESS_DEF;
6580 sd->brightness = BRIGHTNESS_DEF;
6581 sd->contrast = CONTRAST_DEF;
6582 sd->autogain = AUTOGAIN_DEF;
6583 sd->lightfreq = FREQ_DEF;
6584 sd->quality = QUALITY_DEF;
6585
6586 return 0;
6587}
6588
6589/* this function is called at probe and resume time */
6590static int sd_init(struct gspca_dev *gspca_dev)
6591{
6592 struct sd *sd = (struct sd *) gspca_dev;
6575 struct cam *cam; 6593 struct cam *cam;
6576 int sensor; 6594 int sensor;
6577 static const u8 gamma[SENSOR_MAX] = { 6595 static const u8 gamma[SENSOR_MAX] = {
@@ -6617,9 +6635,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
6617 [SENSOR_TAS5130C_VF0250] = 1, 6635 [SENSOR_TAS5130C_VF0250] = 1,
6618 }; 6636 };
6619 6637
6620 /* define some sensors from the vendor/product */
6621 sd->sharpness = SHARPNESS_DEF;
6622 sd->sensor = id->driver_info;
6623 sensor = zcxx_probeSensor(gspca_dev); 6638 sensor = zcxx_probeSensor(gspca_dev);
6624 if (sensor >= 0) 6639 if (sensor >= 0)
6625 PDEBUG(D_PROBE, "probe sensor -> %04x", sensor); 6640 PDEBUG(D_PROBE, "probe sensor -> %04x", sensor);
@@ -6775,12 +6790,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
6775 cam->nmodes = ARRAY_SIZE(broken_vga_mode); 6790 cam->nmodes = ARRAY_SIZE(broken_vga_mode);
6776 break; 6791 break;
6777 } 6792 }
6778 sd->brightness = BRIGHTNESS_DEF;
6779 sd->contrast = CONTRAST_DEF;
6780 sd->gamma = gamma[sd->sensor]; 6793 sd->gamma = gamma[sd->sensor];
6781 sd->autogain = AUTOGAIN_DEF;
6782 sd->lightfreq = FREQ_DEF;
6783 sd->quality = QUALITY_DEF;
6784 6794
6785 switch (sd->sensor) { 6795 switch (sd->sensor) {
6786 case SENSOR_HV7131B: 6796 case SENSOR_HV7131B:
@@ -6790,15 +6800,9 @@ static int sd_config(struct gspca_dev *gspca_dev,
6790 break; 6800 break;
6791 } 6801 }
6792 6802
6793 return gspca_dev->usb_err;
6794}
6795
6796/* this function is called at probe and resume time */
6797static int sd_init(struct gspca_dev *gspca_dev)
6798{
6799 /* switch off the led */ 6803 /* switch off the led */
6800 reg_w(gspca_dev, 0x01, 0x0000); 6804 reg_w(gspca_dev, 0x01, 0x0000);
6801 return 0; 6805 return gspca_dev->usb_err;
6802} 6806}
6803 6807
6804static int sd_start(struct gspca_dev *gspca_dev) 6808static int sd_start(struct gspca_dev *gspca_dev)