aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/vc032x.c
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-07-26 06:59:23 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 22:42:53 -0400
commitbb44f5682b7b7829cf010d6dad9c75f58d1f767b (patch)
tree7e81904fd88ede9204cf3eee2afd1e98e67a2fb4 /drivers/media/video/gspca/vc032x.c
parent486cb2d5b01e77fb3cd93c4c0810100d59a45c8b (diff)
V4L/DVB: gspca - vc032x: Do 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/vc032x.c')
-rw-r--r--drivers/media/video/gspca/vc032x.c60
1 files changed, 32 insertions, 28 deletions
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c
index d450a95480bd..48a8af3078a3 100644
--- a/drivers/media/video/gspca/vc032x.c
+++ b/drivers/media/video/gspca/vc032x.c
@@ -3391,6 +3391,33 @@ static int sd_config(struct gspca_dev *gspca_dev,
3391 const struct usb_device_id *id) 3391 const struct usb_device_id *id)
3392{ 3392{
3393 struct sd *sd = (struct sd *) gspca_dev; 3393 struct sd *sd = (struct sd *) gspca_dev;
3394
3395 sd->bridge = id->driver_info >> 8;
3396 sd->flags = id->driver_info & 0xff;
3397
3398 if (id->idVendor == 0x046d &&
3399 (id->idProduct == 0x0892 || id->idProduct == 0x0896))
3400 sd->sensor = SENSOR_POxxxx; /* no probe */
3401
3402 sd->brightness = BRIGHTNESS_DEF;
3403 sd->contrast = CONTRAST_DEF;
3404 sd->colors = COLOR_DEF;
3405 sd->hflip = HFLIP_DEF;
3406 sd->vflip = VFLIP_DEF;
3407 sd->lightfreq = FREQ_DEF;
3408 sd->sharpness = SHARPNESS_DEF;
3409 sd->gain = GAIN_DEF;
3410 sd->exposure = EXPOSURE_DEF;
3411 sd->autogain = AUTOGAIN_DEF;
3412 sd->backlight = BACKLIGHT_DEF;
3413
3414 return 0;
3415}
3416
3417/* this function is called at probe and resume time */
3418static int sd_init(struct gspca_dev *gspca_dev)
3419{
3420 struct sd *sd = (struct sd *) gspca_dev;
3394 struct cam *cam; 3421 struct cam *cam;
3395 int sensor; 3422 int sensor;
3396 static u8 npkt[] = { /* number of packets per ISOC message */ 3423 static u8 npkt[] = { /* number of packets per ISOC message */
@@ -3406,14 +3433,11 @@ static int sd_config(struct gspca_dev *gspca_dev,
3406 128, /* POxxxx 9 */ 3433 128, /* POxxxx 9 */
3407 }; 3434 };
3408 3435
3409 cam = &gspca_dev->cam; 3436 if (sd->sensor != SENSOR_POxxxx)
3410 sd->bridge = id->driver_info >> 8;
3411 sd->flags = id->driver_info & 0xff;
3412 if (id->idVendor == 0x046d &&
3413 (id->idProduct == 0x0892 || id->idProduct == 0x0896))
3414 sensor = SENSOR_POxxxx;
3415 else
3416 sensor = vc032x_probe_sensor(gspca_dev); 3437 sensor = vc032x_probe_sensor(gspca_dev);
3438 else
3439 sensor = sd->sensor;
3440
3417 switch (sensor) { 3441 switch (sensor) {
3418 case -1: 3442 case -1:
3419 PDEBUG(D_PROBE, "Unknown sensor..."); 3443 PDEBUG(D_PROBE, "Unknown sensor...");
@@ -3452,6 +3476,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
3452 } 3476 }
3453 sd->sensor = sensor; 3477 sd->sensor = sensor;
3454 3478
3479 cam = &gspca_dev->cam;
3455 if (sd->bridge == BRIDGE_VC0321) { 3480 if (sd->bridge == BRIDGE_VC0321) {
3456 cam->cam_mode = vc0321_mode; 3481 cam->cam_mode = vc0321_mode;
3457 cam->nmodes = ARRAY_SIZE(vc0321_mode); 3482 cam->nmodes = ARRAY_SIZE(vc0321_mode);
@@ -3480,32 +3505,11 @@ static int sd_config(struct gspca_dev *gspca_dev,
3480 } 3505 }
3481 } 3506 }
3482 cam->npkt = npkt[sd->sensor]; 3507 cam->npkt = npkt[sd->sensor];
3483
3484 sd->brightness = BRIGHTNESS_DEF;
3485 sd->contrast = CONTRAST_DEF;
3486 sd->colors = COLOR_DEF;
3487 sd->hflip = HFLIP_DEF;
3488 sd->vflip = VFLIP_DEF;
3489 sd->lightfreq = FREQ_DEF;
3490 sd->sharpness = SHARPNESS_DEF;
3491 sd->gain = GAIN_DEF;
3492 sd->exposure = EXPOSURE_DEF;
3493 sd->autogain = AUTOGAIN_DEF;
3494 sd->backlight = BACKLIGHT_DEF;
3495
3496 gspca_dev->ctrl_dis = ctrl_dis[sd->sensor]; 3508 gspca_dev->ctrl_dis = ctrl_dis[sd->sensor];
3497 3509
3498 if (sd->sensor == SENSOR_OV7670) 3510 if (sd->sensor == SENSOR_OV7670)
3499 sd->flags |= FL_HFLIP | FL_VFLIP; 3511 sd->flags |= FL_HFLIP | FL_VFLIP;
3500 3512
3501 return 0;
3502}
3503
3504/* this function is called at probe and resume time */
3505static int sd_init(struct gspca_dev *gspca_dev)
3506{
3507 struct sd *sd = (struct sd *) gspca_dev;
3508
3509 if (sd->bridge == BRIDGE_VC0321) { 3513 if (sd->bridge == BRIDGE_VC0321) {
3510 reg_r(gspca_dev, 0x8a, 0, 3); 3514 reg_r(gspca_dev, 0x8a, 0, 3);
3511 reg_w(gspca_dev, 0x87, 0x00, 0x0f0f); 3515 reg_w(gspca_dev, 0x87, 0x00, 0x0f0f);