aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/gspca/w996Xcf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/gspca/w996Xcf.c')
-rw-r--r--drivers/media/usb/gspca/w996Xcf.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/media/usb/gspca/w996Xcf.c b/drivers/media/usb/gspca/w996Xcf.c
index 2165da0c7ce1..fb9fe2ef3a6f 100644
--- a/drivers/media/usb/gspca/w996Xcf.c
+++ b/drivers/media/usb/gspca/w996Xcf.c
@@ -430,11 +430,11 @@ static void w9968cf_set_crop_window(struct sd *sd)
430 #define SC(x) ((x) << 10) 430 #define SC(x) ((x) << 10)
431 431
432 /* Scaling factors */ 432 /* Scaling factors */
433 fw = SC(sd->gspca_dev.width) / max_width; 433 fw = SC(sd->gspca_dev.pixfmt.width) / max_width;
434 fh = SC(sd->gspca_dev.height) / max_height; 434 fh = SC(sd->gspca_dev.pixfmt.height) / max_height;
435 435
436 cw = (fw >= fh) ? max_width : SC(sd->gspca_dev.width) / fh; 436 cw = (fw >= fh) ? max_width : SC(sd->gspca_dev.pixfmt.width) / fh;
437 ch = (fw >= fh) ? SC(sd->gspca_dev.height) / fw : max_height; 437 ch = (fw >= fh) ? SC(sd->gspca_dev.pixfmt.height) / fw : max_height;
438 438
439 sd->sensor_width = max_width; 439 sd->sensor_width = max_width;
440 sd->sensor_height = max_height; 440 sd->sensor_height = max_height;
@@ -454,34 +454,34 @@ static void w9968cf_mode_init_regs(struct sd *sd)
454 454
455 w9968cf_set_crop_window(sd); 455 w9968cf_set_crop_window(sd);
456 456
457 reg_w(sd, 0x14, sd->gspca_dev.width); 457 reg_w(sd, 0x14, sd->gspca_dev.pixfmt.width);
458 reg_w(sd, 0x15, sd->gspca_dev.height); 458 reg_w(sd, 0x15, sd->gspca_dev.pixfmt.height);
459 459
460 /* JPEG width & height */ 460 /* JPEG width & height */
461 reg_w(sd, 0x30, sd->gspca_dev.width); 461 reg_w(sd, 0x30, sd->gspca_dev.pixfmt.width);
462 reg_w(sd, 0x31, sd->gspca_dev.height); 462 reg_w(sd, 0x31, sd->gspca_dev.pixfmt.height);
463 463
464 /* Y & UV frame buffer strides (in WORD) */ 464 /* Y & UV frame buffer strides (in WORD) */
465 if (w9968cf_vga_mode[sd->gspca_dev.curr_mode].pixelformat == 465 if (w9968cf_vga_mode[sd->gspca_dev.curr_mode].pixelformat ==
466 V4L2_PIX_FMT_JPEG) { 466 V4L2_PIX_FMT_JPEG) {
467 reg_w(sd, 0x2c, sd->gspca_dev.width / 2); 467 reg_w(sd, 0x2c, sd->gspca_dev.pixfmt.width / 2);
468 reg_w(sd, 0x2d, sd->gspca_dev.width / 4); 468 reg_w(sd, 0x2d, sd->gspca_dev.pixfmt.width / 4);
469 } else 469 } else
470 reg_w(sd, 0x2c, sd->gspca_dev.width); 470 reg_w(sd, 0x2c, sd->gspca_dev.pixfmt.width);
471 471
472 reg_w(sd, 0x00, 0xbf17); /* reset everything */ 472 reg_w(sd, 0x00, 0xbf17); /* reset everything */
473 reg_w(sd, 0x00, 0xbf10); /* normal operation */ 473 reg_w(sd, 0x00, 0xbf10); /* normal operation */
474 474
475 /* Transfer size in WORDS (for UYVY format only) */ 475 /* Transfer size in WORDS (for UYVY format only) */
476 val = sd->gspca_dev.width * sd->gspca_dev.height; 476 val = sd->gspca_dev.pixfmt.width * sd->gspca_dev.pixfmt.height;
477 reg_w(sd, 0x3d, val & 0xffff); /* low bits */ 477 reg_w(sd, 0x3d, val & 0xffff); /* low bits */
478 reg_w(sd, 0x3e, val >> 16); /* high bits */ 478 reg_w(sd, 0x3e, val >> 16); /* high bits */
479 479
480 if (w9968cf_vga_mode[sd->gspca_dev.curr_mode].pixelformat == 480 if (w9968cf_vga_mode[sd->gspca_dev.curr_mode].pixelformat ==
481 V4L2_PIX_FMT_JPEG) { 481 V4L2_PIX_FMT_JPEG) {
482 /* We may get called multiple times (usb isoc bw negotiat.) */ 482 /* We may get called multiple times (usb isoc bw negotiat.) */
483 jpeg_define(sd->jpeg_hdr, sd->gspca_dev.height, 483 jpeg_define(sd->jpeg_hdr, sd->gspca_dev.pixfmt.height,
484 sd->gspca_dev.width, 0x22); /* JPEG 420 */ 484 sd->gspca_dev.pixfmt.width, 0x22); /* JPEG 420 */
485 jpeg_set_qual(sd->jpeg_hdr, v4l2_ctrl_g_ctrl(sd->jpegqual)); 485 jpeg_set_qual(sd->jpeg_hdr, v4l2_ctrl_g_ctrl(sd->jpegqual));
486 w9968cf_upload_quantizationtables(sd); 486 w9968cf_upload_quantizationtables(sd);
487 v4l2_ctrl_grab(sd->jpegqual, true); 487 v4l2_ctrl_grab(sd->jpegqual, true);