Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (3599b): Whitespace cleanups under drivers/media

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

+3009 -3009
+14 -14
drivers/media/video/Kconfig
··· 370 370 # 371 371 372 372 menu "V4L USB devices" 373 - depends on USB && VIDEO_DEV 373 + depends on USB && VIDEO_DEV 374 374 375 375 source "drivers/media/video/em28xx/Kconfig" 376 376 ··· 528 528 ---help--- 529 529 Say Y here if you want support for cameras based on OV681 or 530 530 Winbond W9967CF/W9968CF JPEG USB Dual Mode Camera Chips. 531 - 531 + 532 532 This driver has an optional plugin, which is distributed as a 533 - separate module only (released under GPL). It allows to use higher 534 - resolutions and framerates, but cannot be included in the official 533 + separate module only (released under GPL). It allows to use higher 534 + resolutions and framerates, but cannot be included in the official 535 535 Linux kernel for performance purposes. 536 536 537 537 See <file:Documentation/usb/w9968cf.txt> for more informations. 538 538 539 539 This driver uses the Video For Linux and the I2C APIs. It needs the 540 540 OmniVision Camera Chip support as well. You must say Y or M to 541 - "Video For Linux", "I2C Support" and "OmniVision Camera Chip 541 + "Video For Linux", "I2C Support" and "OmniVision Camera Chip 542 542 support" to use this driver. 543 543 544 544 To compile this driver as a module, choose M here: the ··· 564 564 depends on USB && VIDEO_DEV 565 565 ---help--- 566 566 Say Y or M here if you want to use one of these Philips & OEM 567 - webcams: 568 - * Philips PCA645, PCA646 569 - * Philips PCVC675, PCVC680, PCVC690 570 - * Philips PCVC720/40, PCVC730, PCVC740, PCVC750 567 + webcams: 568 + * Philips PCA645, PCA646 569 + * Philips PCVC675, PCVC680, PCVC690 570 + * Philips PCVC720/40, PCVC730, PCVC740, PCVC750 571 571 * Askey VC010 572 - * Logitech QuickCam Pro 3000, 4000, 'Zoom', 'Notebook Pro' 573 - and 'Orbit'/'Sphere' 574 - * Samsung MPC-C10, MPC-C30 572 + * Logitech QuickCam Pro 3000, 4000, 'Zoom', 'Notebook Pro' 573 + and 'Orbit'/'Sphere' 574 + * Samsung MPC-C10, MPC-C30 575 575 * Creative Webcam 5, Pro Ex 576 576 * SOTEC Afina Eye 577 577 * Visionite VCS-UC300, VCS-UM100 578 - 578 + 579 579 The PCA635, PCVC665 and PCVC720/20 are not supported by this driver 580 - and never will be, but the 665 and 720/20 are supported by other 580 + and never will be, but the 665 and 720/20 are supported by other 581 581 drivers. 582 582 583 583 See <file:Documentation/usb/philips.txt> for more information and
+5 -5
drivers/media/video/adv7170.c
··· 1 - /* 1 + /* 2 2 * adv7170 - adv7170, adv7171 video encoder driver version 0.0.1 3 3 * 4 4 * Copyright (C) 2002 Maxim Yevtyushkin <max@linuxmedialabs.com> 5 5 * 6 - * Based on adv7176 driver by: 6 + * Based on adv7176 driver by: 7 7 * 8 8 * Copyright (C) 1998 Dave Perks <dperks@ibm.net> 9 9 * Copyright (C) 1999 Wolfgang Scherr <scherr@net4you.net> ··· 173 173 static const unsigned char init_NTSC[] = { 174 174 0x00, 0x10, // MR0 175 175 0x01, 0x20, // MR1 176 - 0x02, 0x0e, // MR2 RTC control: bits 2 and 1 176 + 0x02, 0x0e, // MR2 RTC control: bits 2 and 1 177 177 0x03, 0x80, // MR3 178 178 0x04, 0x30, // MR4 179 179 0x05, 0x00, // Reserved ··· 196 196 0x16, 0x00, // CGMS_WSS_0 197 197 0x17, 0x00, // CGMS_WSS_1 198 198 0x18, 0x00, // CGMS_WSS_2 199 - 0x19, 0x00, // Teletext Ctl 199 + 0x19, 0x00, // Teletext Ctl 200 200 }; 201 201 202 202 static const unsigned char init_PAL[] = { ··· 381 381 }; 382 382 383 383 static unsigned short ignore = I2C_CLIENT_END; 384 - 384 + 385 385 static struct i2c_client_address_data addr_data = { 386 386 .normal_i2c = normal_i2c, 387 387 .probe = &ignore,
+3 -3
drivers/media/video/adv7175.c
··· 1 - /* 1 + /* 2 2 * adv7175 - adv7175a video encoder driver version 0.0.3 3 3 * 4 4 * Copyright (C) 1998 Dave Perks <dperks@ibm.net> ··· 233 233 sizeof(init_common)); 234 234 adv7175_write(client, 0x07, TR0MODE | TR0RST); 235 235 adv7175_write(client, 0x07, TR0MODE); 236 - break; 236 + break; 237 237 238 238 case ENCODER_GET_CAPABILITIES: 239 239 { ··· 399 399 }; 400 400 401 401 static unsigned short ignore = I2C_CLIENT_END; 402 - 402 + 403 403 static struct i2c_client_address_data addr_data = { 404 404 .normal_i2c = normal_i2c, 405 405 .probe = &ignore,
+27 -27
drivers/media/video/arv.c
··· 161 161 { 162 162 int i; 163 163 164 - /* Slave Address */ 165 - ar_outl(addr, PLDI2CDATA); 164 + /* Slave Address */ 165 + ar_outl(addr, PLDI2CDATA); 166 166 wait_for_vsync(); 167 167 168 - /* Start */ 169 - ar_outl(1, PLDI2CCND); 168 + /* Start */ 169 + ar_outl(1, PLDI2CCND); 170 170 wait_acknowledge(); 171 171 172 172 /* Transfer data 1 */ 173 - ar_outl(data1, PLDI2CDATA); 173 + ar_outl(data1, PLDI2CDATA); 174 174 wait_for_vsync(); 175 - ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN); 175 + ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN); 176 176 wait_acknowledge(); 177 177 178 178 /* Transfer data 2 */ 179 - ar_outl(data2, PLDI2CDATA); 179 + ar_outl(data2, PLDI2CDATA); 180 180 wait_for_vsync(); 181 - ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN); 181 + ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN); 182 182 wait_acknowledge(); 183 183 184 184 if (n == 3) { 185 185 /* Transfer data 3 */ 186 - ar_outl(data3, PLDI2CDATA); 186 + ar_outl(data3, PLDI2CDATA); 187 187 wait_for_vsync(); 188 - ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN); 188 + ar_outl(PLDI2CSTEN_STEN, PLDI2CSTEN); 189 189 wait_acknowledge(); 190 - } 190 + } 191 191 192 - /* Stop */ 192 + /* Stop */ 193 193 for (i = 0; i < 100; i++) 194 194 cpu_relax(); 195 - ar_outl(2, PLDI2CCND); 196 - ar_outl(2, PLDI2CCND); 195 + ar_outl(2, PLDI2CCND); 196 + ar_outl(2, PLDI2CCND); 197 197 198 198 while (ar_inl(PLDI2CSTS) & PLDI2CSTS_BB) 199 199 cpu_relax(); ··· 204 204 { 205 205 DEBUG(1, "init_iic:\n"); 206 206 207 - /* 207 + /* 208 208 * ICU Setting (iic) 209 209 */ 210 - /* I2C Setting */ 211 - ar_outl(0x0, PLDI2CCR); /* I2CCR Disable */ 212 - ar_outl(0x0300, PLDI2CMOD); /* I2CMOD ACK/8b-data/7b-addr/auto */ 213 - ar_outl(0x1, PLDI2CACK); /* I2CACK ACK */ 210 + /* I2C Setting */ 211 + ar_outl(0x0, PLDI2CCR); /* I2CCR Disable */ 212 + ar_outl(0x0300, PLDI2CMOD); /* I2CMOD ACK/8b-data/7b-addr/auto */ 213 + ar_outl(0x1, PLDI2CACK); /* I2CACK ACK */ 214 214 215 215 /* I2C CLK */ 216 - /* 50MH-100k */ 216 + /* 50MH-100k */ 217 217 if (freq == 75) { 218 - ar_outl(369, PLDI2CFREQ); /* BCLK = 75MHz */ 218 + ar_outl(369, PLDI2CFREQ); /* BCLK = 75MHz */ 219 219 } else if (freq == 50) { 220 220 ar_outl(244, PLDI2CFREQ); /* BCLK = 50MHz */ 221 221 } else { 222 222 ar_outl(244, PLDI2CFREQ); /* default: BCLK = 50MHz */ 223 223 } 224 - ar_outl(0x1, PLDI2CCR); /* I2CCR Enable */ 224 + ar_outl(0x1, PLDI2CCR); /* I2CCR Enable */ 225 225 } 226 226 227 227 /************************************************************************** ··· 253 253 254 254 /* 255 255 * check HCOUNT because we cannot check vertical sync. 256 - */ 256 + */ 257 257 for (; tmout >= 0; tmout--) { 258 258 l = ar_inl(ARVHCOUNT); 259 259 if (l == exp_line) ··· 562 562 /* operations for interlace mode */ 563 563 if ( line_count < (AR_HEIGHT_VGA/2) ) /* even line */ 564 564 line_number = (line_count << 1); 565 - else /* odd line */ 566 - line_number = 565 + else /* odd line */ 566 + line_number = 567 567 (((line_count - (AR_HEIGHT_VGA/2)) << 1) + 1); 568 568 } else { 569 569 line_number = line_count; ··· 651 651 cr |= ARVCR1_NORMAL; 652 652 ar_outl(cr, ARVCR1); 653 653 654 - /* 654 + /* 655 655 * Initialize IIC so that CPU can communicate with AR LSI, 656 656 * and send boot commands to AR LSI. 657 657 */ ··· 846 846 * so register video device as a frame grabber type. 847 847 * device is named "video[0-64]". 848 848 * video_register_device() initializes h/w using ar_initialize(). 849 - */ 849 + */ 850 850 if (video_register_device(ar->vdev, VFL_TYPE_GRABBER, video_nr) != 0) { 851 851 /* return -1, -ENFILE(full) or others */ 852 852 printk("arv: register video (Colour AR) failed.\n");
+5 -5
drivers/media/video/bt819.c
··· 1 - /* 1 + /* 2 2 * bt819 - BT819A VideoStream Decoder (Rockwell Part) 3 3 * 4 4 * Copyright (C) 1999 Mike Bernson <mike@mlb.org> ··· 6 6 * 7 7 * Modifications for LML33/DC10plus unified driver 8 8 * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx> 9 - * 9 + * 10 10 * Changes by Ronald Bultje <rbultje@ronald.bitfreak.net> 11 11 * - moved over to linux>=2.4.x i2c protocol (9/9/2002) 12 12 * ··· 206 206 Bug in the bt819 stepping on my board? 207 207 */ 208 208 0x14, 0x00, /* 0x14 Vertial Scaling lsb */ 209 - 0x16, 0x07, /* 0x16 Video Timing Polarity 209 + 0x16, 0x07, /* 0x16 Video Timing Polarity 210 210 ACTIVE=active low 211 - FIELD: high=odd, 211 + FIELD: high=odd, 212 212 vreset=active high, 213 213 hreset=active high */ 214 214 0x18, 0x68, /* 0x18 AGC Delay */ ··· 497 497 }; 498 498 499 499 static unsigned short ignore = I2C_CLIENT_END; 500 - 500 + 501 501 static struct i2c_client_address_data addr_data = { 502 502 .normal_i2c = normal_i2c, 503 503 .probe = &ignore,
+2 -2
drivers/media/video/bt856.c
··· 1 - /* 1 + /* 2 2 * bt856 - BT856A Digital Video Encoder (Rockwell Part) 3 3 * 4 4 * Copyright (C) 1999 Mike Bernson <mike@mlb.org> ··· 285 285 static unsigned short normal_i2c[] = { I2C_BT856 >> 1, I2C_CLIENT_END }; 286 286 287 287 static unsigned short ignore = I2C_CLIENT_END; 288 - 288 + 289 289 static struct i2c_client_address_data addr_data = { 290 290 .normal_i2c = normal_i2c, 291 291 .probe = &ignore,
+53 -53
drivers/media/video/bw-qcam.c
··· 150 150 static struct qcam_device *qcam_init(struct parport *port) 151 151 { 152 152 struct qcam_device *q; 153 - 153 + 154 154 q = kmalloc(sizeof(struct qcam_device), GFP_KERNEL); 155 155 if(q==NULL) 156 156 return NULL; ··· 158 158 q->pport = port; 159 159 q->pdev = parport_register_device(port, "bw-qcam", NULL, NULL, 160 160 NULL, 0, NULL); 161 - if (q->pdev == NULL) 161 + if (q->pdev == NULL) 162 162 { 163 163 printk(KERN_ERR "bw-qcam: couldn't register for %s.\n", 164 164 port->name); 165 165 kfree(q); 166 166 return NULL; 167 167 } 168 - 168 + 169 169 memcpy(&q->vdev, &qcam_template, sizeof(qcam_template)); 170 - 170 + 171 171 mutex_init(&q->lock); 172 172 173 173 q->port_mode = (QC_ANY | QC_NOTSET); ··· 236 236 while (!((status = read_lpstatus(q)) & 8)) 237 237 { 238 238 /* 1000 is enough spins on the I/O for all normal 239 - cases, at that point we start to poll slowly 239 + cases, at that point we start to poll slowly 240 240 until the camera wakes up. However, we are 241 241 busy blocked until the camera responds, so 242 242 setting it lower is much better for interactive 243 243 response. */ 244 - 244 + 245 245 if(runs++>maxpoll) 246 246 { 247 247 msleep_interruptible(5); ··· 255 255 while (((status = read_lpstatus(q)) & 8)) 256 256 { 257 257 /* 1000 is enough spins on the I/O for all normal 258 - cases, at that point we start to poll slowly 258 + cases, at that point we start to poll slowly 259 259 until the camera wakes up. However, we are 260 260 busy blocked until the camera responds, so 261 261 setting it lower is much better for interactive 262 262 response. */ 263 - 263 + 264 264 if(runs++>maxpoll) 265 265 { 266 266 msleep_interruptible(5); ··· 282 282 { 283 283 unsigned int status; 284 284 int runs=0; 285 - 286 - do 285 + 286 + do 287 287 { 288 288 status = read_lpdata(q); 289 289 /* 1000 is enough spins on the I/O for all normal 290 - cases, at that point we start to poll slowly 290 + cases, at that point we start to poll slowly 291 291 until the camera wakes up. However, we are 292 292 busy blocked until the camera responds, so 293 293 setting it lower is much better for interactive 294 294 response. */ 295 - 295 + 296 296 if(runs++>maxpoll) 297 297 { 298 298 msleep_interruptible(5); ··· 321 321 322 322 lastreg = reg = read_lpstatus(q) & 0xf0; 323 323 324 - for (i = 0; i < 500; i++) 324 + for (i = 0; i < 500; i++) 325 325 { 326 326 reg = read_lpstatus(q) & 0xf0; 327 327 if (reg != lastreg) ··· 357 357 358 358 static void qc_reset(struct qcam_device *q) 359 359 { 360 - switch (q->port_mode & QC_FORCE_MASK) 360 + switch (q->port_mode & QC_FORCE_MASK) 361 361 { 362 362 case QC_FORCE_UNIDIR: 363 363 q->port_mode = (q->port_mode & ~QC_MODE_MASK) | QC_UNIDIR; ··· 370 370 case QC_ANY: 371 371 write_lpcontrol(q, 0x20); 372 372 write_lpdata(q, 0x75); 373 - 373 + 374 374 if (read_lpdata(q) != 0x75) { 375 375 q->port_mode = (q->port_mode & ~QC_MODE_MASK) | QC_BIDIR; 376 376 } else { ··· 398 398 static int qc_setscanmode(struct qcam_device *q) 399 399 { 400 400 int old_mode = q->mode; 401 - 402 - switch (q->transfer_scale) 401 + 402 + switch (q->transfer_scale) 403 403 { 404 404 case 1: 405 405 q->mode = 0; ··· 412 412 break; 413 413 } 414 414 415 - switch (q->bpp) 415 + switch (q->bpp) 416 416 { 417 417 case 4: 418 418 break; ··· 421 421 break; 422 422 } 423 423 424 - switch (q->port_mode & QC_MODE_MASK) 424 + switch (q->port_mode & QC_MODE_MASK) 425 425 { 426 426 case QC_BIDIR: 427 427 q->mode += 1; ··· 430 430 case QC_UNIDIR: 431 431 break; 432 432 } 433 - 433 + 434 434 if (q->mode != old_mode) 435 435 q->status |= QC_PARAM_CHANGE; 436 - 436 + 437 437 return 0; 438 438 } 439 439 ··· 451 451 /* Set the brightness. Yes, this is repetitive, but it works. 452 452 * Shorter versions seem to fail subtly. Feel free to try :-). */ 453 453 /* I think the problem was in qc_command, not here -- bls */ 454 - 454 + 455 455 qc_command(q, 0xb); 456 456 qc_command(q, q->brightness); 457 457 ··· 502 502 unsigned int hi2, lo2; 503 503 static int state = 0; 504 504 505 - if (buffer == NULL) 505 + if (buffer == NULL) 506 506 { 507 507 state = 0; 508 508 return 0; 509 509 } 510 - 511 - switch (q->port_mode & QC_MODE_MASK) 510 + 511 + switch (q->port_mode & QC_MODE_MASK) 512 512 { 513 513 case QC_BIDIR: /* Bi-directional Port */ 514 514 write_lpcontrol(q, 0x26); ··· 517 517 write_lpcontrol(q, 0x2e); 518 518 lo2 = (qc_waithand2(q, 0) >> 1); 519 519 hi2 = (read_lpstatus(q) >> 3) & 0x1f; 520 - switch (q->bpp) 520 + switch (q->bpp) 521 521 { 522 522 case 4: 523 523 buffer[0] = lo & 0xf; ··· 544 544 write_lpcontrol(q, 0xe); 545 545 hi = (qc_waithand(q, 0) & 0xf0) >> 4; 546 546 547 - switch (q->bpp) 547 + switch (q->bpp) 548 548 { 549 549 case 4: 550 550 buffer[0] = lo; ··· 552 552 ret = 2; 553 553 break; 554 554 case 6: 555 - switch (state) 555 + switch (state) 556 556 { 557 557 case 0: 558 558 buffer[0] = (lo << 2) | ((hi & 0xc) >> 2); ··· 604 604 int shift=8-q->bpp; 605 605 char invert; 606 606 607 - if (q->mode == -1) 607 + if (q->mode == -1) 608 608 return -ENXIO; 609 609 610 610 qc_command(q, 0x7); 611 611 qc_command(q, q->mode); 612 612 613 - if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR) 613 + if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR) 614 614 { 615 615 write_lpcontrol(q, 0x2e); /* turn port around */ 616 616 write_lpcontrol(q, 0x26); ··· 618 618 write_lpcontrol(q, 0x2e); 619 619 (void) qc_waithand(q, 0); 620 620 } 621 - 621 + 622 622 /* strange -- should be 15:63 below, but 4bpp is odd */ 623 623 invert = (q->bpp == 4) ? 16 : 63; 624 624 ··· 629 629 q->transfer_scale; 630 630 transperline = (transperline + divisor - 1) / divisor; 631 631 632 - for (i = 0, yield = yieldlines; i < linestotrans; i++) 632 + for (i = 0, yield = yieldlines; i < linestotrans; i++) 633 633 { 634 - for (pixels_read = j = 0; j < transperline; j++) 634 + for (pixels_read = j = 0; j < transperline; j++) 635 635 { 636 636 bytes = qc_readbytes(q, buffer); 637 - for (k = 0; k < bytes && (pixels_read + k) < pixels_per_line; k++) 637 + for (k = 0; k < bytes && (pixels_read + k) < pixels_per_line; k++) 638 638 { 639 639 int o; 640 - if (buffer[k] == 0 && invert == 16) 640 + if (buffer[k] == 0 && invert == 16) 641 641 { 642 642 /* 4bpp is odd (again) -- inverter is 16, not 15, but output 643 643 must be 0-15 -- bls */ ··· 653 653 pixels_read += bytes; 654 654 } 655 655 (void) qc_readbytes(q, NULL); /* reset state machine */ 656 - 656 + 657 657 /* Grabbing an entire frame from the quickcam is a lengthy 658 658 process. We don't (usually) want to busy-block the 659 659 processor for the entire frame. yieldlines is a module ··· 666 666 } 667 667 } 668 668 669 - if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR) 669 + if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR) 670 670 { 671 671 write_lpcontrol(q, 2); 672 672 write_lpcontrol(q, 6); ··· 687 687 { 688 688 struct video_device *dev = video_devdata(file); 689 689 struct qcam_device *qcam=(struct qcam_device *)dev; 690 - 690 + 691 691 switch(cmd) 692 692 { 693 693 case VIDIOCGCAP: ··· 762 762 return -EINVAL; 763 763 if(p->depth!=4 && p->depth!=6) 764 764 return -EINVAL; 765 - 765 + 766 766 /* 767 767 * Now load the camera. 768 768 */ ··· 790 790 return -EINVAL; 791 791 if(vw->width<80||vw->width>320) 792 792 return -EINVAL; 793 - 793 + 794 794 qcam->width = 320; 795 795 qcam->height = 240; 796 796 qcam->transfer_scale = 4; 797 - 797 + 798 798 if(vw->width>=160 && vw->height>=120) 799 799 { 800 800 qcam->transfer_scale = 2; ··· 808 808 mutex_lock(&qcam->lock); 809 809 qc_setscanmode(qcam); 810 810 mutex_unlock(&qcam->lock); 811 - 811 + 812 812 /* We must update the camera before we grab. We could 813 813 just have changed the grab size */ 814 814 qcam->status |= QC_PARAM_CHANGE; 815 - 815 + 816 816 /* Ok we figured out what to use from our wide choice */ 817 817 return 0; 818 818 } ··· 853 853 struct qcam_device *qcam=(struct qcam_device *)v; 854 854 int len; 855 855 parport_claim_or_block(qcam->pdev); 856 - 856 + 857 857 mutex_lock(&qcam->lock); 858 - 858 + 859 859 qc_reset(qcam); 860 860 861 861 /* Update the camera parameters if we need to */ ··· 863 863 qc_set(qcam); 864 864 865 865 len=qc_capture(qcam, buf,count); 866 - 866 + 867 867 mutex_unlock(&qcam->lock); 868 - 868 + 869 869 parport_release(qcam->pdev); 870 870 return len; 871 871 } 872 - 872 + 873 873 static struct file_operations qcam_fops = { 874 874 .owner = THIS_MODULE, 875 875 .open = video_exclusive_open, ··· 905 905 qcam=qcam_init(port); 906 906 if(qcam==NULL) 907 907 return -ENODEV; 908 - 908 + 909 909 parport_claim_or_block(qcam->pdev); 910 910 911 911 qc_reset(qcam); 912 - 912 + 913 913 if(qc_detect(qcam)==0) 914 914 { 915 915 parport_release(qcam->pdev); ··· 920 920 qc_calibrate(qcam); 921 921 922 922 parport_release(qcam->pdev); 923 - 923 + 924 924 printk(KERN_INFO "Connectix Quickcam on %s\n", qcam->pport->name); 925 - 925 + 926 926 if(video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1) 927 927 { 928 928 parport_unregister_device(qcam->pdev); ··· 1013 1013 printk("Connectix Quickcam max-poll was above 5000. Using 5000.\n"); 1014 1014 maxpoll = 5000; 1015 1015 } 1016 - 1016 + 1017 1017 if (yieldlines < 1) { 1018 1018 printk("Connectix Quickcam yieldlines was less than 1. Using 1.\n"); 1019 1019 yieldlines = 1;
+33 -33
drivers/media/video/c-qcam.c
··· 16 16 * 17 17 * The parport parameter controls which parports will be scanned. 18 18 * Scanning all parports causes some printers to print a garbage page. 19 - * -- March 14, 1999 Billy Donahue <billy@escape.com> 19 + * -- March 14, 1999 Billy Donahue <billy@escape.com> 20 20 * 21 21 * Fixed data format to BGR, added force_rgb parameter. Added missing 22 22 * parport_unregister_driver() on module removal. ··· 88 88 return (parport_read_data(qcam->pport) & 0x1)?1:0; 89 89 } 90 90 91 - static unsigned int qcam_await_ready1(struct qcam_device *qcam, 91 + static unsigned int qcam_await_ready1(struct qcam_device *qcam, 92 92 int value) 93 93 { 94 94 unsigned long oldjiffies = jiffies; ··· 98 98 if (qcam_ready1(qcam) == value) 99 99 return 0; 100 100 101 - /* If the camera didn't respond within 1/25 second, poll slowly 101 + /* If the camera didn't respond within 1/25 second, poll slowly 102 102 for a while. */ 103 103 for (i = 0; i < 50; i++) 104 104 { ··· 123 123 if (qcam_ready2(qcam) == value) 124 124 return 0; 125 125 126 - /* If the camera didn't respond within 1/25 second, poll slowly 126 + /* If the camera didn't respond within 1/25 second, poll slowly 127 127 for a while. */ 128 128 for (i = 0; i < 50; i++) 129 129 { ··· 157 157 unsigned int idata; 158 158 parport_write_data(qcam->pport, data); 159 159 idata = qcam_read_data(qcam); 160 - if (data != idata) 160 + if (data != idata) 161 161 { 162 - printk(KERN_WARNING "cqcam: sent %x but received %x\n", data, 162 + printk(KERN_WARNING "cqcam: sent %x but received %x\n", data, 163 163 idata); 164 164 return 1; 165 - } 165 + } 166 166 return 0; 167 167 } 168 168 ··· 193 193 no device was found". Fix this one day. */ 194 194 if (qcam->pport->probe_info[0].class == PARPORT_CLASS_MEDIA 195 195 && qcam->pport->probe_info[0].model 196 - && !strcmp(qcam->pdev->port->probe_info[0].model, 196 + && !strcmp(qcam->pdev->port->probe_info[0].model, 197 197 "Color QuickCam 2.0")) { 198 198 printk(KERN_DEBUG "QuickCam: Found by IEEE1284 probe.\n"); 199 199 return 1; 200 200 } 201 - 201 + 202 202 if (probe < 2) 203 203 return 0; 204 204 ··· 206 206 207 207 /* look for a heartbeat */ 208 208 ostat = stat = parport_read_status(qcam->pport); 209 - for (i=0; i<250; i++) 209 + for (i=0; i<250; i++) 210 210 { 211 211 mdelay(1); 212 212 stat = parport_read_status(qcam->pport); 213 - if (ostat != stat) 213 + if (ostat != stat) 214 214 { 215 215 if (++count >= 3) return 1; 216 216 ostat = stat; ··· 226 226 count = 0; 227 227 228 228 ostat = stat = parport_read_status(qcam->pport); 229 - for (i=0; i<250; i++) 229 + for (i=0; i<250; i++) 230 230 { 231 231 mdelay(1); 232 232 stat = parport_read_status(qcam->pport); 233 - if (ostat != stat) 233 + if (ostat != stat) 234 234 { 235 235 if (++count >= 3) return 1; 236 236 ostat = stat; ··· 247 247 parport_write_control(qcam->pport, 0x8); 248 248 mdelay(1); 249 249 parport_write_control(qcam->pport, 0xc); 250 - mdelay(1); 250 + mdelay(1); 251 251 } 252 252 253 253 /* Reset the QuickCam and program for brightness, contrast, ··· 258 258 qc_reset(q); 259 259 260 260 /* Set the brightness. */ 261 - qcam_set(q, 11, q->brightness); 261 + qcam_set(q, 11, q->brightness); 262 262 263 263 /* Set the height and width. These refer to the actual 264 264 CCD area *before* applying the selected decimation. */ ··· 272 272 /* Set contrast and white balance. */ 273 273 qcam_set(q, 0x19, q->contrast); 274 274 qcam_set(q, 0x1f, q->whitebal); 275 - 275 + 276 276 /* Set the speed. */ 277 277 qcam_set(q, 45, 2); 278 278 } 279 279 280 - /* Read some bytes from the camera and put them in the buffer. 280 + /* Read some bytes from the camera and put them in the buffer. 281 281 nbytes should be a multiple of 3, because bidirectional mode gives 282 282 us three bytes at a time. */ 283 283 ··· 383 383 384 384 if (qcam_set(q, 7, (q->mode | (is_bi_dir?1:0)) + 1)) 385 385 return -EIO; 386 - 386 + 387 387 lines = q->height; 388 388 pixelsperline = q->width; 389 389 bitsperxfer = (is_bi_dir) ? 24 : 8; ··· 499 499 { 500 500 struct video_device *dev = video_devdata(file); 501 501 struct qcam_device *qcam=(struct qcam_device *)dev; 502 - 502 + 503 503 switch(cmd) 504 504 { 505 505 case VIDIOCGCAP: ··· 574 574 */ 575 575 if (p->depth != 24 || p->palette != VIDEO_PALETTE_RGB24) 576 576 return -EINVAL; 577 - 577 + 578 578 /* 579 579 * Now load the camera. 580 580 */ ··· 584 584 585 585 mutex_lock(&qcam->lock); 586 586 parport_claim_or_block(qcam->pdev); 587 - qc_setup(qcam); 587 + qc_setup(qcam); 588 588 parport_release(qcam->pdev); 589 589 mutex_unlock(&qcam->lock); 590 590 return 0; ··· 601 601 return -EINVAL; 602 602 if(vw->width<80||vw->width>320) 603 603 return -EINVAL; 604 - 604 + 605 605 qcam->width = 80; 606 606 qcam->height = 60; 607 607 qcam->mode = QC_DECIMATION_4; 608 - 608 + 609 609 if(vw->width>=160 && vw->height>=120) 610 610 { 611 611 qcam->width = 160; ··· 627 627 qcam->mode = QC_BILLIONS | QC_DECIMATION_1; 628 628 } 629 629 #endif 630 - /* Ok we figured out what to use from our 630 + /* Ok we figured out what to use from our 631 631 wide choice */ 632 632 mutex_lock(&qcam->lock); 633 633 parport_claim_or_block(qcam->pdev); ··· 676 676 mutex_lock(&qcam->lock); 677 677 parport_claim_or_block(qcam->pdev); 678 678 /* Probably should have a semaphore against multiple users */ 679 - len = qc_capture(qcam, buf,count); 679 + len = qc_capture(qcam, buf,count); 680 680 parport_release(qcam->pdev); 681 681 mutex_unlock(&qcam->lock); 682 682 return len; ··· 707 707 static struct qcam_device *qcam_init(struct parport *port) 708 708 { 709 709 struct qcam_device *q; 710 - 710 + 711 711 q = kmalloc(sizeof(struct qcam_device), GFP_KERNEL); 712 712 if(q==NULL) 713 713 return NULL; ··· 718 718 719 719 q->bidirectional = (q->pport->modes & PARPORT_MODE_TRISTATE)?1:0; 720 720 721 - if (q->pdev == NULL) 721 + if (q->pdev == NULL) 722 722 { 723 723 printk(KERN_ERR "c-qcam: couldn't register for %s.\n", 724 724 port->name); 725 725 kfree(q); 726 726 return NULL; 727 727 } 728 - 728 + 729 729 memcpy(&q->vdev, &qcam_template, sizeof(qcam_template)); 730 730 731 731 mutex_init(&q->lock); ··· 766 766 qcam = qcam_init(port); 767 767 if (qcam==NULL) 768 768 return -ENODEV; 769 - 769 + 770 770 parport_claim_or_block(qcam->pdev); 771 771 772 772 qc_reset(qcam); 773 - 773 + 774 774 if (probe && qc_detect(qcam)==0) 775 775 { 776 776 parport_release(qcam->pdev); ··· 782 782 qc_setup(qcam); 783 783 784 784 parport_release(qcam->pdev); 785 - 785 + 786 786 if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1) 787 787 { 788 788 printk(KERN_ERR "Unable to register Colour QuickCam on %s\n", ··· 792 792 return -ENODEV; 793 793 } 794 794 795 - printk(KERN_INFO "video%d: Colour QuickCam found on %s\n", 795 + printk(KERN_INFO "video%d: Colour QuickCam found on %s\n", 796 796 qcam->vdev.minor, qcam->pport->name); 797 - 797 + 798 798 qcams[num_cams++] = qcam; 799 799 800 800 return 0;
+328 -328
drivers/media/video/cpia.c
··· 24 24 */ 25 25 26 26 /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */ 27 - /* #define _CPIA_DEBUG_ 1 */ 27 + /* #define _CPIA_DEBUG_ 1 */ 28 28 29 29 #include <linux/config.h> 30 30 ··· 67 67 static unsigned short colorspace_conv = 0; 68 68 module_param(colorspace_conv, ushort, 0444); 69 69 MODULE_PARM_DESC(colorspace_conv, 70 - "\n<n> Colorspace conversion:" 71 - "\n0 = disable" 72 - "\n1 = enable" 73 - "\nDefault value is 0" 74 - "\n"); 70 + "\n<n> Colorspace conversion:" 71 + "\n0 = disable" 72 + "\n1 = enable" 73 + "\nDefault value is 0" 74 + "\n"); 75 75 76 76 #define ABOUT "V4L-Driver for Vision CPiA based cameras" 77 77 ··· 189 189 #define TC 94 190 190 #define EXP_ACC_DARK 50 191 191 #define EXP_ACC_LIGHT 90 192 - #define HIGH_COMP_102 160 193 - #define MAX_COMP 239 192 + #define HIGH_COMP_102 160 193 + #define MAX_COMP 239 194 194 #define DARK_TIME 3 195 195 #define LIGHT_TIME 3 196 196 ··· 208 208 static void reset_camera_struct(struct cam_data *cam); 209 209 static int find_over_exposure(int brightness); 210 210 static void set_flicker(struct cam_params *params, volatile u32 *command_flags, 211 - int on); 211 + int on); 212 212 213 213 214 214 /********************************************************************** ··· 262 262 static struct proc_dir_entry *cpia_proc_root=NULL; 263 263 264 264 static int cpia_read_proc(char *page, char **start, off_t off, 265 - int count, int *eof, void *data) 265 + int count, int *eof, void *data) 266 266 { 267 267 char *out = page; 268 268 int len, tmp; ··· 276 276 out += sprintf(out, "V4L Driver version: %d.%d.%d\n", 277 277 CPIA_MAJ_VER, CPIA_MIN_VER, CPIA_PATCH_VER); 278 278 out += sprintf(out, "CPIA Version: %d.%02d (%d.%d)\n", 279 - cam->params.version.firmwareVersion, 280 - cam->params.version.firmwareRevision, 281 - cam->params.version.vcVersion, 282 - cam->params.version.vcRevision); 279 + cam->params.version.firmwareVersion, 280 + cam->params.version.firmwareRevision, 281 + cam->params.version.vcVersion, 282 + cam->params.version.vcRevision); 283 283 out += sprintf(out, "CPIA PnP-ID: %04x:%04x:%04x\n", 284 - cam->params.pnpID.vendor, cam->params.pnpID.product, 285 - cam->params.pnpID.deviceRevision); 284 + cam->params.pnpID.vendor, cam->params.pnpID.product, 285 + cam->params.pnpID.deviceRevision); 286 286 out += sprintf(out, "VP-Version: %d.%d %04x\n", 287 - cam->params.vpVersion.vpVersion, 288 - cam->params.vpVersion.vpRevision, 289 - cam->params.vpVersion.cameraHeadID); 290 - 287 + cam->params.vpVersion.vpVersion, 288 + cam->params.vpVersion.vpRevision, 289 + cam->params.vpVersion.cameraHeadID); 290 + 291 291 out += sprintf(out, "system_state: %#04x\n", 292 - cam->params.status.systemState); 292 + cam->params.status.systemState); 293 293 out += sprintf(out, "grab_state: %#04x\n", 294 - cam->params.status.grabState); 294 + cam->params.status.grabState); 295 295 out += sprintf(out, "stream_state: %#04x\n", 296 - cam->params.status.streamState); 296 + cam->params.status.streamState); 297 297 out += sprintf(out, "fatal_error: %#04x\n", 298 - cam->params.status.fatalError); 298 + cam->params.status.fatalError); 299 299 out += sprintf(out, "cmd_error: %#04x\n", 300 - cam->params.status.cmdError); 300 + cam->params.status.cmdError); 301 301 out += sprintf(out, "debug_flags: %#04x\n", 302 - cam->params.status.debugFlags); 302 + cam->params.status.debugFlags); 303 303 out += sprintf(out, "vp_status: %#04x\n", 304 - cam->params.status.vpStatus); 304 + cam->params.status.vpStatus); 305 305 out += sprintf(out, "error_code: %#04x\n", 306 - cam->params.status.errorCode); 306 + cam->params.status.errorCode); 307 307 /* QX3 specific entries */ 308 308 if (cam->params.qx3.qx3_detected) { 309 309 out += sprintf(out, "button: %4d\n", 310 - cam->params.qx3.button); 310 + cam->params.qx3.button); 311 311 out += sprintf(out, "cradled: %4d\n", 312 - cam->params.qx3.cradled); 312 + cam->params.qx3.cradled); 313 313 } 314 314 out += sprintf(out, "video_size: %s\n", 315 - cam->params.format.videoSize == VIDEOSIZE_CIF ? 315 + cam->params.format.videoSize == VIDEOSIZE_CIF ? 316 316 "CIF " : "QCIF"); 317 317 out += sprintf(out, "roi: (%3d, %3d) to (%3d, %3d)\n", 318 - cam->params.roi.colStart*8, 319 - cam->params.roi.rowStart*4, 320 - cam->params.roi.colEnd*8, 321 - cam->params.roi.rowEnd*4); 318 + cam->params.roi.colStart*8, 319 + cam->params.roi.rowStart*4, 320 + cam->params.roi.colEnd*8, 321 + cam->params.roi.rowEnd*4); 322 322 out += sprintf(out, "actual_fps: %3d\n", cam->fps); 323 323 out += sprintf(out, "transfer_rate: %4dkB/s\n", 324 - cam->transfer_rate); 325 - 324 + cam->transfer_rate); 325 + 326 326 out += sprintf(out, "\nread-write\n"); 327 327 out += sprintf(out, "----------------------- current min" 328 - " max default comment\n"); 328 + " max default comment\n"); 329 329 out += sprintf(out, "brightness: %8d %8d %8d %8d\n", 330 - cam->params.colourParams.brightness, 0, 100, 50); 330 + cam->params.colourParams.brightness, 0, 100, 50); 331 331 if (cam->params.version.firmwareVersion == 1 && 332 332 cam->params.version.firmwareRevision == 2) 333 333 /* 1-02 firmware limits contrast to 80 */ ··· 336 336 tmp = 96; 337 337 338 338 out += sprintf(out, "contrast: %8d %8d %8d %8d" 339 - " steps of 8\n", 340 - cam->params.colourParams.contrast, 0, tmp, 48); 339 + " steps of 8\n", 340 + cam->params.colourParams.contrast, 0, tmp, 48); 341 341 out += sprintf(out, "saturation: %8d %8d %8d %8d\n", 342 - cam->params.colourParams.saturation, 0, 100, 50); 342 + cam->params.colourParams.saturation, 0, 100, 50); 343 343 tmp = (25000+5000*cam->params.sensorFps.baserate)/ 344 344 (1<<cam->params.sensorFps.divisor); 345 345 out += sprintf(out, "sensor_fps: %4d.%03d %8d %8d %8d\n", 346 - tmp/1000, tmp%1000, 3, 30, 15); 346 + tmp/1000, tmp%1000, 3, 30, 15); 347 347 out += sprintf(out, "stream_start_line: %8d %8d %8d %8d\n", 348 - 2*cam->params.streamStartLine, 0, 348 + 2*cam->params.streamStartLine, 0, 349 349 cam->params.format.videoSize == VIDEOSIZE_CIF ? 288:144, 350 350 cam->params.format.videoSize == VIDEOSIZE_CIF ? 240:120); 351 351 out += sprintf(out, "sub_sample: %8s %8s %8s %8s\n", 352 - cam->params.format.subSample == SUBSAMPLE_420 ? 352 + cam->params.format.subSample == SUBSAMPLE_420 ? 353 353 "420" : "422", "420", "422", "422"); 354 354 out += sprintf(out, "yuv_order: %8s %8s %8s %8s\n", 355 - cam->params.format.yuvOrder == YUVORDER_YUYV ? 355 + cam->params.format.yuvOrder == YUVORDER_YUYV ? 356 356 "YUYV" : "UYVY", "YUYV" , "UYVY", "YUYV"); 357 357 out += sprintf(out, "ecp_timing: %8s %8s %8s %8s\n", 358 - cam->params.ecpTiming ? "slow" : "normal", "slow", 358 + cam->params.ecpTiming ? "slow" : "normal", "slow", 359 359 "normal", "normal"); 360 360 361 361 if (cam->params.colourBalance.balanceMode == 2) { ··· 366 366 out += sprintf(out, "color_balance_mode: %8s %8s %8s" 367 367 " %8s\n", tmpstr, "manual", "auto", "auto"); 368 368 out += sprintf(out, "red_gain: %8d %8d %8d %8d\n", 369 - cam->params.colourBalance.redGain, 0, 212, 32); 369 + cam->params.colourBalance.redGain, 0, 212, 32); 370 370 out += sprintf(out, "green_gain: %8d %8d %8d %8d\n", 371 - cam->params.colourBalance.greenGain, 0, 212, 6); 371 + cam->params.colourBalance.greenGain, 0, 212, 6); 372 372 out += sprintf(out, "blue_gain: %8d %8d %8d %8d\n", 373 - cam->params.colourBalance.blueGain, 0, 212, 92); 373 + cam->params.colourBalance.blueGain, 0, 212, 92); 374 374 375 375 if (cam->params.version.firmwareVersion == 1 && 376 376 cam->params.version.firmwareRevision == 2) ··· 381 381 382 382 if (cam->params.exposure.gainMode == 0) 383 383 out += sprintf(out, "max_gain: unknown %28s" 384 - " powers of 2\n", tmpstr); 384 + " powers of 2\n", tmpstr); 385 385 else 386 386 out += sprintf(out, "max_gain: %8d %28s" 387 387 " 1,2,4 or 8 \n", 388 - 1<<(cam->params.exposure.gainMode-1), tmpstr); 388 + 1<<(cam->params.exposure.gainMode-1), tmpstr); 389 389 390 390 switch(cam->params.exposure.expMode) { 391 391 case 1: ··· 402 402 out += sprintf(out, "exposure_mode: %8s %8s %8s" 403 403 " %8s\n", tmpstr, "manual", "auto", "auto"); 404 404 out += sprintf(out, "centre_weight: %8s %8s %8s %8s\n", 405 - (2-cam->params.exposure.centreWeight) ? "on" : "off", 406 - "off", "on", "on"); 405 + (2-cam->params.exposure.centreWeight) ? "on" : "off", 406 + "off", "on", "on"); 407 407 out += sprintf(out, "gain: %8d %8d max_gain %8d 1,2,4,8 possible\n", 408 - 1<<cam->params.exposure.gain, 1, 1); 408 + 1<<cam->params.exposure.gain, 1, 1); 409 409 if (cam->params.version.firmwareVersion == 1 && 410 410 cam->params.version.firmwareRevision == 2) 411 411 /* 1-02 firmware limits fineExp/2 to 127 */ ··· 414 414 tmp = 510; 415 415 416 416 out += sprintf(out, "fine_exp: %8d %8d %8d %8d\n", 417 - cam->params.exposure.fineExp*2, 0, tmp, 0); 417 + cam->params.exposure.fineExp*2, 0, tmp, 0); 418 418 if (cam->params.version.firmwareVersion == 1 && 419 419 cam->params.version.firmwareRevision == 2) 420 420 /* 1-02 firmware limits coarseExpHi to 0 */ ··· 426 426 " %8d\n", cam->params.exposure.coarseExpLo+ 427 427 256*cam->params.exposure.coarseExpHi, 0, tmp, 185); 428 428 out += sprintf(out, "red_comp: %8d %8d %8d %8d\n", 429 - cam->params.exposure.redComp, COMP_RED, 255, COMP_RED); 429 + cam->params.exposure.redComp, COMP_RED, 255, COMP_RED); 430 430 out += sprintf(out, "green1_comp: %8d %8d %8d %8d\n", 431 - cam->params.exposure.green1Comp, COMP_GREEN1, 255, 431 + cam->params.exposure.green1Comp, COMP_GREEN1, 255, 432 432 COMP_GREEN1); 433 433 out += sprintf(out, "green2_comp: %8d %8d %8d %8d\n", 434 - cam->params.exposure.green2Comp, COMP_GREEN2, 255, 434 + cam->params.exposure.green2Comp, COMP_GREEN2, 255, 435 435 COMP_GREEN2); 436 436 out += sprintf(out, "blue_comp: %8d %8d %8d %8d\n", 437 - cam->params.exposure.blueComp, COMP_BLUE, 255, COMP_BLUE); 438 - 437 + cam->params.exposure.blueComp, COMP_BLUE, 255, COMP_BLUE); 438 + 439 439 out += sprintf(out, "apcor_gain1: %#8x %#8x %#8x %#8x\n", 440 - cam->params.apcor.gain1, 0, 0xff, 0x1c); 440 + cam->params.apcor.gain1, 0, 0xff, 0x1c); 441 441 out += sprintf(out, "apcor_gain2: %#8x %#8x %#8x %#8x\n", 442 - cam->params.apcor.gain2, 0, 0xff, 0x1a); 442 + cam->params.apcor.gain2, 0, 0xff, 0x1a); 443 443 out += sprintf(out, "apcor_gain4: %#8x %#8x %#8x %#8x\n", 444 - cam->params.apcor.gain4, 0, 0xff, 0x2d); 444 + cam->params.apcor.gain4, 0, 0xff, 0x2d); 445 445 out += sprintf(out, "apcor_gain8: %#8x %#8x %#8x %#8x\n", 446 - cam->params.apcor.gain8, 0, 0xff, 0x2a); 446 + cam->params.apcor.gain8, 0, 0xff, 0x2a); 447 447 out += sprintf(out, "vl_offset_gain1: %8d %8d %8d %8d\n", 448 - cam->params.vlOffset.gain1, 0, 255, 24); 448 + cam->params.vlOffset.gain1, 0, 255, 24); 449 449 out += sprintf(out, "vl_offset_gain2: %8d %8d %8d %8d\n", 450 - cam->params.vlOffset.gain2, 0, 255, 28); 450 + cam->params.vlOffset.gain2, 0, 255, 28); 451 451 out += sprintf(out, "vl_offset_gain4: %8d %8d %8d %8d\n", 452 - cam->params.vlOffset.gain4, 0, 255, 30); 452 + cam->params.vlOffset.gain4, 0, 255, 30); 453 453 out += sprintf(out, "vl_offset_gain8: %8d %8d %8d %8d\n", 454 - cam->params.vlOffset.gain8, 0, 255, 30); 454 + cam->params.vlOffset.gain8, 0, 255, 30); 455 455 out += sprintf(out, "flicker_control: %8s %8s %8s %8s\n", 456 - cam->params.flickerControl.flickerMode ? "on" : "off", 456 + cam->params.flickerControl.flickerMode ? "on" : "off", 457 457 "off", "on", "off"); 458 458 out += sprintf(out, "mains_frequency: %8d %8d %8d %8d" 459 - " only 50/60\n", 460 - cam->mainsFreq ? 60 : 50, 50, 60, 50); 459 + " only 50/60\n", 460 + cam->mainsFreq ? 60 : 50, 50, 60, 50); 461 461 if(cam->params.flickerControl.allowableOverExposure < 0) 462 462 out += sprintf(out, "allowable_overexposure: %4dauto auto %8d auto\n", 463 - -cam->params.flickerControl.allowableOverExposure, 464 - 255); 463 + -cam->params.flickerControl.allowableOverExposure, 464 + 255); 465 465 else 466 466 out += sprintf(out, "allowable_overexposure: %8d auto %8d auto\n", 467 - cam->params.flickerControl.allowableOverExposure, 468 - 255); 467 + cam->params.flickerControl.allowableOverExposure, 468 + 255); 469 469 out += sprintf(out, "compression_mode: "); 470 470 switch(cam->params.compression.mode) { 471 471 case CPIA_COMPRESSION_NONE: ··· 483 483 } 484 484 out += sprintf(out, " none,auto,manual auto\n"); 485 485 out += sprintf(out, "decimation_enable: %8s %8s %8s %8s\n", 486 - cam->params.compression.decimation == 487 - DECIMATION_ENAB ? "on":"off", "off", "on", 486 + cam->params.compression.decimation == 487 + DECIMATION_ENAB ? "on":"off", "off", "on", 488 488 "off"); 489 489 out += sprintf(out, "compression_target: %9s %9s %9s %9s\n", 490 - cam->params.compressionTarget.frTargeting == 490 + cam->params.compressionTarget.frTargeting == 491 491 CPIA_COMPRESSION_TARGET_FRAMERATE ? 492 492 "framerate":"quality", 493 493 "framerate", "quality", "quality"); 494 494 out += sprintf(out, "target_framerate: %8d %8d %8d %8d\n", 495 - cam->params.compressionTarget.targetFR, 1, 30, 15); 495 + cam->params.compressionTarget.targetFR, 1, 30, 15); 496 496 out += sprintf(out, "target_quality: %8d %8d %8d %8d\n", 497 - cam->params.compressionTarget.targetQ, 1, 64, 5); 497 + cam->params.compressionTarget.targetQ, 1, 64, 5); 498 498 out += sprintf(out, "y_threshold: %8d %8d %8d %8d\n", 499 - cam->params.yuvThreshold.yThreshold, 0, 31, 6); 499 + cam->params.yuvThreshold.yThreshold, 0, 31, 6); 500 500 out += sprintf(out, "uv_threshold: %8d %8d %8d %8d\n", 501 - cam->params.yuvThreshold.uvThreshold, 0, 31, 6); 501 + cam->params.yuvThreshold.uvThreshold, 0, 31, 6); 502 502 out += sprintf(out, "hysteresis: %8d %8d %8d %8d\n", 503 - cam->params.compressionParams.hysteresis, 0, 255, 3); 503 + cam->params.compressionParams.hysteresis, 0, 255, 3); 504 504 out += sprintf(out, "threshold_max: %8d %8d %8d %8d\n", 505 - cam->params.compressionParams.threshMax, 0, 255, 11); 505 + cam->params.compressionParams.threshMax, 0, 255, 11); 506 506 out += sprintf(out, "small_step: %8d %8d %8d %8d\n", 507 - cam->params.compressionParams.smallStep, 0, 255, 1); 507 + cam->params.compressionParams.smallStep, 0, 255, 1); 508 508 out += sprintf(out, "large_step: %8d %8d %8d %8d\n", 509 - cam->params.compressionParams.largeStep, 0, 255, 3); 509 + cam->params.compressionParams.largeStep, 0, 255, 3); 510 510 out += sprintf(out, "decimation_hysteresis: %8d %8d %8d %8d\n", 511 - cam->params.compressionParams.decimationHysteresis, 511 + cam->params.compressionParams.decimationHysteresis, 512 512 0, 255, 2); 513 513 out += sprintf(out, "fr_diff_step_thresh: %8d %8d %8d %8d\n", 514 - cam->params.compressionParams.frDiffStepThresh, 514 + cam->params.compressionParams.frDiffStepThresh, 515 515 0, 255, 5); 516 516 out += sprintf(out, "q_diff_step_thresh: %8d %8d %8d %8d\n", 517 - cam->params.compressionParams.qDiffStepThresh, 517 + cam->params.compressionParams.qDiffStepThresh, 518 518 0, 255, 3); 519 519 out += sprintf(out, "decimation_thresh_mod: %8d %8d %8d %8d\n", 520 - cam->params.compressionParams.decimationThreshMod, 520 + cam->params.compressionParams.decimationThreshMod, 521 521 0, 255, 2); 522 522 /* QX3 specific entries */ 523 523 if (cam->params.qx3.qx3_detected) { 524 - out += sprintf(out, "toplight: %8s %8s %8s %8s\n", 525 - cam->params.qx3.toplight ? "on" : "off", 524 + out += sprintf(out, "toplight: %8s %8s %8s %8s\n", 525 + cam->params.qx3.toplight ? "on" : "off", 526 526 "off", "on", "off"); 527 - out += sprintf(out, "bottomlight: %8s %8s %8s %8s\n", 528 - cam->params.qx3.bottomlight ? "on" : "off", 527 + out += sprintf(out, "bottomlight: %8s %8s %8s %8s\n", 528 + cam->params.qx3.bottomlight ? "on" : "off", 529 529 "off", "on", "off"); 530 530 } 531 - 531 + 532 532 len = out - page; 533 533 len -= off; 534 534 if (len < count) { ··· 543 543 544 544 545 545 static int match(char *checkstr, char **buffer, unsigned long *count, 546 - int *find_colon, int *err) 546 + int *find_colon, int *err) 547 547 { 548 548 int ret, colon_found = 1; 549 549 int len = strlen(checkstr); ··· 583 583 } 584 584 585 585 static int cpia_write_proc(struct file *file, const char __user *buf, 586 - unsigned long count, void *data) 586 + unsigned long count, void *data) 587 587 { 588 588 struct cam_data *cam = data; 589 589 struct cam_params new_params; ··· 619 619 retval = -EINVAL; 620 620 goto out; 621 621 } 622 - 622 + 623 623 buffer = page; 624 - 624 + 625 625 if (mutex_lock_interruptible(&cam->param_lock)) 626 626 return -ERESTARTSYS; 627 - 627 + 628 628 /* 629 629 * Skip over leading whitespace 630 630 */ ··· 632 632 --count; 633 633 ++buffer; 634 634 } 635 - 635 + 636 636 memcpy(&new_params, &cam->params, sizeof(struct cam_params)); 637 637 new_mains = cam->mainsFreq; 638 - 638 + 639 639 #define MATCH(x) (match(x, &buffer, &count, &find_colon, &retval)) 640 640 #define VALUE (value(&buffer,&count, &retval)) 641 641 #define FIRMWARE_VERSION(x,y) (new_params.version.firmwareVersion == (x) && \ 642 - new_params.version.firmwareRevision == (y)) 643 - 642 + new_params.version.firmwareRevision == (y)) 643 + 644 644 retval = 0; 645 645 while (count && !retval) { 646 646 find_colon = 1; ··· 656 656 } 657 657 command_flags |= COMMAND_SETCOLOURPARAMS; 658 658 if(new_params.flickerControl.allowableOverExposure < 0) 659 - new_params.flickerControl.allowableOverExposure = 659 + new_params.flickerControl.allowableOverExposure = 660 660 -find_over_exposure(new_params.colourParams.brightness); 661 661 if(new_params.flickerControl.flickerMode != 0) 662 662 command_flags |= COMMAND_SETFLICKERCTRL; ··· 721 721 /* Either base rate would work here */ 722 722 new_params.sensorFps.baserate = 1; 723 723 } 724 - new_params.flickerControl.coarseJump = 724 + new_params.flickerControl.coarseJump = 725 725 flicker_jumps[new_mains] 726 726 [new_params.sensorFps.baserate] 727 727 [new_params.sensorFps.divisor]; ··· 1085 1085 } else if (MATCH("mains_frequency")) { 1086 1086 if (!retval && MATCH("50")) { 1087 1087 new_mains = 0; 1088 - new_params.flickerControl.coarseJump = 1088 + new_params.flickerControl.coarseJump = 1089 1089 flicker_jumps[new_mains] 1090 1090 [new_params.sensorFps.baserate] 1091 1091 [new_params.sensorFps.divisor]; ··· 1093 1093 command_flags |= COMMAND_SETFLICKERCTRL; 1094 1094 } else if (!retval && MATCH("60")) { 1095 1095 new_mains = 1; 1096 - new_params.flickerControl.coarseJump = 1096 + new_params.flickerControl.coarseJump = 1097 1097 flicker_jumps[new_mains] 1098 1098 [new_params.sensorFps.baserate] 1099 1099 [new_params.sensorFps.divisor]; ··· 1103 1103 retval = -EINVAL; 1104 1104 } else if (MATCH("allowable_overexposure")) { 1105 1105 if (!retval && MATCH("auto")) { 1106 - new_params.flickerControl.allowableOverExposure = 1106 + new_params.flickerControl.allowableOverExposure = 1107 1107 -find_over_exposure(new_params.colourParams.brightness); 1108 1108 if(new_params.flickerControl.flickerMode != 0) 1109 1109 command_flags |= COMMAND_SETFLICKERCTRL; ··· 1146 1146 command_flags |= COMMAND_SETCOMPRESSION; 1147 1147 } else if (MATCH("compression_target")) { 1148 1148 if (!retval && MATCH("quality")) 1149 - new_params.compressionTarget.frTargeting = 1149 + new_params.compressionTarget.frTargeting = 1150 1150 CPIA_COMPRESSION_TARGET_QUALITY; 1151 1151 else if (!retval && MATCH("framerate")) 1152 - new_params.compressionTarget.frTargeting = 1152 + new_params.compressionTarget.frTargeting = 1153 1153 CPIA_COMPRESSION_TARGET_FRAMERATE; 1154 1154 else 1155 1155 retval = -EINVAL; ··· 1173 1173 if (!retval) { 1174 1174 if(val > 0 && val <= 64) 1175 1175 new_params.compressionTarget.targetQ = val; 1176 - else 1176 + else 1177 1177 retval = -EINVAL; 1178 1178 } 1179 1179 command_flags |= COMMAND_SETCOMPRESSIONTARGET; ··· 1288 1288 } 1289 1289 command_flags |= COMMAND_SETCOMPRESSIONPARAMS; 1290 1290 } else if (MATCH("toplight")) { 1291 - if (!retval && MATCH("on")) 1291 + if (!retval && MATCH("on")) 1292 1292 new_params.qx3.toplight = 1; 1293 1293 else if (!retval && MATCH("off")) 1294 1294 new_params.qx3.toplight = 0; 1295 - else 1295 + else 1296 1296 retval = -EINVAL; 1297 1297 command_flags |= COMMAND_SETLIGHTS; 1298 1298 } else if (MATCH("bottomlight")) { 1299 - if (!retval && MATCH("on")) 1299 + if (!retval && MATCH("on")) 1300 1300 new_params.qx3.bottomlight = 1; 1301 - else if (!retval && MATCH("off")) 1301 + else if (!retval && MATCH("off")) 1302 1302 new_params.qx3.bottomlight = 0; 1303 - else 1303 + else 1304 1304 retval = -EINVAL; 1305 1305 command_flags |= COMMAND_SETLIGHTS; 1306 1306 } else { ··· 1326 1326 } 1327 1327 } 1328 1328 } 1329 - #undef MATCH 1329 + #undef MATCH 1330 1330 #undef VALUE 1331 1331 #undef FIRMWARE_VERSION 1332 1332 if (!retval) { ··· 1349 1349 retval = size; 1350 1350 } else 1351 1351 DBG("error: %d\n", retval); 1352 - 1352 + 1353 1353 mutex_unlock(&cam->param_lock); 1354 - 1354 + 1355 1355 out: 1356 1356 free_page((unsigned long)page); 1357 - return retval; 1357 + return retval; 1358 1358 } 1359 1359 1360 1360 static void create_proc_cpia_cam(struct cam_data *cam) 1361 1361 { 1362 1362 char name[7]; 1363 1363 struct proc_dir_entry *ent; 1364 - 1364 + 1365 1365 if (!cpia_proc_root || !cam) 1366 1366 return; 1367 1367 1368 1368 sprintf(name, "video%d", cam->vdev.minor); 1369 - 1369 + 1370 1370 ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root); 1371 1371 if (!ent) 1372 1372 return; ··· 1374 1374 ent->data = cam; 1375 1375 ent->read_proc = cpia_read_proc; 1376 1376 ent->write_proc = cpia_write_proc; 1377 - /* 1377 + /* 1378 1378 size of the proc entry is 3736 bytes for the standard webcam; 1379 - the extra features of the QX3 microscope add 189 bytes. 1379 + the extra features of the QX3 microscope add 189 bytes. 1380 1380 (we have not yet probed the camera to see which type it is). 1381 1381 */ 1382 1382 ent->size = 3736 + 189; ··· 1386 1386 static void destroy_proc_cpia_cam(struct cam_data *cam) 1387 1387 { 1388 1388 char name[7]; 1389 - 1389 + 1390 1390 if (!cam || !cam->proc_entry) 1391 1391 return; 1392 - 1392 + 1393 1393 sprintf(name, "video%d", cam->vdev.minor); 1394 1394 remove_proc_entry(name, cpia_proc_root); 1395 1395 cam->proc_entry = NULL; ··· 1596 1596 cam->vc.width = cam->vw.width; 1597 1597 if(cam->vc.height == 0) 1598 1598 cam->vc.height = cam->vw.height; 1599 - 1599 + 1600 1600 cam->params.roi.colStart += cam->vc.x >> 3; 1601 1601 cam->params.roi.colEnd = cam->params.roi.colStart + 1602 - (cam->vc.width >> 3); 1602 + (cam->vc.width >> 3); 1603 1603 cam->params.roi.rowStart += cam->vc.y >> 2; 1604 1604 cam->params.roi.rowEnd = cam->params.roi.rowStart + 1605 - (cam->vc.height >> 2); 1605 + (cam->vc.height >> 2); 1606 1606 1607 1607 return; 1608 1608 } ··· 1624 1624 static int free_frame_buf(struct cam_data *cam) 1625 1625 { 1626 1626 int i; 1627 - 1627 + 1628 1628 rvfree(cam->frame_buf, FRAME_NUM*CPIA_MAX_FRAME_SIZE); 1629 1629 cam->frame_buf = NULL; 1630 1630 for (i=0; i < FRAME_NUM; i++) ··· 1667 1667 mutex_lock(&cam->param_lock); 1668 1668 datasize=8; 1669 1669 break; 1670 - case CPIA_COMMAND_ReadMCPorts: 1670 + case CPIA_COMMAND_ReadMCPorts: 1671 1671 case CPIA_COMMAND_ReadVCRegs: 1672 1672 datasize = 4; 1673 1673 break; ··· 1746 1746 mutex_unlock(&cam->param_lock); 1747 1747 break; 1748 1748 1749 - case CPIA_COMMAND_ReadMCPorts: 1750 - if (!cam->params.qx3.qx3_detected) 1749 + case CPIA_COMMAND_ReadMCPorts: 1750 + if (!cam->params.qx3.qx3_detected) 1751 1751 break; 1752 - /* test button press */ 1752 + /* test button press */ 1753 1753 cam->params.qx3.button = ((data[1] & 0x02) == 0); 1754 1754 if (cam->params.qx3.button) { 1755 1755 /* button pressed - unlock the latch */ ··· 1770 1770 1771 1771 /* send a command to the camera with an additional data transaction */ 1772 1772 static int do_command_extended(struct cam_data *cam, u16 command, 1773 - u8 a, u8 b, u8 c, u8 d, 1774 - u8 e, u8 f, u8 g, u8 h, 1775 - u8 i, u8 j, u8 k, u8 l) 1773 + u8 a, u8 b, u8 c, u8 d, 1774 + u8 e, u8 f, u8 g, u8 h, 1775 + u8 i, u8 j, u8 k, u8 l) 1776 1776 { 1777 1777 int retval; 1778 1778 u8 cmd[8], data[8]; ··· 1809 1809 #define LIMIT(x) ((((x)>0xffffff)?0xff0000:(((x)<=0xffff)?0:(x)&0xff0000))>>16) 1810 1810 1811 1811 static int convert420(unsigned char *yuv, unsigned char *rgb, int out_fmt, 1812 - int linesize, int mmap_kludge) 1812 + int linesize, int mmap_kludge) 1813 1813 { 1814 1814 int y, u, v, r, g, b, y1; 1815 - 1815 + 1816 1816 /* Odd lines use the same u and v as the previous line. 1817 1817 * Because of compression, it is necessary to get this 1818 1818 * information from the decoded image. */ ··· 1925 1925 1926 1926 1927 1927 static int yuvconvert(unsigned char *yuv, unsigned char *rgb, int out_fmt, 1928 - int in_uyvy, int mmap_kludge) 1928 + int in_uyvy, int mmap_kludge) 1929 1929 { 1930 1930 int y, u, v, r, g, b, y1; 1931 1931 ··· 2078 2078 mutex_unlock(&cam->param_lock); 2079 2079 return -1; 2080 2080 } 2081 - 2081 + 2082 2082 if (ibuf[17] != SUBSAMPLE_420 && ibuf[17] != SUBSAMPLE_422) { 2083 2083 LOG("illegal subtype %d\n",ibuf[17]); 2084 2084 mutex_unlock(&cam->param_lock); 2085 2085 return -1; 2086 2086 } 2087 2087 subsample_422 = ibuf[17] == SUBSAMPLE_422; 2088 - 2088 + 2089 2089 if (ibuf[18] != YUVORDER_YUYV && ibuf[18] != YUVORDER_UYVY) { 2090 2090 LOG("illegal yuvorder %d\n",ibuf[18]); 2091 2091 mutex_unlock(&cam->param_lock); 2092 2092 return -1; 2093 2093 } 2094 2094 in_uyvy = ibuf[18] == YUVORDER_UYVY; 2095 - 2095 + 2096 2096 if ((ibuf[24] != cam->params.roi.colStart) || 2097 2097 (ibuf[25] != cam->params.roi.colEnd) || 2098 2098 (ibuf[26] != cam->params.roi.rowStart) || ··· 2104 2104 cols = 8*(ibuf[25] - ibuf[24]); 2105 2105 rows = 4*(ibuf[27] - ibuf[26]); 2106 2106 2107 - 2107 + 2108 2108 if ((ibuf[28] != NOT_COMPRESSED) && (ibuf[28] != COMPRESSED)) { 2109 2109 LOG("illegal compression %d\n",ibuf[28]); 2110 2110 mutex_unlock(&cam->param_lock); 2111 2111 return -1; 2112 2112 } 2113 2113 compressed = (ibuf[28] == COMPRESSED); 2114 - 2114 + 2115 2115 if (ibuf[29] != NO_DECIMATION && ibuf[29] != DECIMATION_ENAB) { 2116 2116 LOG("illegal decimation %d\n",ibuf[29]); 2117 2117 mutex_unlock(&cam->param_lock); 2118 2118 return -1; 2119 2119 } 2120 - decimation = (ibuf[29] == DECIMATION_ENAB); 2120 + decimation = (ibuf[29] == DECIMATION_ENAB); 2121 2121 2122 2122 cam->params.yuvThreshold.yThreshold = ibuf[30]; 2123 2123 cam->params.yuvThreshold.uvThreshold = ibuf[31]; ··· 2131 2131 cam->params.status.errorCode = ibuf[39]; 2132 2132 cam->fps = ibuf[41]; 2133 2133 mutex_unlock(&cam->param_lock); 2134 - 2134 + 2135 2135 linesize = skipcount(cols, out_fmt); 2136 2136 ibuf += FRAME_HEADER_SIZE; 2137 2137 size -= FRAME_HEADER_SIZE; ··· 2150 2150 if (!compressed || (compressed && !(*ibuf & 1))) { 2151 2151 if(subsample_422 || even_line) { 2152 2152 obuf += yuvconvert(ibuf, obuf, out_fmt, 2153 - in_uyvy, cam->mmap_kludge); 2153 + in_uyvy, cam->mmap_kludge); 2154 2154 ibuf += 4; 2155 2155 ll -= 4; 2156 2156 } else { 2157 2157 /* SUBSAMPLE_420 on an odd line */ 2158 2158 obuf += convert420(ibuf, obuf, 2159 - out_fmt, linesize, 2160 - cam->mmap_kludge); 2159 + out_fmt, linesize, 2160 + cam->mmap_kludge); 2161 2161 ibuf += 2; 2162 2162 ll -= 2; 2163 2163 } ··· 2183 2183 2184 2184 if ((size > 3) && (ibuf[0] == EOI) && (ibuf[1] == EOI) && 2185 2185 (ibuf[2] == EOI) && (ibuf[3] == EOI)) { 2186 - size -= 4; 2186 + size -= 4; 2187 2187 break; 2188 2188 } 2189 2189 ··· 2204 2204 return -1; 2205 2205 } 2206 2206 } 2207 - 2207 + 2208 2208 if(decimation) { 2209 2209 /* interpolate odd rows */ 2210 2210 int i, j; ··· 2233 2233 static inline int init_stream_cap(struct cam_data *cam) 2234 2234 { 2235 2235 return do_command(cam, CPIA_COMMAND_InitStreamCap, 2236 - 0, cam->params.streamStartLine, 0, 0); 2236 + 0, cam->params.streamStartLine, 0, 0); 2237 2237 } 2238 2238 2239 2239 ··· 2254 2254 int MaxAllowableOverExposure, OverExposure; 2255 2255 2256 2256 MaxAllowableOverExposure = FLICKER_MAX_EXPOSURE - brightness - 2257 - FLICKER_BRIGHTNESS_CONSTANT; 2257 + FLICKER_BRIGHTNESS_CONSTANT; 2258 2258 2259 2259 if (MaxAllowableOverExposure < FLICKER_ALLOWABLE_OVER_EXPOSURE) { 2260 2260 OverExposure = MaxAllowableOverExposure; ··· 2280 2280 DEB_BYTE(cam->cmd_queue>>8); 2281 2281 if (cam->cmd_queue & COMMAND_SETFORMAT) { 2282 2282 do_command(cam, CPIA_COMMAND_SetFormat, 2283 - cam->params.format.videoSize, 2284 - cam->params.format.subSample, 2285 - cam->params.format.yuvOrder, 0); 2283 + cam->params.format.videoSize, 2284 + cam->params.format.subSample, 2285 + cam->params.format.yuvOrder, 0); 2286 2286 do_command(cam, CPIA_COMMAND_SetROI, 2287 - cam->params.roi.colStart, cam->params.roi.colEnd, 2288 - cam->params.roi.rowStart, cam->params.roi.rowEnd); 2287 + cam->params.roi.colStart, cam->params.roi.colEnd, 2288 + cam->params.roi.rowStart, cam->params.roi.rowEnd); 2289 2289 cam->first_frame = 1; 2290 2290 } 2291 2291 2292 2292 if (cam->cmd_queue & COMMAND_SETCOLOURPARAMS) 2293 2293 do_command(cam, CPIA_COMMAND_SetColourParams, 2294 - cam->params.colourParams.brightness, 2295 - cam->params.colourParams.contrast, 2296 - cam->params.colourParams.saturation, 0); 2294 + cam->params.colourParams.brightness, 2295 + cam->params.colourParams.contrast, 2296 + cam->params.colourParams.saturation, 0); 2297 2297 2298 2298 if (cam->cmd_queue & COMMAND_SETAPCOR) 2299 2299 do_command(cam, CPIA_COMMAND_SetApcor, 2300 - cam->params.apcor.gain1, 2301 - cam->params.apcor.gain2, 2302 - cam->params.apcor.gain4, 2303 - cam->params.apcor.gain8); 2300 + cam->params.apcor.gain1, 2301 + cam->params.apcor.gain2, 2302 + cam->params.apcor.gain4, 2303 + cam->params.apcor.gain8); 2304 2304 2305 2305 if (cam->cmd_queue & COMMAND_SETVLOFFSET) 2306 2306 do_command(cam, CPIA_COMMAND_SetVLOffset, 2307 - cam->params.vlOffset.gain1, 2308 - cam->params.vlOffset.gain2, 2309 - cam->params.vlOffset.gain4, 2310 - cam->params.vlOffset.gain8); 2307 + cam->params.vlOffset.gain1, 2308 + cam->params.vlOffset.gain2, 2309 + cam->params.vlOffset.gain4, 2310 + cam->params.vlOffset.gain8); 2311 2311 2312 2312 if (cam->cmd_queue & COMMAND_SETEXPOSURE) { 2313 2313 do_command_extended(cam, CPIA_COMMAND_SetExposure, 2314 - cam->params.exposure.gainMode, 2315 - 1, 2316 - cam->params.exposure.compMode, 2317 - cam->params.exposure.centreWeight, 2318 - cam->params.exposure.gain, 2319 - cam->params.exposure.fineExp, 2320 - cam->params.exposure.coarseExpLo, 2321 - cam->params.exposure.coarseExpHi, 2322 - cam->params.exposure.redComp, 2323 - cam->params.exposure.green1Comp, 2324 - cam->params.exposure.green2Comp, 2325 - cam->params.exposure.blueComp); 2314 + cam->params.exposure.gainMode, 2315 + 1, 2316 + cam->params.exposure.compMode, 2317 + cam->params.exposure.centreWeight, 2318 + cam->params.exposure.gain, 2319 + cam->params.exposure.fineExp, 2320 + cam->params.exposure.coarseExpLo, 2321 + cam->params.exposure.coarseExpHi, 2322 + cam->params.exposure.redComp, 2323 + cam->params.exposure.green1Comp, 2324 + cam->params.exposure.green2Comp, 2325 + cam->params.exposure.blueComp); 2326 2326 if(cam->params.exposure.expMode != 1) { 2327 2327 do_command_extended(cam, CPIA_COMMAND_SetExposure, 2328 - 0, 2329 - cam->params.exposure.expMode, 2330 - 0, 0, 2331 - cam->params.exposure.gain, 2332 - cam->params.exposure.fineExp, 2333 - cam->params.exposure.coarseExpLo, 2334 - cam->params.exposure.coarseExpHi, 2335 - 0, 0, 0, 0); 2328 + 0, 2329 + cam->params.exposure.expMode, 2330 + 0, 0, 2331 + cam->params.exposure.gain, 2332 + cam->params.exposure.fineExp, 2333 + cam->params.exposure.coarseExpLo, 2334 + cam->params.exposure.coarseExpHi, 2335 + 0, 0, 0, 0); 2336 2336 } 2337 2337 } 2338 - 2338 + 2339 2339 if (cam->cmd_queue & COMMAND_SETCOLOURBALANCE) { 2340 2340 if (cam->params.colourBalance.balanceMode == 1) { 2341 2341 do_command(cam, CPIA_COMMAND_SetColourBalance, ··· 2358 2358 2359 2359 if (cam->cmd_queue & COMMAND_SETCOMPRESSIONTARGET) 2360 2360 do_command(cam, CPIA_COMMAND_SetCompressionTarget, 2361 - cam->params.compressionTarget.frTargeting, 2362 - cam->params.compressionTarget.targetFR, 2363 - cam->params.compressionTarget.targetQ, 0); 2361 + cam->params.compressionTarget.frTargeting, 2362 + cam->params.compressionTarget.targetFR, 2363 + cam->params.compressionTarget.targetQ, 0); 2364 2364 2365 2365 if (cam->cmd_queue & COMMAND_SETYUVTHRESH) 2366 2366 do_command(cam, CPIA_COMMAND_SetYUVThresh, 2367 - cam->params.yuvThreshold.yThreshold, 2368 - cam->params.yuvThreshold.uvThreshold, 0, 0); 2367 + cam->params.yuvThreshold.yThreshold, 2368 + cam->params.yuvThreshold.uvThreshold, 0, 0); 2369 2369 2370 2370 if (cam->cmd_queue & COMMAND_SETCOMPRESSIONPARAMS) 2371 2371 do_command_extended(cam, CPIA_COMMAND_SetCompressionParams, 2372 - 0, 0, 0, 0, 2373 - cam->params.compressionParams.hysteresis, 2374 - cam->params.compressionParams.threshMax, 2375 - cam->params.compressionParams.smallStep, 2376 - cam->params.compressionParams.largeStep, 2377 - cam->params.compressionParams.decimationHysteresis, 2378 - cam->params.compressionParams.frDiffStepThresh, 2379 - cam->params.compressionParams.qDiffStepThresh, 2380 - cam->params.compressionParams.decimationThreshMod); 2372 + 0, 0, 0, 0, 2373 + cam->params.compressionParams.hysteresis, 2374 + cam->params.compressionParams.threshMax, 2375 + cam->params.compressionParams.smallStep, 2376 + cam->params.compressionParams.largeStep, 2377 + cam->params.compressionParams.decimationHysteresis, 2378 + cam->params.compressionParams.frDiffStepThresh, 2379 + cam->params.compressionParams.qDiffStepThresh, 2380 + cam->params.compressionParams.decimationThreshMod); 2381 2381 2382 2382 if (cam->cmd_queue & COMMAND_SETCOMPRESSION) 2383 2383 do_command(cam, CPIA_COMMAND_SetCompression, 2384 - cam->params.compression.mode, 2384 + cam->params.compression.mode, 2385 2385 cam->params.compression.decimation, 0, 0); 2386 2386 2387 2387 if (cam->cmd_queue & COMMAND_SETSENSORFPS) 2388 2388 do_command(cam, CPIA_COMMAND_SetSensorFPS, 2389 - cam->params.sensorFps.divisor, 2390 - cam->params.sensorFps.baserate, 0, 0); 2389 + cam->params.sensorFps.divisor, 2390 + cam->params.sensorFps.baserate, 0, 0); 2391 2391 2392 2392 if (cam->cmd_queue & COMMAND_SETFLICKERCTRL) 2393 2393 do_command(cam, CPIA_COMMAND_SetFlickerCtrl, 2394 - cam->params.flickerControl.flickerMode, 2395 - cam->params.flickerControl.coarseJump, 2396 - abs(cam->params.flickerControl.allowableOverExposure), 2397 - 0); 2394 + cam->params.flickerControl.flickerMode, 2395 + cam->params.flickerControl.coarseJump, 2396 + abs(cam->params.flickerControl.allowableOverExposure), 2397 + 0); 2398 2398 2399 2399 if (cam->cmd_queue & COMMAND_SETECPTIMING) 2400 2400 do_command(cam, CPIA_COMMAND_SetECPTiming, 2401 - cam->params.ecpTiming, 0, 0, 0); 2401 + cam->params.ecpTiming, 0, 0, 0); 2402 2402 2403 2403 if (cam->cmd_queue & COMMAND_PAUSE) 2404 2404 do_command(cam, CPIA_COMMAND_EndStreamCap, 0, 0, 0, 0); ··· 2409 2409 if (cam->cmd_queue & COMMAND_SETLIGHTS && cam->params.qx3.qx3_detected) 2410 2410 { 2411 2411 int p1 = (cam->params.qx3.bottomlight == 0) << 1; 2412 - int p2 = (cam->params.qx3.toplight == 0) << 3; 2413 - do_command(cam, CPIA_COMMAND_WriteVCReg, 0x90, 0x8F, 0x50, 0); 2414 - do_command(cam, CPIA_COMMAND_WriteMCPort, 2, 0, (p1|p2|0xE0), 0); 2412 + int p2 = (cam->params.qx3.toplight == 0) << 3; 2413 + do_command(cam, CPIA_COMMAND_WriteVCReg, 0x90, 0x8F, 0x50, 0); 2414 + do_command(cam, CPIA_COMMAND_WriteMCPort, 2, 0, (p1|p2|0xE0), 0); 2415 2415 } 2416 2416 2417 2417 cam->cmd_queue = COMMAND_NONE; ··· 2422 2422 2423 2423 2424 2424 static void set_flicker(struct cam_params *params, volatile u32 *command_flags, 2425 - int on) 2425 + int on) 2426 2426 { 2427 2427 /* Everything in here is from the Windows driver */ 2428 2428 #define FIRMWARE_VERSION(x,y) (params->version.firmwareVersion == (x) && \ 2429 - params->version.firmwareRevision == (y)) 2429 + params->version.firmwareRevision == (y)) 2430 2430 /* define for compgain calculation */ 2431 2431 #if 0 2432 2432 #define COMPGAIN(base, curexp, newexp) \ ··· 2441 2441 (u16)(((u32)(curexp * (u8)(curcomp + 128)) / (u8)(basecomp - 128))) 2442 2442 #endif 2443 2443 2444 - 2444 + 2445 2445 int currentexp = params->exposure.coarseExpLo + 2446 2446 params->exposure.coarseExpHi*256; 2447 2447 int startexp; ··· 2482 2482 } 2483 2483 if(FIRMWARE_VERSION(1,2)) 2484 2484 params->exposure.compMode = 0; 2485 - else 2485 + else 2486 2486 params->exposure.compMode = 1; 2487 2487 2488 2488 params->apcor.gain1 = 0x18; ··· 2533 2533 } 2534 2534 2535 2535 #define FIRMWARE_VERSION(x,y) (cam->params.version.firmwareVersion == (x) && \ 2536 - cam->params.version.firmwareRevision == (y)) 2536 + cam->params.version.firmwareRevision == (y)) 2537 2537 /* monitor the exposure and adjust the sensor frame rate if needed */ 2538 2538 static void monitor_exposure(struct cam_data *cam) 2539 2539 { 2540 2540 u8 exp_acc, bcomp, gain, coarseL, cmd[8], data[8]; 2541 2541 int retval, light_exp, dark_exp, very_dark_exp; 2542 2542 int old_exposure, new_exposure, framerate; 2543 - 2543 + 2544 2544 /* get necessary stats and register settings from camera */ 2545 2545 /* do_command can't handle this, so do it ourselves */ 2546 2546 cmd[0] = CPIA_COMMAND_ReadVPRegs>>8; ··· 2564 2564 2565 2565 mutex_lock(&cam->param_lock); 2566 2566 light_exp = cam->params.colourParams.brightness + 2567 - TC - 50 + EXP_ACC_LIGHT; 2567 + TC - 50 + EXP_ACC_LIGHT; 2568 2568 if(light_exp > 255) 2569 2569 light_exp = 255; 2570 2570 dark_exp = cam->params.colourParams.brightness + 2571 - TC - 50 - EXP_ACC_DARK; 2571 + TC - 50 - EXP_ACC_DARK; 2572 2572 if(dark_exp < 0) 2573 2573 dark_exp = 0; 2574 2574 very_dark_exp = dark_exp/2; 2575 - 2575 + 2576 2576 old_exposure = cam->params.exposure.coarseExpHi * 256 + 2577 - cam->params.exposure.coarseExpLo; 2577 + cam->params.exposure.coarseExpLo; 2578 2578 2579 2579 if(!cam->params.flickerControl.disabled) { 2580 2580 /* Flicker control on */ ··· 2667 2667 cam->exposure_status = EXPOSURE_NORMAL; 2668 2668 } 2669 2669 } 2670 - 2670 + 2671 2671 framerate = cam->fps; 2672 2672 if(framerate > 30 || framerate < 1) 2673 2673 framerate = 1; 2674 - 2674 + 2675 2675 if(!cam->params.flickerControl.disabled) { 2676 2676 /* Flicker control on */ 2677 2677 if((cam->exposure_status == EXPOSURE_VERY_DARK || ··· 2683 2683 ++cam->params.sensorFps.divisor; 2684 2684 cam->cmd_queue |= COMMAND_SETSENSORFPS; 2685 2685 2686 - cam->params.flickerControl.coarseJump = 2686 + cam->params.flickerControl.coarseJump = 2687 2687 flicker_jumps[cam->mainsFreq] 2688 - [cam->params.sensorFps.baserate] 2689 - [cam->params.sensorFps.divisor]; 2688 + [cam->params.sensorFps.baserate] 2689 + [cam->params.sensorFps.divisor]; 2690 2690 cam->cmd_queue |= COMMAND_SETFLICKERCTRL; 2691 2691 2692 2692 new_exposure = cam->params.flickerControl.coarseJump-1; ··· 2704 2704 cam->params.sensorFps.divisor > 0) { 2705 2705 2706 2706 /* light for too long */ 2707 - int max_exp = FIRMWARE_VERSION(1,2) ? MAX_EXP_102 : MAX_EXP ; 2707 + int max_exp = FIRMWARE_VERSION(1,2) ? MAX_EXP_102 : MAX_EXP ; 2708 2708 2709 2709 --cam->params.sensorFps.divisor; 2710 2710 cam->cmd_queue |= COMMAND_SETSENSORFPS; 2711 2711 2712 - cam->params.flickerControl.coarseJump = 2712 + cam->params.flickerControl.coarseJump = 2713 2713 flicker_jumps[cam->mainsFreq] 2714 - [cam->params.sensorFps.baserate] 2715 - [cam->params.sensorFps.divisor]; 2714 + [cam->params.sensorFps.baserate] 2715 + [cam->params.sensorFps.divisor]; 2716 2716 cam->cmd_queue |= COMMAND_SETFLICKERCTRL; 2717 2717 2718 2718 new_exposure = cam->params.flickerControl.coarseJump-1; ··· 2772 2772 2773 2773 It also adjust the colour balance when an exposure step is detected - as 2774 2774 long as flicker is running 2775 - */ 2775 + */ 2776 2776 static void restart_flicker(struct cam_data *cam) 2777 2777 { 2778 2778 int cam_exposure, old_exp; ··· 2786 2786 } 2787 2787 cam_exposure = cam->raw_image[39]*2; 2788 2788 old_exp = cam->params.exposure.coarseExpLo + 2789 - cam->params.exposure.coarseExpHi*256; 2790 - /* 2791 - see how far away camera exposure is from a valid 2792 - flicker exposure value 2793 - */ 2794 - cam_exposure %= cam->params.flickerControl.coarseJump; 2789 + cam->params.exposure.coarseExpHi*256; 2790 + /* 2791 + see how far away camera exposure is from a valid 2792 + flicker exposure value 2793 + */ 2794 + cam_exposure %= cam->params.flickerControl.coarseJump; 2795 2795 if(!cam->params.flickerControl.disabled && 2796 - cam_exposure <= cam->params.flickerControl.coarseJump - 3) { 2796 + cam_exposure <= cam->params.flickerControl.coarseJump - 3) { 2797 2797 /* Flicker control auto-disabled */ 2798 2798 cam->params.flickerControl.disabled = 1; 2799 2799 } 2800 - 2800 + 2801 2801 if(cam->params.flickerControl.disabled && 2802 2802 cam->params.flickerControl.flickerMode && 2803 2803 old_exp > cam->params.flickerControl.coarseJump + 2804 - ROUND_UP_EXP_FOR_FLICKER) { 2804 + ROUND_UP_EXP_FOR_FLICKER) { 2805 2805 /* exposure is now high enough to switch 2806 2806 flicker control back on */ 2807 2807 set_flicker(&cam->params, &cam->cmd_queue, 1); ··· 2818 2818 { 2819 2819 /* FIXME: Does this actually work? */ 2820 2820 LOG("Clearing stall\n"); 2821 - 2821 + 2822 2822 cam->ops->streamRead(cam->lowlevel_data, cam->raw_image, 0); 2823 2823 do_command(cam, CPIA_COMMAND_GetCameraStatus,0,0,0,0); 2824 2824 return cam->params.status.streamState != STREAM_PAUSED; ··· 2878 2878 return -EINTR; 2879 2879 2880 2880 do_command(cam, CPIA_COMMAND_GetCameraStatus, 2881 - 0, 0, 0, 0); 2881 + 0, 0, 0, 0); 2882 2882 } 2883 2883 if(cam->params.status.streamState != STREAM_READY) { 2884 2884 continue; ··· 2903 2903 2904 2904 /* Switch flicker control back on if it got turned off */ 2905 2905 restart_flicker(cam); 2906 - 2906 + 2907 2907 /* If AEC is enabled, monitor the exposure and 2908 2908 adjust the sensor frame rate if needed */ 2909 2909 if(cam->params.exposure.expMode == 2) 2910 2910 monitor_exposure(cam); 2911 - 2911 + 2912 2912 /* camera idle now so dispatch queued commands */ 2913 2913 dispatch_commands(cam); 2914 2914 2915 2915 /* Update our knowledge of the camera state */ 2916 - do_command(cam, CPIA_COMMAND_GetColourBalance, 0, 0, 0, 0); 2917 - do_command(cam, CPIA_COMMAND_GetExposure, 0, 0, 0, 0); 2916 + do_command(cam, CPIA_COMMAND_GetColourBalance, 0, 0, 0, 0); 2917 + do_command(cam, CPIA_COMMAND_GetExposure, 0, 0, 0, 0); 2918 2918 do_command(cam, CPIA_COMMAND_ReadMCPorts, 0, 0, 0, 0); 2919 2919 2920 2920 /* decompress and convert image to by copying it from ··· 2933 2933 uncompressed. */ 2934 2934 cam->first_frame = 1; 2935 2935 do_command(cam, CPIA_COMMAND_SetGrabMode, 2936 - CPIA_GRAB_SINGLE, 0, 0, 0); 2936 + CPIA_GRAB_SINGLE, 0, 0, 0); 2937 2937 /* FIXME: Trial & error - need up to 70ms for 2938 2938 the grab mode change to complete ? */ 2939 2939 msleep_interruptible(70); ··· 2957 2957 if (cam->first_frame) { 2958 2958 cam->first_frame = 0; 2959 2959 do_command(cam, CPIA_COMMAND_SetCompression, 2960 - cam->params.compression.mode, 2960 + cam->params.compression.mode, 2961 2961 cam->params.compression.decimation, 0, 0); 2962 2962 2963 2963 /* Switch from single-grab to continuous grab */ 2964 2964 do_command(cam, CPIA_COMMAND_SetGrabMode, 2965 - CPIA_GRAB_CONTINUOUS, 0, 0, 0); 2965 + CPIA_GRAB_CONTINUOUS, 0, 0, 0); 2966 2966 } 2967 2967 return 0; 2968 2968 } ··· 2977 2977 if ((err = allocate_frame_buf(cam))) 2978 2978 return err; 2979 2979 } 2980 - 2980 + 2981 2981 cam->curframe = vm->frame; 2982 2982 cam->frame[cam->curframe].state = FRAME_READY; 2983 2983 return fetch_frame(cam); 2984 2984 } 2985 - 2985 + 2986 2986 static int goto_high_power(struct cam_data *cam) 2987 2987 { 2988 2988 if (do_command(cam, CPIA_COMMAND_GotoHiPower, 0, 0, 0, 0)) ··· 3039 3039 static int set_camera_state(struct cam_data *cam) 3040 3040 { 3041 3041 cam->cmd_queue = COMMAND_SETCOMPRESSION | 3042 - COMMAND_SETCOMPRESSIONTARGET | 3043 - COMMAND_SETCOLOURPARAMS | 3044 - COMMAND_SETFORMAT | 3045 - COMMAND_SETYUVTHRESH | 3046 - COMMAND_SETECPTIMING | 3047 - COMMAND_SETCOMPRESSIONPARAMS | 3048 - COMMAND_SETEXPOSURE | 3049 - COMMAND_SETCOLOURBALANCE | 3050 - COMMAND_SETSENSORFPS | 3051 - COMMAND_SETAPCOR | 3052 - COMMAND_SETFLICKERCTRL | 3053 - COMMAND_SETVLOFFSET; 3042 + COMMAND_SETCOMPRESSIONTARGET | 3043 + COMMAND_SETCOLOURPARAMS | 3044 + COMMAND_SETFORMAT | 3045 + COMMAND_SETYUVTHRESH | 3046 + COMMAND_SETECPTIMING | 3047 + COMMAND_SETCOMPRESSIONPARAMS | 3048 + COMMAND_SETEXPOSURE | 3049 + COMMAND_SETCOLOURBALANCE | 3050 + COMMAND_SETSENSORFPS | 3051 + COMMAND_SETAPCOR | 3052 + COMMAND_SETFLICKERCTRL | 3053 + COMMAND_SETVLOFFSET; 3054 3054 3055 3055 do_command(cam, CPIA_COMMAND_SetGrabMode, CPIA_GRAB_SINGLE,0,0,0); 3056 3056 dispatch_commands(cam); 3057 - 3057 + 3058 3058 /* Wait 6 frames for the sensor to get all settings and 3059 3059 AEC/ACB to settle */ 3060 3060 msleep_interruptible(6*(cam->params.sensorFps.baserate ? 33 : 40) * ··· 3062 3062 3063 3063 if(signal_pending(current)) 3064 3064 return -EINTR; 3065 - 3065 + 3066 3066 save_camera_state(cam); 3067 3067 3068 3068 return 0; ··· 3094 3094 if (goto_low_power(cam)) 3095 3095 return -ENODEV; 3096 3096 } 3097 - 3097 + 3098 3098 /* procedure described in developer's guide p3-28 */ 3099 - 3099 + 3100 3100 /* Check the firmware version. */ 3101 3101 cam->params.version.firmwareVersion = 0; 3102 3102 get_version_information(cam); ··· 3113 3113 cam->params.qx3.qx3_detected = (cam->params.pnpID.vendor == 0x0813 && 3114 3114 cam->params.pnpID.product == 0x0001); 3115 3115 3116 - /* The fatal error checking should be done after 3116 + /* The fatal error checking should be done after 3117 3117 * the camera powers up (developer's guide p 3-38) */ 3118 3118 3119 3119 /* Set streamState before transition to high power to avoid bug 3120 3120 * in firmware 1-02 */ 3121 3121 do_command(cam, CPIA_COMMAND_ModifyCameraStatus, STREAMSTATE, 0, 3122 - STREAM_NOT_READY, 0); 3123 - 3122 + STREAM_NOT_READY, 0); 3123 + 3124 3124 /* GotoHiPower */ 3125 3125 err = goto_high_power(cam); 3126 3126 if (err) ··· 3142 3142 /* Firmware 1-02 may do this for parallel port cameras, 3143 3143 * just clear the flags (developer's guide p 3-38) */ 3144 3144 do_command(cam, CPIA_COMMAND_ModifyCameraStatus, 3145 - FATALERROR, ~(COM_FLAG|CPIA_FLAG), 0, 0); 3145 + FATALERROR, ~(COM_FLAG|CPIA_FLAG), 0, 0); 3146 3146 } 3147 3147 } 3148 - 3148 + 3149 3149 /* Check the camera status again */ 3150 3150 if (cam->params.status.fatalError) { 3151 3151 if (cam->params.status.fatalError) 3152 3152 return -EIO; 3153 3153 } 3154 - 3154 + 3155 3155 /* VPVersion can't be retrieved before the camera is in HiPower, 3156 3156 * so get it here instead of in get_version_information. */ 3157 3157 do_command(cam, CPIA_COMMAND_GetVPVersion, 0, 0, 0, 0); ··· 3193 3193 if (!cam->raw_image) 3194 3194 goto oops; 3195 3195 } 3196 - 3196 + 3197 3197 if (!cam->decompressed_frame.data) { 3198 3198 cam->decompressed_frame.data = rvmalloc(CPIA_MAX_FRAME_SIZE); 3199 3199 if (!cam->decompressed_frame.data) 3200 3200 goto oops; 3201 3201 } 3202 - 3202 + 3203 3203 /* open cpia */ 3204 3204 err = -ENODEV; 3205 3205 if (cam->ops->open(cam->lowlevel_data)) 3206 3206 goto oops; 3207 - 3207 + 3208 3208 /* reset the camera */ 3209 3209 if ((err = reset_camera(cam)) != 0) { 3210 3210 cam->ops->close(cam->lowlevel_data); 3211 3211 goto oops; 3212 3212 } 3213 - 3213 + 3214 3214 err = -EINTR; 3215 3215 if(signal_pending(current)) 3216 3216 goto oops; ··· 3224 3224 3225 3225 /* init it to something */ 3226 3226 cam->mmap_kludge = 0; 3227 - 3227 + 3228 3228 ++cam->open_count; 3229 3229 file->private_data = dev; 3230 3230 mutex_unlock(&cam->busy_lock); ··· 3250 3250 struct cam_data *cam = dev->priv; 3251 3251 3252 3252 if (cam->ops) { 3253 - /* Return ownership of /proc/cpia/videoX to root */ 3253 + /* Return ownership of /proc/cpia/videoX to root */ 3254 3254 if(cam->proc_entry) 3255 3255 cam->proc_entry->uid = 0; 3256 - 3256 + 3257 3257 /* save camera state for later open (developers guide ch 3.5.3) */ 3258 3258 save_camera_state(cam); 3259 3259 ··· 3342 3342 return -EFAULT; 3343 3343 } 3344 3344 if (copy_to_user(buf, cam->decompressed_frame.data, 3345 - cam->decompressed_frame.count)) { 3345 + cam->decompressed_frame.count)) { 3346 3346 DBG("copy_to_user failed\n"); 3347 3347 mutex_unlock(&cam->busy_lock); 3348 3348 return -EFAULT; ··· 3361 3361 3362 3362 if (!cam || !cam->ops) 3363 3363 return -ENODEV; 3364 - 3364 + 3365 3365 /* make this _really_ smp-safe */ 3366 3366 if (mutex_lock_interruptible(&cam->busy_lock)) 3367 3367 return -EINTR; ··· 3405 3405 v->norm = 0; 3406 3406 break; 3407 3407 } 3408 - 3408 + 3409 3409 case VIDIOCSCHAN: 3410 3410 { 3411 3411 struct video_channel *v = arg; ··· 3424 3424 *pic = cam->vp; 3425 3425 break; 3426 3426 } 3427 - 3427 + 3428 3428 case VIDIOCSPICT: 3429 3429 { 3430 3430 struct video_picture *vp = arg; ··· 3458 3458 3459 3459 /* Adjust flicker control if necessary */ 3460 3460 if(cam->params.flickerControl.allowableOverExposure < 0) 3461 - cam->params.flickerControl.allowableOverExposure = 3461 + cam->params.flickerControl.allowableOverExposure = 3462 3462 -find_over_exposure(cam->params.colourParams.brightness); 3463 3463 if(cam->params.flickerControl.flickerMode != 0) 3464 3464 cam->cmd_queue |= COMMAND_SETFLICKERCTRL; 3465 - 3465 + 3466 3466 3467 3467 /* queue command to update camera */ 3468 3468 cam->cmd_queue |= COMMAND_SETCOLOURPARAMS; ··· 3482 3482 *vw = cam->vw; 3483 3483 break; 3484 3484 } 3485 - 3485 + 3486 3486 case VIDIOCSWIN: 3487 3487 { 3488 3488 /* copy_from_user, check validity, copy to internal structure */ ··· 3514 3514 3515 3515 /* video size is changing, reset the subcapture area */ 3516 3516 memset(&cam->vc, 0, sizeof(cam->vc)); 3517 - 3517 + 3518 3518 set_vw_size(cam); 3519 3519 DBG("%d / %d\n", cam->vw.width, cam->vw.height); 3520 3520 cam->cmd_queue |= COMMAND_SETFORMAT; ··· 3547 3547 vm->offsets[i] = CPIA_MAX_FRAME_SIZE * i; 3548 3548 break; 3549 3549 } 3550 - 3550 + 3551 3551 case VIDIOCMCAPTURE: 3552 3552 { 3553 3553 struct video_mmap *vm = arg; ··· 3597 3597 3598 3598 /* video size is changing, reset the subcapture area */ 3599 3599 memset(&cam->vc, 0, sizeof(cam->vc)); 3600 - 3600 + 3601 3601 set_vw_size(cam); 3602 3602 cam->cmd_queue |= COMMAND_SETFORMAT; 3603 3603 dispatch_commands(cam); ··· 3608 3608 3609 3609 break; 3610 3610 } 3611 - 3611 + 3612 3612 case VIDIOCSYNC: 3613 3613 { 3614 3614 int *frame = arg; ··· 3649 3649 *vc = cam->vc; 3650 3650 3651 3651 break; 3652 - } 3652 + } 3653 3653 3654 3654 case VIDIOCSCAPTURE: 3655 3655 { ··· 3665 3665 retval = -EINVAL; 3666 3666 break; 3667 3667 } 3668 - 3668 + 3669 3669 /* Clip to the resolution we can set for the ROI 3670 3670 (every 8 columns and 4 rows) */ 3671 3671 vc->x = vc->x & ~(__u32)7; ··· 3681 3681 } 3682 3682 3683 3683 DBG("%d,%d/%dx%d\n", vc->x,vc->y,vc->width, vc->height); 3684 - 3684 + 3685 3685 mutex_lock(&cam->param_lock); 3686 - 3686 + 3687 3687 cam->vc.x = vc->x; 3688 3688 cam->vc.y = vc->y; 3689 3689 cam->vc.width = vc->width; 3690 3690 cam->vc.height = vc->height; 3691 - 3691 + 3692 3692 set_vw_size(cam); 3693 3693 cam->cmd_queue |= COMMAND_SETFORMAT; 3694 3694 ··· 3699 3699 dispatch_commands(cam); 3700 3700 break; 3701 3701 } 3702 - 3702 + 3703 3703 case VIDIOCGUNIT: 3704 3704 { 3705 3705 struct video_unit *vu = arg; ··· 3715 3715 break; 3716 3716 } 3717 3717 3718 - 3718 + 3719 3719 /* pointless to implement overlay with this camera */ 3720 3720 case VIDIOCCAPTURE: 3721 3721 case VIDIOCGFBUF: ··· 3738 3738 3739 3739 mutex_unlock(&cam->busy_lock); 3740 3740 return retval; 3741 - } 3741 + } 3742 3742 3743 3743 static int cpia_ioctl(struct inode *inode, struct file *file, 3744 3744 unsigned int cmd, unsigned long arg) ··· 3759 3759 3760 3760 if (!cam || !cam->ops) 3761 3761 return -ENODEV; 3762 - 3762 + 3763 3763 DBG("cpia_mmap: %ld\n", size); 3764 3764 3765 3765 if (size > FRAME_NUM*CPIA_MAX_FRAME_SIZE) ··· 3767 3767 3768 3768 if (!cam || !cam->ops) 3769 3769 return -ENODEV; 3770 - 3770 + 3771 3771 /* make this _really_ smp-safe */ 3772 3772 if (mutex_lock_interruptible(&cam->busy_lock)) 3773 3773 return -EINTR; ··· 3851 3851 cam->params.flickerControl.flickerMode = 0; 3852 3852 cam->params.flickerControl.disabled = 1; 3853 3853 3854 - cam->params.flickerControl.coarseJump = 3854 + cam->params.flickerControl.coarseJump = 3855 3855 flicker_jumps[cam->mainsFreq] 3856 - [cam->params.sensorFps.baserate] 3857 - [cam->params.sensorFps.divisor]; 3858 - cam->params.flickerControl.allowableOverExposure = 3856 + [cam->params.sensorFps.baserate] 3857 + [cam->params.sensorFps.divisor]; 3858 + cam->params.flickerControl.allowableOverExposure = 3859 3859 -find_over_exposure(cam->params.colourParams.brightness); 3860 3860 cam->params.vlOffset.gain1 = 20; 3861 3861 cam->params.vlOffset.gain2 = 24; ··· 3870 3870 cam->params.compressionParams.qDiffStepThresh = 3; 3871 3871 cam->params.compressionParams.decimationThreshMod = 2; 3872 3872 /* End of default values from Software Developer's Guide */ 3873 - 3873 + 3874 3874 cam->transfer_rate = 0; 3875 3875 cam->exposure_status = EXPOSURE_NORMAL; 3876 - 3876 + 3877 3877 /* Set Sensor FPS to 15fps. This seems better than 30fps 3878 3878 * for indoor lighting. */ 3879 3879 cam->params.sensorFps.divisor = 1; 3880 3880 cam->params.sensorFps.baserate = 1; 3881 - 3881 + 3882 3882 cam->params.yuvThreshold.yThreshold = 6; /* From windows driver */ 3883 3883 cam->params.yuvThreshold.uvThreshold = 6; /* From windows driver */ 3884 - 3884 + 3885 3885 cam->params.format.subSample = SUBSAMPLE_422; 3886 3886 cam->params.format.yuvOrder = YUVORDER_YUYV; 3887 - 3887 + 3888 3888 cam->params.compression.mode = CPIA_COMPRESSION_AUTO; 3889 3889 cam->params.compressionTarget.frTargeting = 3890 3890 CPIA_COMPRESSION_TARGET_QUALITY; ··· 3898 3898 cam->params.qx3.cradled = 0; 3899 3899 3900 3900 cam->video_size = VIDEOSIZE_CIF; 3901 - 3901 + 3902 3902 cam->vp.colour = 32768; /* 50% */ 3903 3903 cam->vp.hue = 32768; /* 50% */ 3904 3904 cam->vp.brightness = 32768; /* 50% */ ··· 3911 3911 cam->vc.y = 0; 3912 3912 cam->vc.width = 0; 3913 3913 cam->vc.height = 0; 3914 - 3914 + 3915 3915 cam->vw.x = 0; 3916 3916 cam->vw.y = 0; 3917 3917 set_vw_size(cam); ··· 3928 3928 3929 3929 /* initialize cam_data structure */ 3930 3930 static void init_camera_struct(struct cam_data *cam, 3931 - struct cpia_camera_ops *ops ) 3931 + struct cpia_camera_ops *ops ) 3932 3932 { 3933 3933 int i; 3934 3934 ··· 3945 3945 3946 3946 memcpy(&cam->vdev, &cpia_template, sizeof(cpia_template)); 3947 3947 cam->vdev.priv = cam; 3948 - 3948 + 3949 3949 cam->curframe = 0; 3950 3950 for (i = 0; i < FRAME_NUM; i++) { 3951 3951 cam->frame[i].width = 0; ··· 3961 3961 3962 3962 struct cam_data *cpia_register_camera(struct cpia_camera_ops *ops, void *lowlevel) 3963 3963 { 3964 - struct cam_data *camera; 3965 - 3964 + struct cam_data *camera; 3965 + 3966 3966 if ((camera = kmalloc(sizeof(struct cam_data), GFP_KERNEL)) == NULL) 3967 3967 return NULL; 3968 3968 3969 - 3969 + 3970 3970 init_camera_struct( camera, ops ); 3971 3971 camera->lowlevel_data = lowlevel; 3972 - 3972 + 3973 3973 /* register v4l device */ 3974 3974 if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { 3975 3975 kfree(camera); ··· 3982 3982 /* open cpia */ 3983 3983 if (camera->ops->open(camera->lowlevel_data)) 3984 3984 return camera; 3985 - 3985 + 3986 3986 /* reset the camera */ 3987 3987 if (reset_camera(camera) != 0) { 3988 3988 camera->ops->close(camera->lowlevel_data); ··· 4022 4022 DBG("camera open -- setting ops to NULL\n"); 4023 4023 cam->ops = NULL; 4024 4024 } 4025 - 4025 + 4026 4026 #ifdef CONFIG_PROC_FS 4027 4027 DBG("destroying /proc/cpia/video%d\n", cam->vdev.minor); 4028 4028 destroy_proc_cpia_cam(cam); 4029 - #endif 4029 + #endif 4030 4030 if (!cam->open_count) { 4031 4031 DBG("freeing camera\n"); 4032 4032 kfree(cam);
+26 -26
drivers/media/video/cpia.h
··· 52 52 struct cpia_camera_ops 53 53 { 54 54 /* open sets privdata to point to structure for this camera. 55 - * Returns negative value on error, otherwise 0. 55 + * Returns negative value on error, otherwise 0. 56 56 */ 57 57 int (*open)(void *privdata); 58 - 58 + 59 59 /* Registers callback function cb to be called with cbdata 60 60 * when an image is ready. If cb is NULL, only single image grabs 61 61 * should be used. cb should immediately call streamRead to read ··· 63 63 * otherwise 0. 64 64 */ 65 65 int (*registerCallback)(void *privdata, void (*cb)(void *cbdata), 66 - void *cbdata); 67 - 66 + void *cbdata); 67 + 68 68 /* transferCmd sends commands to the camera. command MUST point to 69 69 * an 8 byte buffer in kernel space. data can be NULL if no extra 70 70 * data is needed. The size of the data is given by the last 2 ··· 77 77 * Returns negative value on error, otherwise 0. 78 78 */ 79 79 int (*streamStart)(void *privdata); 80 - 80 + 81 81 /* streamStop terminates stream capture mode. 82 82 * Returns negative value on error, otherwise 0. 83 83 */ 84 84 int (*streamStop)(void *privdata); 85 - 85 + 86 86 /* streamRead reads a frame from the camera. buffer points to a 87 - * buffer large enough to hold a complete frame in kernel space. 88 - * noblock indicates if this should be a non blocking read. 87 + * buffer large enough to hold a complete frame in kernel space. 88 + * noblock indicates if this should be a non blocking read. 89 89 * Returns the number of bytes read, or negative value on error. 90 - */ 90 + */ 91 91 int (*streamRead)(void *privdata, u8 *buffer, int noblock); 92 - 92 + 93 93 /* close disables the device until open() is called again. 94 94 * Returns negative value on error, otherwise 0. 95 95 */ 96 96 int (*close)(void *privdata); 97 - 97 + 98 98 /* If wait_for_stream_ready is non-zero, wait until the streamState 99 99 * is STREAM_READY before calling streamRead. 100 100 */ 101 101 int wait_for_stream_ready; 102 102 103 - /* 103 + /* 104 104 * Used to maintain lowlevel module usage counts 105 105 */ 106 106 struct module *owner; ··· 215 215 u8 videoSize; /* CIF/QCIF */ 216 216 u8 subSample; 217 217 u8 yuvOrder; 218 - } format; 219 - struct { /* Intel QX3 specific data */ 220 - u8 qx3_detected; /* a QX3 is present */ 221 - u8 toplight; /* top light lit , R/W */ 222 - u8 bottomlight; /* bottom light lit, R/W */ 223 - u8 button; /* snapshot button pressed (R/O) */ 224 - u8 cradled; /* microscope is in cradle (R/O) */ 225 - } qx3; 218 + } format; 219 + struct { /* Intel QX3 specific data */ 220 + u8 qx3_detected; /* a QX3 is present */ 221 + u8 toplight; /* top light lit , R/W */ 222 + u8 bottomlight; /* bottom light lit, R/W */ 223 + u8 button; /* snapshot button pressed (R/O) */ 224 + u8 cradled; /* microscope is in cradle (R/O) */ 225 + } qx3; 226 226 struct { 227 227 u8 colStart; /* skip first 8*colStart pixels */ 228 228 u8 colEnd; /* finish at 8*colEnd pixels */ ··· 247 247 struct cam_data { 248 248 struct list_head cam_data_list; 249 249 250 - struct mutex busy_lock; /* guard against SMP multithreading */ 250 + struct mutex busy_lock; /* guard against SMP multithreading */ 251 251 struct cpia_camera_ops *ops; /* lowlevel driver operations */ 252 252 void *lowlevel_data; /* private data for lowlevel driver */ 253 253 u8 *raw_image; /* buffer for raw image data */ 254 254 struct cpia_frame decompressed_frame; 255 - /* buffer to hold decompressed frame */ 256 - int image_size; /* sizeof last decompressed image */ 255 + /* buffer to hold decompressed frame */ 256 + int image_size; /* sizeof last decompressed image */ 257 257 int open_count; /* # of process that have camera open */ 258 258 259 259 /* camera status */ ··· 265 265 struct mutex param_lock; /* params lock for this camera */ 266 266 struct cam_params params; /* camera settings */ 267 267 struct proc_dir_entry *proc_entry; /* /proc/cpia/videoX */ 268 - 268 + 269 269 /* v4l */ 270 270 int video_size; /* VIDEO_SIZE_ */ 271 271 volatile enum v4l_camstates camstate; /* v4l layer status */ ··· 277 277 /* mmap interface */ 278 278 int curframe; /* the current frame to grab into */ 279 279 u8 *frame_buf; /* frame buffer data */ 280 - struct cpia_frame frame[FRAME_NUM]; 280 + struct cpia_frame frame[FRAME_NUM]; 281 281 /* FRAME_NUM-buffering, so we need a array */ 282 282 283 283 int first_frame; ··· 424 424 #define DEB_BYTE(p)\ 425 425 DBG("%1d %1d %1d %1d %1d %1d %1d %1d \n",\ 426 426 (p)&0x80?1:0, (p)&0x40?1:0, (p)&0x20?1:0, (p)&0x10?1:0,\ 427 - (p)&0x08?1:0, (p)&0x04?1:0, (p)&0x02?1:0, (p)&0x01?1:0); 427 + (p)&0x08?1:0, (p)&0x04?1:0, (p)&0x02?1:0, (p)&0x01?1:0); 428 428 429 429 #endif /* __KERNEL__ */ 430 430
+53 -53
drivers/media/video/cpia_pp.c
··· 23 23 */ 24 24 25 25 /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */ 26 - /* #define _CPIA_DEBUG_ 1 */ 26 + /* #define _CPIA_DEBUG_ 1 */ 27 27 28 28 #include <linux/config.h> 29 29 ··· 45 45 46 46 static int cpia_pp_open(void *privdata); 47 47 static int cpia_pp_registerCallback(void *privdata, void (*cb) (void *cbdata), 48 - void *cbdata); 48 + void *cbdata); 49 49 static int cpia_pp_transferCmd(void *privdata, u8 *command, u8 *data); 50 50 static int cpia_pp_streamStart(void *privdata); 51 51 static int cpia_pp_streamStop(void *privdata); ··· 93 93 int stream_irq; 94 94 }; 95 95 96 - static struct cpia_camera_ops cpia_pp_ops = 96 + static struct cpia_camera_ops cpia_pp_ops = 97 97 { 98 98 cpia_pp_open, 99 99 cpia_pp_registerCallback, ··· 123 123 } 124 124 125 125 /* Special CPiA PPC modes: These are invoked by using the 1284 Extensibility 126 - * Link Flag during negotiation */ 126 + * Link Flag during negotiation */ 127 127 #define UPLOAD_FLAG 0x08 128 128 #define NIBBLE_TRANSFER 0x01 129 129 #define ECP_TRANSFER 0x03 ··· 139 139 /* CPiA nonstandard "Nibble" mode (no nDataAvail signal after each byte). */ 140 140 /* The standard kernel parport_ieee1284_read_nibble() fails with the CPiA... */ 141 141 142 - static size_t cpia_read_nibble (struct parport *port, 143 - void *buffer, size_t len, 142 + static size_t cpia_read_nibble (struct parport *port, 143 + void *buffer, size_t len, 144 144 int flags) 145 145 { 146 - /* adapted verbatim, with one change, from 146 + /* adapted verbatim, with one change, from 147 147 parport_ieee1284_read_nibble() in drivers/parport/ieee1284-ops.c */ 148 148 149 149 unsigned char *buf = buffer; 150 150 int i; 151 151 unsigned char byte = 0; 152 - 152 + 153 153 len *= 2; /* in nibbles */ 154 154 for (i=0; i < len; i++) { 155 155 unsigned char nibble; ··· 158 158 * after every second nibble to signal that more 159 159 * data is available. (the total number of Bytes that 160 160 * should be sent is known; if too few are received, an error 161 - * will be recorded after a timeout). 161 + * will be recorded after a timeout). 162 162 * This is incompatible with parport_ieee1284_read_nibble(), 163 163 * which expects to find nFault LO after every second nibble. 164 164 */ 165 165 166 - /* Solution: modify cpia_read_nibble to only check for 166 + /* Solution: modify cpia_read_nibble to only check for 167 167 * nDataAvail before the first nibble is sent. 168 168 */ 169 169 ··· 216 216 /* Second nibble */ 217 217 byte |= nibble << 4; 218 218 *buf++ = byte; 219 - } else 219 + } else 220 220 byte = nibble; 221 221 } 222 222 ··· 238 238 } 239 239 240 240 /* CPiA nonstandard "Nibble Stream" mode (2 nibbles per cycle, instead of 1) 241 - * (See CPiA Data sheet p. 31) 242 - * 243 - * "Nibble Stream" mode used by CPiA for uploads to non-ECP ports is a 244 - * nonstandard variant of nibble mode which allows the same (mediocre) 245 - * data flow of 8 bits per cycle as software-enabled ECP by TRISTATE-capable 241 + * (See CPiA Data sheet p. 31) 242 + * 243 + * "Nibble Stream" mode used by CPiA for uploads to non-ECP ports is a 244 + * nonstandard variant of nibble mode which allows the same (mediocre) 245 + * data flow of 8 bits per cycle as software-enabled ECP by TRISTATE-capable 246 246 * parallel ports, but works also for non-TRISTATE-capable ports. 247 247 * (Standard nibble mode only send 4 bits per cycle) 248 248 * 249 249 */ 250 250 251 - static size_t cpia_read_nibble_stream(struct parport *port, 252 - void *buffer, size_t len, 251 + static size_t cpia_read_nibble_stream(struct parport *port, 252 + void *buffer, size_t len, 253 253 int flags) 254 254 { 255 255 int i; ··· 260 260 unsigned char nibble[2], byte = 0; 261 261 int j; 262 262 263 - /* Image Data is complete when 4 consecutive EOI bytes (0xff) are seen */ 263 + /* Image Data is complete when 4 consecutive EOI bytes (0xff) are seen */ 264 264 if (endseen > 3 ) 265 265 break; 266 266 ··· 268 268 parport_frob_control (port, 269 269 PARPORT_CONTROL_AUTOFD, 270 270 PARPORT_CONTROL_AUTOFD); 271 - 271 + 272 272 /* Event 9: nAck goes low. */ 273 273 port->ieee1284.phase = IEEE1284_PH_REV_DATA; 274 274 if (parport_wait_peripheral (port, ··· 282 282 283 283 /* Read lower nibble */ 284 284 nibble[0] = parport_read_status (port) >>3; 285 - 285 + 286 286 /* Event 10: Set nAutoFd high. */ 287 287 parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); 288 288 ··· 295 295 port->name); 296 296 break; 297 297 } 298 - 298 + 299 299 /* Read upper nibble */ 300 300 nibble[1] = parport_read_status (port) >>3; 301 - 301 + 302 302 /* reassemble the byte */ 303 303 for (j = 0; j < 2 ; j++ ) { 304 304 nibble[j] &= ~8; ··· 335 335 static int ForwardSetup(struct pp_cam_entry *cam) 336 336 { 337 337 int retry; 338 - 339 - /* The CPiA uses ECP protocol for Downloads from the Host to the camera. 338 + 339 + /* The CPiA uses ECP protocol for Downloads from the Host to the camera. 340 340 * This will be software-emulated if ECP hardware is not present 341 341 */ 342 342 ··· 375 375 upload_mode = mode; 376 376 if(extensibility) mode = UPLOAD_FLAG|transfer_mode|IEEE1284_EXT_LINK; 377 377 378 - /* the usual camera maximum response time is 10ms, but after 378 + /* the usual camera maximum response time is 10ms, but after 379 379 * receiving some commands, it needs up to 40ms. */ 380 - 380 + 381 381 for(retry = 0; retry < 4; ++retry) { 382 382 if(!parport_negotiate(cam->port, mode)) { 383 383 break; ··· 439 439 440 440 /* support for CPiA variant nibble reads */ 441 441 if(cam->port->ieee1284.mode == IEEE1284_MODE_NIBBLE) { 442 - if(cpia_read_nibble(cam->port, packet, size, 0) != size) 443 - retval = -EIO; 442 + if(cpia_read_nibble(cam->port, packet, size, 0) != size) 443 + retval = -EIO; 444 444 } else { 445 - if(parport_read(cam->port, packet, size) != size) 445 + if(parport_read(cam->port, packet, size) != size) 446 446 retval = -EIO; 447 447 } 448 448 EndTransferMode(cam); ··· 542 542 block_size = PARPORT_CHUNK_SIZE; 543 543 while( !cam->image_complete ) { 544 544 cond_resched(); 545 - 545 + 546 546 new_bytes = cpia_pp_read(cam->port, buffer, block_size ); 547 547 if( new_bytes <= 0 ) { 548 548 break; 549 549 } 550 550 i=-1; 551 551 while(++i<new_bytes && endseen<4) { 552 - if(*buffer==EOI) { 553 - endseen++; 554 - } else { 555 - endseen=0; 556 - } 552 + if(*buffer==EOI) { 553 + endseen++; 554 + } else { 555 + endseen=0; 556 + } 557 557 buffer++; 558 558 } 559 559 read_bytes += i; ··· 601 601 } 602 602 if((err = ReadPacket(cam, buffer, 8)) < 0) { 603 603 DBG("Error reading command result\n"); 604 - return err; 604 + return err; 605 605 } 606 606 memcpy(data, buffer, databytes); 607 607 } else if(command[0] == DATA_OUT) { ··· 631 631 static int cpia_pp_open(void *privdata) 632 632 { 633 633 struct pp_cam_entry *cam = (struct pp_cam_entry *)privdata; 634 - 634 + 635 635 if (cam == NULL) 636 636 return -EINVAL; 637 - 637 + 638 638 if(cam->open_count == 0) { 639 639 if (parport_claim(cam->pdev)) { 640 640 DBG("failed to claim the port\n"); ··· 645 645 parport_write_control(cam->port, PARPORT_CONTROL_SELECT); 646 646 udelay(50); 647 647 parport_write_control(cam->port, 648 - PARPORT_CONTROL_SELECT 649 - | PARPORT_CONTROL_INIT); 648 + PARPORT_CONTROL_SELECT 649 + | PARPORT_CONTROL_INIT); 650 650 } 651 - 651 + 652 652 ++cam->open_count; 653 - 653 + 654 654 return 0; 655 655 } 656 656 ··· 663 663 { 664 664 struct pp_cam_entry *cam = privdata; 665 665 int retval = 0; 666 - 666 + 667 667 if(cam->port->irq != PARPORT_IRQ_NONE) { 668 668 INIT_WORK(&cam->cb_task, cb, cbdata); 669 669 } else { ··· 707 707 LOG("failed to allocate camera structure\n"); 708 708 return -ENOMEM; 709 709 } 710 - 710 + 711 711 pdev = parport_register_device(port, "cpia_pp", NULL, NULL, 712 - NULL, 0, cam); 712 + NULL, 0, cam); 713 713 714 714 if (!pdev) { 715 715 LOG("failed to parport_register_device\n"); ··· 753 753 } 754 754 cpia = NULL; 755 755 } 756 - spin_unlock( &cam_list_lock_pp ); 756 + spin_unlock( &cam_list_lock_pp ); 757 757 758 758 if (!cpia) { 759 759 DBG("cpia_pp_detach failed to find cam_data in cam_list\n"); 760 760 return; 761 761 } 762 - 763 - cam = (struct pp_cam_entry *) cpia->lowlevel_data; 762 + 763 + cam = (struct pp_cam_entry *) cpia->lowlevel_data; 764 764 cpia_unregister_camera(cpia); 765 - if(cam->open_count > 0) 765 + if(cam->open_count > 0) 766 766 cpia_pp_close(cam); 767 767 parport_unregister_device(cam->pdev); 768 - cpia->lowlevel_data = NULL; 768 + cpia->lowlevel_data = NULL; 769 769 kfree(cam); 770 770 } 771 771 ··· 805 805 806 806 int cpia_pp_init(void) 807 807 { 808 - printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT, 808 + printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT, 809 809 CPIA_PP_MAJ_VER,CPIA_PP_MIN_VER,CPIA_PP_PATCH_VER); 810 810 811 811 if(parport_nr[0] == PPCPIA_PARPORT_OFF) { 812 812 printk(" disabled\n"); 813 813 return 0; 814 814 } 815 - 815 + 816 816 spin_lock_init( &cam_list_lock_pp ); 817 817 818 818 if (parport_register_driver (&cpia_pp_driver)) {
+20 -20
drivers/media/video/cpia_usb.c
··· 22 22 */ 23 23 24 24 /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */ 25 - /* #define _CPIA_DEBUG_ 1 */ 25 + /* #define _CPIA_DEBUG_ 1 */ 26 26 27 27 #include <linux/module.h> 28 28 #include <linux/kernel.h> ··· 85 85 86 86 static int cpia_usb_open(void *privdata); 87 87 static int cpia_usb_registerCallback(void *privdata, void (*cb) (void *cbdata), 88 - void *cbdata); 88 + void *cbdata); 89 89 static int cpia_usb_transferCmd(void *privdata, u8 *command, u8 *data); 90 90 static int cpia_usb_streamStart(void *privdata); 91 91 static int cpia_usb_streamStop(void *privdata); ··· 127 127 ucpia->workbuff->status = FRAME_READING; 128 128 ucpia->workbuff->length = 0; 129 129 } 130 - 130 + 131 131 for (i = 0; i < urb->number_of_packets; i++) { 132 132 int n = urb->iso_frame_desc[i].actual_length; 133 133 int st = urb->iso_frame_desc[i].status; ··· 141 141 printk(KERN_DEBUG "cpia: scratch buf overflow!scr_len: %d, n: %d\n", ucpia->workbuff->length, n); 142 142 return; 143 143 } 144 - 144 + 145 145 if (n) { 146 - if ((ucpia->workbuff->length > 0) || 146 + if ((ucpia->workbuff->length > 0) || 147 147 (0x19 == cdata[0] && 0x68 == cdata[1])) { 148 148 memcpy(ucpia->workbuff->data + ucpia->workbuff->length, cdata, n); 149 149 ucpia->workbuff->length += n; ··· 160 160 ucpia->workbuff = ucpia->workbuff->next; 161 161 ucpia->workbuff->status = FRAME_EMPTY; 162 162 ucpia->workbuff->length = 0; 163 - 163 + 164 164 if (waitqueue_active(&ucpia->wq_stream)) 165 165 wake_up_interruptible(&ucpia->wq_stream); 166 166 } ··· 178 178 struct usb_cpia *ucpia = (struct usb_cpia *) privdata; 179 179 struct urb *urb; 180 180 int ret, retval = 0, fx, err; 181 - 181 + 182 182 if (!ucpia) 183 183 return -EINVAL; 184 184 ··· 191 191 retval = -EINVAL; 192 192 goto error_0; 193 193 } 194 - 194 + 195 195 ret = usb_set_interface(ucpia->dev, ucpia->iface, 3); 196 196 if (ret < 0) { 197 197 printk(KERN_ERR "cpia_usb_open: usb_set_interface error (ret = %d)\n", ret); ··· 286 286 error_0: 287 287 kfree (ucpia->sbuf[0].data); 288 288 ucpia->sbuf[0].data = NULL; 289 - 289 + 290 290 return retval; 291 291 } 292 292 ··· 307 307 return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 308 308 packet[1] + (packet[0] << 8), 309 309 USB_TYPE_VENDOR | USB_RECIP_DEVICE, 310 - packet[2] + (packet[3] << 8), 310 + packet[2] + (packet[3] << 8), 311 311 packet[4] + (packet[5] << 8), buf, size, 1000); 312 312 } 313 313 ··· 324 324 return usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 325 325 packet[1] + (packet[0] << 8), 326 326 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 327 - packet[2] + (packet[3] << 8), 327 + packet[2] + (packet[3] << 8), 328 328 packet[4] + (packet[5] << 8), buf, size, 1000); 329 329 } 330 330 ··· 393 393 394 394 if (!ucpia || !ucpia->present) 395 395 return -1; 396 - 396 + 397 397 if (ucpia->curbuff->status != FRAME_READY) 398 398 interruptible_sleep_on(&ucpia->wq_stream); 399 399 else ··· 403 403 404 404 if (!mybuff) 405 405 return -1; 406 - 406 + 407 407 if (mybuff->status != FRAME_READY || mybuff->length < 4) { 408 408 DBG("Something went wrong!\n"); 409 409 return -1; ··· 411 411 412 412 memcpy(frame, mybuff->data, mybuff->length); 413 413 mybuff->status = FRAME_EMPTY; 414 - 414 + 415 415 /* DBG("read done, %d bytes, Header: %x/%x, Footer: %x%x%x%x\n", */ 416 416 /* mybuff->length, frame[0], frame[1], */ 417 417 /* frame[mybuff->length-4], frame[mybuff->length-3], */ ··· 447 447 448 448 kfree(ucpia->sbuf[1].data); 449 449 ucpia->sbuf[1].data = NULL; 450 - 450 + 451 451 if (ucpia->sbuf[0].urb) { 452 452 usb_kill_urb(ucpia->sbuf[0].urb); 453 453 usb_free_urb(ucpia->sbuf[0].urb); ··· 490 490 struct usb_cpia *ucpia; 491 491 struct cam_data *cam; 492 492 int ret; 493 - 493 + 494 494 /* A multi-config CPiA camera? */ 495 495 if (udev->descriptor.bNumConfigurations != 1) 496 496 return -ENODEV; ··· 539 539 540 540 /* Before register_camera, important */ 541 541 ucpia->present = 1; 542 - 542 + 543 543 cam = cpia_register_camera(&cpia_usb_ops, ucpia); 544 544 if (!cam) { 545 545 LOG("failed to cpia_register_camera\n"); ··· 591 591 struct cam_data *cam = usb_get_intfdata(intf); 592 592 struct usb_cpia *ucpia; 593 593 struct usb_device *udev; 594 - 594 + 595 595 usb_set_intfdata(intf, NULL); 596 596 if (!cam) 597 597 return; ··· 600 600 spin_lock( &cam_list_lock_usb ); 601 601 list_del(&cam->cam_data_list); 602 602 spin_unlock( &cam_list_lock_usb ); 603 - 603 + 604 604 ucpia->present = 0; 605 605 606 606 cpia_unregister_camera(cam); ··· 631 631 632 632 static int __init usb_cpia_init(void) 633 633 { 634 - printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT, 634 + printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT, 635 635 CPIA_USB_MAJ_VER,CPIA_USB_MIN_VER,CPIA_USB_PATCH_VER); 636 636 637 637 spin_lock_init(&cam_list_lock_usb);
+1 -1
drivers/media/video/cs8420.h
··· 20 20 #define __CS8420_H__ 21 21 22 22 /* Initialization Sequence */ 23 - 23 + 24 24 static __u8 init8420[] = { 25 25 1, 0x01, 2, 0x02, 3, 0x00, 4, 0x46, 26 26 5, 0x24, 6, 0x84, 18, 0x18, 19, 0x13,
+9 -9
drivers/media/video/dabusb.c
··· 86 86 return ret; 87 87 } 88 88 /*-------------------------------------------------------------------*/ 89 - #ifdef DEBUG 89 + #ifdef DEBUG 90 90 static void dump_urb (struct urb *urb) 91 91 { 92 92 dbg("urb :%p", urb); ··· 136 136 for (p = q->next; p != q;) { 137 137 b = list_entry (p, buff_t, buff_list); 138 138 139 - #ifdef DEBUG 139 + #ifdef DEBUG 140 140 dump_urb(b->purb); 141 141 #endif 142 142 kfree(b->purb->transfer_buffer); ··· 287 287 } 288 288 289 289 } 290 - 290 + 291 291 if( ret == -EPIPE ) { 292 292 warn("CLEAR_FEATURE request to remove STALL condition."); 293 293 if(usb_clear_halt(s->usbdev, usb_pipeendpoint(pipe))) ··· 328 328 PINTEL_HEX_RECORD ptr = firmware; 329 329 330 330 dbg("Enter dabusb_loadmem (internal)"); 331 - 331 + 332 332 ret = dabusb_8051_reset (s, 1); 333 333 while (ptr->Type == 0) { 334 334 ··· 449 449 if (!list_empty (&s->free_buff_list)) { 450 450 pbuff_t end; 451 451 int ret; 452 - 452 + 453 453 while (!dabusb_add_buf_tail (s, &s->rec_buff_list, &s->free_buff_list)) { 454 454 455 455 dbg("submitting: end:%p s->rec_buff_list:%p", s->rec_buff_list.prev, &s->rec_buff_list); ··· 506 506 err("error: rec_buf_list is empty"); 507 507 goto err; 508 508 } 509 - 509 + 510 510 b = list_entry (s->rec_buff_list.next, buff_t, buff_list); 511 511 purb = b->purb; 512 512 ··· 783 783 pdabusb_t s = usb_get_intfdata (intf); 784 784 785 785 dbg("dabusb_disconnect"); 786 - 786 + 787 787 init_waitqueue_entry(&__wait, current); 788 - 788 + 789 789 usb_set_intfdata (intf, NULL); 790 790 if (s) { 791 791 usb_deregister_dev (intf, &dabusb_class); ··· 797 797 schedule(); 798 798 current->state = TASK_RUNNING; 799 799 remove_wait_queue(&s->remove_ok, &__wait); 800 - 800 + 801 801 s->usbdev = NULL; 802 802 s->overruns = 0; 803 803 }
+2 -2
drivers/media/video/dabusb.h
··· 10 10 #define DABUSB_VERSION 0x1000 11 11 #define IOCTL_DAB_BULK _IOWR('d', 0x30, bulk_transfer_t) 12 12 #define IOCTL_DAB_OVERRUNS _IOR('d', 0x15, int) 13 - #define IOCTL_DAB_VERSION _IOR('d', 0x3f, int) 13 + #define IOCTL_DAB_VERSION _IOR('d', 0x3f, int) 14 14 15 15 #ifdef __KERNEL__ 16 16 ··· 36 36 struct list_head rec_buff_list; 37 37 } dabusb_t,*pdabusb_t; 38 38 39 - typedef struct 39 + typedef struct 40 40 { 41 41 pdabusb_t s; 42 42 struct urb *purb;
+22 -22
drivers/media/video/dsbr100.c
··· 37 37 Markus: Updates for 2.6.x kernels, code layout changes, name sanitizing 38 38 39 39 Version 0.30: 40 - Markus: Updates for 2.5.x kernel and more ISO compliant source 40 + Markus: Updates for 2.5.x kernel and more ISO compliant source 41 41 42 42 Version 0.25: 43 - PSL and Markus: Cleanup, radio now doesn't stop on device close 43 + PSL and Markus: Cleanup, radio now doesn't stop on device close 44 44 45 45 Version 0.24: 46 - Markus: Hope I got these silly VIDEO_TUNER_LOW issues finally 46 + Markus: Hope I got these silly VIDEO_TUNER_LOW issues finally 47 47 right. Some minor cleanup, improved standalone compilation 48 48 49 49 Version 0.23: 50 - Markus: Sign extension bug fixed by declaring transfer_buffer unsigned 50 + Markus: Sign extension bug fixed by declaring transfer_buffer unsigned 51 51 52 52 Version 0.22: 53 - Markus: Some (brown bag) cleanup in what VIDIOCSTUNER returns, 53 + Markus: Some (brown bag) cleanup in what VIDIOCSTUNER returns, 54 54 thanks to Mike Cox for pointing the problem out. 55 55 56 56 Version 0.21: 57 - Markus: Minor cleanup, warnings if something goes wrong, lame attempt 57 + Markus: Minor cleanup, warnings if something goes wrong, lame attempt 58 58 to adhere to Documentation/CodingStyle 59 59 60 - Version 0.2: 61 - Brad Hards <bradh@dynamite.com.au>: Fixes to make it work as non-module 60 + Version 0.2: 61 + Brad Hards <bradh@dynamite.com.au>: Fixes to make it work as non-module 62 62 Markus: Copyright clarification 63 63 64 64 Version 0.01: Markus: initial release ··· 163 163 static int dsbr100_start(dsbr100_device *radio) 164 164 { 165 165 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 166 - USB_REQ_GET_STATUS, 166 + USB_REQ_GET_STATUS, 167 167 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 168 168 0x00, 0xC7, radio->transfer_buffer, 8, 300)<0 || 169 169 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 170 - DSB100_ONOFF, 170 + DSB100_ONOFF, 171 171 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 172 172 0x01, 0x00, radio->transfer_buffer, 8, 300)<0) 173 173 return -1; ··· 179 179 static int dsbr100_stop(dsbr100_device *radio) 180 180 { 181 181 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 182 - USB_REQ_GET_STATUS, 182 + USB_REQ_GET_STATUS, 183 183 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 184 184 0x16, 0x1C, radio->transfer_buffer, 8, 300)<0 || 185 185 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 186 - DSB100_ONOFF, 186 + DSB100_ONOFF, 187 187 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 188 188 0x00, 0x00, radio->transfer_buffer, 8, 300)<0) 189 189 return -1; ··· 195 195 { 196 196 freq = (freq/16*80)/1000+856; 197 197 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 198 - DSB100_TUNE, 198 + DSB100_TUNE, 199 199 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 200 - (freq>>8)&0x00ff, freq&0xff, 200 + (freq>>8)&0x00ff, freq&0xff, 201 201 radio->transfer_buffer, 8, 300)<0 || 202 202 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 203 - USB_REQ_GET_STATUS, 203 + USB_REQ_GET_STATUS, 204 204 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 205 205 0x96, 0xB7, radio->transfer_buffer, 8, 300)<0 || 206 206 usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 207 - USB_REQ_GET_STATUS, 207 + USB_REQ_GET_STATUS, 208 208 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 209 209 0x00, 0x24, radio->transfer_buffer, 8, 300)<0) { 210 210 radio->stereo = -1; ··· 219 219 static void dsbr100_getstat(dsbr100_device *radio) 220 220 { 221 221 if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), 222 - USB_REQ_GET_STATUS, 222 + USB_REQ_GET_STATUS, 223 223 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 224 224 0x00 , 0x24, radio->transfer_buffer, 8, 300)<0) 225 225 radio->stereo = -1; ··· 232 232 233 233 /* check if the device is present and register with v4l and 234 234 usb if it is */ 235 - static int usb_dsbr100_probe(struct usb_interface *intf, 235 + static int usb_dsbr100_probe(struct usb_interface *intf, 236 236 const struct usb_device_id *id) 237 237 { 238 238 dsbr100_device *radio; ··· 243 243 kfree(radio); 244 244 return -ENOMEM; 245 245 } 246 - memcpy(radio->videodev, &dsbr100_videodev_template, 246 + memcpy(radio->videodev, &dsbr100_videodev_template, 247 247 sizeof(dsbr100_videodev_template)); 248 248 radio->removed = 0; 249 249 radio->users = 0; ··· 310 310 struct video_tuner *v = arg; 311 311 312 312 dsbr100_getstat(radio); 313 - if(v->tuner) /* Only 1 tuner */ 313 + if(v->tuner) /* Only 1 tuner */ 314 314 return -EINVAL; 315 315 v->rangelow = FREQ_MIN*FREQ_MUL; 316 316 v->rangehigh = FREQ_MAX*FREQ_MUL; ··· 355 355 v->volume = 1; 356 356 v->step = 1; 357 357 strcpy(v->name, "Radio"); 358 - return 0; 358 + return 0; 359 359 } 360 360 case VIDIOCSAUDIO: { 361 361 struct video_audio *v = arg; 362 362 363 - if (v->audio) 363 + if (v->audio) 364 364 return -EINVAL; 365 365 if (v->flags&VIDEO_AUDIO_MUTE) { 366 366 if (dsbr100_stop(radio)==-1)
+4 -4
drivers/media/video/et61x251/et61x251.h
··· 180 180 181 181 void 182 182 et61x251_attach_sensor(struct et61x251_device* cam, 183 - struct et61x251_sensor* sensor) 183 + struct et61x251_sensor* sensor) 184 184 { 185 185 memcpy(&cam->sensor, sensor, sizeof(struct et61x251_sensor)); 186 186 } ··· 199 199 dev_info(&cam->usbdev->dev, fmt "\n", ## args); \ 200 200 else if ((level) >= 3) \ 201 201 dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ 202 - __FUNCTION__, __LINE__ , ## args); \ 202 + __FUNCTION__, __LINE__ , ## args); \ 203 203 } \ 204 204 } while (0) 205 205 # define KDBG(level, fmt, args...) \ ··· 209 209 pr_info("et61x251: " fmt "\n", ## args); \ 210 210 else if ((level) == 3) \ 211 211 pr_debug("et61x251: [%s:%d] " fmt "\n", __FUNCTION__, \ 212 - __LINE__ , ## args); \ 212 + __LINE__ , ## args); \ 213 213 } \ 214 214 } while (0) 215 215 # define V4LDBG(level, name, cmd) \ ··· 226 226 #undef PDBG 227 227 #define PDBG(fmt, args...) \ 228 228 dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ 229 - __FUNCTION__, __LINE__ , ## args) 229 + __FUNCTION__, __LINE__ , ## args) 230 230 231 231 #undef PDBGG 232 232 #define PDBGG(fmt, args...) do {;} while(0) /* placeholder */
+105 -105
drivers/media/video/et61x251/et61x251_core.c
··· 44 44 /*****************************************************************************/ 45 45 46 46 #define ET61X251_MODULE_NAME "V4L2 driver for ET61X[12]51 " \ 47 - "PC Camera Controllers" 47 + "PC Camera Controllers" 48 48 #define ET61X251_MODULE_AUTHOR "(C) 2006 Luca Risolia" 49 49 #define ET61X251_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>" 50 50 #define ET61X251_MODULE_LICENSE "GPL" ··· 63 63 static short video_nr[] = {[0 ... ET61X251_MAX_DEVICES-1] = -1}; 64 64 module_param_array(video_nr, short, NULL, 0444); 65 65 MODULE_PARM_DESC(video_nr, 66 - "\n<-1|n[,...]> Specify V4L2 minor mode number." 67 - "\n -1 = use next available (default)" 68 - "\n n = use minor number n (integer >= 0)" 69 - "\nYou can specify up to " 70 - __MODULE_STRING(ET61X251_MAX_DEVICES) " cameras this way." 71 - "\nFor example:" 72 - "\nvideo_nr=-1,2,-1 would assign minor number 2 to" 73 - "\nthe second registered camera and use auto for the first" 74 - "\none and for every other camera." 75 - "\n"); 66 + "\n<-1|n[,...]> Specify V4L2 minor mode number." 67 + "\n -1 = use next available (default)" 68 + "\n n = use minor number n (integer >= 0)" 69 + "\nYou can specify up to " 70 + __MODULE_STRING(ET61X251_MAX_DEVICES) " cameras this way." 71 + "\nFor example:" 72 + "\nvideo_nr=-1,2,-1 would assign minor number 2 to" 73 + "\nthe second registered camera and use auto for the first" 74 + "\none and for every other camera." 75 + "\n"); 76 76 77 77 static short force_munmap[] = {[0 ... ET61X251_MAX_DEVICES-1] = 78 - ET61X251_FORCE_MUNMAP}; 78 + ET61X251_FORCE_MUNMAP}; 79 79 module_param_array(force_munmap, bool, NULL, 0444); 80 80 MODULE_PARM_DESC(force_munmap, 81 - "\n<0|1[,...]> Force the application to unmap previously" 82 - "\nmapped buffer memory before calling any VIDIOC_S_CROP or" 83 - "\nVIDIOC_S_FMT ioctl's. Not all the applications support" 84 - "\nthis feature. This parameter is specific for each" 85 - "\ndetected camera." 86 - "\n 0 = do not force memory unmapping" 87 - "\n 1 = force memory unmapping (save memory)" 88 - "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"." 89 - "\n"); 81 + "\n<0|1[,...]> Force the application to unmap previously" 82 + "\nmapped buffer memory before calling any VIDIOC_S_CROP or" 83 + "\nVIDIOC_S_FMT ioctl's. Not all the applications support" 84 + "\nthis feature. This parameter is specific for each" 85 + "\ndetected camera." 86 + "\n 0 = do not force memory unmapping" 87 + "\n 1 = force memory unmapping (save memory)" 88 + "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"." 89 + "\n"); 90 90 91 91 static unsigned int frame_timeout[] = {[0 ... ET61X251_MAX_DEVICES-1] = 92 - ET61X251_FRAME_TIMEOUT}; 92 + ET61X251_FRAME_TIMEOUT}; 93 93 module_param_array(frame_timeout, uint, NULL, 0644); 94 94 MODULE_PARM_DESC(frame_timeout, 95 - "\n<n[,...]> Timeout for a video frame in seconds." 96 - "\nThis parameter is specific for each detected camera." 97 - "\nDefault value is " 98 - __MODULE_STRING(ET61X251_FRAME_TIMEOUT)"." 99 - "\n"); 95 + "\n<n[,...]> Timeout for a video frame in seconds." 96 + "\nThis parameter is specific for each detected camera." 97 + "\nDefault value is " 98 + __MODULE_STRING(ET61X251_FRAME_TIMEOUT)"." 99 + "\n"); 100 100 101 101 #ifdef ET61X251_DEBUG 102 102 static unsigned short debug = ET61X251_DEBUG_LEVEL; 103 103 module_param(debug, ushort, 0644); 104 104 MODULE_PARM_DESC(debug, 105 - "\n<n> Debugging information level, from 0 to 3:" 106 - "\n0 = none (use carefully)" 107 - "\n1 = critical errors" 108 - "\n2 = significant informations" 109 - "\n3 = more verbose messages" 110 - "\nLevel 3 is useful for testing only, when only " 111 - "one device is used." 112 - "\nDefault value is "__MODULE_STRING(ET61X251_DEBUG_LEVEL)"." 113 - "\n"); 105 + "\n<n> Debugging information level, from 0 to 3:" 106 + "\n0 = none (use carefully)" 107 + "\n1 = critical errors" 108 + "\n2 = significant informations" 109 + "\n3 = more verbose messages" 110 + "\nLevel 3 is useful for testing only, when only " 111 + "one device is used." 112 + "\nDefault value is "__MODULE_STRING(ET61X251_DEBUG_LEVEL)"." 113 + "\n"); 114 114 #endif 115 115 116 116 /*****************************************************************************/ 117 117 118 118 static u32 119 119 et61x251_request_buffers(struct et61x251_device* cam, u32 count, 120 - enum et61x251_io_method io) 120 + enum et61x251_io_method io) 121 121 { 122 122 struct v4l2_pix_format* p = &(cam->sensor.pix_format); 123 123 struct v4l2_rect* r = &(cam->sensor.cropcap.bounds); 124 124 const size_t imagesize = cam->module_param.force_munmap || 125 - io == IO_READ ? 126 - (p->width * p->height * p->priv) / 8 : 127 - (r->width * r->height * p->priv) / 8; 125 + io == IO_READ ? 126 + (p->width * p->height * p->priv) / 8 : 127 + (r->width * r->height * p->priv) / 8; 128 128 void* buff = NULL; 129 129 u32 i; 130 130 ··· 216 216 *buff = value; 217 217 218 218 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41, 219 - 0, index, buff, 1, ET61X251_CTRL_TIMEOUT); 219 + 0, index, buff, 1, ET61X251_CTRL_TIMEOUT); 220 220 if (res < 0) { 221 221 DBG(3, "Failed to write a register (value 0x%02X, index " 222 222 "0x%02X, error %d)", value, index, res); ··· 234 234 int res; 235 235 236 236 res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1, 237 - 0, index, buff, 1, ET61X251_CTRL_TIMEOUT); 237 + 0, index, buff, 1, ET61X251_CTRL_TIMEOUT); 238 238 if (res < 0) 239 239 DBG(3, "Failed to read a register (index 0x%02X, error %d)", 240 240 index, res); ··· 269 269 270 270 int 271 271 et61x251_i2c_try_read(struct et61x251_device* cam, 272 - struct et61x251_sensor* sensor, u8 address) 272 + struct et61x251_sensor* sensor, u8 address) 273 273 { 274 274 struct usb_device* udev = cam->usbdev; 275 275 u8* data = cam->control_buffer; ··· 280 280 data[2] = cam->sensor.rsta | 0x10; 281 281 data[3] = !(et61x251_read_reg(cam, 0x8b) & 0x02); 282 282 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41, 283 - 0, 0x88, data, 4, ET61X251_CTRL_TIMEOUT); 283 + 0, 0x88, data, 4, ET61X251_CTRL_TIMEOUT); 284 284 if (res < 0) 285 285 err += res; 286 286 287 287 err += et61x251_i2c_wait(cam, sensor); 288 288 289 289 res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1, 290 - 0, 0x80, data, 8, ET61X251_CTRL_TIMEOUT); 290 + 0, 0x80, data, 8, ET61X251_CTRL_TIMEOUT); 291 291 if (res < 0) 292 292 err += res; 293 293 ··· 302 302 303 303 int 304 304 et61x251_i2c_try_write(struct et61x251_device* cam, 305 - struct et61x251_sensor* sensor, u8 address, u8 value) 305 + struct et61x251_sensor* sensor, u8 address, u8 value) 306 306 { 307 307 struct usb_device* udev = cam->usbdev; 308 308 u8* data = cam->control_buffer; ··· 312 312 data[1] = cam->sensor.i2c_slave_id; 313 313 data[2] = cam->sensor.rsta | 0x12; 314 314 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41, 315 - 0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT); 315 + 0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT); 316 316 if (res < 0) 317 317 err += res; 318 318 319 319 data[0] = value; 320 320 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41, 321 - 0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT); 321 + 0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT); 322 322 if (res < 0) 323 323 err += res; 324 324 ··· 335 335 336 336 int 337 337 et61x251_i2c_raw_write(struct et61x251_device* cam, u8 n, u8 data1, u8 data2, 338 - u8 data3, u8 data4, u8 data5, u8 data6, u8 data7, 339 - u8 data8, u8 address) 338 + u8 data3, u8 data4, u8 data5, u8 data6, u8 data7, 339 + u8 data8, u8 address) 340 340 { 341 341 struct usb_device* udev = cam->usbdev; 342 342 u8* data = cam->control_buffer; ··· 350 350 data[5] = data7; 351 351 data[6] = data8; 352 352 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41, 353 - 0, 0x81, data, n-1, ET61X251_CTRL_TIMEOUT); 353 + 0, 0x81, data, n-1, ET61X251_CTRL_TIMEOUT); 354 354 if (res < 0) 355 355 err += res; 356 356 ··· 358 358 data[1] = cam->sensor.i2c_slave_id; 359 359 data[2] = cam->sensor.rsta | 0x02 | (n << 4); 360 360 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41, 361 - 0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT); 361 + 0, 0x88, data, 3, ET61X251_CTRL_TIMEOUT); 362 362 if (res < 0) 363 363 err += res; 364 364 365 365 /* Start writing through the serial interface */ 366 366 data[0] = data1; 367 367 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x00, 0x41, 368 - 0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT); 368 + 0, 0x80, data, 1, ET61X251_CTRL_TIMEOUT); 369 369 if (res < 0) 370 370 err += res; 371 371 ··· 432 432 433 433 if (!(*f)) 434 434 (*f) = list_entry(cam->inqueue.next, struct et61x251_frame_t, 435 - frame); 435 + frame); 436 436 437 437 imagesize = (cam->sensor.pix_format.width * 438 - cam->sensor.pix_format.height * 439 - cam->sensor.pix_format.priv) / 8; 438 + cam->sensor.pix_format.height * 439 + cam->sensor.pix_format.priv) / 8; 440 440 441 441 for (i = 0; i < urb->number_of_packets; i++) { 442 442 unsigned int len, status; ··· 476 476 if ((*f)->state == F_GRABBING) { 477 477 if (sof && (*f)->buf.bytesused) { 478 478 if (cam->sensor.pix_format.pixelformat == 479 - V4L2_PIX_FMT_ET61X251) 479 + V4L2_PIX_FMT_ET61X251) 480 480 goto end_of_frame; 481 481 else { 482 482 DBG(3, "Not expected SOF detected " ··· 508 508 list_move_tail(&(*f)->frame, &cam->outqueue); 509 509 if (!list_empty(&cam->inqueue)) 510 510 (*f) = list_entry(cam->inqueue.next, 511 - struct et61x251_frame_t, 512 - frame); 511 + struct et61x251_frame_t, 512 + frame); 513 513 else 514 514 (*f) = NULL; 515 515 spin_unlock(&cam->queue_lock); ··· 521 521 522 522 if (sof && 523 523 cam->sensor.pix_format.pixelformat == 524 - V4L2_PIX_FMT_ET61X251) 524 + V4L2_PIX_FMT_ET61X251) 525 525 goto start_of_frame; 526 526 } 527 527 } ··· 544 544 struct usb_device *udev = cam->usbdev; 545 545 struct urb* urb; 546 546 const unsigned int wMaxPacketSize[] = {0, 256, 384, 512, 640, 768, 832, 547 - 864, 896, 920, 956, 980, 1000, 548 - 1022}; 547 + 864, 896, 920, 956, 980, 1000, 548 + 1022}; 549 549 const unsigned int psz = wMaxPacketSize[ET61X251_ALTERNATE_SETTING]; 550 550 s8 i, j; 551 551 int err = 0; 552 552 553 553 for (i = 0; i < ET61X251_URBS; i++) { 554 554 cam->transfer_buffer[i] = kzalloc(ET61X251_ISO_PACKETS * psz, 555 - GFP_KERNEL); 555 + GFP_KERNEL); 556 556 if (!cam->transfer_buffer[i]) { 557 557 err = -ENOMEM; 558 558 DBG(1, "Not enough memory"); ··· 653 653 654 654 cam->stream = STREAM_INTERRUPT; 655 655 timeout = wait_event_timeout(cam->wait_stream, 656 - (cam->stream == STREAM_OFF) || 657 - (cam->state & DEV_DISCONNECTED), 658 - ET61X251_URB_TIMEOUT); 656 + (cam->stream == STREAM_OFF) || 657 + (cam->state & DEV_DISCONNECTED), 658 + ET61X251_URB_TIMEOUT); 659 659 if (cam->state & DEV_DISCONNECTED) 660 660 return -ENODEV; 661 661 else if (cam->stream != STREAM_OFF) { ··· 699 699 700 700 /* 701 701 NOTE 1: being inside one of the following methods implies that the v4l 702 - device exists for sure (see kobjects and reference counters) 702 + device exists for sure (see kobjects and reference counters) 703 703 NOTE 2: buffers are PAGE_SIZE long 704 704 */ 705 705 ··· 964 964 965 965 966 966 static CLASS_DEVICE_ATTR(reg, S_IRUGO | S_IWUSR, 967 - et61x251_show_reg, et61x251_store_reg); 967 + et61x251_show_reg, et61x251_store_reg); 968 968 static CLASS_DEVICE_ATTR(val, S_IRUGO | S_IWUSR, 969 - et61x251_show_val, et61x251_store_val); 969 + et61x251_show_val, et61x251_store_val); 970 970 static CLASS_DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR, 971 - et61x251_show_i2c_reg, et61x251_store_i2c_reg); 971 + et61x251_show_i2c_reg, et61x251_store_i2c_reg); 972 972 static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, 973 - et61x251_show_i2c_val, et61x251_store_i2c_val); 973 + et61x251_show_i2c_val, et61x251_store_i2c_val); 974 974 975 975 976 976 static void et61x251_create_sysfs(struct et61x251_device* cam) ··· 990 990 991 991 static int 992 992 et61x251_set_pix_format(struct et61x251_device* cam, 993 - struct v4l2_pix_format* pix) 993 + struct v4l2_pix_format* pix) 994 994 { 995 995 int r, err = 0; 996 996 ··· 1007 1007 1008 1008 static int 1009 1009 et61x251_set_compression(struct et61x251_device* cam, 1010 - struct v4l2_jpegcompression* compression) 1010 + struct v4l2_jpegcompression* compression) 1011 1011 { 1012 1012 int r, err = 0; 1013 1013 ··· 1049 1049 { 1050 1050 struct et61x251_sensor* s = &cam->sensor; 1051 1051 u16 fmw_sx = (u16)(rect->left - s->cropcap.bounds.left + 1052 - s->active_pixel.left), 1052 + s->active_pixel.left), 1053 1053 fmw_sy = (u16)(rect->top - s->cropcap.bounds.top + 1054 - s->active_pixel.top), 1054 + s->active_pixel.top), 1055 1055 fmw_length = (u16)(rect->width), 1056 1056 fmw_height = (u16)(rect->height); 1057 1057 int err = 0; ··· 1061 1061 err += et61x251_write_reg(cam, fmw_length & 0xff, 0x6b); 1062 1062 err += et61x251_write_reg(cam, fmw_height & 0xff, 0x6c); 1063 1063 err += et61x251_write_reg(cam, (fmw_sx >> 8) | ((fmw_sy & 0x300) >> 6) 1064 - | ((fmw_length & 0x300) >> 4) 1065 - | ((fmw_height & 0x300) >> 2), 0x6d); 1064 + | ((fmw_length & 0x300) >> 4) 1065 + | ((fmw_height & 0x300) >> 2), 0x6d); 1066 1066 if (err) 1067 1067 return -EIO; 1068 1068 ··· 1203 1203 } 1204 1204 mutex_unlock(&cam->dev_mutex); 1205 1205 err = wait_event_interruptible_exclusive(cam->open, 1206 - cam->state & DEV_DISCONNECTED 1207 - || !cam->users); 1206 + cam->state & DEV_DISCONNECTED 1207 + || !cam->users); 1208 1208 if (err) { 1209 1209 up_read(&et61x251_disconnect); 1210 1210 return err; ··· 1277 1277 1278 1278 static ssize_t 1279 1279 et61x251_read(struct file* filp, char __user * buf, 1280 - size_t count, loff_t* f_pos) 1280 + size_t count, loff_t* f_pos) 1281 1281 { 1282 1282 struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); 1283 1283 struct et61x251_frame_t* f, * i; ··· 1310 1310 1311 1311 if (cam->io == IO_NONE) { 1312 1312 if (!et61x251_request_buffers(cam, cam->nreadbuffers, 1313 - IO_READ)) { 1313 + IO_READ)) { 1314 1314 DBG(1, "read() failed, not enough memory"); 1315 1315 mutex_unlock(&cam->fileop_mutex); 1316 1316 return -ENOMEM; ··· 1336 1336 return -EAGAIN; 1337 1337 } 1338 1338 timeout = wait_event_interruptible_timeout 1339 - ( cam->wait_frame, 1340 - (!list_empty(&cam->outqueue)) || 1341 - (cam->state & DEV_DISCONNECTED) || 1342 - (cam->state & DEV_MISCONFIGURED), 1343 - cam->module_param.frame_timeout * 1344 - 1000 * msecs_to_jiffies(1) ); 1339 + ( cam->wait_frame, 1340 + (!list_empty(&cam->outqueue)) || 1341 + (cam->state & DEV_DISCONNECTED) || 1342 + (cam->state & DEV_MISCONFIGURED), 1343 + cam->module_param.frame_timeout * 1344 + 1000 * msecs_to_jiffies(1) ); 1345 1345 if (timeout < 0) { 1346 1346 mutex_unlock(&cam->fileop_mutex); 1347 1347 return timeout; ··· 1408 1408 1409 1409 if (cam->io == IO_NONE) { 1410 1410 if (!et61x251_request_buffers(cam, cam->nreadbuffers, 1411 - IO_READ)) { 1411 + IO_READ)) { 1412 1412 DBG(1, "poll() failed, not enough memory"); 1413 1413 goto error; 1414 1414 } ··· 1465 1465 { 1466 1466 struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); 1467 1467 unsigned long size = vma->vm_end - vma->vm_start, 1468 - start = vma->vm_start; 1468 + start = vma->vm_start; 1469 1469 void *pos; 1470 1470 u32 i; 1471 1471 ··· 1533 1533 .driver = "et61x251", 1534 1534 .version = ET61X251_MODULE_VERSION_CODE, 1535 1535 .capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | 1536 - V4L2_CAP_STREAMING, 1536 + V4L2_CAP_STREAMING, 1537 1537 }; 1538 1538 1539 1539 strlcpy(cap.card, cam->v4ldev->name, sizeof(cap.card)); 1540 1540 if (usb_make_path(cam->usbdev, cap.bus_info, sizeof(cap.bus_info)) < 0) 1541 1541 strlcpy(cap.bus_info, cam->usbdev->dev.bus_id, 1542 - sizeof(cap.bus_info)); 1542 + sizeof(cap.bus_info)); 1543 1543 1544 1544 if (copy_to_user(arg, &cap, sizeof(cap))) 1545 1545 return -EFAULT; ··· 1871 1871 return -EINVAL; 1872 1872 1873 1873 pfmt->bytesperline = (pfmt->pixelformat==V4L2_PIX_FMT_ET61X251) 1874 - ? 0 : (pfmt->width * pfmt->priv) / 8; 1874 + ? 0 : (pfmt->width * pfmt->priv) / 8; 1875 1875 pfmt->sizeimage = pfmt->height * ((pfmt->width*pfmt->priv)/8); 1876 1876 pfmt->field = V4L2_FIELD_NONE; 1877 1877 memcpy(&(format.fmt.pix), pfmt, sizeof(*pfmt)); ··· 1885 1885 1886 1886 static int 1887 1887 et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd, 1888 - void __user * arg) 1888 + void __user * arg) 1889 1889 { 1890 1890 struct et61x251_sensor* s = &cam->sensor; 1891 1891 struct v4l2_format format; ··· 1947 1947 pix->priv = pfmt->priv; /* bpp */ 1948 1948 pix->colorspace = pfmt->colorspace; 1949 1949 pix->bytesperline = (pix->pixelformat == V4L2_PIX_FMT_ET61X251) 1950 - ? 0 : (pix->width * pix->priv) / 8; 1950 + ? 0 : (pix->width * pix->priv) / 8; 1951 1951 pix->sizeimage = pix->height * ((pix->width * pix->priv) / 8); 1952 1952 pix->field = V4L2_FIELD_NONE; 1953 1953 ··· 2020 2020 et61x251_vidioc_g_jpegcomp(struct et61x251_device* cam, void __user * arg) 2021 2021 { 2022 2022 if (copy_to_user(arg, &cam->compression, 2023 - sizeof(cam->compression))) 2023 + sizeof(cam->compression))) 2024 2024 return -EFAULT; 2025 2025 2026 2026 return 0; ··· 2169 2169 2170 2170 static int 2171 2171 et61x251_vidioc_dqbuf(struct et61x251_device* cam, struct file* filp, 2172 - void __user * arg) 2172 + void __user * arg) 2173 2173 { 2174 2174 struct v4l2_buffer b; 2175 2175 struct et61x251_frame_t *f; ··· 2188 2188 if (filp->f_flags & O_NONBLOCK) 2189 2189 return -EAGAIN; 2190 2190 timeout = wait_event_interruptible_timeout 2191 - ( cam->wait_frame, 2192 - (!list_empty(&cam->outqueue)) || 2193 - (cam->state & DEV_DISCONNECTED) || 2194 - (cam->state & DEV_MISCONFIGURED), 2195 - cam->module_param.frame_timeout * 2196 - 1000 * msecs_to_jiffies(1) ); 2191 + ( cam->wait_frame, 2192 + (!list_empty(&cam->outqueue)) || 2193 + (cam->state & DEV_DISCONNECTED) || 2194 + (cam->state & DEV_MISCONFIGURED), 2195 + cam->module_param.frame_timeout * 2196 + 1000 * msecs_to_jiffies(1) ); 2197 2197 if (timeout < 0) 2198 2198 return timeout; 2199 2199 if (cam->state & DEV_DISCONNECTED) ··· 2317 2317 2318 2318 2319 2319 static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp, 2320 - unsigned int cmd, void __user * arg) 2320 + unsigned int cmd, void __user * arg) 2321 2321 { 2322 2322 struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); 2323 2323 ··· 2411 2411 2412 2412 2413 2413 static int et61x251_ioctl(struct inode* inode, struct file* filp, 2414 - unsigned int cmd, unsigned long arg) 2414 + unsigned int cmd, unsigned long arg) 2415 2415 { 2416 2416 struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); 2417 2417 int err = 0; ··· 2518 2518 mutex_lock(&cam->dev_mutex); 2519 2519 2520 2520 err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER, 2521 - video_nr[dev_nr]); 2521 + video_nr[dev_nr]); 2522 2522 if (err) { 2523 2523 DBG(1, "V4L2 device registration failed"); 2524 2524 if (err == -ENFILE && video_nr[dev_nr] == -1)
+10 -10
drivers/media/video/et61x251/et61x251_sensor.h
··· 47 47 48 48 extern void 49 49 et61x251_attach_sensor(struct et61x251_device* cam, 50 - struct et61x251_sensor* sensor); 50 + struct et61x251_sensor* sensor); 51 51 52 52 /*****************************************************************************/ 53 53 ··· 56 56 extern int et61x251_i2c_write(struct et61x251_device*, u8 address, u8 value); 57 57 extern int et61x251_i2c_read(struct et61x251_device*, u8 address); 58 58 extern int et61x251_i2c_try_write(struct et61x251_device*, 59 - struct et61x251_sensor*, u8 address, 60 - u8 value); 59 + struct et61x251_sensor*, u8 address, 60 + u8 value); 61 61 extern int et61x251_i2c_try_read(struct et61x251_device*, 62 - struct et61x251_sensor*, u8 address); 62 + struct et61x251_sensor*, u8 address); 63 63 extern int et61x251_i2c_raw_write(struct et61x251_device*, u8 n, u8 data1, 64 - u8 data2, u8 data3, u8 data4, u8 data5, 65 - u8 data6, u8 data7, u8 data8, u8 address); 64 + u8 data2, u8 data3, u8 data4, u8 data5, 65 + u8 data6, u8 data7, u8 data8, u8 address); 66 66 67 67 /*****************************************************************************/ 68 68 ··· 100 100 101 101 int (*init)(struct et61x251_device* cam); 102 102 int (*get_ctrl)(struct et61x251_device* cam, 103 - struct v4l2_control* ctrl); 103 + struct v4l2_control* ctrl); 104 104 int (*set_ctrl)(struct et61x251_device* cam, 105 - const struct v4l2_control* ctrl); 105 + const struct v4l2_control* ctrl); 106 106 int (*set_crop)(struct et61x251_device* cam, 107 - const struct v4l2_rect* rect); 107 + const struct v4l2_rect* rect); 108 108 int (*set_pix_format)(struct et61x251_device* cam, 109 - const struct v4l2_pix_format* pix); 109 + const struct v4l2_pix_format* pix); 110 110 111 111 /* Private */ 112 112 struct v4l2_queryctrl _qctrl[ET61X251_MAX_CTRLS];
+5 -5
drivers/media/video/et61x251/et61x251_tas5130d1b.c
··· 46 46 47 47 48 48 static int tas5130d1b_set_ctrl(struct et61x251_device* cam, 49 - const struct v4l2_control* ctrl) 49 + const struct v4l2_control* ctrl) 50 50 { 51 51 int err = 0; 52 52 53 53 switch (ctrl->id) { 54 54 case V4L2_CID_GAIN: 55 55 err += et61x251_i2c_raw_write(cam, 2, 0x20, 56 - 0xf6-ctrl->value, 0, 0, 0, 57 - 0, 0, 0, 0); 56 + 0xf6-ctrl->value, 0, 0, 0, 57 + 0, 0, 0, 0); 58 58 break; 59 59 case V4L2_CID_EXPOSURE: 60 60 err += et61x251_i2c_raw_write(cam, 2, 0x40, 61 - 0x47-ctrl->value, 0, 0, 0, 62 - 0, 0, 0, 0); 61 + 0x47-ctrl->value, 0, 0, 0, 62 + 0, 0, 0, 0); 63 63 break; 64 64 default: 65 65 return -EINVAL;
+46 -46
drivers/media/video/ov511.c
··· 15 15 * 16 16 * Based on the Linux CPiA driver written by Peter Pregler, 17 17 * Scott J. Bertin and Johannes Erdfelt. 18 - * 18 + * 19 19 * Please see the file: Documentation/usb/ov511.txt 20 20 * and the website at: http://alpha.dyndns.org/ov511 21 21 * for more info. ··· 433 433 return (reg_w(ov, reg, newval)); 434 434 } 435 435 436 - /* 436 + /* 437 437 * Writes multiple (n) byte value to a single register. Only valid with certain 438 438 * registers (0x30 and 0xc4 - 0xce). 439 439 */ ··· 629 629 /* Retry until idle */ 630 630 do 631 631 rc = reg_r(ov, R511_I2C_CTL); 632 - while (rc > 0 && ((rc&1) == 0)); 632 + while (rc > 0 && ((rc&1) == 0)); 633 633 if (rc < 0) 634 634 break; 635 635 ··· 1752 1752 ov->whiteness = p->whiteness; 1753 1753 1754 1754 /* Don't return error if a setting is unsupported, or rest of settings 1755 - * will not be performed */ 1755 + * will not be performed */ 1756 1756 1757 1757 rc = sensor_set_contrast(ov, p->contrast); 1758 1758 if (FATAL_ERROR(rc)) ··· 1781 1781 PDEBUG(4, "sensor_get_picture"); 1782 1782 1783 1783 /* Don't return error if a setting is unsupported, or rest of settings 1784 - * will not be performed */ 1784 + * will not be performed */ 1785 1785 1786 1786 rc = sensor_get_contrast(ov, &(p->contrast)); 1787 1787 if (FATAL_ERROR(rc)) ··· 2251 2251 2252 2252 /******** Clock programming ********/ 2253 2253 2254 - /* The OV6620 needs special handling. This prevents the 2254 + /* The OV6620 needs special handling. This prevents the 2255 2255 * severe banding that normally occurs */ 2256 2256 if (ov->sensor == SEN_OV6620 || ov->sensor == SEN_OV6630) 2257 2257 { ··· 2326 2326 int sub_flag) 2327 2327 { 2328 2328 int ret; 2329 - int hwsbase, hwebase, vwsbase, vwebase, hwsize, vwsize; 2329 + int hwsbase, hwebase, vwsbase, vwebase, hwsize, vwsize; 2330 2330 int hoffset, voffset, hwscale = 0, vwscale = 0; 2331 2331 2332 2332 /* The different sensor ICs handle setting up of window differently. ··· 2575 2575 /* OV518 needs U and V swapped */ 2576 2576 i2c_w_mask(ov, 0x15, 0x00, 0x01); 2577 2577 2578 - if (mode == VIDEO_PALETTE_GREY) { 2578 + if (mode == VIDEO_PALETTE_GREY) { 2579 2579 /* Set 16-bit input format (UV data are ignored) */ 2580 2580 reg_w_mask(ov, 0x20, 0x00, 0x08); 2581 2581 ··· 2894 2894 * ... ... ... 2895 2895 * 56 57 ... 63 120 121 ... 127 248 249 ... 255 2896 2896 * 2897 - */ 2897 + */ 2898 2898 static void 2899 2899 yuv400raw_to_yuv400p(struct ov511_frame *frame, 2900 2900 unsigned char *pIn0, unsigned char *pOut0) ··· 2923 2923 * 2924 2924 * 0 1 ... 7 2925 2925 * 8 9 ... 15 2926 - * ... 2926 + * ... 2927 2927 * 56 57 ... 63 2928 2928 * 2929 2929 * U and V are shipped at half resolution (1 U,V sample -> one 2x2 block). ··· 3034 3034 */ 3035 3035 static void 3036 3036 deinterlace(struct ov511_frame *frame, int rawformat, 3037 - unsigned char *pIn0, unsigned char *pOut0) 3037 + unsigned char *pIn0, unsigned char *pOut0) 3038 3038 { 3039 3039 const int fieldheight = frame->rawheight / 2; 3040 3040 const int fieldpix = fieldheight * frame->rawwidth; ··· 3112 3112 frame->tempdata); 3113 3113 3114 3114 deinterlace(frame, RAWFMT_YUV400, frame->tempdata, 3115 - frame->data); 3115 + frame->data); 3116 3116 } else { 3117 3117 if (frame->compressed) 3118 3118 decompress(ov, frame, frame->rawdata, ··· 3136 3136 frame->tempdata); 3137 3137 3138 3138 deinterlace(frame, RAWFMT_YUV420, frame->tempdata, 3139 - frame->data); 3139 + frame->data); 3140 3140 } else { 3141 3141 if (frame->compressed) 3142 3142 decompress(ov, frame, frame->rawdata, frame->data); ··· 3226 3226 frame->rawwidth = ((int)(in[9]) + 1) * 8; 3227 3227 frame->rawheight = ((int)(in[10]) + 1) * 8; 3228 3228 3229 - PDEBUG(4, "Frame end, frame=%d, pnum=%d, w=%d, h=%d, recvd=%d", 3229 + PDEBUG(4, "Frame end, frame=%d, pnum=%d, w=%d, h=%d, recvd=%d", 3230 3230 ov->curframe, pnum, frame->rawwidth, frame->rawheight, 3231 3231 frame->bytes_recvd); 3232 3232 ··· 3527 3527 return; 3528 3528 } 3529 3529 3530 - if (urb->status == -ENOENT || urb->status == -ECONNRESET) { 3531 - PDEBUG(4, "URB unlinked"); 3532 - return; 3533 - } 3530 + if (urb->status == -ENOENT || urb->status == -ECONNRESET) { 3531 + PDEBUG(4, "URB unlinked"); 3532 + return; 3533 + } 3534 3534 3535 3535 if (urb->status != -EINPROGRESS && urb->status != 0) { 3536 3536 err("ERROR: urb->status=%d: %s", urb->status, ··· 4627 4627 PDEBUG(4, "mmap: %ld (%lX) bytes", size, size); 4628 4628 4629 4629 if (size > (((OV511_NUMFRAMES 4630 - * MAX_DATA_SIZE(ov->maxwidth, ov->maxheight) 4631 - + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))) 4630 + * MAX_DATA_SIZE(ov->maxwidth, ov->maxheight) 4631 + + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))) 4632 4632 return -EINVAL; 4633 4633 4634 4634 if (mutex_lock_interruptible(&ov->lock)) ··· 5062 5062 } 5063 5063 5064 5064 /* This initializes the KS0127 and KS0127B video decoders. */ 5065 - static int 5065 + static int 5066 5066 ks0127_configure(struct usb_ov511 *ov) 5067 5067 { 5068 5068 int rc; ··· 5193 5193 return -1; 5194 5194 5195 5195 /* Detect version of decoder. This must be done after writing the 5196 - * initial regs or the decoder will lock up. */ 5196 + * initial regs or the decoder will lock up. */ 5197 5197 rc = i2c_r(ov, 0x00); 5198 5198 5199 5199 if (rc < 0) { ··· 5216 5216 } 5217 5217 5218 5218 /* This initializes the OV511/OV511+ and the sensor */ 5219 - static int 5219 + static int 5220 5220 ov511_configure(struct usb_ov511 *ov) 5221 5221 { 5222 5222 static struct ov511_regvals aRegvalsInit511[] = { 5223 5223 { OV511_REG_BUS, R51x_SYS_RESET, 0x7f }, 5224 - { OV511_REG_BUS, R51x_SYS_INIT, 0x01 }, 5225 - { OV511_REG_BUS, R51x_SYS_RESET, 0x7f }, 5224 + { OV511_REG_BUS, R51x_SYS_INIT, 0x01 }, 5225 + { OV511_REG_BUS, R51x_SYS_RESET, 0x7f }, 5226 5226 { OV511_REG_BUS, R51x_SYS_INIT, 0x01 }, 5227 5227 { OV511_REG_BUS, R51x_SYS_RESET, 0x3f }, 5228 5228 { OV511_REG_BUS, R51x_SYS_INIT, 0x01 }, ··· 5269 5269 err("Please notify " EMAIL " of the name,"); 5270 5270 err("manufacturer, model, and this number of your camera."); 5271 5271 err("Also include the output of the detection process."); 5272 - } 5272 + } 5273 5273 5274 5274 if (ov->customid == 70) /* USB Life TV (PAL/SECAM) */ 5275 5275 ov->pal = 1; ··· 5336 5336 5337 5337 if (i2c_w(ov, 0x10, 0x00) < 0) { 5338 5338 err("Can't determine sensor slave IDs"); 5339 - goto error; 5339 + goto error; 5340 5340 } else { 5341 5341 if (ks0127_configure(ov) < 0) { 5342 5342 err("Failed to configure KS0127"); 5343 - goto error; 5343 + goto error; 5344 5344 } 5345 5345 } 5346 5346 } else { 5347 5347 if (saa7111a_configure(ov) < 0) { 5348 5348 err("Failed to configure SAA7111A"); 5349 - goto error; 5349 + goto error; 5350 5350 } 5351 5351 } 5352 5352 } else { ··· 5356 5356 } else { 5357 5357 if (ov6xx0_configure(ov) < 0) { 5358 5358 err("Failed to configure OV6xx0"); 5359 - goto error; 5359 + goto error; 5360 5360 } 5361 5361 } 5362 5362 } else { 5363 5363 if (ov7xx0_configure(ov) < 0) { 5364 5364 err("Failed to configure OV7xx0"); 5365 - goto error; 5365 + goto error; 5366 5366 } 5367 5367 } 5368 5368 ··· 5381 5381 /* For 518 and 518+ */ 5382 5382 static struct ov511_regvals aRegvalsInit518[] = { 5383 5383 { OV511_REG_BUS, R51x_SYS_RESET, 0x40 }, 5384 - { OV511_REG_BUS, R51x_SYS_INIT, 0xe1 }, 5385 - { OV511_REG_BUS, R51x_SYS_RESET, 0x3e }, 5384 + { OV511_REG_BUS, R51x_SYS_INIT, 0xe1 }, 5385 + { OV511_REG_BUS, R51x_SYS_RESET, 0x3e }, 5386 5386 { OV511_REG_BUS, R51x_SYS_INIT, 0xe1 }, 5387 5387 { OV511_REG_BUS, R51x_SYS_RESET, 0x00 }, 5388 5388 { OV511_REG_BUS, R51x_SYS_INIT, 0xe1 }, 5389 - { OV511_REG_BUS, 0x46, 0x00 }, 5389 + { OV511_REG_BUS, 0x46, 0x00 }, 5390 5390 { OV511_REG_BUS, 0x5d, 0x03 }, 5391 5391 { OV511_DONE_BUS, 0x0, 0x00}, 5392 5392 }; ··· 5517 5517 5518 5518 if (init_ov_sensor(ov) < 0) { 5519 5519 err("Can't determine sensor slave IDs"); 5520 - goto error; 5520 + goto error; 5521 5521 } else { 5522 5522 err("Detected unsupported OV8xx0 sensor"); 5523 5523 goto error; ··· 5525 5525 } else { 5526 5526 if (ov6xx0_configure(ov) < 0) { 5527 5527 err("Failed to configure OV6xx0"); 5528 - goto error; 5528 + goto error; 5529 5529 } 5530 5530 } 5531 5531 } else { 5532 5532 if (ov7xx0_configure(ov) < 0) { 5533 5533 err("Failed to configure OV7xx0"); 5534 - goto error; 5534 + goto error; 5535 5535 } 5536 5536 } 5537 5537 ··· 5564 5564 { 5565 5565 struct usb_ov511 *ov = cd_to_ov(cd); 5566 5566 return sprintf(buf, "%d\n", ov->customid); 5567 - } 5567 + } 5568 5568 static CLASS_DEVICE_ATTR(custom_id, S_IRUGO, show_custom_id, NULL); 5569 5569 5570 5570 static ssize_t show_model(struct class_device *cd, char *buf) 5571 5571 { 5572 5572 struct usb_ov511 *ov = cd_to_ov(cd); 5573 5573 return sprintf(buf, "%s\n", ov->desc); 5574 - } 5574 + } 5575 5575 static CLASS_DEVICE_ATTR(model, S_IRUGO, show_model, NULL); 5576 5576 5577 5577 static ssize_t show_bridge(struct class_device *cd, char *buf) 5578 5578 { 5579 5579 struct usb_ov511 *ov = cd_to_ov(cd); 5580 5580 return sprintf(buf, "%s\n", symbolic(brglist, ov->bridge)); 5581 - } 5581 + } 5582 5582 static CLASS_DEVICE_ATTR(bridge, S_IRUGO, show_bridge, NULL); 5583 5583 5584 5584 static ssize_t show_sensor(struct class_device *cd, char *buf) 5585 5585 { 5586 5586 struct usb_ov511 *ov = cd_to_ov(cd); 5587 5587 return sprintf(buf, "%s\n", symbolic(senlist, ov->sensor)); 5588 - } 5588 + } 5589 5589 static CLASS_DEVICE_ATTR(sensor, S_IRUGO, show_sensor, NULL); 5590 5590 5591 5591 static ssize_t show_brightness(struct class_device *cd, char *buf) ··· 5597 5597 return -ENODEV; 5598 5598 sensor_get_brightness(ov, &x); 5599 5599 return sprintf(buf, "%d\n", x >> 8); 5600 - } 5600 + } 5601 5601 static CLASS_DEVICE_ATTR(brightness, S_IRUGO, show_brightness, NULL); 5602 5602 5603 5603 static ssize_t show_saturation(struct class_device *cd, char *buf) ··· 5609 5609 return -ENODEV; 5610 5610 sensor_get_saturation(ov, &x); 5611 5611 return sprintf(buf, "%d\n", x >> 8); 5612 - } 5612 + } 5613 5613 static CLASS_DEVICE_ATTR(saturation, S_IRUGO, show_saturation, NULL); 5614 5614 5615 5615 static ssize_t show_contrast(struct class_device *cd, char *buf) ··· 5621 5621 return -ENODEV; 5622 5622 sensor_get_contrast(ov, &x); 5623 5623 return sprintf(buf, "%d\n", x >> 8); 5624 - } 5624 + } 5625 5625 static CLASS_DEVICE_ATTR(contrast, S_IRUGO, show_contrast, NULL); 5626 5626 5627 5627 static ssize_t show_hue(struct class_device *cd, char *buf) ··· 5633 5633 return -ENODEV; 5634 5634 sensor_get_hue(ov, &x); 5635 5635 return sprintf(buf, "%d\n", x >> 8); 5636 - } 5636 + } 5637 5637 static CLASS_DEVICE_ATTR(hue, S_IRUGO, show_hue, NULL); 5638 5638 5639 5639 static ssize_t show_exposure(struct class_device *cd, char *buf) ··· 5645 5645 return -ENODEV; 5646 5646 sensor_get_exposure(ov, &exp); 5647 5647 return sprintf(buf, "%d\n", exp >> 8); 5648 - } 5648 + } 5649 5649 static CLASS_DEVICE_ATTR(exposure, S_IRUGO, show_exposure, NULL); 5650 5650 5651 5651 static void ov_create_sysfs(struct video_device *vdev)
+4 -4
drivers/media/video/ov511.h
··· 130 130 #define R511_COMP_QVY 0x76 131 131 #define R511_COMP_QVUV 0x77 132 132 #define R511_COMP_EN 0x78 133 - #define R511_COMP_LUT_EN 0x79 133 + #define R511_COMP_LUT_EN 0x79 134 134 #define R511_COMP_LUT_BEGIN 0x80 135 135 136 136 /* --------------------------------- */ ··· 459 459 int subh; /* Pix Array subcapture height */ 460 460 461 461 int curframe; /* Current receiving sbuf */ 462 - struct ov511_frame frame[OV511_NUMFRAMES]; 462 + struct ov511_frame frame[OV511_NUMFRAMES]; 463 463 464 464 struct ov511_sbuf sbuf[OV511_NUMSBUF]; 465 465 466 466 wait_queue_head_t wq; /* Processes waiting */ 467 467 468 468 int snap_enabled; /* Snapshot mode enabled */ 469 - 469 + 470 470 int bridge; /* Type of bridge (BRG_*) */ 471 471 int bclass; /* Class of bridge (BCL_*) */ 472 472 int sensor; /* Type of image sensor chip (SEN_*) */ ··· 512 512 /* Returns the name of the matching element in the symbolic_list array. The 513 513 * end of the list must be marked with an element that has a NULL name. 514 514 */ 515 - static inline char * 515 + static inline char * 516 516 symbolic(struct symbolic_list list[], int num) 517 517 { 518 518 int i;
+1 -1
drivers/media/video/ovcamchip/Makefile
··· 1 1 ovcamchip-objs := ovcamchip_core.o ov6x20.o ov6x30.o ov7x10.o ov7x20.o \ 2 - ov76be.o 2 + ov76be.o 3 3 4 4 obj-$(CONFIG_VIDEO_OVCAMCHIP) += ovcamchip.o
+3 -3
drivers/media/video/ovcamchip/ovcamchip_core.c
··· 266 266 PDEBUG(3, "Testing for 0V6xx0"); 267 267 c->addr = OV6xx0_SID; 268 268 if (init_camchip(c) < 0) { 269 - return -ENODEV; 269 + return -ENODEV; 270 270 } else { 271 271 if (ov6xx0_detect(c) < 0) { 272 272 PERROR("Failed to init OV6xx0"); 273 - return -EIO; 273 + return -EIO; 274 274 } 275 275 } 276 276 } else { 277 277 if (ov7xx0_detect(c) < 0) { 278 278 PERROR("Failed to init OV7xx0"); 279 - return -EIO; 279 + return -EIO; 280 280 } 281 281 } 282 282
+1 -1
drivers/media/video/ovcamchip/ovcamchip_priv.h
··· 82 82 struct ovcamchip_regvals *rvals); 83 83 84 84 extern int ov_write_mask(struct i2c_client *c, unsigned char reg, 85 - unsigned char value, unsigned char mask); 85 + unsigned char value, unsigned char mask); 86 86 87 87 #endif
+64 -64
drivers/media/video/planb.c
··· 1 - /* 1 + /* 2 2 planb - PlanB frame grabber driver 3 3 4 4 PlanB is used in the 7x00/8x00 series of PowerMacintosh ··· 584 584 wake_up_interruptible(&pb->suspendq); 585 585 } 586 586 587 - static void add_clip(struct planb *pb, struct video_clip *clip) 587 + static void add_clip(struct planb *pb, struct video_clip *clip) 588 588 { 589 589 volatile unsigned char *base; 590 590 int xc = clip->x, yc = clip->y; ··· 758 758 PLANB_SET(CH_SYNC)); 759 759 tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), 760 760 PLANB_SET(DMA_ABORT)); 761 - 761 + 762 762 /* odd field data: */ 763 763 jump = virt_to_bus(c1 + nlines / 2); 764 764 for (i=1; i < nlines; i += stepsize, c1++) ··· 1247 1247 tab_cmd_dbdma(c1, DBDMA_NOP | BR_IFCLR, virt_to_bus(c1-3)); c1++; 1248 1248 tab_cmd_store(c1++, (unsigned)(&pb->planb_base_phys->ch1.br_sel), 1249 1249 PLANB_SET(DMA_ABORT)); 1250 - 1250 + 1251 1251 /* odd field data: */ 1252 1252 jump_addr = c1 + TAB_FACTOR * nlines / 2; 1253 1253 jump = virt_to_bus(jump_addr); ··· 1383 1383 pb->user++; 1384 1384 1385 1385 DEBUG("PlanB: device opened\n"); 1386 - return 0; 1386 + return 0; 1387 1387 } 1388 1388 1389 1389 static void planb_close(struct video_device *dev) ··· 1424 1424 static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg) 1425 1425 { 1426 1426 struct planb *pb=(struct planb *)dev; 1427 - 1427 + 1428 1428 switch (cmd) 1429 - { 1429 + { 1430 1430 case VIDIOCGCAP: 1431 1431 { 1432 1432 struct video_capability b; ··· 1440 1440 b.channels = 2; /* composite & svhs */ 1441 1441 b.audios = 0; 1442 1442 b.maxwidth = PLANB_MAXPIXELS; 1443 - b.maxheight = PLANB_MAXLINES; 1444 - b.minwidth = 32; /* wild guess */ 1445 - b.minheight = 32; 1446 - if (copy_to_user(arg,&b,sizeof(b))) 1447 - return -EFAULT; 1443 + b.maxheight = PLANB_MAXLINES; 1444 + b.minwidth = 32; /* wild guess */ 1445 + b.minheight = 32; 1446 + if (copy_to_user(arg,&b,sizeof(b))) 1447 + return -EFAULT; 1448 1448 return 0; 1449 1449 } 1450 1450 case VIDIOCSFBUF: 1451 1451 { 1452 - struct video_buffer v; 1452 + struct video_buffer v; 1453 1453 unsigned short bpp; 1454 1454 unsigned int fmt; 1455 1455 1456 1456 DEBUG("PlanB: IOCTL VIDIOCSFBUF\n"); 1457 1457 1458 - if (!capable(CAP_SYS_ADMIN) 1458 + if (!capable(CAP_SYS_ADMIN) 1459 1459 || !capable(CAP_SYS_RAWIO)) 1460 - return -EPERM; 1461 - if (copy_from_user(&v, arg,sizeof(v))) 1462 - return -EFAULT; 1460 + return -EPERM; 1461 + if (copy_from_user(&v, arg,sizeof(v))) 1462 + return -EFAULT; 1463 1463 planb_lock(pb); 1464 1464 switch(v.depth) { 1465 1465 case 8: ··· 1478 1478 break; 1479 1479 default: 1480 1480 planb_unlock(pb); 1481 - return -EINVAL; 1481 + return -EINVAL; 1482 1482 } 1483 1483 if (bpp * v.width > v.bytesperline) { 1484 1484 planb_unlock(pb); ··· 1493 1493 pb->win.bpl = pb->win.bpp * pb->win.swidth; 1494 1494 pb->win.pad = v.bytesperline - pb->win.bpl; 1495 1495 1496 - DEBUG("PlanB: Display at %p is %d by %d, bytedepth %d," 1496 + DEBUG("PlanB: Display at %p is %d by %d, bytedepth %d," 1497 1497 " bpl %d (+ %d)\n", v.base, v.width,v.height, 1498 1498 pb->win.bpp, pb->win.bpl, pb->win.pad); 1499 1499 ··· 1504 1504 resume_overlay(pb); 1505 1505 } 1506 1506 planb_unlock(pb); 1507 - return 0; 1507 + return 0; 1508 1508 } 1509 1509 case VIDIOCGFBUF: 1510 1510 { 1511 - struct video_buffer v; 1511 + struct video_buffer v; 1512 1512 1513 1513 DEBUG("PlanB: IOCTL VIDIOCGFBUF\n"); 1514 1514 ··· 1518 1518 v.depth = pb->win.depth; 1519 1519 v.bytesperline = pb->win.bpl + pb->win.pad; 1520 1520 if (copy_to_user(arg, &v, sizeof(v))) 1521 - return -EFAULT; 1521 + return -EFAULT; 1522 1522 return 0; 1523 1523 } 1524 1524 case VIDIOCCAPTURE: 1525 1525 { 1526 1526 int i; 1527 1527 1528 - if(copy_from_user(&i, arg, sizeof(i))) 1529 - return -EFAULT; 1528 + if(copy_from_user(&i, arg, sizeof(i))) 1529 + return -EFAULT; 1530 1530 if(i==0) { 1531 1531 DEBUG("PlanB: IOCTL VIDIOCCAPTURE Stop\n"); 1532 1532 ··· 1695 1695 struct video_window vw; 1696 1696 struct video_clip clip; 1697 1697 int i; 1698 - 1698 + 1699 1699 DEBUG("PlanB: IOCTL VIDIOCSWIN\n"); 1700 1700 1701 1701 if(copy_from_user(&vw,arg,sizeof(vw))) ··· 1749 1749 return -EFAULT; 1750 1750 return 0; 1751 1751 } 1752 - case VIDIOCSYNC: { 1752 + case VIDIOCSYNC: { 1753 1753 int i; 1754 1754 1755 1755 IDEBUG("PlanB: IOCTL VIDIOCSYNC\n"); ··· 1759 1759 1760 1760 IDEBUG("PlanB: sync to frame %d\n", i); 1761 1761 1762 - if(i > (MAX_GBUFFERS - 1) || i < 0) 1763 - return -EINVAL; 1762 + if(i > (MAX_GBUFFERS - 1) || i < 0) 1763 + return -EINVAL; 1764 1764 chk_grab: 1765 - switch (pb->frame_stat[i]) { 1766 - case GBUFFER_UNUSED: 1767 - return -EINVAL; 1765 + switch (pb->frame_stat[i]) { 1766 + case GBUFFER_UNUSED: 1767 + return -EINVAL; 1768 1768 case GBUFFER_GRABBING: 1769 1769 IDEBUG("PlanB: waiting for grab" 1770 1770 " done (%d)\n", i); 1771 - interruptible_sleep_on(&pb->capq); 1771 + interruptible_sleep_on(&pb->capq); 1772 1772 if(signal_pending(current)) 1773 1773 return -EINTR; 1774 1774 goto chk_grab; 1775 - case GBUFFER_DONE: 1776 - pb->frame_stat[i] = GBUFFER_UNUSED; 1777 - break; 1778 - } 1779 - return 0; 1775 + case GBUFFER_DONE: 1776 + pb->frame_stat[i] = GBUFFER_UNUSED; 1777 + break; 1778 + } 1779 + return 0; 1780 1780 } 1781 1781 1782 - case VIDIOCMCAPTURE: 1782 + case VIDIOCMCAPTURE: 1783 1783 { 1784 - struct video_mmap vm; 1784 + struct video_mmap vm; 1785 1785 volatile unsigned int status; 1786 1786 1787 1787 IDEBUG("PlanB: IOCTL VIDIOCMCAPTURE\n"); 1788 1788 1789 1789 if(copy_from_user((void *) &vm,(void *)arg,sizeof(vm))) 1790 1790 return -EFAULT; 1791 - status = pb->frame_stat[vm.frame]; 1792 - if (status != GBUFFER_UNUSED) 1793 - return -EBUSY; 1791 + status = pb->frame_stat[vm.frame]; 1792 + if (status != GBUFFER_UNUSED) 1793 + return -EBUSY; 1794 1794 1795 - return vgrab(pb, &vm); 1795 + return vgrab(pb, &vm); 1796 1796 } 1797 - 1797 + 1798 1798 case VIDIOCGMBUF: 1799 1799 { 1800 1800 int i; ··· 1811 1811 return -EFAULT; 1812 1812 return 0; 1813 1813 } 1814 - 1814 + 1815 1815 case PLANBIOCGSAAREGS: 1816 1816 { 1817 1817 struct planb_saa_regs preg; ··· 1828 1828 return -EFAULT; 1829 1829 return 0; 1830 1830 } 1831 - 1831 + 1832 1832 case PLANBIOCSSAAREGS: 1833 1833 { 1834 1834 struct planb_saa_regs preg; ··· 1842 1842 saa_set (preg.addr, preg.val, pb); 1843 1843 return 0; 1844 1844 } 1845 - 1845 + 1846 1846 case PLANBIOCGSTAT: 1847 1847 { 1848 1848 struct planb_stat_regs pstat; ··· 1859 1859 return -EFAULT; 1860 1860 return 0; 1861 1861 } 1862 - 1862 + 1863 1863 case PLANBIOCSMODE: { 1864 1864 int v; 1865 1865 ··· 1985 1985 { 1986 1986 int i; 1987 1987 struct planb *pb = (struct planb *)dev; 1988 - unsigned long start = (unsigned long)adr; 1988 + unsigned long start = (unsigned long)adr; 1989 1989 1990 1990 if (size > MAX_GBUFFERS * PLANB_MAX_FBUF) 1991 - return -EINVAL; 1991 + return -EINVAL; 1992 1992 if (!pb->rawbuf) { 1993 1993 int err; 1994 1994 if((err=grabbuf_alloc(pb))) ··· 2091 2091 /* clear interrupt mask */ 2092 2092 pb->intr_mask = PLANB_CLR_IRQ; 2093 2093 2094 - result = request_irq(pb->irq, planb_irq, 0, "PlanB", (void *)pb); 2095 - if (result < 0) { 2096 - if (result==-EINVAL) 2097 - printk(KERN_ERR "PlanB: Bad irq number (%d) " 2094 + result = request_irq(pb->irq, planb_irq, 0, "PlanB", (void *)pb); 2095 + if (result < 0) { 2096 + if (result==-EINVAL) 2097 + printk(KERN_ERR "PlanB: Bad irq number (%d) " 2098 2098 "or handler\n", (int)pb->irq); 2099 2099 else if (result==-EBUSY) 2100 2100 printk(KERN_ERR "PlanB: I don't know why, " ··· 2102 2102 return result; 2103 2103 } 2104 2104 disable_irq(pb->irq); 2105 - 2105 + 2106 2106 /* Now add the template and register the device unit. */ 2107 2107 memcpy(&pb->video_dev,&planb_template,sizeof(planb_template)); 2108 2108 ··· 2143 2143 } 2144 2144 2145 2145 /* 2146 - * Scan for a PlanB controller, request the irq and map the io memory 2146 + * Scan for a PlanB controller, request the irq and map the io memory 2147 2147 */ 2148 2148 2149 2149 static int find_planb(void) ··· 2171 2171 pb = &planbs[0]; 2172 2172 planb_num = 1; 2173 2173 2174 - if (planb_devices->n_addrs != 1) { 2175 - printk (KERN_WARNING "PlanB: expecting 1 address for planb " 2176 - "(got %d)", planb_devices->n_addrs); 2174 + if (planb_devices->n_addrs != 1) { 2175 + printk (KERN_WARNING "PlanB: expecting 1 address for planb " 2176 + "(got %d)", planb_devices->n_addrs); 2177 2177 return 0; 2178 2178 } 2179 2179 ··· 2236 2236 pb->planb_base = planb_regs; 2237 2237 pb->planb_base_phys = (struct planb_registers *)new_base; 2238 2238 pb->irq = irq; 2239 - 2239 + 2240 2240 return planb_num; 2241 2241 2242 2242 err_out_disable: ··· 2251 2251 int i; 2252 2252 struct planb *pb; 2253 2253 2254 - for (i=0;i<planb_num; i++) 2254 + for (i=0;i<planb_num; i++) 2255 2255 { 2256 2256 pb=&planbs[i]; 2257 2257 ··· 2278 2278 static int __init init_planbs(void) 2279 2279 { 2280 2280 int i; 2281 - 2281 + 2282 2282 if (find_planb()<=0) 2283 2283 return -EIO; 2284 2284 ··· 2288 2288 " with v4l\n", i); 2289 2289 release_planb(); 2290 2290 return -EIO; 2291 - } 2291 + } 2292 2292 printk(KERN_INFO "PlanB: registered device %d with v4l\n", i); 2293 - } 2293 + } 2294 2294 return 0; 2295 2295 } 2296 2296
+3 -3
drivers/media/video/planb.h
··· 1 - /* 1 + /* 2 2 planb - PlanB frame grabber driver 3 3 4 4 PlanB is used in the 7x00/8x00 series of PowerMacintosh ··· 167 167 struct video_device video_dev; 168 168 struct video_picture picture; /* Current picture params */ 169 169 struct video_audio audio_dev; /* Current audio params */ 170 - 170 + 171 171 volatile struct planb_registers *planb_base; /* virt base of planb */ 172 172 struct planb_registers *planb_base_phys; /* phys base of planb */ 173 173 void *priv_space; /* Org. alloc. mem for kfree */ ··· 209 209 int gwidth[MAX_GBUFFERS], gheight[MAX_GBUFFERS]; 210 210 unsigned int gfmt[MAX_GBUFFERS]; 211 211 int gnorm_switch[MAX_GBUFFERS]; 212 - volatile unsigned int *frame_stat; 212 + volatile unsigned int *frame_stat; 213 213 #define GBUFFER_UNUSED 0x00U 214 214 #define GBUFFER_GRABBING 0x01U 215 215 #define GBUFFER_DONE 0x02U
+68 -68
drivers/media/video/pms.c
··· 12 12 * Most of this code is directly derived from his userspace driver. 13 13 * His driver works so send any reports to alan@redhat.com unless the 14 14 * userspace driver also doesn't work for you... 15 - * 15 + * 16 16 * Changes: 17 17 * 08/07/2003 Daniele Bellucci <bellucda@tiscali.it> 18 - * - pms_capture: report back -EFAULT 18 + * - pms_capture: report back -EFAULT 19 19 */ 20 20 21 21 #include <linux/module.h> ··· 66 66 /* 67 67 * I/O ports and Shared Memory 68 68 */ 69 - 69 + 70 70 static int io_port = 0x250; 71 71 static int data_port = 0x251; 72 72 static int mem_base = 0xC8000; 73 73 static void __iomem *mem; 74 74 static int video_nr = -1; 75 75 76 - 76 + 77 77 78 78 static inline void mvv_write(u8 index, u8 value) 79 79 { ··· 90 90 { 91 91 int counter; 92 92 int i; 93 - 93 + 94 94 outb(0x28, io_port); 95 - 95 + 96 96 counter=0; 97 97 while((inb(data_port)&0x01)==0) 98 98 if(counter++==256) ··· 101 101 while((inb(data_port)&0x01)!=0) 102 102 if(counter++==256) 103 103 break; 104 - 104 + 105 105 outb(slave, io_port); 106 - 106 + 107 107 counter=0; 108 108 while((inb(data_port)&0x01)==0) 109 109 if(counter++==256) ··· 112 112 while((inb(data_port)&0x01)!=0) 113 113 if(counter++==256) 114 114 break; 115 - 115 + 116 116 for(i=0;i<12;i++) 117 117 { 118 118 char st=inb(data_port); ··· 122 122 break; 123 123 } 124 124 outb(0x29, io_port); 125 - return inb(data_port); 125 + return inb(data_port); 126 126 } 127 127 128 128 static int pms_i2c_write(u16 slave, u16 sub, u16 data) ··· 130 130 int skip=0; 131 131 int count; 132 132 int i; 133 - 133 + 134 134 for(i=0;i<i2c_count;i++) 135 135 { 136 136 if((i2cinfo[i].slave==slave) && 137 137 (i2cinfo[i].sub == sub)) 138 138 { 139 - if(i2cinfo[i].data==data) 140 - skip=1; 141 - i2cinfo[i].data=data; 142 - i=i2c_count+1; 139 + if(i2cinfo[i].data==data) 140 + skip=1; 141 + i2cinfo[i].data=data; 142 + i=i2c_count+1; 143 143 } 144 144 } 145 - 145 + 146 146 if(i==i2c_count && i2c_count<64) 147 147 { 148 148 i2cinfo[i2c_count].slave=slave; ··· 150 150 i2cinfo[i2c_count].data=data; 151 151 i2c_count++; 152 152 } 153 - 153 + 154 154 if(skip) 155 155 return 0; 156 - 156 + 157 157 mvv_write(0x29, sub); 158 158 mvv_write(0x2A, data); 159 159 mvv_write(0x28, slave); 160 - 160 + 161 161 outb(0x28, io_port); 162 - 162 + 163 163 count=0; 164 164 while((inb(data_port)&1)==0) 165 165 if(count>255) ··· 167 167 while((inb(data_port)&1)!=0) 168 168 if(count>255) 169 169 break; 170 - 170 + 171 171 count=inb(data_port); 172 - 172 + 173 173 if(count&2) 174 174 return -1; 175 175 return count; ··· 189 189 190 190 static void pms_i2c_andor(int slave, int sub, int and, int or) 191 191 { 192 - u8 tmp; 193 - 192 + u8 tmp; 193 + 194 194 tmp=pms_i2c_read(slave, sub); 195 195 tmp = (tmp&and)|or; 196 196 pms_i2c_write(slave, sub, tmp); ··· 199 199 /* 200 200 * Control functions 201 201 */ 202 - 202 + 203 203 204 204 static void pms_videosource(short source) 205 205 { ··· 234 234 break; 235 235 } 236 236 } 237 - 238 - 237 + 238 + 239 239 static void pms_contrast(short contrast) 240 240 { 241 241 switch(decoder) ··· 269 269 { 270 270 int target; 271 271 standard = format; 272 - 272 + 273 273 if(decoder==PHILIPS1) 274 274 target=0x42; 275 275 else if(decoder==PHILIPS2) 276 276 target=0x8A; 277 277 else 278 278 return; 279 - 279 + 280 280 switch(format) 281 281 { 282 282 case 0: /* Auto */ ··· 302 302 303 303 /* 304 304 * These features of the PMS card are not currently exposes. They 305 - * could become a private v4l ioctl for PMSCONFIG or somesuch if 305 + * could become a private v4l ioctl for PMSCONFIG or somesuch if 306 306 * people need it. We also don't yet use the PMS interrupt. 307 307 */ 308 308 ··· 324 324 /* 325 325 * Bandpass filters 326 326 */ 327 - 327 + 328 328 static void pms_bandpass(short pass) 329 329 { 330 330 if(decoder==PHILIPS2) ··· 493 493 /* 494 494 * Turn 16bit ratios into best small ratio the chipset can grok 495 495 */ 496 - 496 + 497 497 static void pms_vertdeci(unsigned short decinum, unsigned short deciden) 498 498 { 499 499 /* Knock it down by /5 once */ ··· 546 546 decinum=512; 547 547 deciden=640; /* 768 would be ideal */ 548 548 } 549 - 549 + 550 550 while(((decinum|deciden)&1)==0) 551 551 { 552 552 decinum>>=1; ··· 559 559 } 560 560 if(deciden==32) 561 561 deciden--; 562 - 562 + 563 563 mvv_write(0x24, 0x80|deciden); 564 564 mvv_write(0x25, decinum); 565 565 } ··· 567 567 static void pms_resolution(short width, short height) 568 568 { 569 569 int fg_height; 570 - 570 + 571 571 fg_height=height; 572 572 if(fg_height>280) 573 573 fg_height=280; 574 - 574 + 575 575 mvv_write(0x18, fg_height); 576 576 mvv_write(0x19, fg_height>>8); 577 - 577 + 578 578 if(standard==1) 579 579 { 580 580 mvv_write(0x1A, 0xFC); ··· 598 598 mvv_write(0x42, 0x00); 599 599 mvv_write(0x43, 0x00); 600 600 mvv_write(0x44, MVVMEMORYWIDTH); 601 - 601 + 602 602 mvv_write(0x22, width+8); 603 603 mvv_write(0x23, (width+8)>> 8); 604 604 ··· 618 618 /* 619 619 * Set Input 620 620 */ 621 - 621 + 622 622 static void pms_vcrinput(short input) 623 623 { 624 624 if(decoder==PHILIPS2) ··· 643 643 mvv_write(0x08,r8); /* capture rgb555/565, init DRAM, PC enable */ 644 644 645 645 /* printf("%d %d %d %d %d %x %x\n",width,height,voff,nom,den,mvv_buf); */ 646 - 647 - for (y = 0; y < dev->height; y++ ) 646 + 647 + for (y = 0; y < dev->height; y++ ) 648 648 { 649 649 writeb(0, mem); /* synchronisiert neue Zeile */ 650 - 650 + 651 651 /* 652 652 * This is in truth a fifo, be very careful as if you 653 653 * forgot this odd things will occur 8) 654 654 */ 655 - 655 + 656 656 memcpy_fromio(tmp, mem, dw+32); /* discard 16 word */ 657 657 cnt -= dev->height; 658 - while (cnt <= 0) 659 - { 658 + while (cnt <= 0) 659 + { 660 660 /* 661 661 * Don't copy too far 662 662 */ ··· 666 666 cnt += dev->height; 667 667 if (copy_to_user(buf, tmp+32, dt)) 668 668 return len ? len : -EFAULT; 669 - buf += dt; 669 + buf += dt; 670 670 len += dt; 671 671 } 672 672 } ··· 683 683 { 684 684 struct video_device *dev = video_devdata(file); 685 685 struct pms_device *pd=(struct pms_device *)dev; 686 - 686 + 687 687 switch(cmd) 688 688 { 689 689 case VIDIOCGCAP: ··· 806 806 ||(p->palette==VIDEO_PALETTE_RGB555 && p->depth==15))) 807 807 return -EINVAL; 808 808 pd->picture= *p; 809 - 809 + 810 810 /* 811 811 * Now load the card. 812 812 */ ··· 815 815 pms_brightness(p->brightness>>8); 816 816 pms_hue(p->hue>>8); 817 817 pms_colour(p->colour>>8); 818 - pms_contrast(p->contrast>>8); 818 + pms_contrast(p->contrast>>8); 819 819 mutex_unlock(&pd->lock); 820 820 return 0; 821 821 } ··· 873 873 struct video_device *v = video_devdata(file); 874 874 struct pms_device *pd=(struct pms_device *)v; 875 875 int len; 876 - 876 + 877 877 mutex_lock(&pd->lock); 878 878 len=pms_capture(pd, buf, (pd->picture.depth==16)?0:1,count); 879 879 mutex_unlock(&pd->lock); ··· 905 905 /* 906 906 * Probe for and initialise the Mediavision PMS 907 907 */ 908 - 908 + 909 909 static int init_mediavision(void) 910 910 { 911 911 int id; 912 912 int idec, decst; 913 913 int i; 914 - 914 + 915 915 unsigned char i2c_defs[]={ 916 916 0x4C,0x30,0x00,0xE8, 917 917 0xB6,0xE2,0x00,0x00, ··· 925 925 mem = ioremap(mem_base, 0x800); 926 926 if (!mem) 927 927 return -ENOMEM; 928 - 928 + 929 929 if (!request_region(0x9A01, 1, "Mediavision PMS config")) 930 930 { 931 931 printk(KERN_WARNING "mediavision: unable to detect: 0x9A01 in use.\n"); ··· 941 941 } 942 942 outb(0xB8, 0x9A01); /* Unlock */ 943 943 outb(io_port>>4, 0x9A01); /* Set IO port */ 944 - 945 - 944 + 945 + 946 946 id=mvv_read(3); 947 947 decst=pms_i2c_stat(0x43); 948 - 948 + 949 949 if(decst!=-1) 950 950 idec=2; 951 951 else if(pms_i2c_stat(0xb9)!=-1) 952 952 idec=3; 953 953 else if(pms_i2c_stat(0x8b)!=-1) 954 954 idec=1; 955 - else 955 + else 956 956 idec=0; 957 957 958 958 printk(KERN_INFO "PMS type is %d\n", idec); ··· 966 966 /* 967 967 * Ok we have a PMS of some sort 968 968 */ 969 - 969 + 970 970 mvv_write(0x04, mem_base>>12); /* Set the memory area */ 971 - 971 + 972 972 /* Ok now load the defaults */ 973 - 973 + 974 974 for(i=0;i<0x19;i++) 975 975 { 976 976 if(i2c_defs[i]==0xFF) ··· 978 978 else 979 979 pms_i2c_write(0x8A, i, i2c_defs[i]); 980 980 } 981 - 981 + 982 982 pms_i2c_write(0xB8,0x00,0x12); 983 983 pms_i2c_write(0xB8,0x04,0x00); 984 984 pms_i2c_write(0xB8,0x07,0x00); ··· 987 987 pms_i2c_write(0xB8,0x0A,0x00); 988 988 pms_i2c_write(0xB8,0x0B,0x10); 989 989 pms_i2c_write(0xB8,0x10,0x03); 990 - 990 + 991 991 mvv_write(0x01, 0x00); 992 992 mvv_write(0x05, 0xA0); 993 993 mvv_write(0x08, 0x25); 994 994 mvv_write(0x09, 0x00); 995 - mvv_write(0x0A, 0x20|MVVMEMORYWIDTH); 996 - 995 + mvv_write(0x0A, 0x20|MVVMEMORYWIDTH); 996 + 997 997 mvv_write(0x10, 0x02); 998 998 mvv_write(0x1E, 0x0C); 999 999 mvv_write(0x1F, 0x03); 1000 1000 mvv_write(0x26, 0x06); 1001 - 1001 + 1002 1002 mvv_write(0x2B, 0x00); 1003 1003 mvv_write(0x2C, 0x20); 1004 1004 mvv_write(0x2D, 0x00); ··· 1018 1018 /* 1019 1019 * Initialization and module stuff 1020 1020 */ 1021 - 1021 + 1022 1022 static int __init init_pms_cards(void) 1023 1023 { 1024 1024 printk(KERN_INFO "Mediavision Pro Movie Studio driver 0.02\n"); 1025 - 1025 + 1026 1026 data_port = io_port +1; 1027 - 1027 + 1028 1028 if(init_mediavision()) 1029 1029 { 1030 1030 printk(KERN_INFO "Board not found.\n");
+1 -1
drivers/media/video/pwc/Makefile
··· 15 15 endif 16 16 17 17 clean: 18 - rm -f *.[oas] .*.flags *.ko .*.cmd .*.d .*.tmp *.mod.c 18 + rm -f *.[oas] .*.flags *.ko .*.cmd .*.d .*.tmp *.mod.c 19 19 rm -rf .tmp_versions 20 20
+33 -33
drivers/media/video/pwc/philips.txt
··· 47 47 size 48 48 Can be one of 'sqcif', 'qsif', 'qcif', 'sif', 'cif' or 49 49 'vga', for an image size of resp. 128x96, 160x120, 176x144, 50 - 320x240, 352x288 and 640x480 (of course, only for those cameras that 50 + 320x240, 352x288 and 640x480 (of course, only for those cameras that 51 51 support these resolutions). 52 52 53 53 fps 54 54 Specifies the desired framerate. Is an integer in the range of 4-30. 55 55 56 56 fbufs 57 - This paramter specifies the number of internal buffers to use for storing 58 - frames from the cam. This will help if the process that reads images from 59 - the cam is a bit slow or momentarely busy. However, on slow machines it 60 - only introduces lag, so choose carefully. The default is 3, which is 57 + This paramter specifies the number of internal buffers to use for storing 58 + frames from the cam. This will help if the process that reads images from 59 + the cam is a bit slow or momentarely busy. However, on slow machines it 60 + only introduces lag, so choose carefully. The default is 3, which is 61 61 reasonable. You can set it between 2 and 5. 62 62 63 63 mbufs ··· 65 65 buffers to reserve for mmap(), VIDIOCCGMBUF, VIDIOCMCAPTURE and friends. 66 66 The default is 2, which is adequate for most applications (double 67 67 buffering). 68 - 68 + 69 69 Should you experience a lot of 'Dumping frame...' messages during 70 - grabbing with a tool that uses mmap(), you might want to increase if. 70 + grabbing with a tool that uses mmap(), you might want to increase if. 71 71 However, it doesn't really buffer images, it just gives you a bit more 72 72 slack when your program is behind. But you need a multi-threaded or 73 73 forked program to really take advantage of these buffers. ··· 88 88 89 89 compression (only useful with the plugin) 90 90 With this option you can control the compression factor that the camera 91 - uses to squeeze the image through the USB bus. You can set the 91 + uses to squeeze the image through the USB bus. You can set the 92 92 parameter between 0 and 3: 93 93 0 = prefer uncompressed images; if the requested mode is not available 94 - in an uncompressed format, the driver will silently switch to low 95 - compression. 94 + in an uncompressed format, the driver will silently switch to low 95 + compression. 96 96 1 = low compression. 97 97 2 = medium compression. 98 98 3 = high compression. 99 - 99 + 100 100 High compression takes less bandwidth of course, but it could also 101 101 introduce some unwanted artefacts. The default is 2, medium compression. 102 102 See the FAQ on the website for an overview of which modes require ··· 112 112 this is let the LED blink while the camera is in use. This: 113 113 114 114 leds=500,500 115 - 115 + 116 116 will blink the LED once every second. But with: 117 117 118 118 leds=0,0 ··· 123 123 when the camera is not used anymore. 124 124 125 125 This parameter works only with the ToUCam range of cameras (720, 730, 740, 126 - 750) and OEMs. For other cameras this command is silently ignored, and 126 + 750) and OEMs. For other cameras this command is silently ignored, and 127 127 the LED cannot be controlled. 128 128 129 129 Finally: this parameters does not take effect UNTIL the first time you ··· 144 144 format: 145 145 146 146 [type[.serialnumber]:]node 147 - 147 + 148 148 The square brackets mean that both the type and the serialnumber are 149 149 optional, but a serialnumber cannot be specified without a type (which 150 150 would be rather pointless). The serialnumber is separated from the type 151 151 by a '.'; the node number by a ':'. 152 - 152 + 153 153 This somewhat cryptic syntax is best explained by a few examples: 154 154 155 155 dev_hint=3,5 The first detected cam gets assigned 156 - /dev/video3, the second /dev/video5. Any 157 - other cameras will get the first free 158 - available slot (see below). 156 + /dev/video3, the second /dev/video5. Any 157 + other cameras will get the first free 158 + available slot (see below). 159 159 160 160 dev_hint=645:1,680:2 The PCA645 camera will get /dev/video1, 161 - and a PCVC680 /dev/video2. 162 - 163 - dev_hint=645.0123:3,645.4567:0 The PCA645 camera with serialnumber 164 - 0123 goes to /dev/video3, the same 165 - camera model with the 4567 serial 166 - gets /dev/video0. 161 + and a PCVC680 /dev/video2. 167 162 168 - dev_hint=750:1,4,5,6 The PCVC750 camera will get /dev/video1, the 169 - next 3 Philips cams will use /dev/video4 170 - through /dev/video6. 163 + dev_hint=645.0123:3,645.4567:0 The PCA645 camera with serialnumber 164 + 0123 goes to /dev/video3, the same 165 + camera model with the 4567 serial 166 + gets /dev/video0. 167 + 168 + dev_hint=750:1,4,5,6 The PCVC750 camera will get /dev/video1, the 169 + next 3 Philips cams will use /dev/video4 170 + through /dev/video6. 171 171 172 172 Some points worth knowing: 173 - - Serialnumbers are case sensitive and must be written full, including 173 + - Serialnumbers are case sensitive and must be written full, including 174 174 leading zeroes (it's treated as a string). 175 - - If a device node is already occupied, registration will fail and 175 + - If a device node is already occupied, registration will fail and 176 176 the webcam is not available. 177 177 - You can have up to 64 video devices; be sure to make enough device 178 178 nodes in /dev if you want to spread the numbers (this does not apply ··· 186 186 kernel log at debug level. 187 187 188 188 The trace variable is a bitmask; each bit represents a certain feature. 189 - If you want to trace something, look up the bit value(s) in the table 189 + If you want to trace something, look up the bit value(s) in the table 190 190 below, add the values together and supply that to the trace variable. 191 191 192 192 Value Value Description Default 193 193 (dec) (hex) 194 194 1 0x1 Module initialization; this will log messages On 195 - while loading and unloading the module 195 + while loading and unloading the module 196 196 197 197 2 0x2 probe() and disconnect() traces On 198 198 ··· 203 203 16 0x10 Memory allocation of buffers, etc. Off 204 204 205 205 32 0x20 Showing underflow, overflow and Dumping frame On 206 - messages 206 + messages 207 207 208 208 64 0x40 Show viewport and image sizes Off 209 209 ··· 217 217 218 218 219 219 Example: 220 - 220 + 221 221 # modprobe pwc size=cif fps=15 power_save=1 222 222 223 223 The fbufs, mbufs and trace parameters are global and apply to all connected
+185 -185
drivers/media/video/pwc/pwc-ctrl.c
··· 31 31 32 32 /* 33 33 Changes 34 - 2001/08/03 Alvarado Added methods for changing white balance and 35 - red/green gains 34 + 2001/08/03 Alvarado Added methods for changing white balance and 35 + red/green gains 36 36 */ 37 37 38 38 /* Control functions for the cam; brightness, contrast, video mode, etc. */ 39 39 40 40 #ifdef __KERNEL__ 41 - #include <asm/uaccess.h> 41 + #include <asm/uaccess.h> 42 42 #endif 43 43 #include <asm/errno.h> 44 - 44 + 45 45 #include "pwc.h" 46 46 #include "pwc-ioctl.h" 47 47 #include "pwc-uncompress.h" ··· 116 116 "SIF", 117 117 "CIF", 118 118 "VGA", 119 - }; 119 + }; 120 120 121 121 /********/ 122 122 123 - /* Entries for the Nala (645/646) camera; the Nala doesn't have compression 123 + /* Entries for the Nala (645/646) camera; the Nala doesn't have compression 124 124 preferences, so you either get compressed or non-compressed streams. 125 - 125 + 126 126 An alternate value of 0 means this mode is not available at all. 127 127 */ 128 128 ··· 205 205 { /* closest match of framerate */ 206 206 0, 0, 0, 0, 4, /* 0-4 */ 207 207 5, 5, 7, 7, 10, /* 5-9 */ 208 - 10, 10, 12, 12, 15, /* 10-14 */ 209 - 15, 15, 15, 20, 20, /* 15-19 */ 210 - 20, 20, 20, 24, 24, /* 20-24 */ 211 - 24, 24, 24, 24, 24, /* 25-29 */ 212 - 24 /* 30 */ 208 + 10, 10, 12, 12, 15, /* 10-14 */ 209 + 15, 15, 15, 20, 20, /* 15-19 */ 210 + 20, 20, 20, 24, 24, /* 20-24 */ 211 + 24, 24, 24, 24, 24, /* 25-29 */ 212 + 24 /* 30 */ 213 213 }; 214 - int frames2table[31] = 214 + int frames2table[31] = 215 215 { 0, 0, 0, 0, 0, /* 0-4 */ 216 216 1, 1, 1, 2, 2, /* 5-9 */ 217 217 3, 3, 4, 4, 4, /* 10-14 */ ··· 220 220 7, 7, 7, 7, 7, /* 25-29 */ 221 221 7 /* 30 */ 222 222 }; 223 - 223 + 224 224 if (size < 0 || size > PSZ_CIF || frames < 4 || frames > 25) 225 225 return -EINVAL; 226 226 frames = frames2frames[frames]; ··· 232 232 if (pEntry->compressed) 233 233 return -ENOENT; /* Not supported. */ 234 234 235 - memcpy(buf, pEntry->mode, 3); 235 + memcpy(buf, pEntry->mode, 3); 236 236 ret = send_video_command(pdev->udev, pdev->vendpoint, buf, 3); 237 237 if (ret < 0) { 238 238 Debug("Failed to send video command... %d\n", ret); ··· 257 257 break; 258 258 } 259 259 } 260 - 260 + 261 261 pdev->cmd_len = 3; 262 262 memcpy(pdev->cmd_buf, buf, 3); 263 263 ··· 352 352 /* special case: VGA @ 5 fps and snapshot is raw bayer mode */ 353 353 if (size == PSZ_VGA && frames == 5 && snapshot) 354 354 { 355 - /* Only available in case the raw palette is selected or 356 - we have the decompressor available. This mode is 357 - only available in compressed form 355 + /* Only available in case the raw palette is selected or 356 + we have the decompressor available. This mode is 357 + only available in compressed form 358 358 */ 359 359 if (pdev->vpalette == VIDEO_PALETTE_RAW) 360 360 { 361 - Info("Choosing VGA/5 BAYER mode (%d).\n", pdev->vpalette); 361 + Info("Choosing VGA/5 BAYER mode (%d).\n", pdev->vpalette); 362 362 pChoose = &RawEntry; 363 363 } 364 364 else ··· 368 368 } 369 369 else 370 370 { 371 - /* Find a supported framerate with progressively higher compression ratios 371 + /* Find a supported framerate with progressively higher compression ratios 372 372 if the preferred ratio is not available. 373 - Skip this step when using RAW modes. 373 + Skip this step when using RAW modes. 374 374 */ 375 375 while (compression <= 3) { 376 376 pChoose = &Kiara_table[size][fps][compression]; ··· 383 383 return -ENOENT; /* Not supported. */ 384 384 385 385 Debug("Using alternate setting %d.\n", pChoose->alternate); 386 - 386 + 387 387 /* usb_control_msg won't take staticly allocated arrays as argument?? */ 388 388 memcpy(buf, pChoose->mode, 12); 389 389 if (snapshot) ··· 463 463 */ 464 464 int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frames, int compression, int snapshot) 465 465 { 466 - int ret, size; 466 + int ret, size; 467 467 468 - Trace(TRACE_FLOW, "set_video_mode(%dx%d @ %d, palette %d).\n", width, height, frames, pdev->vpalette); 468 + Trace(TRACE_FLOW, "set_video_mode(%dx%d @ %d, palette %d).\n", width, height, frames, pdev->vpalette); 469 469 size = pwc_decode_size(pdev, width, height); 470 470 if (size < 0) { 471 471 Debug("Could not find suitable size.\n"); ··· 473 473 } 474 474 Debug("decode_size = %d.\n", size); 475 475 476 - ret = -EINVAL; 476 + ret = -EINVAL; 477 477 switch(pdev->type) { 478 478 case 645: 479 479 case 646: ··· 485 485 case 690: 486 486 ret = set_video_mode_Timon(pdev, size, frames, compression, snapshot); 487 487 break; 488 - 488 + 489 489 case 720: 490 490 case 730: 491 491 case 740: ··· 517 517 char buf; 518 518 int ret; 519 519 520 - ret = RecvControlMsg(GET_LUM_CTL, BRIGHTNESS_FORMATTER, 1); 520 + ret = RecvControlMsg(GET_LUM_CTL, BRIGHTNESS_FORMATTER, 1); 521 521 if (ret < 0) 522 522 return ret; 523 523 return buf << 9; ··· 566 566 { 567 567 char buf; 568 568 int ret; 569 - 569 + 570 570 ret = RecvControlMsg(GET_LUM_CTL, GAMMA_FORMATTER, 1); 571 571 if (ret < 0) 572 572 return ret; ··· 622 622 { 623 623 char buf; 624 624 int ret; 625 - 625 + 626 626 if (mode) 627 627 buf = 0x0; /* auto */ 628 628 else 629 629 buf = 0xff; /* fixed */ 630 630 631 631 ret = SendControlMsg(SET_LUM_CTL, AGC_MODE_FORMATTER, 1); 632 - 632 + 633 633 if (!mode && ret >= 0) { 634 634 if (value < 0) 635 635 value = 0; ··· 647 647 { 648 648 unsigned char buf; 649 649 int ret; 650 - 650 + 651 651 ret = RecvControlMsg(GET_LUM_CTL, AGC_MODE_FORMATTER, 1); 652 652 if (ret < 0) 653 653 return ret; ··· 658 658 return ret; 659 659 if (buf > 0x3F) 660 660 buf = 0x3F; 661 - *value = (buf << 10); 661 + *value = (buf << 10); 662 662 } 663 663 else { /* auto */ 664 664 ret = RecvControlMsg(GET_STATUS_CTL, READ_AGC_FORMATTER, 1); ··· 683 683 buf[0] = 0x0; /* auto */ 684 684 else 685 685 buf[0] = 0xff; /* fixed */ 686 - 686 + 687 687 ret = SendControlMsg(SET_LUM_CTL, SHUTTER_MODE_FORMATTER, 1); 688 688 689 689 if (!mode && ret >= 0) { ··· 713 713 ret = SendControlMsg(SET_LUM_CTL, PRESET_SHUTTER_FORMATTER, 2); 714 714 } 715 715 return ret; 716 - } 716 + } 717 717 718 718 719 719 /* POWER */ ··· 765 765 * 02: fluorescent lighting 766 766 * 03: manual 767 767 * 04: auto 768 - */ 768 + */ 769 769 static inline int pwc_set_awb(struct pwc_device *pdev, int mode) 770 770 { 771 771 char buf; 772 772 int ret; 773 - 773 + 774 774 if (mode < 0) 775 775 mode = 0; 776 - 776 + 777 777 if (mode > 4) 778 778 mode = 4; 779 - 779 + 780 780 buf = mode & 0x07; /* just the lowest three bits */ 781 - 781 + 782 782 ret = SendControlMsg(SET_CHROM_CTL, WB_MODE_FORMATTER, 1); 783 - 783 + 784 784 if (ret < 0) 785 785 return ret; 786 786 return 0; ··· 790 790 { 791 791 unsigned char buf; 792 792 int ret; 793 - 793 + 794 794 ret = RecvControlMsg(GET_CHROM_CTL, WB_MODE_FORMATTER, 1); 795 795 796 - if (ret < 0) 796 + if (ret < 0) 797 797 return ret; 798 798 return buf; 799 799 } 800 800 801 801 static inline int pwc_set_red_gain(struct pwc_device *pdev, int value) 802 802 { 803 - unsigned char buf; 803 + unsigned char buf; 804 804 805 805 if (value < 0) 806 806 value = 0; ··· 815 815 { 816 816 unsigned char buf; 817 817 int ret; 818 - 818 + 819 819 ret = RecvControlMsg(GET_CHROM_CTL, PRESET_MANUAL_RED_GAIN_FORMATTER, 1); 820 820 if (ret < 0) 821 821 return ret; ··· 841 841 { 842 842 unsigned char buf; 843 843 int ret; 844 - 844 + 845 845 ret = RecvControlMsg(GET_CHROM_CTL, PRESET_MANUAL_BLUE_GAIN_FORMATTER, 1); 846 846 if (ret < 0) 847 847 return ret; ··· 851 851 852 852 853 853 /* The following two functions are different, since they only read the 854 - internal red/blue gains, which may be different from the manual 854 + internal red/blue gains, which may be different from the manual 855 855 gains set or read above. 856 - */ 856 + */ 857 857 static inline int pwc_read_red_gain(struct pwc_device *pdev, int *value) 858 858 { 859 859 unsigned char buf; 860 860 int ret; 861 - 861 + 862 862 ret = RecvControlMsg(GET_STATUS_CTL, READ_RED_GAIN_FORMATTER, 1); 863 863 if (ret < 0) 864 864 return ret; ··· 870 870 { 871 871 unsigned char buf; 872 872 int ret; 873 - 873 + 874 874 ret = RecvControlMsg(GET_STATUS_CTL, READ_BLUE_GAIN_FORMATTER, 1); 875 875 if (ret < 0) 876 876 return ret; ··· 882 882 static inline int pwc_set_wb_speed(struct pwc_device *pdev, int speed) 883 883 { 884 884 unsigned char buf; 885 - 885 + 886 886 /* useful range is 0x01..0x20 */ 887 887 buf = speed / 0x7f0; 888 888 return SendControlMsg(SET_CHROM_CTL, AWB_CONTROL_SPEED_FORMATTER, 1); ··· 892 892 { 893 893 unsigned char buf; 894 894 int ret; 895 - 895 + 896 896 ret = RecvControlMsg(GET_CHROM_CTL, AWB_CONTROL_SPEED_FORMATTER, 1); 897 897 if (ret < 0) 898 898 return ret; ··· 904 904 static inline int pwc_set_wb_delay(struct pwc_device *pdev, int delay) 905 905 { 906 906 unsigned char buf; 907 - 907 + 908 908 /* useful range is 0x01..0x3F */ 909 909 buf = (delay >> 10); 910 910 return SendControlMsg(SET_CHROM_CTL, AWB_CONTROL_DELAY_FORMATTER, 1); ··· 914 914 { 915 915 unsigned char buf; 916 916 int ret; 917 - 917 + 918 918 ret = RecvControlMsg(GET_CHROM_CTL, AWB_CONTROL_DELAY_FORMATTER, 1); 919 919 if (ret < 0) 920 920 return ret; ··· 950 950 { 951 951 unsigned char buf[2]; 952 952 int ret; 953 - 953 + 954 954 if (pdev->type < 730) { 955 955 *on_value = -1; 956 956 *off_value = -1; ··· 969 969 { 970 970 unsigned char buf; 971 971 int ret; 972 - 972 + 973 973 if (contour < 0) 974 974 buf = 0xff; /* auto contour on */ 975 975 else ··· 977 977 ret = SendControlMsg(SET_LUM_CTL, AUTO_CONTOUR_FORMATTER, 1); 978 978 if (ret < 0) 979 979 return ret; 980 - 980 + 981 981 if (contour < 0) 982 982 return 0; 983 983 if (contour > 0xffff) 984 984 contour = 0xffff; 985 - 985 + 986 986 buf = (contour >> 10); /* contour preset is [0..3f] */ 987 987 ret = SendControlMsg(SET_LUM_CTL, PRESET_CONTOUR_FORMATTER, 1); 988 - if (ret < 0) 989 - return ret; 988 + if (ret < 0) 989 + return ret; 990 990 return 0; 991 991 } 992 992 ··· 994 994 { 995 995 unsigned char buf; 996 996 int ret; 997 - 997 + 998 998 ret = RecvControlMsg(GET_LUM_CTL, AUTO_CONTOUR_FORMATTER, 1); 999 999 if (ret < 0) 1000 1000 return ret; ··· 1002 1002 if (buf == 0) { 1003 1003 /* auto mode off, query current preset value */ 1004 1004 ret = RecvControlMsg(GET_LUM_CTL, PRESET_CONTOUR_FORMATTER, 1); 1005 - if (ret < 0) 1005 + if (ret < 0) 1006 1006 return ret; 1007 1007 *contour = buf << 10; 1008 1008 } ··· 1015 1015 static inline int pwc_set_backlight(struct pwc_device *pdev, int backlight) 1016 1016 { 1017 1017 unsigned char buf; 1018 - 1018 + 1019 1019 if (backlight) 1020 1020 buf = 0xff; 1021 1021 else ··· 1027 1027 { 1028 1028 int ret; 1029 1029 unsigned char buf; 1030 - 1030 + 1031 1031 ret = RecvControlMsg(GET_LUM_CTL, BACK_LIGHT_COMPENSATION_FORMATTER, 1); 1032 1032 if (ret < 0) 1033 1033 return ret; ··· 1039 1039 static inline int pwc_set_flicker(struct pwc_device *pdev, int flicker) 1040 1040 { 1041 1041 unsigned char buf; 1042 - 1042 + 1043 1043 if (flicker) 1044 1044 buf = 0xff; 1045 1045 else ··· 1051 1051 { 1052 1052 int ret; 1053 1053 unsigned char buf; 1054 - 1054 + 1055 1055 ret = RecvControlMsg(GET_LUM_CTL, FLICKERLESS_MODE_FORMATTER, 1); 1056 1056 if (ret < 0) 1057 1057 return ret; ··· 1076 1076 { 1077 1077 int ret; 1078 1078 unsigned char buf; 1079 - 1079 + 1080 1080 ret = RecvControlMsg(GET_LUM_CTL, DYNAMIC_NOISE_CONTROL_FORMATTER, 1); 1081 1081 if (ret < 0) 1082 1082 return ret; ··· 1087 1087 static int pwc_mpt_reset(struct pwc_device *pdev, int flags) 1088 1088 { 1089 1089 unsigned char buf; 1090 - 1090 + 1091 1091 buf = flags & 0x03; // only lower two bits are currently used 1092 1092 return SendControlMsg(SET_MPT_CTL, PT_RESET_CONTROL_FORMATTER, 1); 1093 1093 } ··· 1095 1095 static inline int pwc_mpt_set_angle(struct pwc_device *pdev, int pan, int tilt) 1096 1096 { 1097 1097 unsigned char buf[4]; 1098 - 1098 + 1099 1099 /* set new relative angle; angles are expressed in degrees * 100, 1100 1100 but cam as .5 degree resolution, hence divide by 200. Also 1101 1101 the angle must be multiplied by 64 before it's send to ··· 1114 1114 { 1115 1115 int ret; 1116 1116 unsigned char buf[5]; 1117 - 1117 + 1118 1118 ret = RecvControlMsg(GET_MPT_CTL, PT_STATUS_FORMATTER, 5); 1119 1119 if (ret < 0) 1120 1120 return ret; ··· 1129 1129 { 1130 1130 unsigned char buf; 1131 1131 int ret = -1, request; 1132 - 1132 + 1133 1133 if (pdev->type < 675) 1134 1134 request = SENSOR_TYPE_FORMATTER1; 1135 1135 else if (pdev->type < 730) 1136 1136 return -1; /* The Vesta series doesn't have this call */ 1137 1137 else 1138 1138 request = SENSOR_TYPE_FORMATTER2; 1139 - 1139 + 1140 1140 ret = RecvControlMsg(GET_STATUS_CTL, request, 1); 1141 1141 if (ret < 0) 1142 1142 return ret; ··· 1163 1163 ret = -EINVAL; 1164 1164 break; 1165 1165 } 1166 - 1166 + 1167 1167 case VIDIOCPWCSUSER: 1168 1168 { 1169 1169 if (pwc_save_user(pdev)) 1170 1170 ret = -EINVAL; 1171 1171 break; 1172 1172 } 1173 - 1173 + 1174 1174 case VIDIOCPWCFACTORY: 1175 1175 { 1176 1176 if (pwc_restore_factory(pdev)) 1177 1177 ret = -EINVAL; 1178 1178 break; 1179 1179 } 1180 - 1180 + 1181 1181 case VIDIOCPWCSCQUAL: 1182 - { 1182 + { 1183 1183 int *qual = arg; 1184 1184 1185 1185 if (*qual < 0 || *qual > 3) ··· 1190 1190 pdev->vcompression = *qual; 1191 1191 break; 1192 1192 } 1193 - 1193 + 1194 1194 case VIDIOCPWCGCQUAL: 1195 1195 { 1196 1196 int *qual = arg; 1197 1197 *qual = pdev->vcompression; 1198 1198 break; 1199 1199 } 1200 - 1200 + 1201 1201 case VIDIOCPWCPROBE: 1202 1202 { 1203 1203 struct pwc_probe *probe = arg; ··· 1220 1220 ret = -EINVAL; 1221 1221 break; 1222 1222 } 1223 - 1223 + 1224 1224 case VIDIOCPWCGAGC: 1225 1225 { 1226 1226 int *agc = arg; 1227 - 1227 + 1228 1228 if (pwc_get_agc(pdev, agc)) 1229 1229 ret = -EINVAL; 1230 1230 break; 1231 1231 } 1232 - 1232 + 1233 1233 case VIDIOCPWCSSHUTTER: 1234 1234 { 1235 1235 int *shutter_speed = arg; 1236 1236 ret = pwc_set_shutter_speed(pdev, *shutter_speed < 0 ? 1 : 0, *shutter_speed); 1237 1237 break; 1238 1238 } 1239 - 1240 - case VIDIOCPWCSAWB: 1239 + 1240 + case VIDIOCPWCSAWB: 1241 1241 { 1242 1242 struct pwc_whitebalance *wb = arg; 1243 - 1243 + 1244 1244 ret = pwc_set_awb(pdev, wb->mode); 1245 1245 if (ret >= 0 && wb->mode == PWC_WB_MANUAL) { 1246 1246 pwc_set_red_gain(pdev, wb->manual_red); ··· 1270 1270 ret = pwc_read_red_gain(pdev, &wb->read_red); 1271 1271 if (ret < 0) 1272 1272 break; 1273 - ret = pwc_read_blue_gain(pdev, &wb->read_blue); 1274 - if (ret < 0) 1275 - break; 1273 + ret = pwc_read_blue_gain(pdev, &wb->read_blue); 1274 + if (ret < 0) 1275 + break; 1276 1276 } 1277 1277 } 1278 1278 break; 1279 1279 } 1280 - 1280 + 1281 1281 case VIDIOCPWCSAWBSPEED: 1282 1282 { 1283 1283 struct pwc_wb_speed *wbs = arg; 1284 - 1284 + 1285 1285 if (wbs->control_speed > 0) { 1286 1286 ret = pwc_set_wb_speed(pdev, wbs->control_speed); 1287 1287 } ··· 1290 1290 } 1291 1291 break; 1292 1292 } 1293 - 1293 + 1294 1294 case VIDIOCPWCGAWBSPEED: 1295 1295 { 1296 1296 struct pwc_wb_speed *wbs = arg; 1297 - 1297 + 1298 1298 ret = pwc_get_wb_speed(pdev, &wbs->control_speed); 1299 1299 if (ret < 0) 1300 1300 break; ··· 1304 1304 break; 1305 1305 } 1306 1306 1307 - case VIDIOCPWCSLED: 1307 + case VIDIOCPWCSLED: 1308 1308 { 1309 1309 struct pwc_leds *leds = arg; 1310 1310 ret = pwc_set_leds(pdev, leds->led_on, leds->led_off); ··· 1325 1325 ret = pwc_set_contour(pdev, *contour); 1326 1326 break; 1327 1327 } 1328 - 1328 + 1329 1329 case VIDIOCPWCGCONTOUR: 1330 1330 { 1331 1331 int *contour = arg; 1332 1332 ret = pwc_get_contour(pdev, contour); 1333 1333 break; 1334 1334 } 1335 - 1335 + 1336 1336 case VIDIOCPWCSBACKLIGHT: 1337 1337 { 1338 1338 int *backlight = arg; ··· 1346 1346 ret = pwc_get_backlight(pdev, backlight); 1347 1347 break; 1348 1348 } 1349 - 1349 + 1350 1350 case VIDIOCPWCSFLICKER: 1351 1351 { 1352 1352 int *flicker = arg; ··· 1360 1360 ret = pwc_get_flicker(pdev, flicker); 1361 1361 break; 1362 1362 } 1363 - 1363 + 1364 1364 case VIDIOCPWCSDYNNOISE: 1365 1365 { 1366 1366 int *dynnoise = arg; 1367 1367 ret = pwc_set_dynamic_noise(pdev, *dynnoise); 1368 1368 break; 1369 1369 } 1370 - 1370 + 1371 1371 case VIDIOCPWCGDYNNOISE: 1372 1372 { 1373 1373 int *dynnoise = arg; ··· 1381 1381 size->width = pdev->image.x; 1382 1382 size->height = pdev->image.y; 1383 1383 break; 1384 - } 1385 - 1386 - case VIDIOCPWCMPTRESET: 1387 - { 1388 - if (pdev->features & FEATURE_MOTOR_PANTILT) 1389 - { 1390 - int *flags = arg; 1384 + } 1385 + 1386 + case VIDIOCPWCMPTRESET: 1387 + { 1388 + if (pdev->features & FEATURE_MOTOR_PANTILT) 1389 + { 1390 + int *flags = arg; 1391 1391 1392 1392 ret = pwc_mpt_reset(pdev, *flags); 1393 - if (ret >= 0) 1394 - { 1395 - pdev->pan_angle = 0; 1396 - pdev->tilt_angle = 0; 1397 - } 1398 - } 1399 - else 1400 - { 1401 - ret = -ENXIO; 1402 - } 1403 - break; 1404 - } 1405 - 1406 - case VIDIOCPWCMPTGRANGE: 1407 - { 1408 - if (pdev->features & FEATURE_MOTOR_PANTILT) 1409 - { 1410 - struct pwc_mpt_range *range = arg; 1411 - *range = pdev->angle_range; 1412 - } 1413 - else 1414 - { 1415 - ret = -ENXIO; 1416 - } 1417 - break; 1418 - } 1419 - 1420 - case VIDIOCPWCMPTSANGLE: 1421 - { 1422 - int new_pan, new_tilt; 1423 - 1424 - if (pdev->features & FEATURE_MOTOR_PANTILT) 1425 - { 1426 - struct pwc_mpt_angles *angles = arg; 1393 + if (ret >= 0) 1394 + { 1395 + pdev->pan_angle = 0; 1396 + pdev->tilt_angle = 0; 1397 + } 1398 + } 1399 + else 1400 + { 1401 + ret = -ENXIO; 1402 + } 1403 + break; 1404 + } 1405 + 1406 + case VIDIOCPWCMPTGRANGE: 1407 + { 1408 + if (pdev->features & FEATURE_MOTOR_PANTILT) 1409 + { 1410 + struct pwc_mpt_range *range = arg; 1411 + *range = pdev->angle_range; 1412 + } 1413 + else 1414 + { 1415 + ret = -ENXIO; 1416 + } 1417 + break; 1418 + } 1419 + 1420 + case VIDIOCPWCMPTSANGLE: 1421 + { 1422 + int new_pan, new_tilt; 1423 + 1424 + if (pdev->features & FEATURE_MOTOR_PANTILT) 1425 + { 1426 + struct pwc_mpt_angles *angles = arg; 1427 1427 /* The camera can only set relative angles, so 1428 1428 do some calculations when getting an absolute angle . 1429 1429 */ 1430 1430 if (angles->absolute) 1431 1431 { 1432 - new_pan = angles->pan; 1433 - new_tilt = angles->tilt; 1434 - } 1435 - else 1436 - { 1437 - new_pan = pdev->pan_angle + angles->pan; 1438 - new_tilt = pdev->tilt_angle + angles->tilt; 1432 + new_pan = angles->pan; 1433 + new_tilt = angles->tilt; 1434 + } 1435 + else 1436 + { 1437 + new_pan = pdev->pan_angle + angles->pan; 1438 + new_tilt = pdev->tilt_angle + angles->tilt; 1439 1439 } 1440 1440 /* check absolute ranges */ 1441 1441 if (new_pan < pdev->angle_range.pan_min || ··· 1463 1463 pdev->tilt_angle += new_tilt; 1464 1464 } 1465 1465 if (ret == -EPIPE) /* stall -> out of range */ 1466 - ret = -ERANGE; 1466 + ret = -ERANGE; 1467 1467 } 1468 - } 1469 - else 1470 - { 1471 - ret = -ENXIO; 1472 - } 1473 - break; 1474 - } 1468 + } 1469 + else 1470 + { 1471 + ret = -ENXIO; 1472 + } 1473 + break; 1474 + } 1475 1475 1476 - case VIDIOCPWCMPTGANGLE: 1477 - { 1478 - 1479 - if (pdev->features & FEATURE_MOTOR_PANTILT) 1480 - { 1481 - struct pwc_mpt_angles *angles = arg; 1476 + case VIDIOCPWCMPTGANGLE: 1477 + { 1482 1478 1483 - angles->absolute = 1; 1484 - angles->pan = pdev->pan_angle; 1485 - angles->tilt = pdev->tilt_angle; 1486 - } 1487 - else 1488 - { 1489 - ret = -ENXIO; 1490 - } 1491 - break; 1492 - } 1493 - 1494 - case VIDIOCPWCMPTSTATUS: 1495 - { 1496 - if (pdev->features & FEATURE_MOTOR_PANTILT) 1497 - { 1498 - struct pwc_mpt_status *status = arg; 1499 - ret = pwc_mpt_get_status(pdev, status); 1500 - } 1501 - else 1502 - { 1503 - ret = -ENXIO; 1504 - } 1505 - break; 1479 + if (pdev->features & FEATURE_MOTOR_PANTILT) 1480 + { 1481 + struct pwc_mpt_angles *angles = arg; 1482 + 1483 + angles->absolute = 1; 1484 + angles->pan = pdev->pan_angle; 1485 + angles->tilt = pdev->tilt_angle; 1486 + } 1487 + else 1488 + { 1489 + ret = -ENXIO; 1490 + } 1491 + break; 1492 + } 1493 + 1494 + case VIDIOCPWCMPTSTATUS: 1495 + { 1496 + if (pdev->features & FEATURE_MOTOR_PANTILT) 1497 + { 1498 + struct pwc_mpt_status *status = arg; 1499 + ret = pwc_mpt_get_status(pdev, status); 1500 + } 1501 + else 1502 + { 1503 + ret = -ENXIO; 1504 + } 1505 + break; 1506 1506 } 1507 1507 1508 1508 case VIDIOCPWCGVIDCMD: 1509 1509 { 1510 1510 struct pwc_video_command *cmd = arg; 1511 - 1512 - cmd->type = pdev->type; 1511 + 1512 + cmd->type = pdev->type; 1513 1513 cmd->release = pdev->release; 1514 1514 cmd->command_len = pdev->cmd_len; 1515 1515 memcpy(&cmd->command_buf, pdev->cmd_buf, pdev->cmd_len); ··· 1531 1531 ret = -ENOIOCTLCMD; 1532 1532 break; 1533 1533 } 1534 - 1534 + 1535 1535 if (ret > 0) 1536 1536 return 0; 1537 1537 return ret;
+151 -151
drivers/media/video/pwc/pwc-if.c
··· 25 25 26 26 */ 27 27 28 - /* 28 + /* 29 29 This code forms the interface between the USB layers and the Philips 30 30 specific stuff. Some adanved stuff of the driver falls under an 31 31 NDA, signed between me and Philips B.V., Eindhoven, the Netherlands, and 32 - is thus not distributed in source form. The binary pwcx.o module 32 + is thus not distributed in source form. The binary pwcx.o module 33 33 contains the code that falls under the NDA. 34 - 35 - In case you're wondering: 'pwc' stands for "Philips WebCam", but 34 + 35 + In case you're wondering: 'pwc' stands for "Philips WebCam", but 36 36 I really didn't want to type 'philips_web_cam' every time (I'm lazy as 37 37 any Linux kernel hacker, but I don't like uncomprehensible abbreviations 38 38 without explanation). 39 - 39 + 40 40 Oh yes, convention: to disctinguish between all the various pointers to 41 41 device-structures, I use these names for the pointer variables: 42 42 udev: struct usb_device * ··· 170 170 171 171 /* Okay, this is some magic that I worked out and the reasoning behind it... 172 172 173 - The biggest problem with any USB device is of course: "what to do 173 + The biggest problem with any USB device is of course: "what to do 174 174 when the user unplugs the device while it is in use by an application?" 175 175 We have several options: 176 176 1) Curse them with the 7 plagues when they do (requires divine intervention) 177 177 2) Tell them not to (won't work: they'll do it anyway) 178 178 3) Oops the kernel (this will have a negative effect on a user's uptime) 179 179 4) Do something sensible. 180 - 180 + 181 181 Of course, we go for option 4. 182 182 183 183 It happens that this device will be linked to two times, once from ··· 185 185 pointers. This is done when the device is probed() and all initialization 186 186 succeeded. The pwc_device struct links back to both structures. 187 187 188 - When a device is unplugged while in use it will be removed from the 189 - list of known USB devices; I also de-register it as a V4L device, but 188 + When a device is unplugged while in use it will be removed from the 189 + list of known USB devices; I also de-register it as a V4L device, but 190 190 unfortunately I can't free the memory since the struct is still in use 191 191 by the file descriptor. This free-ing is then deferend until the first 192 192 opportunity. Crude, but it works. 193 - 193 + 194 194 A small 'advantage' is that if a user unplugs the cam and plugs it back 195 195 in, it should get assigned the same video device minor, but unfortunately 196 - it's non-trivial to re-link the cam back to the video device... (that 196 + it's non-trivial to re-link the cam back to the video device... (that 197 197 would surely be magic! :)) 198 198 */ 199 199 ··· 203 203 /* Here we want the physical address of the memory. 204 204 * This is used when initializing the contents of the area. 205 205 */ 206 - static inline unsigned long kvirt_to_pa(unsigned long adr) 206 + static inline unsigned long kvirt_to_pa(unsigned long adr) 207 207 { 208 - unsigned long kva, ret; 208 + unsigned long kva, ret; 209 209 210 210 kva = (unsigned long) page_address(vmalloc_to_page((void *)adr)); 211 211 kva |= adr & (PAGE_SIZE-1); /* restore the offset */ 212 212 ret = __pa(kva); 213 - return ret; 213 + return ret; 214 214 } 215 215 216 216 static void * rvmalloc(unsigned long size) ··· 219 219 unsigned long adr; 220 220 221 221 size=PAGE_ALIGN(size); 222 - mem=vmalloc_32(size); 223 - if (mem) 222 + mem=vmalloc_32(size); 223 + if (mem) 224 224 { 225 225 memset(mem, 0, size); /* Clear the ram out, no junk to the user */ 226 - adr=(unsigned long) mem; 227 - while (size > 0) 228 - { 226 + adr=(unsigned long) mem; 227 + while (size > 0) 228 + { 229 229 SetPageReserved(vmalloc_to_page((void *)adr)); 230 230 adr+=PAGE_SIZE; 231 231 size-=PAGE_SIZE; ··· 236 236 237 237 static void rvfree(void * mem, unsigned long size) 238 238 { 239 - unsigned long adr; 239 + unsigned long adr; 240 240 241 - if (mem) 241 + if (mem) 242 242 { 243 - adr=(unsigned long) mem; 244 - while ((long) size > 0) 245 - { 243 + adr=(unsigned long) mem; 244 + while ((long) size > 0) 245 + { 246 246 ClearPageReserved(vmalloc_to_page((void *)adr)); 247 247 adr+=PAGE_SIZE; 248 248 size-=PAGE_SIZE; ··· 263 263 264 264 if (pdev == NULL) 265 265 return -ENXIO; 266 - 266 + 267 267 #ifdef PWC_MAGIC 268 268 if (pdev->magic != PWC_MAGIC) { 269 269 Err("allocate_buffers(): magic failed.\n"); 270 270 return -ENXIO; 271 271 } 272 - #endif 272 + #endif 273 273 /* Allocate Isochronous pipe buffers */ 274 274 for (i = 0; i < MAX_ISO_BUFS; i++) { 275 275 if (pdev->sbuf[i].data == NULL) { ··· 308 308 memset(kbuf, 128, PWC_FRAME_SIZE); 309 309 } 310 310 } 311 - 311 + 312 312 /* Allocate decompressor table space */ 313 313 kbuf = NULL; 314 314 switch (pdev->type) ··· 320 320 case 730: 321 321 case 740: 322 322 case 750: 323 - #if 0 323 + #if 0 324 324 Trace(TRACE_MEMORY,"private_data(%zu)\n",sizeof(struct pwc_dec23_private)); 325 325 kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL); /* Timon & Kiara */ 326 326 break; ··· 329 329 /* TODO & FIXME */ 330 330 kbuf = kmalloc(sizeof(struct pwc_dec23_private), GFP_KERNEL); 331 331 break; 332 - #endif 332 + #endif 333 333 ; 334 334 } 335 335 pdev->decompress_data = kbuf; 336 - 336 + 337 337 /* Allocate image buffer; double buffer for mmap() */ 338 338 kbuf = rvmalloc(default_mbufs * pdev->len_per_image); 339 339 if (kbuf == NULL) { ··· 348 348 pdev->image_ptr[i] = NULL; 349 349 350 350 kbuf = NULL; 351 - 351 + 352 352 Trace(TRACE_MEMORY, "<< pwc_allocate_buffers()\n"); 353 353 return 0; 354 354 } ··· 366 366 Err("free_buffers(): magic failed.\n"); 367 367 return; 368 368 } 369 - #endif 369 + #endif 370 370 371 371 /* Release Iso-pipe buffers */ 372 372 for (i = 0; i < MAX_ISO_BUFS; i++) ··· 403 403 rvfree(pdev->image_data, default_mbufs * pdev->len_per_image); 404 404 } 405 405 pdev->image_data = NULL; 406 - 406 + 407 407 Trace(TRACE_MEMORY, "Leaving free_buffers().\n"); 408 408 } 409 409 410 - /* The frame & image buffer mess. 410 + /* The frame & image buffer mess. 411 411 412 412 Yes, this is a mess. Well, it used to be simple, but alas... In this 413 413 module, 3 buffers schemes are used to get the data from the USB bus to 414 414 the user program. The first scheme involves the ISO buffers (called thus 415 415 since they transport ISO data from the USB controller), and not really 416 - interesting. Suffices to say the data from this buffer is quickly 416 + interesting. Suffices to say the data from this buffer is quickly 417 417 gathered in an interrupt handler (pwc_isoc_handler) and placed into the 418 418 frame buffer. 419 419 ··· 443 443 and a 'full' frame list: 444 444 * Initially, all frame buffers but one are on the 'empty' list; the one 445 445 remaining buffer is our initial fill frame. 446 - * If a frame is needed for filling, we try to take it from the 'empty' 447 - list, unless that list is empty, in which case we take the buffer at 446 + * If a frame is needed for filling, we try to take it from the 'empty' 447 + list, unless that list is empty, in which case we take the buffer at 448 448 the head of the 'full' list. 449 449 * When our fill buffer has been filled, it is appended to the 'full' 450 450 list. ··· 646 646 case -ETIMEDOUT: errmsg = "NAK (device does not respond)"; break; 647 647 } 648 648 Trace(TRACE_FLOW, "pwc_isoc_handler() called with status %d [%s].\n", urb->status, errmsg); 649 - /* Give up after a number of contiguous errors on the USB bus. 649 + /* Give up after a number of contiguous errors on the USB bus. 650 650 Appearantly something is wrong so we simulate an unplug event. 651 651 */ 652 652 if (++pdev->visoc_errors > MAX_ISOC_ERRORS) ··· 673 673 pdev->visoc_errors = 0; 674 674 675 675 /* vsync: 0 = don't copy data 676 - 1 = sync-hunt 677 - 2 = synched 676 + 1 = sync-hunt 677 + 2 = synched 678 678 */ 679 679 /* Compact data */ 680 680 for (i = 0; i < urb->number_of_packets; i++) { ··· 701 701 } /* ..flen > 0 */ 702 702 703 703 if (flen < pdev->vlast_packet_size) { 704 - /* Shorter packet... We probably have the end of an image-frame; 704 + /* Shorter packet... We probably have the end of an image-frame; 705 705 wake up read() process and let select()/poll() do something. 706 706 Decompression is done in user time over there. 707 707 */ 708 708 if (pdev->vsync == 2) { 709 - /* The ToUCam Fun CMOS sensor causes the firmware to send 2 or 3 bogus 710 - frames on the USB wire after an exposure change. This conditition is 709 + /* The ToUCam Fun CMOS sensor causes the firmware to send 2 or 3 bogus 710 + frames on the USB wire after an exposure change. This conditition is 711 711 however detected in the cam and a bit is set in the header. 712 712 */ 713 713 if (pdev->type == 730) { 714 714 unsigned char *ptr = (unsigned char *)fbuf->data; 715 - 715 + 716 716 if (ptr[1] == 1 && ptr[0] & 0x10) { 717 717 #if PWC_DEBUG 718 718 Debug("Hyundai CMOS sensor bug. Dropping frame %d.\n", fbuf->sequence); ··· 733 733 Info("Image is normal.\n"); 734 734 } 735 735 pdev->vmirror = ptr[0] & 0x03; 736 - /* Sometimes the trailer of the 730 is still sent as a 4 byte packet 736 + /* Sometimes the trailer of the 730 is still sent as a 4 byte packet 737 737 after a short frame; this condition is filtered out specifically. A 4 byte 738 738 frame doesn't make sense anyway. 739 - So we get either this sequence: 740 - drop_bit set -> 4 byte frame -> short frame -> good frame 739 + So we get either this sequence: 740 + drop_bit set -> 4 byte frame -> short frame -> good frame 741 741 Or this one: 742 - drop_bit set -> short frame -> good frame 742 + drop_bit set -> short frame -> good frame 743 743 So we drop either 3 or 2 frames in all! 744 744 */ 745 745 if (fbuf->filled == 4) ··· 830 830 intf = usb_ifnum_to_if(udev, 0); 831 831 if (intf) 832 832 idesc = usb_altnum_to_altsetting(intf, pdev->valternate); 833 - 833 + 834 834 if (!idesc) 835 835 return -EFAULT; 836 836 ··· 841 841 pdev->vmax_packet_size = le16_to_cpu(idesc->endpoint[i].desc.wMaxPacketSize); 842 842 break; 843 843 } 844 - 844 + 845 845 if (pdev->vmax_packet_size < 0 || pdev->vmax_packet_size > ISO_MAX_FRAME_SIZE) { 846 846 Err("Failed to find packet size for video endpoint in current alternate setting.\n"); 847 847 return -ENFILE; /* Odd error, that should be noticeable */ ··· 875 875 return ret; 876 876 } 877 877 878 - /* init URB structure */ 878 + /* init URB structure */ 879 879 for (i = 0; i < MAX_ISO_BUFS; i++) { 880 880 urb = pdev->sbuf[i].urb; 881 881 882 882 urb->interval = 1; // devik 883 883 urb->dev = udev; 884 - urb->pipe = usb_rcvisocpipe(udev, pdev->vendpoint); 884 + urb->pipe = usb_rcvisocpipe(udev, pdev->vendpoint); 885 885 urb->transfer_flags = URB_ISO_ASAP; 886 - urb->transfer_buffer = pdev->sbuf[i].data; 887 - urb->transfer_buffer_length = ISO_BUFFER_SIZE; 888 - urb->complete = pwc_isoc_handler; 889 - urb->context = pdev; 886 + urb->transfer_buffer = pdev->sbuf[i].data; 887 + urb->transfer_buffer_length = ISO_BUFFER_SIZE; 888 + urb->complete = pwc_isoc_handler; 889 + urb->context = pdev; 890 890 urb->start_frame = 0; 891 891 urb->number_of_packets = ISO_FRAMES_PER_DESC; 892 892 for (j = 0; j < ISO_FRAMES_PER_DESC; j++) { ··· 935 935 } 936 936 937 937 /* Stop camera, but only if we are sure the camera is still there (unplug 938 - is signalled by EPIPE) 938 + is signalled by EPIPE) 939 939 */ 940 940 if (pdev->error_status && pdev->error_status != EPIPE) { 941 941 Trace(TRACE_OPEN, "Setting alternate interface 0.\n"); ··· 956 956 pwc_reset_buffers(pdev); 957 957 /* Try to set video mode... */ 958 958 start = ret = pwc_set_video_mode(pdev, width, height, new_fps, new_compression, new_snapshot); 959 - if (ret) { 960 - Trace(TRACE_FLOW, "pwc_set_video_mode attempt 1 failed.\n"); 959 + if (ret) { 960 + Trace(TRACE_FLOW, "pwc_set_video_mode attempt 1 failed.\n"); 961 961 /* That failed... restore old mode (we know that worked) */ 962 962 start = pwc_set_video_mode(pdev, pdev->view.x, pdev->view.y, pdev->vframes, pdev->vcompression, pdev->vsnapshot); 963 963 if (start) { 964 - Trace(TRACE_FLOW, "pwc_set_video_mode attempt 2 failed.\n"); 964 + Trace(TRACE_FLOW, "pwc_set_video_mode attempt 2 failed.\n"); 965 965 } 966 966 } 967 967 if (start == 0) ··· 987 987 struct pwc_device *pdev; 988 988 989 989 Trace(TRACE_OPEN, ">> video_open called(vdev = 0x%p).\n", vdev); 990 - 990 + 991 991 pdev = (struct pwc_device *)vdev->priv; 992 992 if (pdev == NULL) 993 993 BUG(); 994 994 if (pdev->vopen) 995 995 return -EBUSY; 996 - 996 + 997 997 down(&pdev->modlock); 998 998 if (!pdev->usb_init) { 999 999 Trace(TRACE_OPEN, "Doing first time initialization.\n"); 1000 1000 pdev->usb_init = 1; 1001 - 1001 + 1002 1002 if (pwc_trace & TRACE_OPEN) 1003 1003 { 1004 1004 /* Query sensor type */ ··· 1036 1036 /* Set LED on/off time */ 1037 1037 if (pwc_set_leds(pdev, led_on, led_off) < 0) 1038 1038 Info("Failed to set LED on/off time.\n"); 1039 - 1039 + 1040 1040 pwc_construct(pdev); /* set min/max sizes correct */ 1041 1041 1042 1042 /* So far, so good. Allocate memory. */ ··· 1046 1046 up(&pdev->modlock); 1047 1047 return i; 1048 1048 } 1049 - 1049 + 1050 1050 /* Reset buffers & parameters */ 1051 1051 pwc_reset_buffers(pdev); 1052 1052 for (i = 0; i < default_mbufs; i++) ··· 1081 1081 up(&pdev->modlock); 1082 1082 return i; 1083 1083 } 1084 - 1084 + 1085 1085 i = pwc_isoc_init(pdev); 1086 1086 if (i) { 1087 1087 Trace(TRACE_OPEN, "Failed to init ISOC stuff = %d.\n", i); ··· 1155 1155 /* 1156 1156 * FIXME: what about two parallel reads ???? 1157 1157 * ANSWER: Not supported. You can't open the device more than once, 1158 - despite what the V4L1 interface says. First, I don't see 1159 - the need, second there's no mechanism of alerting the 1160 - 2nd/3rd/... process of events like changing image size. 1161 - And I don't see the point of blocking that for the 1162 - 2nd/3rd/... process. 1163 - In multi-threaded environments reading parallel from any 1164 - device is tricky anyhow. 1158 + despite what the V4L1 interface says. First, I don't see 1159 + the need, second there's no mechanism of alerting the 1160 + 2nd/3rd/... process of events like changing image size. 1161 + And I don't see the point of blocking that for the 1162 + 2nd/3rd/... process. 1163 + In multi-threaded environments reading parallel from any 1164 + device is tricky anyhow. 1165 1165 */ 1166 1166 1167 1167 static ssize_t pwc_video_read(struct file *file, char __user * buf, ··· 1171 1171 struct pwc_device *pdev; 1172 1172 int noblock = file->f_flags & O_NONBLOCK; 1173 1173 DECLARE_WAITQUEUE(wait, current); 1174 - int bytes_to_read; 1174 + int bytes_to_read; 1175 1175 1176 1176 Trace(TRACE_READ, "video_read(0x%p, %p, %zu) called.\n", vdev, buf, count); 1177 1177 if (vdev == NULL) ··· 1193 1193 set_current_state(TASK_RUNNING); 1194 1194 return -pdev->error_status ; 1195 1195 } 1196 - if (noblock) { 1197 - remove_wait_queue(&pdev->frameq, &wait); 1198 - set_current_state(TASK_RUNNING); 1199 - return -EWOULDBLOCK; 1200 - } 1201 - if (signal_pending(current)) { 1202 - remove_wait_queue(&pdev->frameq, &wait); 1203 - set_current_state(TASK_RUNNING); 1204 - return -ERESTARTSYS; 1205 - } 1206 - schedule(); 1207 - set_current_state(TASK_INTERRUPTIBLE); 1196 + if (noblock) { 1197 + remove_wait_queue(&pdev->frameq, &wait); 1198 + set_current_state(TASK_RUNNING); 1199 + return -EWOULDBLOCK; 1200 + } 1201 + if (signal_pending(current)) { 1202 + remove_wait_queue(&pdev->frameq, &wait); 1203 + set_current_state(TASK_RUNNING); 1204 + return -ERESTARTSYS; 1205 + } 1206 + schedule(); 1207 + set_current_state(TASK_INTERRUPTIBLE); 1208 1208 } 1209 1209 remove_wait_queue(&pdev->frameq, &wait); 1210 1210 set_current_state(TASK_RUNNING); 1211 - 1211 + 1212 1212 /* Decompress and release frame */ 1213 1213 if (pwc_handle_frame(pdev)) 1214 1214 return -EFAULT; ··· 1218 1218 if (pdev->vpalette == VIDEO_PALETTE_RAW) 1219 1219 bytes_to_read = pdev->frame_size; 1220 1220 else 1221 - bytes_to_read = pdev->view.size; 1221 + bytes_to_read = pdev->view.size; 1222 1222 1223 1223 /* copy bytes to user space; we allow for partial reads */ 1224 1224 if (count + pdev->image_read_pos > bytes_to_read) ··· 1348 1348 struct video_picture *p = arg; 1349 1349 /* 1350 1350 * FIXME: Suppose we are mid read 1351 - ANSWER: No problem: the firmware of the camera 1352 - can handle brightness/contrast/etc 1353 - changes at _any_ time, and the palette 1354 - is used exactly once in the uncompress 1355 - routine. 1351 + ANSWER: No problem: the firmware of the camera 1352 + can handle brightness/contrast/etc 1353 + changes at _any_ time, and the palette 1354 + is used exactly once in the uncompress 1355 + routine. 1356 1356 */ 1357 1357 pwc_set_brightness(pdev, p->brightness); 1358 1358 pwc_set_contrast(pdev, p->contrast); ··· 1373 1373 break; 1374 1374 } 1375 1375 1376 - /* Window/size parameters */ 1376 + /* Window/size parameters */ 1377 1377 case VIDIOCGWIN: 1378 1378 { 1379 1379 struct video_window *vw = arg; 1380 - 1380 + 1381 1381 vw->x = 0; 1382 1382 vw->y = 0; 1383 1383 vw->width = pdev->view.x; 1384 1384 vw->height = pdev->view.y; 1385 1385 vw->chromakey = 0; 1386 - vw->flags = (pdev->vframes << PWC_FPS_SHIFT) | 1387 - (pdev->vsnapshot ? PWC_FPS_SNAPSHOT : 0); 1386 + vw->flags = (pdev->vframes << PWC_FPS_SHIFT) | 1387 + (pdev->vsnapshot ? PWC_FPS_SNAPSHOT : 0); 1388 1388 break; 1389 1389 } 1390 - 1390 + 1391 1391 case VIDIOCSWIN: 1392 1392 { 1393 1393 struct video_window *vw = arg; ··· 1402 1402 ret = pwc_try_video_mode(pdev, vw->width, vw->height, fps, pdev->vcompression, snapshot); 1403 1403 if (ret) 1404 1404 return ret; 1405 - break; 1405 + break; 1406 1406 } 1407 - 1407 + 1408 1408 /* We don't have overlay support (yet) */ 1409 1409 case VIDIOCGFBUF: 1410 1410 { ··· 1471 1471 return -EBUSY; /* buffer wasn't available. Bummer */ 1472 1472 pdev->image_used[vm->frame] = 1; 1473 1473 1474 - /* Okay, we're done here. In the SYNC call we wait until a 1475 - frame comes available, then expand image into the given 1474 + /* Okay, we're done here. In the SYNC call we wait until a 1475 + frame comes available, then expand image into the given 1476 1476 buffer. 1477 1477 In contrast to the CPiA cam the Philips cams deliver a 1478 1478 constant stream, almost like a grabber card. Also, ··· 1487 1487 { 1488 1488 /* The doc says: "Whenever a buffer is used it should 1489 1489 call VIDIOCSYNC to free this frame up and continue." 1490 - 1491 - The only odd thing about this whole procedure is 1490 + 1491 + The only odd thing about this whole procedure is 1492 1492 that MCAPTURE flags the buffer as "in use", and 1493 - SYNC immediately unmarks it, while it isn't 1493 + SYNC immediately unmarks it, while it isn't 1494 1494 after SYNC that you know that the buffer actually 1495 1495 got filled! So you better not start a CAPTURE in 1496 - the same frame immediately (use double buffering). 1497 - This is not a problem for this cam, since it has 1498 - extra intermediate buffers, but a hardware 1499 - grabber card will then overwrite the buffer 1496 + the same frame immediately (use double buffering). 1497 + This is not a problem for this cam, since it has 1498 + extra intermediate buffers, but a hardware 1499 + grabber card will then overwrite the buffer 1500 1500 you're working on. 1501 1501 */ 1502 1502 int *mbuf = arg; ··· 1512 1512 return -EINVAL; 1513 1513 1514 1514 /* Add ourselves to the frame wait-queue. 1515 - 1515 + 1516 1516 FIXME: needs auditing for safety. 1517 1517 QUESTION: In what respect? I think that using the 1518 - frameq is safe now. 1518 + frameq is safe now. 1519 1519 */ 1520 1520 add_wait_queue(&pdev->frameq, &wait); 1521 1521 while (pdev->full_frames == NULL) { ··· 1524 1524 set_current_state(TASK_RUNNING); 1525 1525 return -pdev->error_status; 1526 1526 } 1527 - 1528 - if (signal_pending(current)) { 1529 - remove_wait_queue(&pdev->frameq, &wait); 1530 - set_current_state(TASK_RUNNING); 1531 - return -ERESTARTSYS; 1532 - } 1533 - schedule(); 1534 - set_current_state(TASK_INTERRUPTIBLE); 1527 + 1528 + if (signal_pending(current)) { 1529 + remove_wait_queue(&pdev->frameq, &wait); 1530 + set_current_state(TASK_RUNNING); 1531 + return -ERESTARTSYS; 1532 + } 1533 + schedule(); 1534 + set_current_state(TASK_INTERRUPTIBLE); 1535 1535 } 1536 1536 remove_wait_queue(&pdev->frameq, &wait); 1537 1537 set_current_state(TASK_RUNNING); 1538 - 1539 - /* The frame is ready. Expand in the image buffer 1540 - requested by the user. I don't care if you 1541 - mmap() 5 buffers and request data in this order: 1538 + 1539 + /* The frame is ready. Expand in the image buffer 1540 + requested by the user. I don't care if you 1541 + mmap() 5 buffers and request data in this order: 1542 1542 buffer 4 2 3 0 1 2 3 0 4 3 1 . . . 1543 1543 Grabber hardware may not be so forgiving. 1544 1544 */ ··· 1551 1551 return -EFAULT; 1552 1552 break; 1553 1553 } 1554 - 1554 + 1555 1555 case VIDIOCGAUDIO: 1556 1556 { 1557 1557 struct video_audio *v = arg; 1558 - 1558 + 1559 1559 strcpy(v->name, "Microphone"); 1560 1560 v->audio = -1; /* unknown audio minor */ 1561 1561 v->flags = 0; ··· 1565 1565 v->treble = 0; 1566 1566 v->balance = 0x8000; 1567 1567 v->step = 1; 1568 - break; 1568 + break; 1569 1569 } 1570 - 1570 + 1571 1571 case VIDIOCSAUDIO: 1572 1572 { 1573 1573 /* Dummy: nothing can be set */ 1574 1574 break; 1575 1575 } 1576 - 1576 + 1577 1577 case VIDIOCGUNIT: 1578 1578 { 1579 1579 struct video_unit *vu = arg; 1580 - 1580 + 1581 1581 vu->video = pdev->vdev->minor & 0x3F; 1582 1582 vu->audio = -1; /* not known yet */ 1583 1583 vu->vbi = -1; ··· 1589 1589 return pwc_ioctl(pdev, cmd, arg); 1590 1590 } /* ..switch */ 1591 1591 return 0; 1592 - } 1592 + } 1593 1593 1594 1594 static int pwc_video_ioctl(struct inode *inode, struct file *file, 1595 1595 unsigned int cmd, unsigned long arg) ··· 1605 1605 unsigned long start = vma->vm_start; 1606 1606 unsigned long size = vma->vm_end-vma->vm_start; 1607 1607 unsigned long page, pos; 1608 - 1608 + 1609 1609 Trace(TRACE_MEMORY, "mmap(0x%p, 0x%lx, %lu) called.\n", vdev, start, size); 1610 1610 pdev = vdev->priv; 1611 - 1611 + 1612 1612 vma->vm_flags |= VM_IO; 1613 1613 1614 1614 pos = (unsigned long)pdev->image_data; ··· 1646 1646 char serial_number[30], *name; 1647 1647 1648 1648 /* Check if we can handle this device */ 1649 - Trace(TRACE_PROBE, "probe() called [%04X %04X], if %d\n", 1649 + Trace(TRACE_PROBE, "probe() called [%04X %04X], if %d\n", 1650 1650 le16_to_cpu(udev->descriptor.idVendor), 1651 1651 le16_to_cpu(udev->descriptor.idProduct), 1652 1652 intf->altsetting->desc.bInterfaceNumber); ··· 1770 1770 name = "Logitech QuickCam (res.)"; 1771 1771 type_id = 730; /* Assuming CMOS */ 1772 1772 break; 1773 - default: 1773 + default: 1774 1774 return -ENODEV; 1775 - break; 1776 - } 1777 - } 1775 + break; 1776 + } 1777 + } 1778 1778 else if (vendor_id == 0x055d) { 1779 1779 /* I don't know the difference between the C10 and the C30; 1780 1780 I suppose the difference is the sensor, but both cameras ··· 1837 1837 return -ENODEV; 1838 1838 break; 1839 1839 } 1840 - 1840 + 1841 1841 } 1842 1842 else if (vendor_id == 0x0d81) { 1843 1843 switch(product_id) { ··· 1856 1856 break; 1857 1857 } 1858 1858 } 1859 - else 1859 + else 1860 1860 return -ENODEV; /* Not any of the know types; but the list keeps growing. */ 1861 1861 1862 1862 memset(serial_number, 0, 30); ··· 1880 1880 if (vendor_id == 0x046D && product_id == 0x08B5) 1881 1881 { 1882 1882 /* Logitech QuickCam Orbit 1883 - The ranges have been determined experimentally; they may differ from cam to cam. 1884 - Also, the exact ranges left-right and up-down are different for my cam 1885 - */ 1883 + The ranges have been determined experimentally; they may differ from cam to cam. 1884 + Also, the exact ranges left-right and up-down are different for my cam 1885 + */ 1886 1886 pdev->angle_range.pan_min = -7000; 1887 1887 pdev->angle_range.pan_max = 7000; 1888 1888 pdev->angle_range.tilt_min = -3000; ··· 1939 1939 } 1940 1940 1941 1941 /* occupy slot */ 1942 - if (hint < MAX_DEV_HINTS) 1942 + if (hint < MAX_DEV_HINTS) 1943 1943 device_hint[hint].pdev = pdev; 1944 1944 1945 1945 Trace(TRACE_PROBE, "probe() function returning struct at 0x%p.\n", pdev); ··· 1968 1968 Err("pwc_disconnect() Woops: pointer mismatch udev/pdev.\n"); 1969 1969 goto disconnect_out; 1970 1970 } 1971 - #ifdef PWC_MAGIC 1971 + #ifdef PWC_MAGIC 1972 1972 if (pdev->magic != PWC_MAGIC) { 1973 1973 Err("pwc_disconnect() Magic number failed. Consult your scrolls and try again.\n"); 1974 1974 goto disconnect_out; 1975 1975 } 1976 1976 #endif 1977 - 1977 + 1978 1978 /* We got unplugged; this is signalled by an EPIPE error code */ 1979 1979 if (pdev->vopen) { 1980 1980 Info("Disconnected while webcam is in use!\n"); ··· 2017 2017 } 2018 2018 2019 2019 2020 - /* 2021 - * Initialization code & module stuff 2020 + /* 2021 + * Initialization code & module stuff 2022 2022 */ 2023 2023 2024 2024 static char size[10]; ··· 2168 2168 if (*dot != '\0') { 2169 2169 /* There's a serial number as well */ 2170 2170 int k; 2171 - 2171 + 2172 2172 dot++; 2173 2173 k = 0; 2174 2174 while (*dot != ':' && k < 29) { ··· 2178 2178 device_hint[i].serial_number[k] = '\0'; 2179 2179 } 2180 2180 } 2181 - #if PWC_DEBUG 2181 + #if PWC_DEBUG 2182 2182 Debug("device_hint[%d]:\n", i); 2183 2183 Debug(" type : %d\n", device_hint[i].type); 2184 2184 Debug(" serial# : %s\n", device_hint[i].serial_number); 2185 2185 Debug(" node : %d\n", device_hint[i].device_node); 2186 - #endif 2186 + #endif 2187 2187 } 2188 2188 else 2189 2189 device_hint[i].type = 0; /* not filled */ 2190 2190 } /* ..for MAX_DEV_HINTS */ 2191 2191 2192 - Trace(TRACE_PROBE, "Registering driver at address 0x%p.\n", &pwc_driver); 2192 + Trace(TRACE_PROBE, "Registering driver at address 0x%p.\n", &pwc_driver); 2193 2193 return usb_register(&pwc_driver); 2194 2194 } 2195 2195
+20 -20
drivers/media/video/pwc/pwc-ioctl.h
··· 33 33 /* 34 34 Changes 35 35 2001/08/03 Alvarado Added ioctl constants to access methods for 36 - changing white balance and red/blue gains 36 + changing white balance and red/blue gains 37 37 2002/12/15 G. H. Fernandez-Toribio VIDIOCGREALSIZE 38 38 2003/12/13 Nemosft Unv. Some modifications to make interfacing to 39 - PWCX easier 39 + PWCX easier 40 40 */ 41 41 42 42 /* These are private ioctl() commands, specific for the Philips webcams. ··· 45 45 46 46 The #define names are built up like follows: 47 47 VIDIOC VIDeo IOCtl prefix 48 - PWC Philps WebCam 49 - G optional: Get 50 - S optional: Set 51 - ... the function 48 + PWC Philps WebCam 49 + G optional: Get 50 + S optional: Set 51 + ... the function 52 52 */ 53 53 54 54 ··· 94 94 { 95 95 char serial[30]; /* String with serial number. Contains terminating 0 */ 96 96 }; 97 - 97 + 98 98 /* pwc_whitebalance.mode values */ 99 99 #define PWC_WB_INDOOR 0 100 100 #define PWC_WB_OUTDOOR 1 ··· 102 102 #define PWC_WB_MANUAL 3 103 103 #define PWC_WB_AUTO 4 104 104 105 - /* Used with VIDIOCPWC[SG]AWB (Auto White Balance). 105 + /* Used with VIDIOCPWC[SG]AWB (Auto White Balance). 106 106 Set mode to one of the PWC_WB_* values above. 107 - *red and *blue are the respective gains of these colour components inside 107 + *red and *blue are the respective gains of these colour components inside 108 108 the camera; range 0..65535 109 - When 'mode' == PWC_WB_MANUAL, 'manual_red' and 'manual_blue' are set or read; 109 + When 'mode' == PWC_WB_MANUAL, 'manual_red' and 'manual_blue' are set or read; 110 110 otherwise undefined. 111 111 'read_red' and 'read_blue' are read-only. 112 - */ 112 + */ 113 113 struct pwc_whitebalance 114 114 { 115 115 int mode; ··· 117 117 int read_red, read_blue; /* R/O */ 118 118 }; 119 119 120 - /* 120 + /* 121 121 'control_speed' and 'control_delay' are used in automatic whitebalance mode, 122 - and tell the camera how fast it should react to changes in lighting, and 122 + and tell the camera how fast it should react to changes in lighting, and 123 123 with how much delay. Valid values are 0..65535. 124 124 */ 125 125 struct pwc_wb_speed ··· 148 148 #define PWC_MPT_TILT 0x02 149 149 #define PWC_MPT_TIMEOUT 0x04 /* for status */ 150 150 151 - /* Set angles; when absolute != 0, the angle is absolute and the 151 + /* Set angles; when absolute != 0, the angle is absolute and the 152 152 driver calculates the relative offset for you. This can only 153 153 be used with VIDIOCPWCSANGLE; VIDIOCPWCGANGLE always returns 154 154 absolute angles. 155 - */ 155 + */ 156 156 struct pwc_mpt_angles 157 157 { 158 158 int absolute; /* write-only */ ··· 179 179 /* This is used for out-of-kernel decompression. With it, you can get 180 180 all the necessary information to initialize and use the decompressor 181 181 routines in standalone applications. 182 - */ 182 + */ 183 183 struct pwc_video_command 184 184 { 185 185 int type; /* camera type (645, 675, 730, etc.) */ 186 186 int release; /* release number */ 187 187 188 - int size; /* one of PSZ_* */ 189 - int alternate; 188 + int size; /* one of PSZ_* */ 189 + int alternate; 190 190 int command_len; /* length of USB video command */ 191 191 unsigned char command_buf[13]; /* Actual USB video command */ 192 192 int bandlength; /* >0 = compressed */ ··· 264 264 265 265 /* Flickerless mode; = 0 off, otherwise on */ 266 266 #define VIDIOCPWCSFLICKER _IOW('v', 208, int) 267 - #define VIDIOCPWCGFLICKER _IOR('v', 208, int) 267 + #define VIDIOCPWCGFLICKER _IOR('v', 208, int) 268 268 269 269 /* Dynamic noise reduction; 0 off, 3 = high noise reduction */ 270 270 #define VIDIOCPWCSDYNNOISE _IOW('v', 209, int) ··· 273 273 /* Real image size as used by the camera; tells you whether or not there's a gray border around the image */ 274 274 #define VIDIOCPWCGREALSIZE _IOR('v', 210, struct pwc_imagesize) 275 275 276 - /* Motorized pan & tilt functions */ 276 + /* Motorized pan & tilt functions */ 277 277 #define VIDIOCPWCMPTRESET _IOW('v', 211, int) 278 278 #define VIDIOCPWCMPTGRANGE _IOR('v', 211, struct pwc_mpt_range) 279 279 #define VIDIOCPWCMPTSANGLE _IOW('v', 212, struct pwc_mpt_angles)
+144 -144
drivers/media/video/pwc/pwc-kiara.c
··· 48 48 { 49 49 /* 5 fps */ 50 50 { 51 - {0, }, 52 - {0, }, 53 - {0, }, 54 - {0, }, 51 + {0, }, 52 + {0, }, 53 + {0, }, 54 + {0, }, 55 55 }, 56 56 /* 10 fps */ 57 57 { 58 - {0, }, 59 - {0, }, 60 - {0, }, 61 - {0, }, 58 + {0, }, 59 + {0, }, 60 + {0, }, 61 + {0, }, 62 62 }, 63 63 /* 15 fps */ 64 64 { 65 - {0, }, 66 - {0, }, 67 - {0, }, 68 - {0, }, 65 + {0, }, 66 + {0, }, 67 + {0, }, 68 + {0, }, 69 69 }, 70 70 /* 20 fps */ 71 71 { 72 - {0, }, 73 - {0, }, 74 - {0, }, 75 - {0, }, 72 + {0, }, 73 + {0, }, 74 + {0, }, 75 + {0, }, 76 76 }, 77 77 /* 25 fps */ 78 78 { 79 - {0, }, 80 - {0, }, 81 - {0, }, 82 - {0, }, 79 + {0, }, 80 + {0, }, 81 + {0, }, 82 + {0, }, 83 83 }, 84 84 /* 30 fps */ 85 85 { 86 - {0, }, 87 - {0, }, 88 - {0, }, 89 - {0, }, 86 + {0, }, 87 + {0, }, 88 + {0, }, 89 + {0, }, 90 90 }, 91 91 }, 92 92 /* QSIF */ 93 93 { 94 94 /* 5 fps */ 95 95 { 96 - {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}}, 97 - {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}}, 98 - {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}}, 99 - {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}}, 96 + {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}}, 97 + {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}}, 98 + {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}}, 99 + {1, 146, 0, {0x1D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0x00, 0x80}}, 100 100 }, 101 101 /* 10 fps */ 102 102 { 103 - {2, 291, 0, {0x1C, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0x01, 0x80}}, 104 - {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}}, 105 - {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}}, 106 - {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}}, 103 + {2, 291, 0, {0x1C, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0x01, 0x80}}, 104 + {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}}, 105 + {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}}, 106 + {1, 192, 630, {0x14, 0xF4, 0x30, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xC0, 0x00, 0x80}}, 107 107 }, 108 108 /* 15 fps */ 109 109 { 110 - {3, 437, 0, {0x1B, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x01, 0x80}}, 111 - {2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}}, 112 - {2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}}, 113 - {1, 192, 420, {0x13, 0xF4, 0x30, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x18, 0xC0, 0x00, 0x80}}, 110 + {3, 437, 0, {0x1B, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x01, 0x80}}, 111 + {2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}}, 112 + {2, 292, 640, {0x13, 0xF4, 0x30, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x20, 0x24, 0x01, 0x80}}, 113 + {1, 192, 420, {0x13, 0xF4, 0x30, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x18, 0xC0, 0x00, 0x80}}, 114 114 }, 115 115 /* 20 fps */ 116 116 { 117 - {4, 589, 0, {0x1A, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4D, 0x02, 0x80}}, 118 - {3, 448, 730, {0x12, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xC0, 0x01, 0x80}}, 119 - {2, 292, 476, {0x12, 0xF4, 0x30, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0x01, 0x80}}, 120 - {1, 192, 312, {0x12, 0xF4, 0x50, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0x00, 0x80}}, 117 + {4, 589, 0, {0x1A, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4D, 0x02, 0x80}}, 118 + {3, 448, 730, {0x12, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xC0, 0x01, 0x80}}, 119 + {2, 292, 476, {0x12, 0xF4, 0x30, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0x01, 0x80}}, 120 + {1, 192, 312, {0x12, 0xF4, 0x50, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0x00, 0x80}}, 121 121 }, 122 122 /* 25 fps */ 123 123 { 124 - {5, 703, 0, {0x19, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x02, 0x80}}, 125 - {3, 447, 610, {0x11, 0xF4, 0x30, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x28, 0xBF, 0x01, 0x80}}, 126 - {2, 292, 398, {0x11, 0xF4, 0x50, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x28, 0x24, 0x01, 0x80}}, 127 - {1, 193, 262, {0x11, 0xF4, 0x50, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x28, 0xC1, 0x00, 0x80}}, 124 + {5, 703, 0, {0x19, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x02, 0x80}}, 125 + {3, 447, 610, {0x11, 0xF4, 0x30, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x28, 0xBF, 0x01, 0x80}}, 126 + {2, 292, 398, {0x11, 0xF4, 0x50, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x28, 0x24, 0x01, 0x80}}, 127 + {1, 193, 262, {0x11, 0xF4, 0x50, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x28, 0xC1, 0x00, 0x80}}, 128 128 }, 129 129 /* 30 fps */ 130 130 { 131 - {8, 874, 0, {0x18, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x6A, 0x03, 0x80}}, 132 - {5, 704, 730, {0x10, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x28, 0xC0, 0x02, 0x80}}, 133 - {3, 448, 492, {0x10, 0xF4, 0x30, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x28, 0xC0, 0x01, 0x80}}, 134 - {2, 292, 320, {0x10, 0xF4, 0x50, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x28, 0x24, 0x01, 0x80}}, 131 + {8, 874, 0, {0x18, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x6A, 0x03, 0x80}}, 132 + {5, 704, 730, {0x10, 0xF4, 0x30, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x28, 0xC0, 0x02, 0x80}}, 133 + {3, 448, 492, {0x10, 0xF4, 0x30, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x28, 0xC0, 0x01, 0x80}}, 134 + {2, 292, 320, {0x10, 0xF4, 0x50, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x28, 0x24, 0x01, 0x80}}, 135 135 }, 136 136 }, 137 137 /* QCIF */ 138 138 { 139 139 /* 5 fps */ 140 140 { 141 - {0, }, 142 - {0, }, 143 - {0, }, 144 - {0, }, 141 + {0, }, 142 + {0, }, 143 + {0, }, 144 + {0, }, 145 145 }, 146 146 /* 10 fps */ 147 147 { 148 - {0, }, 149 - {0, }, 150 - {0, }, 151 - {0, }, 148 + {0, }, 149 + {0, }, 150 + {0, }, 151 + {0, }, 152 152 }, 153 153 /* 15 fps */ 154 154 { 155 - {0, }, 156 - {0, }, 157 - {0, }, 158 - {0, }, 155 + {0, }, 156 + {0, }, 157 + {0, }, 158 + {0, }, 159 159 }, 160 160 /* 20 fps */ 161 161 { 162 - {0, }, 163 - {0, }, 164 - {0, }, 165 - {0, }, 162 + {0, }, 163 + {0, }, 164 + {0, }, 165 + {0, }, 166 166 }, 167 167 /* 25 fps */ 168 168 { 169 - {0, }, 170 - {0, }, 171 - {0, }, 172 - {0, }, 169 + {0, }, 170 + {0, }, 171 + {0, }, 172 + {0, }, 173 173 }, 174 174 /* 30 fps */ 175 175 { 176 - {0, }, 177 - {0, }, 178 - {0, }, 179 - {0, }, 176 + {0, }, 177 + {0, }, 178 + {0, }, 179 + {0, }, 180 180 }, 181 181 }, 182 182 /* SIF */ 183 183 { 184 184 /* 5 fps */ 185 185 { 186 - {4, 582, 0, {0x0D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x02, 0x80}}, 187 - {3, 387, 1276, {0x05, 0xF4, 0x30, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x01, 0x80}}, 188 - {2, 291, 960, {0x05, 0xF4, 0x30, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0x01, 0x80}}, 189 - {1, 191, 630, {0x05, 0xF4, 0x50, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x18, 0xBF, 0x00, 0x80}}, 186 + {4, 582, 0, {0x0D, 0xF4, 0x30, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x02, 0x80}}, 187 + {3, 387, 1276, {0x05, 0xF4, 0x30, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x01, 0x80}}, 188 + {2, 291, 960, {0x05, 0xF4, 0x30, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0x01, 0x80}}, 189 + {1, 191, 630, {0x05, 0xF4, 0x50, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x18, 0xBF, 0x00, 0x80}}, 190 190 }, 191 191 /* 10 fps */ 192 192 { 193 - {0, }, 194 - {6, 775, 1278, {0x04, 0xF4, 0x30, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x03, 0x80}}, 195 - {3, 447, 736, {0x04, 0xF4, 0x30, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x28, 0xBF, 0x01, 0x80}}, 196 - {2, 292, 480, {0x04, 0xF4, 0x70, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x28, 0x24, 0x01, 0x80}}, 193 + {0, }, 194 + {6, 775, 1278, {0x04, 0xF4, 0x30, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x03, 0x80}}, 195 + {3, 447, 736, {0x04, 0xF4, 0x30, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x28, 0xBF, 0x01, 0x80}}, 196 + {2, 292, 480, {0x04, 0xF4, 0x70, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x28, 0x24, 0x01, 0x80}}, 197 197 }, 198 198 /* 15 fps */ 199 199 { 200 - {0, }, 201 - {9, 955, 1050, {0x03, 0xF4, 0x30, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x03, 0x80}}, 202 - {4, 592, 650, {0x03, 0xF4, 0x30, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x50, 0x02, 0x80}}, 203 - {3, 448, 492, {0x03, 0xF4, 0x50, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x38, 0xC0, 0x01, 0x80}}, 200 + {0, }, 201 + {9, 955, 1050, {0x03, 0xF4, 0x30, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x03, 0x80}}, 202 + {4, 592, 650, {0x03, 0xF4, 0x30, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x50, 0x02, 0x80}}, 203 + {3, 448, 492, {0x03, 0xF4, 0x50, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x38, 0xC0, 0x01, 0x80}}, 204 204 }, 205 205 /* 20 fps */ 206 206 { 207 - {0, }, 208 - {9, 958, 782, {0x02, 0xF4, 0x30, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x03, 0x80}}, 209 - {5, 703, 574, {0x02, 0xF4, 0x50, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x02, 0x80}}, 210 - {3, 446, 364, {0x02, 0xF4, 0x90, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x38, 0xBE, 0x01, 0x80}}, 207 + {0, }, 208 + {9, 958, 782, {0x02, 0xF4, 0x30, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x03, 0x80}}, 209 + {5, 703, 574, {0x02, 0xF4, 0x50, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x02, 0x80}}, 210 + {3, 446, 364, {0x02, 0xF4, 0x90, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x38, 0xBE, 0x01, 0x80}}, 211 211 }, 212 212 /* 25 fps */ 213 213 { 214 - {0, }, 215 - {9, 958, 654, {0x01, 0xF4, 0x30, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x03, 0x80}}, 216 - {6, 776, 530, {0x01, 0xF4, 0x50, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x03, 0x80}}, 217 - {4, 592, 404, {0x01, 0xF4, 0x70, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x48, 0x50, 0x02, 0x80}}, 214 + {0, }, 215 + {9, 958, 654, {0x01, 0xF4, 0x30, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x03, 0x80}}, 216 + {6, 776, 530, {0x01, 0xF4, 0x50, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x03, 0x80}}, 217 + {4, 592, 404, {0x01, 0xF4, 0x70, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x48, 0x50, 0x02, 0x80}}, 218 218 }, 219 219 /* 30 fps */ 220 220 { 221 - {0, }, 222 - {9, 957, 526, {0x00, 0xF4, 0x50, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x03, 0x80}}, 223 - {6, 775, 426, {0x00, 0xF4, 0x70, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x03, 0x80}}, 224 - {4, 590, 324, {0x00, 0x7A, 0x88, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x50, 0x4E, 0x02, 0x80}}, 221 + {0, }, 222 + {9, 957, 526, {0x00, 0xF4, 0x50, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x03, 0x80}}, 223 + {6, 775, 426, {0x00, 0xF4, 0x70, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x03, 0x80}}, 224 + {4, 590, 324, {0x00, 0x7A, 0x88, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x50, 0x4E, 0x02, 0x80}}, 225 225 }, 226 226 }, 227 227 /* CIF */ 228 228 { 229 229 /* 5 fps */ 230 230 { 231 - {0, }, 232 - {0, }, 233 - {0, }, 234 - {0, }, 231 + {0, }, 232 + {0, }, 233 + {0, }, 234 + {0, }, 235 235 }, 236 236 /* 10 fps */ 237 237 { 238 - {0, }, 239 - {0, }, 240 - {0, }, 241 - {0, }, 238 + {0, }, 239 + {0, }, 240 + {0, }, 241 + {0, }, 242 242 }, 243 243 /* 15 fps */ 244 244 { 245 - {0, }, 246 - {0, }, 247 - {0, }, 248 - {0, }, 245 + {0, }, 246 + {0, }, 247 + {0, }, 248 + {0, }, 249 249 }, 250 250 /* 20 fps */ 251 251 { 252 - {0, }, 253 - {0, }, 254 - {0, }, 255 - {0, }, 252 + {0, }, 253 + {0, }, 254 + {0, }, 255 + {0, }, 256 256 }, 257 257 /* 25 fps */ 258 258 { 259 - {0, }, 260 - {0, }, 261 - {0, }, 262 - {0, }, 259 + {0, }, 260 + {0, }, 261 + {0, }, 262 + {0, }, 263 263 }, 264 264 /* 30 fps */ 265 265 { 266 - {0, }, 267 - {0, }, 268 - {0, }, 269 - {0, }, 266 + {0, }, 267 + {0, }, 268 + {0, }, 269 + {0, }, 270 270 }, 271 271 }, 272 272 /* VGA */ 273 273 { 274 274 /* 5 fps */ 275 275 { 276 - {0, }, 277 - {6, 773, 1272, {0x25, 0xF4, 0x30, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}}, 278 - {4, 592, 976, {0x25, 0xF4, 0x50, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x02, 0x80}}, 279 - {3, 448, 738, {0x25, 0xF4, 0x90, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x01, 0x80}}, 276 + {0, }, 277 + {6, 773, 1272, {0x25, 0xF4, 0x30, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}}, 278 + {4, 592, 976, {0x25, 0xF4, 0x50, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x02, 0x80}}, 279 + {3, 448, 738, {0x25, 0xF4, 0x90, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x01, 0x80}}, 280 280 }, 281 281 /* 10 fps */ 282 282 { 283 - {0, }, 284 - {9, 956, 788, {0x24, 0xF4, 0x70, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x03, 0x80}}, 285 - {6, 776, 640, {0x24, 0xF4, 0xB0, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x03, 0x80}}, 286 - {4, 592, 488, {0x24, 0x7A, 0xE8, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x02, 0x80}}, 283 + {0, }, 284 + {9, 956, 788, {0x24, 0xF4, 0x70, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x03, 0x80}}, 285 + {6, 776, 640, {0x24, 0xF4, 0xB0, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x03, 0x80}}, 286 + {4, 592, 488, {0x24, 0x7A, 0xE8, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x02, 0x80}}, 287 287 }, 288 288 /* 15 fps */ 289 289 { 290 - {0, }, 291 - {9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}}, 292 - {9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}}, 293 - {8, 895, 492, {0x23, 0x7A, 0xE8, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x03, 0x80}}, 290 + {0, }, 291 + {9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}}, 292 + {9, 957, 526, {0x23, 0x7A, 0xE8, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x03, 0x80}}, 293 + {8, 895, 492, {0x23, 0x7A, 0xE8, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x03, 0x80}}, 294 294 }, 295 295 /* 20 fps */ 296 296 { 297 - {0, }, 298 - {0, }, 299 - {0, }, 300 - {0, }, 297 + {0, }, 298 + {0, }, 299 + {0, }, 300 + {0, }, 301 301 }, 302 302 /* 25 fps */ 303 303 { 304 - {0, }, 305 - {0, }, 306 - {0, }, 307 - {0, }, 304 + {0, }, 305 + {0, }, 306 + {0, }, 307 + {0, }, 308 308 }, 309 309 /* 30 fps */ 310 310 { 311 - {0, }, 312 - {0, }, 313 - {0, }, 314 - {0, }, 311 + {0, }, 312 + {0, }, 313 + {0, }, 314 + {0, }, 315 315 }, 316 316 }, 317 317 };
+13 -13
drivers/media/video/pwc/pwc-misc.c
··· 1 - /* Linux driver for Philips webcam 1 + /* Linux driver for Philips webcam 2 2 Various miscellaneous functions and tables. 3 3 (C) 1999-2003 Nemosoft Unv. 4 4 (C) 2004 Luc Saillard (luc@saillard.org) ··· 44 44 int i, find; 45 45 46 46 /* Make sure we don't go beyond our max size. 47 - NB: we have different limits for RAW and normal modes. In case 48 - you don't have the decompressor loaded or use RAW mode, 49 - the maximum viewable size is smaller. 50 - */ 47 + NB: we have different limits for RAW and normal modes. In case 48 + you don't have the decompressor loaded or use RAW mode, 49 + the maximum viewable size is smaller. 50 + */ 51 51 if (pdev->vpalette == VIDEO_PALETTE_RAW) 52 52 { 53 53 if (width > pdev->abs_max.x || height > pdev->abs_max.y) 54 54 { 55 55 Debug("VIDEO_PALETTE_RAW: going beyond abs_max.\n"); 56 - return -1; 57 - } 56 + return -1; 57 + } 58 58 } 59 59 else 60 60 { ··· 88 88 pdev->view_min.y = 96; 89 89 pdev->view_max.x = 352; 90 90 pdev->view_max.y = 288; 91 - pdev->abs_max.x = 352; 92 - pdev->abs_max.y = 288; 91 + pdev->abs_max.x = 352; 92 + pdev->abs_max.y = 288; 93 93 pdev->image_mask = 1 << PSZ_SQCIF | 1 << PSZ_QCIF | 1 << PSZ_CIF; 94 94 pdev->vcinterface = 2; 95 95 pdev->vendpoint = 4; ··· 105 105 pdev->view_max.x = 640; 106 106 pdev->view_max.y = 480; 107 107 pdev->image_mask = 1 << PSZ_SQCIF | 1 << PSZ_QSIF | 1 << PSZ_QCIF | 1 << PSZ_SIF | 1 << PSZ_CIF | 1 << PSZ_VGA; 108 - pdev->abs_max.x = 640; 109 - pdev->abs_max.y = 480; 108 + pdev->abs_max.x = 640; 109 + pdev->abs_max.y = 480; 110 110 pdev->vcinterface = 3; 111 111 pdev->vendpoint = 4; 112 112 pdev->frame_header_size = 0; ··· 121 121 pdev->view_max.x = 640; 122 122 pdev->view_max.y = 480; 123 123 pdev->image_mask = 1 << PSZ_QSIF | 1 << PSZ_SIF | 1 << PSZ_VGA; 124 - pdev->abs_max.x = 640; 125 - pdev->abs_max.y = 480; 124 + pdev->abs_max.x = 640; 125 + pdev->abs_max.y = 480; 126 126 pdev->vcinterface = 3; 127 127 pdev->vendpoint = 5; 128 128 pdev->frame_header_size = TOUCAM_HEADER_SIZE;
+1 -1
drivers/media/video/pwc/pwc-nala.h
··· 54 54 {0}, 55 55 }, 56 56 /* VGA */ 57 - { 57 + { 58 58 {0}, 59 59 {0}, 60 60 {0},
+144 -144
drivers/media/video/pwc/pwc-timon.c
··· 46 46 { 47 47 /* 5 fps */ 48 48 { 49 - {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}}, 50 - {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}}, 51 - {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}}, 52 - {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}}, 49 + {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}}, 50 + {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}}, 51 + {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}}, 52 + {1, 140, 0, {0x05, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x8C, 0xFC, 0x80, 0x02}}, 53 53 }, 54 54 /* 10 fps */ 55 55 { 56 - {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}}, 57 - {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}}, 58 - {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}}, 59 - {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}}, 56 + {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}}, 57 + {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}}, 58 + {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}}, 59 + {2, 280, 0, {0x04, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x18, 0xA9, 0x80, 0x02}}, 60 60 }, 61 61 /* 15 fps */ 62 62 { 63 - {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}}, 64 - {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}}, 65 - {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}}, 66 - {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}}, 63 + {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}}, 64 + {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}}, 65 + {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}}, 66 + {3, 410, 0, {0x03, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x9A, 0x71, 0x80, 0x02}}, 67 67 }, 68 68 /* 20 fps */ 69 69 { 70 - {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}}, 71 - {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}}, 72 - {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}}, 73 - {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}}, 70 + {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}}, 71 + {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}}, 72 + {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}}, 73 + {4, 559, 0, {0x02, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x2F, 0x56, 0x80, 0x02}}, 74 74 }, 75 75 /* 25 fps */ 76 76 { 77 - {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}}, 78 - {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}}, 79 - {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}}, 80 - {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}}, 77 + {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}}, 78 + {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}}, 79 + {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}}, 80 + {5, 659, 0, {0x01, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x93, 0x46, 0x80, 0x02}}, 81 81 }, 82 82 /* 30 fps */ 83 83 { 84 - {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}}, 85 - {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}}, 86 - {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}}, 87 - {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}}, 84 + {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}}, 85 + {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}}, 86 + {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}}, 87 + {7, 838, 0, {0x00, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x46, 0x3B, 0x80, 0x02}}, 88 88 }, 89 89 }, 90 90 /* QSIF */ 91 91 { 92 92 /* 5 fps */ 93 93 { 94 - {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}}, 95 - {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}}, 96 - {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}}, 97 - {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}}, 94 + {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}}, 95 + {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}}, 96 + {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}}, 97 + {1, 146, 0, {0x2D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x92, 0xFC, 0xC0, 0x02}}, 98 98 }, 99 99 /* 10 fps */ 100 100 { 101 - {2, 291, 0, {0x2C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0xA1, 0xC0, 0x02}}, 102 - {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}}, 103 - {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}}, 104 - {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}}, 101 + {2, 291, 0, {0x2C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x23, 0xA1, 0xC0, 0x02}}, 102 + {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}}, 103 + {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}}, 104 + {1, 191, 630, {0x2C, 0xF4, 0x05, 0x13, 0xA9, 0x12, 0xE1, 0x17, 0x08, 0xBF, 0xF4, 0xC0, 0x02}}, 105 105 }, 106 106 /* 15 fps */ 107 107 { 108 - {3, 437, 0, {0x2B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x6D, 0xC0, 0x02}}, 109 - {2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}}, 110 - {2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}}, 111 - {1, 191, 420, {0x2B, 0xF4, 0x0D, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x08, 0xBF, 0xF4, 0xC0, 0x02}}, 108 + {3, 437, 0, {0x2B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xB5, 0x6D, 0xC0, 0x02}}, 109 + {2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}}, 110 + {2, 291, 640, {0x2B, 0xF4, 0x05, 0x13, 0xF7, 0x13, 0x2F, 0x13, 0x08, 0x23, 0xA1, 0xC0, 0x02}}, 111 + {1, 191, 420, {0x2B, 0xF4, 0x0D, 0x0D, 0x1B, 0x0C, 0x53, 0x1E, 0x08, 0xBF, 0xF4, 0xC0, 0x02}}, 112 112 }, 113 113 /* 20 fps */ 114 114 { 115 - {4, 588, 0, {0x2A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4C, 0x52, 0xC0, 0x02}}, 116 - {3, 447, 730, {0x2A, 0xF4, 0x05, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xBF, 0x69, 0xC0, 0x02}}, 117 - {2, 292, 476, {0x2A, 0xF4, 0x0D, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0xA1, 0xC0, 0x02}}, 118 - {1, 192, 312, {0x2A, 0xF4, 0x1D, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}}, 115 + {4, 588, 0, {0x2A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4C, 0x52, 0xC0, 0x02}}, 116 + {3, 447, 730, {0x2A, 0xF4, 0x05, 0x16, 0xC9, 0x16, 0x01, 0x0E, 0x18, 0xBF, 0x69, 0xC0, 0x02}}, 117 + {2, 292, 476, {0x2A, 0xF4, 0x0D, 0x0E, 0xD8, 0x0E, 0x10, 0x19, 0x18, 0x24, 0xA1, 0xC0, 0x02}}, 118 + {1, 192, 312, {0x2A, 0xF4, 0x1D, 0x09, 0xB3, 0x08, 0xEB, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}}, 119 119 }, 120 120 /* 25 fps */ 121 121 { 122 - {5, 703, 0, {0x29, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x42, 0xC0, 0x02}}, 123 - {3, 447, 610, {0x29, 0xF4, 0x05, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x18, 0xBF, 0x69, 0xC0, 0x02}}, 124 - {2, 292, 398, {0x29, 0xF4, 0x0D, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}}, 125 - {1, 192, 262, {0x29, 0xF4, 0x25, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}}, 122 + {5, 703, 0, {0x29, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0xBF, 0x42, 0xC0, 0x02}}, 123 + {3, 447, 610, {0x29, 0xF4, 0x05, 0x13, 0x0B, 0x12, 0x43, 0x14, 0x18, 0xBF, 0x69, 0xC0, 0x02}}, 124 + {2, 292, 398, {0x29, 0xF4, 0x0D, 0x0C, 0x6C, 0x0B, 0xA4, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}}, 125 + {1, 192, 262, {0x29, 0xF4, 0x25, 0x08, 0x23, 0x07, 0x5B, 0x1E, 0x18, 0xC0, 0xF4, 0xC0, 0x02}}, 126 126 }, 127 127 /* 30 fps */ 128 128 { 129 - {8, 873, 0, {0x28, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x69, 0x37, 0xC0, 0x02}}, 130 - {5, 704, 774, {0x28, 0xF4, 0x05, 0x18, 0x21, 0x17, 0x59, 0x0F, 0x18, 0xC0, 0x42, 0xC0, 0x02}}, 131 - {3, 448, 492, {0x28, 0xF4, 0x05, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x18, 0xC0, 0x69, 0xC0, 0x02}}, 132 - {2, 291, 320, {0x28, 0xF4, 0x1D, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}}, 129 + {8, 873, 0, {0x28, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x69, 0x37, 0xC0, 0x02}}, 130 + {5, 704, 774, {0x28, 0xF4, 0x05, 0x18, 0x21, 0x17, 0x59, 0x0F, 0x18, 0xC0, 0x42, 0xC0, 0x02}}, 131 + {3, 448, 492, {0x28, 0xF4, 0x05, 0x0F, 0x5D, 0x0E, 0x95, 0x15, 0x18, 0xC0, 0x69, 0xC0, 0x02}}, 132 + {2, 291, 320, {0x28, 0xF4, 0x1D, 0x09, 0xFB, 0x09, 0x33, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}}, 133 133 }, 134 134 }, 135 135 /* QCIF */ 136 136 { 137 137 /* 5 fps */ 138 138 { 139 - {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}}, 140 - {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}}, 141 - {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}}, 142 - {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}}, 139 + {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}}, 140 + {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}}, 141 + {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}}, 142 + {1, 193, 0, {0x0D, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xC1, 0xF4, 0xC0, 0x02}}, 143 143 }, 144 144 /* 10 fps */ 145 145 { 146 - {3, 385, 0, {0x0C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x81, 0x79, 0xC0, 0x02}}, 147 - {2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}}, 148 - {2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}}, 149 - {1, 194, 532, {0x0C, 0xF4, 0x05, 0x10, 0x9A, 0x0F, 0xBE, 0x1B, 0x08, 0xC2, 0xF0, 0xC0, 0x02}}, 146 + {3, 385, 0, {0x0C, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x81, 0x79, 0xC0, 0x02}}, 147 + {2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}}, 148 + {2, 291, 800, {0x0C, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x11, 0x08, 0x23, 0xA1, 0xC0, 0x02}}, 149 + {1, 194, 532, {0x0C, 0xF4, 0x05, 0x10, 0x9A, 0x0F, 0xBE, 0x1B, 0x08, 0xC2, 0xF0, 0xC0, 0x02}}, 150 150 }, 151 151 /* 15 fps */ 152 152 { 153 - {4, 577, 0, {0x0B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x41, 0x52, 0xC0, 0x02}}, 154 - {3, 447, 818, {0x0B, 0xF4, 0x05, 0x19, 0x89, 0x18, 0xAD, 0x0F, 0x10, 0xBF, 0x69, 0xC0, 0x02}}, 155 - {2, 292, 534, {0x0B, 0xF4, 0x05, 0x10, 0xA3, 0x0F, 0xC7, 0x19, 0x10, 0x24, 0xA1, 0xC0, 0x02}}, 156 - {1, 195, 356, {0x0B, 0xF4, 0x15, 0x0B, 0x11, 0x0A, 0x35, 0x1E, 0x10, 0xC3, 0xF0, 0xC0, 0x02}}, 153 + {4, 577, 0, {0x0B, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x41, 0x52, 0xC0, 0x02}}, 154 + {3, 447, 818, {0x0B, 0xF4, 0x05, 0x19, 0x89, 0x18, 0xAD, 0x0F, 0x10, 0xBF, 0x69, 0xC0, 0x02}}, 155 + {2, 292, 534, {0x0B, 0xF4, 0x05, 0x10, 0xA3, 0x0F, 0xC7, 0x19, 0x10, 0x24, 0xA1, 0xC0, 0x02}}, 156 + {1, 195, 356, {0x0B, 0xF4, 0x15, 0x0B, 0x11, 0x0A, 0x35, 0x1E, 0x10, 0xC3, 0xF0, 0xC0, 0x02}}, 157 157 }, 158 158 /* 20 fps */ 159 159 { 160 - {6, 776, 0, {0x0A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x08, 0x3F, 0xC0, 0x02}}, 161 - {4, 591, 804, {0x0A, 0xF4, 0x05, 0x19, 0x1E, 0x18, 0x42, 0x0F, 0x18, 0x4F, 0x4E, 0xC0, 0x02}}, 162 - {3, 447, 608, {0x0A, 0xF4, 0x05, 0x12, 0xFD, 0x12, 0x21, 0x15, 0x18, 0xBF, 0x69, 0xC0, 0x02}}, 163 - {2, 291, 396, {0x0A, 0xF4, 0x15, 0x0C, 0x5E, 0x0B, 0x82, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}}, 160 + {6, 776, 0, {0x0A, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x08, 0x3F, 0xC0, 0x02}}, 161 + {4, 591, 804, {0x0A, 0xF4, 0x05, 0x19, 0x1E, 0x18, 0x42, 0x0F, 0x18, 0x4F, 0x4E, 0xC0, 0x02}}, 162 + {3, 447, 608, {0x0A, 0xF4, 0x05, 0x12, 0xFD, 0x12, 0x21, 0x15, 0x18, 0xBF, 0x69, 0xC0, 0x02}}, 163 + {2, 291, 396, {0x0A, 0xF4, 0x15, 0x0C, 0x5E, 0x0B, 0x82, 0x1E, 0x18, 0x23, 0xA1, 0xC0, 0x02}}, 164 164 }, 165 165 /* 25 fps */ 166 166 { 167 - {9, 928, 0, {0x09, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xA0, 0x33, 0xC0, 0x02}}, 168 - {5, 703, 800, {0x09, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x10, 0x18, 0xBF, 0x42, 0xC0, 0x02}}, 169 - {3, 447, 508, {0x09, 0xF4, 0x0D, 0x0F, 0xD2, 0x0E, 0xF6, 0x1B, 0x18, 0xBF, 0x69, 0xC0, 0x02}}, 170 - {2, 292, 332, {0x09, 0xF4, 0x1D, 0x0A, 0x5A, 0x09, 0x7E, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}}, 167 + {9, 928, 0, {0x09, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0xA0, 0x33, 0xC0, 0x02}}, 168 + {5, 703, 800, {0x09, 0xF4, 0x05, 0x18, 0xF4, 0x18, 0x18, 0x10, 0x18, 0xBF, 0x42, 0xC0, 0x02}}, 169 + {3, 447, 508, {0x09, 0xF4, 0x0D, 0x0F, 0xD2, 0x0E, 0xF6, 0x1B, 0x18, 0xBF, 0x69, 0xC0, 0x02}}, 170 + {2, 292, 332, {0x09, 0xF4, 0x1D, 0x0A, 0x5A, 0x09, 0x7E, 0x1E, 0x18, 0x24, 0xA1, 0xC0, 0x02}}, 171 171 }, 172 172 /* 30 fps */ 173 173 { 174 - {0, }, 175 - {9, 956, 876, {0x08, 0xF4, 0x05, 0x1B, 0x58, 0x1A, 0x7C, 0x0E, 0x20, 0xBC, 0x33, 0x10, 0x02}}, 176 - {4, 592, 542, {0x08, 0xF4, 0x05, 0x10, 0xE4, 0x10, 0x08, 0x17, 0x20, 0x50, 0x4E, 0x10, 0x02}}, 177 - {2, 291, 266, {0x08, 0xF4, 0x25, 0x08, 0x48, 0x07, 0x6C, 0x1E, 0x20, 0x23, 0xA1, 0x10, 0x02}}, 174 + {0, }, 175 + {9, 956, 876, {0x08, 0xF4, 0x05, 0x1B, 0x58, 0x1A, 0x7C, 0x0E, 0x20, 0xBC, 0x33, 0x10, 0x02}}, 176 + {4, 592, 542, {0x08, 0xF4, 0x05, 0x10, 0xE4, 0x10, 0x08, 0x17, 0x20, 0x50, 0x4E, 0x10, 0x02}}, 177 + {2, 291, 266, {0x08, 0xF4, 0x25, 0x08, 0x48, 0x07, 0x6C, 0x1E, 0x20, 0x23, 0xA1, 0x10, 0x02}}, 178 178 }, 179 179 }, 180 180 /* SIF */ 181 181 { 182 182 /* 5 fps */ 183 183 { 184 - {4, 582, 0, {0x35, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x52, 0x60, 0x02}}, 185 - {3, 387, 1276, {0x35, 0xF4, 0x05, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x79, 0x60, 0x02}}, 186 - {2, 291, 960, {0x35, 0xF4, 0x0D, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0xA1, 0x60, 0x02}}, 187 - {1, 191, 630, {0x35, 0xF4, 0x1D, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x08, 0xBF, 0xF4, 0x60, 0x02}}, 184 + {4, 582, 0, {0x35, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x46, 0x52, 0x60, 0x02}}, 185 + {3, 387, 1276, {0x35, 0xF4, 0x05, 0x27, 0xD8, 0x26, 0x48, 0x03, 0x10, 0x83, 0x79, 0x60, 0x02}}, 186 + {2, 291, 960, {0x35, 0xF4, 0x0D, 0x1D, 0xF2, 0x1C, 0x62, 0x04, 0x10, 0x23, 0xA1, 0x60, 0x02}}, 187 + {1, 191, 630, {0x35, 0xF4, 0x1D, 0x13, 0xA9, 0x12, 0x19, 0x05, 0x08, 0xBF, 0xF4, 0x60, 0x02}}, 188 188 }, 189 189 /* 10 fps */ 190 190 { 191 - {0, }, 192 - {6, 775, 1278, {0x34, 0xF4, 0x05, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x3F, 0x10, 0x02}}, 193 - {3, 447, 736, {0x34, 0xF4, 0x15, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x18, 0xBF, 0x69, 0x10, 0x02}}, 194 - {2, 291, 480, {0x34, 0xF4, 0x2D, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x18, 0x23, 0xA1, 0x10, 0x02}}, 191 + {0, }, 192 + {6, 775, 1278, {0x34, 0xF4, 0x05, 0x27, 0xE8, 0x26, 0x58, 0x05, 0x30, 0x07, 0x3F, 0x10, 0x02}}, 193 + {3, 447, 736, {0x34, 0xF4, 0x15, 0x16, 0xFB, 0x15, 0x6B, 0x05, 0x18, 0xBF, 0x69, 0x10, 0x02}}, 194 + {2, 291, 480, {0x34, 0xF4, 0x2D, 0x0E, 0xF9, 0x0D, 0x69, 0x09, 0x18, 0x23, 0xA1, 0x10, 0x02}}, 195 195 }, 196 196 /* 15 fps */ 197 197 { 198 - {0, }, 199 - {9, 955, 1050, {0x33, 0xF4, 0x05, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x33, 0x10, 0x02}}, 200 - {4, 591, 650, {0x33, 0xF4, 0x15, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x4F, 0x4E, 0x10, 0x02}}, 201 - {3, 448, 492, {0x33, 0xF4, 0x25, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x28, 0xC0, 0x69, 0x10, 0x02}}, 198 + {0, }, 199 + {9, 955, 1050, {0x33, 0xF4, 0x05, 0x20, 0xCF, 0x1F, 0x3F, 0x06, 0x48, 0xBB, 0x33, 0x10, 0x02}}, 200 + {4, 591, 650, {0x33, 0xF4, 0x15, 0x14, 0x44, 0x12, 0xB4, 0x08, 0x30, 0x4F, 0x4E, 0x10, 0x02}}, 201 + {3, 448, 492, {0x33, 0xF4, 0x25, 0x0F, 0x52, 0x0D, 0xC2, 0x09, 0x28, 0xC0, 0x69, 0x10, 0x02}}, 202 202 }, 203 203 /* 20 fps */ 204 204 { 205 - {0, }, 206 - {9, 958, 782, {0x32, 0xF4, 0x0D, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x33, 0xD0, 0x02}}, 207 - {5, 703, 574, {0x32, 0xF4, 0x1D, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x42, 0xD0, 0x02}}, 208 - {3, 446, 364, {0x32, 0xF4, 0x3D, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x30, 0xBE, 0x69, 0xD0, 0x02}}, 205 + {0, }, 206 + {9, 958, 782, {0x32, 0xF4, 0x0D, 0x18, 0x6A, 0x16, 0xDA, 0x0B, 0x58, 0xBE, 0x33, 0xD0, 0x02}}, 207 + {5, 703, 574, {0x32, 0xF4, 0x1D, 0x11, 0xE7, 0x10, 0x57, 0x0B, 0x40, 0xBF, 0x42, 0xD0, 0x02}}, 208 + {3, 446, 364, {0x32, 0xF4, 0x3D, 0x0B, 0x5C, 0x09, 0xCC, 0x0E, 0x30, 0xBE, 0x69, 0xD0, 0x02}}, 209 209 }, 210 210 /* 25 fps */ 211 211 { 212 - {0, }, 213 - {9, 958, 654, {0x31, 0xF4, 0x15, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x33, 0x90, 0x02}}, 214 - {6, 776, 530, {0x31, 0xF4, 0x25, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x3F, 0x90, 0x02}}, 215 - {4, 592, 404, {0x31, 0xF4, 0x35, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x38, 0x50, 0x4E, 0x90, 0x02}}, 212 + {0, }, 213 + {9, 958, 654, {0x31, 0xF4, 0x15, 0x14, 0x66, 0x12, 0xD6, 0x0B, 0x50, 0xBE, 0x33, 0x90, 0x02}}, 214 + {6, 776, 530, {0x31, 0xF4, 0x25, 0x10, 0x8C, 0x0E, 0xFC, 0x0C, 0x48, 0x08, 0x3F, 0x90, 0x02}}, 215 + {4, 592, 404, {0x31, 0xF4, 0x35, 0x0C, 0x96, 0x0B, 0x06, 0x0B, 0x38, 0x50, 0x4E, 0x90, 0x02}}, 216 216 }, 217 217 /* 30 fps */ 218 218 { 219 - {0, }, 220 - {9, 957, 526, {0x30, 0xF4, 0x25, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x33, 0x60, 0x02}}, 221 - {6, 775, 426, {0x30, 0xF4, 0x35, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x3F, 0x60, 0x02}}, 222 - {4, 590, 324, {0x30, 0x7A, 0x4B, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x40, 0x4E, 0x52, 0x60, 0x02}}, 219 + {0, }, 220 + {9, 957, 526, {0x30, 0xF4, 0x25, 0x10, 0x68, 0x0E, 0xD8, 0x0D, 0x58, 0xBD, 0x33, 0x60, 0x02}}, 221 + {6, 775, 426, {0x30, 0xF4, 0x35, 0x0D, 0x48, 0x0B, 0xB8, 0x0F, 0x50, 0x07, 0x3F, 0x60, 0x02}}, 222 + {4, 590, 324, {0x30, 0x7A, 0x4B, 0x0A, 0x1C, 0x08, 0xB4, 0x0E, 0x40, 0x4E, 0x52, 0x60, 0x02}}, 223 223 }, 224 224 }, 225 225 /* CIF */ 226 226 { 227 227 /* 5 fps */ 228 228 { 229 - {6, 771, 0, {0x15, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x3F, 0x80, 0x02}}, 230 - {4, 465, 1278, {0x15, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x03, 0x18, 0xD1, 0x65, 0x80, 0x02}}, 231 - {2, 291, 800, {0x15, 0xF4, 0x15, 0x18, 0xF4, 0x17, 0x3C, 0x05, 0x18, 0x23, 0xA1, 0x80, 0x02}}, 232 - {1, 193, 528, {0x15, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x18, 0xC1, 0xF4, 0x80, 0x02}}, 229 + {6, 771, 0, {0x15, 0xF4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x3F, 0x80, 0x02}}, 230 + {4, 465, 1278, {0x15, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x03, 0x18, 0xD1, 0x65, 0x80, 0x02}}, 231 + {2, 291, 800, {0x15, 0xF4, 0x15, 0x18, 0xF4, 0x17, 0x3C, 0x05, 0x18, 0x23, 0xA1, 0x80, 0x02}}, 232 + {1, 193, 528, {0x15, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x18, 0xC1, 0xF4, 0x80, 0x02}}, 233 233 }, 234 234 /* 10 fps */ 235 235 { 236 - {0, }, 237 - {9, 932, 1278, {0x14, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x04, 0x30, 0xA4, 0x33, 0x10, 0x02}}, 238 - {4, 591, 812, {0x14, 0xF4, 0x15, 0x19, 0x56, 0x17, 0x9E, 0x06, 0x28, 0x4F, 0x4E, 0x10, 0x02}}, 239 - {2, 291, 400, {0x14, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x28, 0x23, 0xA1, 0x10, 0x02}}, 236 + {0, }, 237 + {9, 932, 1278, {0x14, 0xF4, 0x05, 0x27, 0xEE, 0x26, 0x36, 0x04, 0x30, 0xA4, 0x33, 0x10, 0x02}}, 238 + {4, 591, 812, {0x14, 0xF4, 0x15, 0x19, 0x56, 0x17, 0x9E, 0x06, 0x28, 0x4F, 0x4E, 0x10, 0x02}}, 239 + {2, 291, 400, {0x14, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x28, 0x23, 0xA1, 0x10, 0x02}}, 240 240 }, 241 241 /* 15 fps */ 242 242 { 243 - {0, }, 244 - {9, 956, 876, {0x13, 0xF4, 0x0D, 0x1B, 0x58, 0x19, 0xA0, 0x05, 0x38, 0xBC, 0x33, 0x60, 0x02}}, 245 - {5, 703, 644, {0x13, 0xF4, 0x1D, 0x14, 0x1C, 0x12, 0x64, 0x08, 0x38, 0xBF, 0x42, 0x60, 0x02}}, 246 - {3, 448, 410, {0x13, 0xF4, 0x3D, 0x0C, 0xC4, 0x0B, 0x0C, 0x0E, 0x38, 0xC0, 0x69, 0x60, 0x02}}, 243 + {0, }, 244 + {9, 956, 876, {0x13, 0xF4, 0x0D, 0x1B, 0x58, 0x19, 0xA0, 0x05, 0x38, 0xBC, 0x33, 0x60, 0x02}}, 245 + {5, 703, 644, {0x13, 0xF4, 0x1D, 0x14, 0x1C, 0x12, 0x64, 0x08, 0x38, 0xBF, 0x42, 0x60, 0x02}}, 246 + {3, 448, 410, {0x13, 0xF4, 0x3D, 0x0C, 0xC4, 0x0B, 0x0C, 0x0E, 0x38, 0xC0, 0x69, 0x60, 0x02}}, 247 247 }, 248 248 /* 20 fps */ 249 249 { 250 - {0, }, 251 - {9, 956, 650, {0x12, 0xF4, 0x1D, 0x14, 0x4A, 0x12, 0x92, 0x09, 0x48, 0xBC, 0x33, 0x10, 0x03}}, 252 - {6, 776, 528, {0x12, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x40, 0x08, 0x3F, 0x10, 0x03}}, 253 - {4, 591, 402, {0x12, 0xF4, 0x3D, 0x0C, 0x8F, 0x0A, 0xD7, 0x0E, 0x40, 0x4F, 0x4E, 0x10, 0x03}}, 250 + {0, }, 251 + {9, 956, 650, {0x12, 0xF4, 0x1D, 0x14, 0x4A, 0x12, 0x92, 0x09, 0x48, 0xBC, 0x33, 0x10, 0x03}}, 252 + {6, 776, 528, {0x12, 0xF4, 0x2D, 0x10, 0x7E, 0x0E, 0xC6, 0x0A, 0x40, 0x08, 0x3F, 0x10, 0x03}}, 253 + {4, 591, 402, {0x12, 0xF4, 0x3D, 0x0C, 0x8F, 0x0A, 0xD7, 0x0E, 0x40, 0x4F, 0x4E, 0x10, 0x03}}, 254 254 }, 255 255 /* 25 fps */ 256 256 { 257 - {0, }, 258 - {9, 956, 544, {0x11, 0xF4, 0x25, 0x10, 0xF4, 0x0F, 0x3C, 0x0A, 0x48, 0xBC, 0x33, 0xC0, 0x02}}, 259 - {7, 840, 478, {0x11, 0xF4, 0x2D, 0x0E, 0xEB, 0x0D, 0x33, 0x0B, 0x48, 0x48, 0x3B, 0xC0, 0x02}}, 260 - {5, 703, 400, {0x11, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x48, 0xBF, 0x42, 0xC0, 0x02}}, 257 + {0, }, 258 + {9, 956, 544, {0x11, 0xF4, 0x25, 0x10, 0xF4, 0x0F, 0x3C, 0x0A, 0x48, 0xBC, 0x33, 0xC0, 0x02}}, 259 + {7, 840, 478, {0x11, 0xF4, 0x2D, 0x0E, 0xEB, 0x0D, 0x33, 0x0B, 0x48, 0x48, 0x3B, 0xC0, 0x02}}, 260 + {5, 703, 400, {0x11, 0xF4, 0x3D, 0x0C, 0x7A, 0x0A, 0xC2, 0x0E, 0x48, 0xBF, 0x42, 0xC0, 0x02}}, 261 261 }, 262 262 /* 30 fps */ 263 263 { 264 - {0, }, 265 - {9, 956, 438, {0x10, 0xF4, 0x35, 0x0D, 0xAC, 0x0B, 0xF4, 0x0D, 0x50, 0xBC, 0x33, 0x10, 0x02}}, 266 - {7, 838, 384, {0x10, 0xF4, 0x45, 0x0B, 0xFD, 0x0A, 0x45, 0x0F, 0x50, 0x46, 0x3B, 0x10, 0x02}}, 267 - {6, 773, 354, {0x10, 0x7A, 0x4B, 0x0B, 0x0C, 0x09, 0x80, 0x10, 0x50, 0x05, 0x3F, 0x10, 0x02}}, 264 + {0, }, 265 + {9, 956, 438, {0x10, 0xF4, 0x35, 0x0D, 0xAC, 0x0B, 0xF4, 0x0D, 0x50, 0xBC, 0x33, 0x10, 0x02}}, 266 + {7, 838, 384, {0x10, 0xF4, 0x45, 0x0B, 0xFD, 0x0A, 0x45, 0x0F, 0x50, 0x46, 0x3B, 0x10, 0x02}}, 267 + {6, 773, 354, {0x10, 0x7A, 0x4B, 0x0B, 0x0C, 0x09, 0x80, 0x10, 0x50, 0x05, 0x3F, 0x10, 0x02}}, 268 268 }, 269 269 }, 270 270 /* VGA */ 271 271 { 272 272 /* 5 fps */ 273 273 { 274 - {0, }, 275 - {6, 773, 1272, {0x1D, 0xF4, 0x15, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x3F, 0x10, 0x02}}, 276 - {4, 592, 976, {0x1D, 0xF4, 0x25, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x4E, 0x10, 0x02}}, 277 - {3, 448, 738, {0x1D, 0xF4, 0x3D, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x69, 0x10, 0x02}}, 274 + {0, }, 275 + {6, 773, 1272, {0x1D, 0xF4, 0x15, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x3F, 0x10, 0x02}}, 276 + {4, 592, 976, {0x1D, 0xF4, 0x25, 0x1E, 0x78, 0x1B, 0x58, 0x03, 0x30, 0x50, 0x4E, 0x10, 0x02}}, 277 + {3, 448, 738, {0x1D, 0xF4, 0x3D, 0x17, 0x0C, 0x13, 0xEC, 0x04, 0x30, 0xC0, 0x69, 0x10, 0x02}}, 278 278 }, 279 279 /* 10 fps */ 280 280 { 281 - {0, }, 282 - {9, 956, 788, {0x1C, 0xF4, 0x35, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x33, 0x10, 0x02}}, 283 - {6, 776, 640, {0x1C, 0x7A, 0x53, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x3F, 0x10, 0x02}}, 284 - {4, 592, 488, {0x1C, 0x7A, 0x6B, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x4E, 0x10, 0x02}}, 281 + {0, }, 282 + {9, 956, 788, {0x1C, 0xF4, 0x35, 0x18, 0x9C, 0x15, 0x7C, 0x03, 0x48, 0xBC, 0x33, 0x10, 0x02}}, 283 + {6, 776, 640, {0x1C, 0x7A, 0x53, 0x13, 0xFC, 0x11, 0x2C, 0x04, 0x48, 0x08, 0x3F, 0x10, 0x02}}, 284 + {4, 592, 488, {0x1C, 0x7A, 0x6B, 0x0F, 0x3C, 0x0C, 0x6C, 0x06, 0x48, 0x50, 0x4E, 0x10, 0x02}}, 285 285 }, 286 286 /* 15 fps */ 287 287 { 288 - {0, }, 289 - {9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}}, 290 - {9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}}, 291 - {8, 895, 492, {0x1B, 0x7A, 0x6B, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x37, 0x80, 0x02}}, 288 + {0, }, 289 + {9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}}, 290 + {9, 957, 526, {0x1B, 0x7A, 0x63, 0x10, 0x68, 0x0D, 0x98, 0x06, 0x58, 0xBD, 0x33, 0x80, 0x02}}, 291 + {8, 895, 492, {0x1B, 0x7A, 0x6B, 0x0F, 0x5D, 0x0C, 0x8D, 0x06, 0x58, 0x7F, 0x37, 0x80, 0x02}}, 292 292 }, 293 293 /* 20 fps */ 294 294 { 295 - {0, }, 296 - {0, }, 297 - {0, }, 298 - {0, }, 295 + {0, }, 296 + {0, }, 297 + {0, }, 298 + {0, }, 299 299 }, 300 300 /* 25 fps */ 301 301 { 302 - {0, }, 303 - {0, }, 304 - {0, }, 305 - {0, }, 302 + {0, }, 303 + {0, }, 304 + {0, }, 305 + {0, }, 306 306 }, 307 307 /* 30 fps */ 308 308 { 309 - {0, }, 310 - {0, }, 311 - {0, }, 312 - {0, }, 309 + {0, }, 310 + {0, }, 311 + {0, }, 312 + {0, }, 313 313 }, 314 314 }, 315 315 };
+3 -3
drivers/media/video/pwc/pwc-uncompress.c
··· 109 109 in planar format immediately. 110 110 */ 111 111 int flags; 112 - 113 - flags = PWCX_FLAG_PLANAR; 114 - if (pdev->vsize == PSZ_VGA && pdev->vframes == 5 && pdev->vsnapshot) 112 + 113 + flags = PWCX_FLAG_PLANAR; 114 + if (pdev->vsize == PSZ_VGA && pdev->vframes == 5 && pdev->vsnapshot) 115 115 { 116 116 printk(KERN_ERR "pwc: Mode Bayer is not supported for now\n"); 117 117 flags |= PWCX_FLAG_BAYER;
+1 -1
drivers/media/video/pwc/pwc-uncompress.h
··· 24 24 25 25 /* This file is the bridge between the kernel module and the plugin; it 26 26 describes the structures and datatypes used in both modules. Any 27 - significant change should be reflected by increasing the 27 + significant change should be reflected by increasing the 28 28 pwc_decompressor_version major number. 29 29 */ 30 30 #ifndef PWC_UNCOMPRESS_H
+2 -2
drivers/media/video/pwc/pwc.h
··· 123 123 #endif 124 124 /* Pointer to our usb_device */ 125 125 struct usb_device *udev; 126 - 126 + 127 127 int type; /* type of cam (645, 646, 675, 680, 690, 720, 730, 740, 750) */ 128 128 int release; /* release number */ 129 129 int features; /* feature bits */ ··· 149 149 char vsnapshot; /* snapshot mode */ 150 150 char vsync; /* used by isoc handler */ 151 151 char vmirror; /* for ToUCaM series */ 152 - 152 + 153 153 int cmd_len; 154 154 unsigned char cmd_buf[13]; 155 155
+56 -56
drivers/media/video/saa5249.c
··· 71 71 #define NUM_BUFS 8 72 72 #define IF_NAME "SAA5249" 73 73 74 - static const int disp_modes[8][3] = 74 + static const int disp_modes[8][3] = 75 75 { 76 76 { 0x46, 0x03, 0x03 }, /* DISPOFF */ 77 77 { 0x46, 0xcc, 0xcc }, /* DISPNORM */ ··· 150 150 client=kmalloc(sizeof(*client), GFP_KERNEL); 151 151 if(client==NULL) 152 152 return -ENOMEM; 153 - client_template.adapter = adap; 154 - client_template.addr = addr; 153 + client_template.adapter = adap; 154 + client_template.addr = addr; 155 155 memcpy(client, &client_template, sizeof(*client)); 156 156 t = kzalloc(sizeof(*t), GFP_KERNEL); 157 157 if(t==NULL) ··· 161 161 } 162 162 strlcpy(client->name, IF_NAME, I2C_NAME_SIZE); 163 163 mutex_init(&t->lock); 164 - 164 + 165 165 /* 166 166 * Now create a video4linux device 167 167 */ 168 - 168 + 169 169 vd = kmalloc(sizeof(struct video_device), GFP_KERNEL); 170 170 if(vd==NULL) 171 171 { ··· 175 175 } 176 176 i2c_set_clientdata(client, vd); 177 177 memcpy(vd, &saa_template, sizeof(*vd)); 178 - 179 - for (pgbuf = 0; pgbuf < NUM_DAUS; pgbuf++) 178 + 179 + for (pgbuf = 0; pgbuf < NUM_DAUS; pgbuf++) 180 180 { 181 181 memset(t->vdau[pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf)); 182 182 memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs)); ··· 186 186 t->vdau[pgbuf].stopped = TRUE; 187 187 t->is_searching[pgbuf] = FALSE; 188 188 } 189 - vd->priv=t; 190 - 191 - 189 + vd->priv=t; 190 + 191 + 192 192 /* 193 193 * Register it 194 194 */ ··· 208 208 /* 209 209 * We do most of the hard work when we become a device on the i2c. 210 210 */ 211 - 211 + 212 212 static int saa5249_probe(struct i2c_adapter *adap) 213 213 { 214 214 if (adap->class & I2C_CLASS_TV_ANALOG) ··· 229 229 230 230 /* new I2C driver support */ 231 231 232 - static struct i2c_driver i2c_driver_videotext = 232 + static struct i2c_driver i2c_driver_videotext = 233 233 { 234 234 .driver = { 235 235 .name = IF_NAME, /* name */ ··· 249 249 * delay may be longer. 250 250 */ 251 251 252 - static void jdelay(unsigned long delay) 252 + static void jdelay(unsigned long delay) 253 253 { 254 254 sigset_t oldblocked = current->blocked; 255 255 ··· 269 269 /* 270 270 * I2C interfaces 271 271 */ 272 - 273 - static int i2c_sendbuf(struct saa5249_device *t, int reg, int count, u8 *data) 272 + 273 + static int i2c_sendbuf(struct saa5249_device *t, int reg, int count, u8 *data) 274 274 { 275 275 char buf[64]; 276 - 276 + 277 277 buf[0] = reg; 278 278 memcpy(buf+1, data, count); 279 - 279 + 280 280 if(i2c_master_send(t->client, buf, count+1)==count+1) 281 281 return 0; 282 282 return -1; ··· 289 289 int ct=0; 290 290 va_list argp; 291 291 va_start(argp,t); 292 - 292 + 293 293 while((v=va_arg(argp,int))!=-1) 294 294 buf[ct++]=v; 295 295 return i2c_sendbuf(t, buf[0], ct-1, buf+1); ··· 301 301 * Returns -1 if I�C-device didn't send acknowledge, 0 otherwise 302 302 */ 303 303 304 - static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf) 304 + static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf) 305 305 { 306 306 if(i2c_master_recv(t->client, buf, count)!=count) 307 307 return -1; ··· 320 320 struct video_device *vd = video_devdata(file); 321 321 struct saa5249_device *t=vd->priv; 322 322 323 - switch(cmd) 323 + switch(cmd) 324 324 { 325 - case VTXIOCGETINFO: 325 + case VTXIOCGETINFO: 326 326 { 327 327 vtx_info_t *info = arg; 328 328 info->version_major = VTX_VER_MAJ; ··· 332 332 return 0; 333 333 } 334 334 335 - case VTXIOCCLRPAGE: 335 + case VTXIOCCLRPAGE: 336 336 { 337 337 vtx_pagereq_t *req = arg; 338 - 338 + 339 339 if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS) 340 340 return -EINVAL; 341 341 memset(t->vdau[req->pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf)); ··· 343 343 return 0; 344 344 } 345 345 346 - case VTXIOCCLRFOUND: 346 + case VTXIOCCLRFOUND: 347 347 { 348 348 vtx_pagereq_t *req = arg; 349 - 349 + 350 350 if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS) 351 351 return -EINVAL; 352 352 t->vdau[req->pgbuf].clrfound = TRUE; 353 353 return 0; 354 354 } 355 355 356 - case VTXIOCPAGEREQ: 356 + case VTXIOCPAGEREQ: 357 357 { 358 358 vtx_pagereq_t *req = arg; 359 359 if (!(req->pagemask & PGMASK_PAGE)) ··· 381 381 return 0; 382 382 } 383 383 384 - case VTXIOCGETSTAT: 384 + case VTXIOCGETSTAT: 385 385 { 386 386 vtx_pagereq_t *req = arg; 387 387 u8 infobits[10]; ··· 390 390 391 391 if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS) 392 392 return -EINVAL; 393 - if (!t->vdau[req->pgbuf].stopped) 393 + if (!t->vdau[req->pgbuf].stopped) 394 394 { 395 395 if (i2c_senddata(t, 2, 0, -1) || 396 396 i2c_sendbuf(t, 3, sizeof(t->vdau[0].sregs), t->vdau[req->pgbuf].sregs) || ··· 403 403 return -EIO; 404 404 405 405 if (!(infobits[8] & 0x10) && !(infobits[7] & 0xf0) && /* check FOUND-bit */ 406 - (memcmp(infobits, t->vdau[req->pgbuf].laststat, sizeof(infobits)) || 406 + (memcmp(infobits, t->vdau[req->pgbuf].laststat, sizeof(infobits)) || 407 407 time_after_eq(jiffies, t->vdau[req->pgbuf].expire))) 408 408 { /* check if new page arrived */ 409 409 if (i2c_senddata(t, 8, 0, 0, 0, -1) || ··· 411 411 return -EIO; 412 412 t->vdau[req->pgbuf].expire = jiffies + PGBUF_EXPIRE; 413 413 memset(t->vdau[req->pgbuf].pgbuf + VTX_PAGESIZE, ' ', VTX_VIRTUALSIZE - VTX_PAGESIZE); 414 - if (t->virtual_mode) 414 + if (t->virtual_mode) 415 415 { 416 416 /* Packet X/24 */ 417 417 if (i2c_senddata(t, 8, 0, 0x20, 0, -1) || ··· 459 459 info.notfound = !!(infobits[8] & 0x10); 460 460 info.pblf = !!(infobits[9] & 0x20); 461 461 info.hamming = 0; 462 - for (a = 0; a <= 7; a++) 462 + for (a = 0; a <= 7; a++) 463 463 { 464 - if (infobits[a] & 0xf0) 464 + if (infobits[a] & 0xf0) 465 465 { 466 466 info.hamming = 1; 467 467 break; ··· 471 471 info.notfound = 1; 472 472 if(copy_to_user(req->buffer, &info, sizeof(vtx_pageinfo_t))) 473 473 return -EFAULT; 474 - if (!info.hamming && !info.notfound) 474 + if (!info.hamming && !info.notfound) 475 475 { 476 476 t->is_searching[req->pgbuf] = FALSE; 477 477 } 478 478 return 0; 479 479 } 480 480 481 - case VTXIOCGETPAGE: 481 + case VTXIOCGETPAGE: 482 482 { 483 483 vtx_pagereq_t *req = arg; 484 484 int start, end; ··· 488 488 return -EINVAL; 489 489 if(copy_to_user(req->buffer, &t->vdau[req->pgbuf].pgbuf[req->start], req->end - req->start + 1)) 490 490 return -EFAULT; 491 - 492 - /* 491 + 492 + /* 493 493 * Always read the time directly from SAA5249 494 494 */ 495 - 496 - if (req->start <= 39 && req->end >= 32) 495 + 496 + if (req->start <= 39 && req->end >= 32) 497 497 { 498 498 int len; 499 - char buf[16]; 499 + char buf[16]; 500 500 start = max(req->start, 32); 501 501 end = min(req->end, 39); 502 502 len=end-start+1; ··· 507 507 return -EFAULT; 508 508 } 509 509 /* Insert the current header if DAU is still searching for a page */ 510 - if (req->start <= 31 && req->end >= 7 && t->is_searching[req->pgbuf]) 510 + if (req->start <= 31 && req->end >= 7 && t->is_searching[req->pgbuf]) 511 511 { 512 512 char buf[32]; 513 513 int len; ··· 523 523 return 0; 524 524 } 525 525 526 - case VTXIOCSTOPDAU: 526 + case VTXIOCSTOPDAU: 527 527 { 528 528 vtx_pagereq_t *req = arg; 529 529 ··· 534 534 return 0; 535 535 } 536 536 537 - case VTXIOCPUTPAGE: 538 - case VTXIOCSETDISP: 539 - case VTXIOCPUTSTAT: 537 + case VTXIOCPUTPAGE: 538 + case VTXIOCSETDISP: 539 + case VTXIOCPUTSTAT: 540 540 return 0; 541 - 542 - case VTXIOCCLRCACHE: 541 + 542 + case VTXIOCCLRCACHE: 543 543 { 544 544 if (i2c_senddata(t, 0, NUM_DAUS, 0, 8, -1) || i2c_senddata(t, 11, 545 545 ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ··· 551 551 return 0; 552 552 } 553 553 554 - case VTXIOCSETVIRT: 554 + case VTXIOCSETVIRT: 555 555 { 556 556 /* The SAA5249 has virtual-row reception turned on always */ 557 557 t->virtual_mode = (int)(long)arg; ··· 612 612 /* 613 613 * Handle the locking 614 614 */ 615 - 615 + 616 616 static int saa5249_ioctl(struct inode *inode, struct file *file, 617 - unsigned int cmd, unsigned long arg) 617 + unsigned int cmd, unsigned long arg) 618 618 { 619 619 struct video_device *vd = video_devdata(file); 620 620 struct saa5249_device *t=vd->priv; 621 621 int err; 622 - 622 + 623 623 cmd = vtx_fix_command(cmd); 624 624 mutex_lock(&t->lock); 625 625 err = video_usercopy(inode,file,cmd,arg,do_saa5249_ioctl); ··· 627 627 return err; 628 628 } 629 629 630 - static int saa5249_open(struct inode *inode, struct file *file) 630 + static int saa5249_open(struct inode *inode, struct file *file) 631 631 { 632 632 struct video_device *vd = video_devdata(file); 633 633 struct saa5249_device *t=vd->priv; ··· 636 636 err = video_exclusive_open(inode,file); 637 637 if (err < 0) 638 638 return err; 639 - 639 + 640 640 if (t->client==NULL) { 641 641 err = -ENODEV; 642 642 goto fail; ··· 647 647 i2c_senddata(t, 1, disp_modes[t->disp_mode][0], 0, -1) || 648 648 /* Display TV-picture, no virtual rows */ 649 649 i2c_senddata(t, 4, NUM_DAUS, disp_modes[t->disp_mode][1], disp_modes[t->disp_mode][2], 7, -1)) /* Set display to page 4 */ 650 - 650 + 651 651 { 652 652 err = -EIO; 653 653 goto fail; 654 654 } 655 655 656 - for (pgbuf = 0; pgbuf < NUM_DAUS; pgbuf++) 656 + for (pgbuf = 0; pgbuf < NUM_DAUS; pgbuf++) 657 657 { 658 658 memset(t->vdau[pgbuf].pgbuf, ' ', sizeof(t->vdau[0].pgbuf)); 659 659 memset(t->vdau[pgbuf].sregs, 0, sizeof(t->vdau[0].sregs)); ··· 673 673 674 674 675 675 676 - static int saa5249_release(struct inode *inode, struct file *file) 676 + static int saa5249_release(struct inode *inode, struct file *file) 677 677 { 678 678 struct video_device *vd = video_devdata(file); 679 679 struct saa5249_device *t=vd->priv; ··· 690 690 return i2c_add_driver(&i2c_driver_videotext); 691 691 } 692 692 693 - static void __exit cleanup_saa_5249 (void) 693 + static void __exit cleanup_saa_5249 (void) 694 694 { 695 695 i2c_del_driver(&i2c_driver_videotext); 696 696 }
+2 -2
drivers/media/video/saa7110.c
··· 139 139 140 140 static int 141 141 saa7110_selmux (struct i2c_client *client, 142 - int chan) 142 + int chan) 143 143 { 144 144 static const unsigned char modes[9][8] = { 145 145 /* mode 0 */ ··· 457 457 }; 458 458 459 459 static unsigned short ignore = I2C_CLIENT_END; 460 - 460 + 461 461 static struct i2c_client_address_data addr_data = { 462 462 .normal_i2c = normal_i2c, 463 463 .probe = &ignore,
+2 -2
drivers/media/video/saa7111.c
··· 1 - /* 1 + /* 2 2 * saa7111 - Philips SAA7111A video decoder driver version 0.0.3 3 3 * 4 4 * Copyright (C) 1998 Dave Perks <dperks@ibm.net> ··· 482 482 static unsigned short normal_i2c[] = { I2C_SAA7111 >> 1, I2C_CLIENT_END }; 483 483 484 484 static unsigned short ignore = I2C_CLIENT_END; 485 - 485 + 486 486 static struct i2c_client_address_data addr_data = { 487 487 .normal_i2c = normal_i2c, 488 488 .probe = &ignore,
+6 -6
drivers/media/video/saa7114.c
··· 1 - /* 1 + /* 2 2 * saa7114 - Philips SAA7114H video decoder driver version 0.0.1 3 3 * 4 4 * Copyright (C) 2002 Maxim Yevtyushkin <max@linuxmedialabs.com> ··· 300 300 0x55, 0xff, 301 301 0x56, 0xff, 302 302 0x57, 0xff, 303 - 0x58, 0x40, // framing code 303 + 0x58, 0x40, // framing code 304 304 0x59, 0x47, // horizontal offset 305 305 0x5a, 0x06, // vertical offset 306 306 0x5b, 0x83, // field offset ··· 345 345 0x82, 0x00, 346 346 0x83, 0x00, 347 347 0x84, 0xc5, 348 - 0x85, 0x0d, // hsync and vsync ? 348 + 0x85, 0x0d, // hsync and vsync ? 349 349 0x86, 0x40, 350 350 0x87, 0x01, 351 351 0x88, 0x00, ··· 434 434 0xd9, 0x04, 435 435 0xda, 0x00, // horizontal luminance phase offset 436 436 0xdb, 0x00, 437 - 0xdc, 0x00, // horizontal chrominance scaling increment 437 + 0xdc, 0x00, // horizontal chrominance scaling increment 438 438 0xdd, 0x02, 439 439 0xde, 0x00, // horizontal chrominance phase offset 440 440 0xdf, 0x00, ··· 754 754 saa7114_write(client, 0x87, 755 755 decoder->reg[REG_ADDR(0x87)]); 756 756 saa7114_write(client, 0x88, 0xd8); // sw reset scaler 757 - saa7114_write(client, 0x88, 0xf8); // sw reset scaler release 757 + saa7114_write(client, 0x88, 0xf8); // sw reset scaler release 758 758 saa7114_write(client, 0x80, 0x36); 759 759 760 760 } ··· 813 813 { I2C_SAA7114 >> 1, I2C_SAA7114A >> 1, I2C_CLIENT_END }; 814 814 815 815 static unsigned short ignore = I2C_CLIENT_END; 816 - 816 + 817 817 static struct i2c_client_address_data addr_data = { 818 818 .normal_i2c = normal_i2c, 819 819 .probe = &ignore,
+3 -3
drivers/media/video/saa7121.h
··· 64 64 #define PAL_MSB_VERTICAL 0x40 /* 7c */ 65 65 66 66 /* Initialization Sequence */ 67 - 67 + 68 68 static __u8 init7121ntsc[] = { 69 69 0x26, 0x0, 0x27, 0x0, 70 70 0x28, NTSC_BURST_START, 0x29, NTSC_BURST_END, ··· 95 95 0x78, 0x0, 0x79, 0x0, 0x7a, NTSC_FIRST_ACTIVE, 96 96 0x7b, NTSC_LAST_ACTIVE, 0x7c, NTSC_MSB_VERTICAL, 97 97 0x7d, 0x0, 0x7e, 0x0, 0x7f, 0x0 98 - }; 98 + }; 99 99 #define INIT7121LEN (sizeof(init7121ntsc)/2) 100 100 101 101 static __u8 init7121pal[] = { ··· 128 128 0x78, 0x0, 0x79, 0x0, 0x7a, PAL_FIRST_ACTIVE, 129 129 0x7b, PAL_LAST_ACTIVE, 0x7c, PAL_MSB_VERTICAL, 130 130 0x7d, 0x0, 0x7e, 0x0, 0x7f, 0x0 131 - }; 131 + }; 132 132 #endif
+5 -5
drivers/media/video/saa7146.h
··· 1 - /* 1 + /* 2 2 saa7146.h - definitions philips saa7146 based cards 3 3 Copyright (C) 1999 Nathan Laredo (laredo@gnu.org) 4 - 4 + 5 5 This program is free software; you can redistribute it and/or modify 6 6 it under the terms of the GNU General Public License as published by 7 7 the Free Software Foundation; either version 2 of the License, or ··· 27 27 28 28 #include <linux/videodev.h> 29 29 30 - #ifndef O_NONCAP 30 + #ifndef O_NONCAP 31 31 #define O_NONCAP O_TRUNC 32 32 #endif 33 33 ··· 36 36 37 37 #ifdef __KERNEL__ 38 38 39 - struct saa7146_window 39 + struct saa7146_window 40 40 { 41 41 int x, y; 42 42 ushort width, height; ··· 70 70 int irqstate; /* irq routine is state driven */ 71 71 int writemode; 72 72 int playmode; 73 - unsigned int nr; 73 + unsigned int nr; 74 74 unsigned long irq; /* IRQ used by SAA7146 card */ 75 75 unsigned short id; 76 76 unsigned char revision;
+2 -2
drivers/media/video/saa7146reg.h
··· 1 - /* 1 + /* 2 2 saa7146.h - definitions philips saa7146 based cards 3 3 Copyright (C) 1999 Nathan Laredo (laredo@gnu.org) 4 - 4 + 5 5 This program is free software; you can redistribute it and/or modify 6 6 it under the terms of the GNU General Public License as published by 7 7 the Free Software Foundation; either version 2 of the License, or
+2 -2
drivers/media/video/saa7185.c
··· 1 - /* 1 + /* 2 2 * saa7185 - Philips SAA7185B video encoder driver version 0.0.3 3 3 * 4 4 * Copyright (C) 1998 Dave Perks <dperks@ibm.net> ··· 377 377 static unsigned short normal_i2c[] = { I2C_SAA7185 >> 1, I2C_CLIENT_END }; 378 378 379 379 static unsigned short ignore = I2C_CLIENT_END; 380 - 380 + 381 381 static struct i2c_client_address_data addr_data = { 382 382 .normal_i2c = normal_i2c, 383 383 .probe = &ignore,
+2 -2
drivers/media/video/saa7196.h
··· 2 2 Definitions for the Philips SAA7196 digital video decoder, 3 3 scaler, and clock generator circuit (DESCpro), as used in 4 4 the PlanB video input of the Powermac 7x00/8x00 series. 5 - 5 + 6 6 Copyright (C) 1998 Michel Lanners (mlan@cpu.lu) 7 7 8 8 The register defines are shamelessly copied from the meteor 9 9 driver out of NetBSD (with permission), 10 10 and are copyrighted (c) 1995 Mark Tinguely and Jim Lowe 11 11 (Thanks !) 12 - 12 + 13 13 Additional debugging and coding by Takashi Oe (toe@unlinfo.unl.edu) 14 14 15 15 The default values used for PlanB are my mistakes.
+108 -108
drivers/media/video/se401.c
··· 4 4 * Copyright (c) 2000 Jeroen B. Vreeken (pe1rxq@amsat.org) 5 5 * 6 6 * Still somewhat based on the Linux ov511 driver. 7 - * 7 + * 8 8 * This program is free software; you can redistribute it and/or modify it 9 9 * under the terms of the GNU General Public License as published by the 10 10 * Free Software Foundation; either version 2 of the License, or (at your ··· 114 114 unsigned short value, unsigned char *cp, int size) 115 115 { 116 116 return usb_control_msg ( 117 - se401->dev, 118 - set ? usb_sndctrlpipe(se401->dev, 0) : usb_rcvctrlpipe(se401->dev, 0), 119 - req, 120 - (set ? USB_DIR_OUT : USB_DIR_IN) | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 121 - value, 122 - 0, 123 - cp, 124 - size, 125 - 1000 126 - ); 117 + se401->dev, 118 + set ? usb_sndctrlpipe(se401->dev, 0) : usb_rcvctrlpipe(se401->dev, 0), 119 + req, 120 + (set ? USB_DIR_OUT : USB_DIR_IN) | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 121 + value, 122 + 0, 123 + cp, 124 + size, 125 + 1000 126 + ); 127 127 } 128 128 129 129 static int se401_set_feature(struct usb_se401 *se401, unsigned short selector, ··· 140 140 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 141 141 param, 142 142 selector, 143 - NULL, 144 - 0, 145 - 1000 146 - ); 143 + NULL, 144 + 0, 145 + 1000 146 + ); 147 147 } 148 148 149 - static unsigned short se401_get_feature(struct usb_se401 *se401, 150 - unsigned short selector) 149 + static unsigned short se401_get_feature(struct usb_se401 *se401, 150 + unsigned short selector) 151 151 { 152 152 /* For 'set' the selecetor should be in index, not sure if the spec is 153 153 wrong here to.... 154 154 */ 155 155 unsigned char cp[2]; 156 - usb_control_msg ( 157 - se401->dev, 158 - usb_rcvctrlpipe(se401->dev, 0), 159 - SE401_REQ_GET_EXT_FEATURE, 160 - USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 161 - 0, 162 - selector, 163 - cp, 164 - 2, 165 - 1000 166 - ); 156 + usb_control_msg ( 157 + se401->dev, 158 + usb_rcvctrlpipe(se401->dev, 0), 159 + SE401_REQ_GET_EXT_FEATURE, 160 + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 161 + 0, 162 + selector, 163 + cp, 164 + 2, 165 + 1000 166 + ); 167 167 return cp[0]+cp[1]*256; 168 168 } 169 169 ··· 183 183 se401_set_feature(se401, HV7131_REG_ARCG, se401->rgain);/* red color gain */ 184 184 se401_set_feature(se401, HV7131_REG_AGCG, se401->ggain);/* green color gain */ 185 185 se401_set_feature(se401, HV7131_REG_ABCG, se401->bgain);/* blue color gain */ 186 - 186 + 187 187 return 0; 188 188 } 189 189 190 190 static void se401_set_exposure(struct usb_se401 *se401, int brightness) 191 191 { 192 192 int integration=brightness<<5; 193 - 193 + 194 194 if (flickerless==50) { 195 195 integration=integration-integration%106667; 196 196 } ··· 255 255 /* For some reason this normally read-only register doesn't get reset 256 256 to zero after reading them just once... 257 257 */ 258 - se401_get_feature(se401, HV7131_REG_HIREFNOH); 258 + se401_get_feature(se401, HV7131_REG_HIREFNOH); 259 259 se401_get_feature(se401, HV7131_REG_HIREFNOL); 260 260 se401_get_feature(se401, HV7131_REG_LOREFNOH); 261 261 se401_get_feature(se401, HV7131_REG_LOREFNOL); 262 - ahrc=256*se401_get_feature(se401, HV7131_REG_HIREFNOH) + 262 + ahrc=256*se401_get_feature(se401, HV7131_REG_HIREFNOH) + 263 263 se401_get_feature(se401, HV7131_REG_HIREFNOL); 264 264 alrc=256*se401_get_feature(se401, HV7131_REG_LOREFNOH) + 265 265 se401_get_feature(se401, HV7131_REG_LOREFNOL); ··· 287 287 { 288 288 struct usb_se401 *se401 = urb->context; 289 289 int status; 290 - 290 + 291 291 if (!se401->dev) { 292 292 info("ohoh: device vapourished"); 293 293 return; 294 294 } 295 - 295 + 296 296 switch (urb->status) { 297 297 case 0: 298 298 /* success */ ··· 368 368 if (se401->nullpackets > SE401_MAX_NULLPACKETS) { 369 369 if (waitqueue_active(&se401->wq)) { 370 370 wake_up_interruptible(&se401->wq); 371 - } 371 + } 372 372 } 373 373 } 374 374 ··· 433 433 int err=0, i; 434 434 se401->streaming=1; 435 435 436 - se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 1, NULL, 0); 437 - se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0); 436 + se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 1, NULL, 0); 437 + se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0); 438 438 439 439 /* Set picture settings */ 440 440 se401_set_feature(se401, HV7131_REG_MODE_B, 0x05);/*windowed + pix intg */ ··· 571 571 } 572 572 573 573 /* First three are absolute, all others relative. 574 - * Format is rgb from right to left (mirrorred image), 574 + * Format is rgb from right to left (mirrorred image), 575 575 * we flip it to get bgr from left to right. */ 576 576 if (frame->curlinepix < 3) { 577 577 *(frame->curline-frame->curlinepix)=1+data*4; ··· 703 703 int width=se401->cwidth; 704 704 int blineoffset=0, bline; 705 705 int linelength=width*3, i; 706 - 706 + 707 707 708 708 if (frame->curpix==0) { 709 709 if (frame->grabstate==FRAME_READY) { ··· 831 831 se401->nullpackets=0; 832 832 info("to many null length packets, restarting capture"); 833 833 se401_stop_stream(se401); 834 - se401_start_stream(se401); 834 + se401_start_stream(se401); 835 835 } else { 836 836 if (se401->scratch[se401->scratch_use].state!=BUFFER_READY) { 837 837 se401->frame[framenr].grabstate=FRAME_ERROR; ··· 866 866 { 867 867 int i; 868 868 869 - se401->dev = NULL; 869 + se401->dev = NULL; 870 870 871 871 for (i=0; i<SE401_NUMSBUF; i++) 872 872 if (se401->urb[i]) { ··· 882 882 usb_kill_urb(se401->inturb); 883 883 usb_free_urb(se401->inturb); 884 884 } 885 - info("%s disconnected", se401->camera_name); 885 + info("%s disconnected", se401->camera_name); 886 886 887 - /* Free the memory */ 887 + /* Free the memory */ 888 888 kfree(se401->width); 889 889 kfree(se401->height); 890 890 kfree(se401); ··· 910 910 se401->fbuf = rvmalloc(se401->maxframesize * SE401_NUMFRAMES); 911 911 if (se401->fbuf) 912 912 file->private_data = dev; 913 - else 913 + else 914 914 err = -ENOMEM; 915 915 se401->user = !err; 916 916 ··· 920 920 static int se401_close(struct inode *inode, struct file *file) 921 921 { 922 922 struct video_device *dev = file->private_data; 923 - struct usb_se401 *se401 = (struct usb_se401 *)dev; 923 + struct usb_se401 *se401 = (struct usb_se401 *)dev; 924 924 int i; 925 925 926 926 rvfree(se401->fbuf, se401->maxframesize * SE401_NUMFRAMES); 927 - if (se401->removed) { 927 + if (se401->removed) { 928 928 usb_se401_remove_disconnected(se401); 929 929 info("device unregistered"); 930 930 } else { ··· 942 942 unsigned int cmd, void *arg) 943 943 { 944 944 struct video_device *vdev = file->private_data; 945 - struct usb_se401 *se401 = (struct usb_se401 *)vdev; 945 + struct usb_se401 *se401 = (struct usb_se401 *)vdev; 946 946 947 - if (!se401->dev) 948 - return -EIO; 947 + if (!se401->dev) 948 + return -EIO; 949 949 950 - switch (cmd) { 950 + switch (cmd) { 951 951 case VIDIOCGCAP: 952 952 { 953 953 struct video_capability *b = arg; ··· 981 981 return -EINVAL; 982 982 return 0; 983 983 } 984 - case VIDIOCGPICT: 985 - { 984 + case VIDIOCGPICT: 985 + { 986 986 struct video_picture *p = arg; 987 987 988 988 se401_get_pict(se401, p); ··· 1007 1007 if (se401_set_size(se401, vw->width, vw->height)) 1008 1008 return -EINVAL; 1009 1009 return 0; 1010 - } 1010 + } 1011 1011 case VIDIOCGWIN: 1012 1012 { 1013 1013 struct video_window *vw = arg; ··· 1095 1095 case VIDIOCGAUDIO: 1096 1096 case VIDIOCSAUDIO: 1097 1097 return -EINVAL; 1098 - default: 1099 - return -ENOIOCTLCMD; 1100 - } /* end switch */ 1098 + default: 1099 + return -ENOIOCTLCMD; 1100 + } /* end switch */ 1101 1101 1102 - return 0; 1102 + return 0; 1103 1103 } 1104 1104 1105 1105 static int se401_ioctl(struct inode *inode, struct file *file, ··· 1142 1142 1143 1143 se401->frame[0].grabstate=FRAME_UNUSED; 1144 1144 if (ret) 1145 - return ret; 1145 + return ret; 1146 1146 if (copy_to_user(buf, se401->frame[0].data, realcount)) 1147 1147 return -EFAULT; 1148 1148 ··· 1183 1183 } 1184 1184 mutex_unlock(&se401->lock); 1185 1185 1186 - return 0; 1186 + return 0; 1187 1187 } 1188 1188 1189 1189 static struct file_operations se401_fops = { 1190 1190 .owner = THIS_MODULE, 1191 - .open = se401_open, 1192 - .release = se401_close, 1193 - .read = se401_read, 1194 - .mmap = se401_mmap, 1191 + .open = se401_open, 1192 + .release = se401_close, 1193 + .read = se401_read, 1194 + .mmap = se401_mmap, 1195 1195 .ioctl = se401_ioctl, 1196 1196 .compat_ioctl = v4l_compat_ioctl32, 1197 1197 .llseek = no_llseek, 1198 1198 }; 1199 1199 static struct video_device se401_template = { 1200 1200 .owner = THIS_MODULE, 1201 - .name = "se401 USB camera", 1202 - .type = VID_TYPE_CAPTURE, 1203 - .hardware = VID_HARDWARE_SE401, 1201 + .name = "se401 USB camera", 1202 + .type = VID_TYPE_CAPTURE, 1203 + .hardware = VID_HARDWARE_SE401, 1204 1204 .fops = &se401_fops, 1205 1205 }; 1206 1206 ··· 1209 1209 /***************************/ 1210 1210 static int se401_init(struct usb_se401 *se401, int button) 1211 1211 { 1212 - int i=0, rc; 1213 - unsigned char cp[0x40]; 1212 + int i=0, rc; 1213 + unsigned char cp[0x40]; 1214 1214 char temp[200]; 1215 1215 1216 1216 /* led on */ 1217 - se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0); 1217 + se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0); 1218 1218 1219 1219 /* get camera descriptor */ 1220 1220 rc=se401_sndctrl(0, se401, SE401_REQ_GET_CAMERA_DESCRIPTOR, 0, cp, sizeof(cp)); ··· 1254 1254 return 1; 1255 1255 } 1256 1256 /* set output mode (BAYER) */ 1257 - se401_sndctrl(1, se401, SE401_REQ_SET_OUTPUT_MODE, SE401_FORMAT_BAYER, NULL, 0); 1257 + se401_sndctrl(1, se401, SE401_REQ_SET_OUTPUT_MODE, SE401_FORMAT_BAYER, NULL, 0); 1258 1258 1259 1259 rc=se401_sndctrl(0, se401, SE401_REQ_GET_BRT, 0, cp, sizeof(cp)); 1260 1260 se401->brightness=cp[0]+cp[1]*256; ··· 1292 1292 } else 1293 1293 se401->inturb=NULL; 1294 1294 1295 - /* Flash the led */ 1296 - se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 1, NULL, 0); 1297 - se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0); 1298 - se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 0, NULL, 0); 1295 + /* Flash the led */ 1296 + se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 1, NULL, 0); 1297 + se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0); 1298 + se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 0, NULL, 0); 1299 1299 se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 0, NULL, 0); 1300 1300 1301 - return 0; 1301 + return 0; 1302 1302 } 1303 1303 1304 1304 static int se401_probe(struct usb_interface *intf, 1305 1305 const struct usb_device_id *id) 1306 1306 { 1307 1307 struct usb_device *dev = interface_to_usbdev(intf); 1308 - struct usb_interface_descriptor *interface; 1309 - struct usb_se401 *se401; 1310 - char *camera_name=NULL; 1308 + struct usb_interface_descriptor *interface; 1309 + struct usb_se401 *se401; 1310 + char *camera_name=NULL; 1311 1311 int button=1; 1312 1312 1313 - /* We don't handle multi-config cameras */ 1314 - if (dev->descriptor.bNumConfigurations != 1) 1315 - return -ENODEV; 1313 + /* We don't handle multi-config cameras */ 1314 + if (dev->descriptor.bNumConfigurations != 1) 1315 + return -ENODEV; 1316 1316 1317 - interface = &intf->cur_altsetting->desc; 1317 + interface = &intf->cur_altsetting->desc; 1318 1318 1319 - /* Is it an se401? */ 1320 - if (le16_to_cpu(dev->descriptor.idVendor) == 0x03e8 && 1321 - le16_to_cpu(dev->descriptor.idProduct) == 0x0004) { 1322 - camera_name="Endpoints/Aox SE401"; 1323 - } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x0471 && 1324 - le16_to_cpu(dev->descriptor.idProduct) == 0x030b) { 1325 - camera_name="Philips PCVC665K"; 1326 - } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d && 1319 + /* Is it an se401? */ 1320 + if (le16_to_cpu(dev->descriptor.idVendor) == 0x03e8 && 1321 + le16_to_cpu(dev->descriptor.idProduct) == 0x0004) { 1322 + camera_name="Endpoints/Aox SE401"; 1323 + } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x0471 && 1324 + le16_to_cpu(dev->descriptor.idProduct) == 0x030b) { 1325 + camera_name="Philips PCVC665K"; 1326 + } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d && 1327 1327 le16_to_cpu(dev->descriptor.idProduct) == 0x5001) { 1328 1328 camera_name="Kensington VideoCAM 67014"; 1329 - } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d && 1329 + } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d && 1330 1330 le16_to_cpu(dev->descriptor.idProduct) == 0x5002) { 1331 1331 camera_name="Kensington VideoCAM 6701(5/7)"; 1332 - } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d && 1332 + } else if (le16_to_cpu(dev->descriptor.idVendor) == 0x047d && 1333 1333 le16_to_cpu(dev->descriptor.idProduct) == 0x5003) { 1334 1334 camera_name="Kensington VideoCAM 67016"; 1335 1335 button=0; 1336 1336 } else 1337 1337 return -ENODEV; 1338 1338 1339 - /* Checking vendor/product should be enough, but what the hell */ 1340 - if (interface->bInterfaceClass != 0x00) 1339 + /* Checking vendor/product should be enough, but what the hell */ 1340 + if (interface->bInterfaceClass != 0x00) 1341 1341 return -ENODEV; 1342 - if (interface->bInterfaceSubClass != 0x00) 1342 + if (interface->bInterfaceSubClass != 0x00) 1343 1343 return -ENODEV; 1344 1344 1345 - /* We found one */ 1346 - info("SE401 camera found: %s", camera_name); 1345 + /* We found one */ 1346 + info("SE401 camera found: %s", camera_name); 1347 1347 1348 - if ((se401 = kzalloc(sizeof(*se401), GFP_KERNEL)) == NULL) { 1349 - err("couldn't kmalloc se401 struct"); 1348 + if ((se401 = kzalloc(sizeof(*se401), GFP_KERNEL)) == NULL) { 1349 + err("couldn't kmalloc se401 struct"); 1350 1350 return -ENOMEM; 1351 - } 1351 + } 1352 1352 1353 - se401->dev = dev; 1354 - se401->iface = interface->bInterfaceNumber; 1355 - se401->camera_name = camera_name; 1353 + se401->dev = dev; 1354 + se401->iface = interface->bInterfaceNumber; 1355 + se401->camera_name = camera_name; 1356 1356 1357 1357 info("firmware version: %02x", le16_to_cpu(dev->descriptor.bcdDevice) & 255); 1358 1358 1359 - if (se401_init(se401, button)) { 1359 + if (se401_init(se401, button)) { 1360 1360 kfree(se401); 1361 1361 return -EIO; 1362 1362 } ··· 1375 1375 info("registered new video device: video%d", se401->vdev.minor); 1376 1376 1377 1377 usb_set_intfdata (intf, se401); 1378 - return 0; 1378 + return 0; 1379 1379 } 1380 1380 1381 1381 static void se401_disconnect(struct usb_interface *intf) ··· 1400 1400 } 1401 1401 1402 1402 static struct usb_driver se401_driver = { 1403 - .name = "se401", 1404 - .id_table = device_table, 1403 + .name = "se401", 1404 + .id_table = device_table, 1405 1405 .probe = se401_probe, 1406 - .disconnect = se401_disconnect, 1406 + .disconnect = se401_disconnect, 1407 1407 }; 1408 1408 1409 1409
+3 -3
drivers/media/video/se401.h
··· 177 177 int expose_m; 178 178 int expose_l; 179 179 int resetlevel; 180 - 180 + 181 181 int enhance; 182 182 183 183 int format; ··· 200 200 201 201 struct urb *urb[SE401_NUMSBUF]; 202 202 struct urb *inturb; 203 - 203 + 204 204 int button; 205 205 int buttonpressed; 206 206 207 207 int curframe; /* Current receiving frame */ 208 - struct se401_frame frame[SE401_NUMFRAMES]; 208 + struct se401_frame frame[SE401_NUMFRAMES]; 209 209 int readcount; 210 210 int framecount; 211 211 int error;
+3 -3
drivers/media/video/sn9c102/Makefile
··· 1 1 sn9c102-objs := sn9c102_core.o sn9c102_hv7131d.o sn9c102_mi0343.o \ 2 - sn9c102_ov7630.o sn9c102_pas106b.o sn9c102_pas202bca.o \ 3 - sn9c102_pas202bcb.o sn9c102_tas5110c1b.o \ 4 - sn9c102_tas5130d1b.o 2 + sn9c102_ov7630.o sn9c102_pas106b.o sn9c102_pas202bca.o \ 3 + sn9c102_pas202bcb.o sn9c102_tas5110c1b.o \ 4 + sn9c102_tas5130d1b.o 5 5 6 6 obj-$(CONFIG_USB_SN9C102) += sn9c102.o 7 7
+4 -4
drivers/media/video/sn9c102/sn9c102.h
··· 164 164 165 165 void 166 166 sn9c102_attach_sensor(struct sn9c102_device* cam, 167 - struct sn9c102_sensor* sensor) 167 + struct sn9c102_sensor* sensor) 168 168 { 169 169 memcpy(&cam->sensor, sensor, sizeof(struct sn9c102_sensor)); 170 170 } ··· 183 183 dev_info(&cam->usbdev->dev, fmt "\n", ## args); \ 184 184 else if ((level) >= 3) \ 185 185 dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ 186 - __FUNCTION__, __LINE__ , ## args); \ 186 + __FUNCTION__, __LINE__ , ## args); \ 187 187 } \ 188 188 } while (0) 189 189 # define V4LDBG(level, name, cmd) \ ··· 198 198 pr_info("sn9c102: " fmt "\n", ## args); \ 199 199 else if ((level) == 3) \ 200 200 pr_debug("sn9c102: [%s:%d] " fmt "\n", __FUNCTION__, \ 201 - __LINE__ , ## args); \ 201 + __LINE__ , ## args); \ 202 202 } \ 203 203 } while (0) 204 204 #else ··· 210 210 #undef PDBG 211 211 #define PDBG(fmt, args...) \ 212 212 dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ 213 - __FUNCTION__, __LINE__ , ## args) 213 + __FUNCTION__, __LINE__ , ## args) 214 214 215 215 #undef PDBGG 216 216 #define PDBGG(fmt, args...) do {;} while(0) /* placeholder */
+131 -131
drivers/media/video/sn9c102/sn9c102_core.c
··· 62 62 static short video_nr[] = {[0 ... SN9C102_MAX_DEVICES-1] = -1}; 63 63 module_param_array(video_nr, short, NULL, 0444); 64 64 MODULE_PARM_DESC(video_nr, 65 - "\n<-1|n[,...]> Specify V4L2 minor mode number." 66 - "\n -1 = use next available (default)" 67 - "\n n = use minor number n (integer >= 0)" 68 - "\nYou can specify up to "__MODULE_STRING(SN9C102_MAX_DEVICES) 69 - " cameras this way." 70 - "\nFor example:" 71 - "\nvideo_nr=-1,2,-1 would assign minor number 2 to" 72 - "\nthe second camera and use auto for the first" 73 - "\none and for every other camera." 74 - "\n"); 65 + "\n<-1|n[,...]> Specify V4L2 minor mode number." 66 + "\n -1 = use next available (default)" 67 + "\n n = use minor number n (integer >= 0)" 68 + "\nYou can specify up to "__MODULE_STRING(SN9C102_MAX_DEVICES) 69 + " cameras this way." 70 + "\nFor example:" 71 + "\nvideo_nr=-1,2,-1 would assign minor number 2 to" 72 + "\nthe second camera and use auto for the first" 73 + "\none and for every other camera." 74 + "\n"); 75 75 76 - static short force_munmap[] = {[0 ... SN9C102_MAX_DEVICES-1] = 77 - SN9C102_FORCE_MUNMAP}; 76 + static short force_munmap[] = {[0 ... SN9C102_MAX_DEVICES-1] = 77 + SN9C102_FORCE_MUNMAP}; 78 78 module_param_array(force_munmap, bool, NULL, 0444); 79 79 MODULE_PARM_DESC(force_munmap, 80 - "\n<0|1[,...]> Force the application to unmap previously" 81 - "\nmapped buffer memory before calling any VIDIOC_S_CROP or" 82 - "\nVIDIOC_S_FMT ioctl's. Not all the applications support" 83 - "\nthis feature. This parameter is specific for each" 84 - "\ndetected camera." 85 - "\n 0 = do not force memory unmapping" 86 - "\n 1 = force memory unmapping (save memory)" 87 - "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"." 88 - "\n"); 80 + "\n<0|1[,...]> Force the application to unmap previously" 81 + "\nmapped buffer memory before calling any VIDIOC_S_CROP or" 82 + "\nVIDIOC_S_FMT ioctl's. Not all the applications support" 83 + "\nthis feature. This parameter is specific for each" 84 + "\ndetected camera." 85 + "\n 0 = do not force memory unmapping" 86 + "\n 1 = force memory unmapping (save memory)" 87 + "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"." 88 + "\n"); 89 89 90 90 static unsigned int frame_timeout[] = {[0 ... SN9C102_MAX_DEVICES-1] = 91 - SN9C102_FRAME_TIMEOUT}; 91 + SN9C102_FRAME_TIMEOUT}; 92 92 module_param_array(frame_timeout, uint, NULL, 0644); 93 93 MODULE_PARM_DESC(frame_timeout, 94 - "\n<n[,...]> Timeout for a video frame in seconds." 95 - "\nThis parameter is specific for each detected camera." 96 - "\nDefault value is "__MODULE_STRING(SN9C102_FRAME_TIMEOUT)"." 97 - "\n"); 94 + "\n<n[,...]> Timeout for a video frame in seconds." 95 + "\nThis parameter is specific for each detected camera." 96 + "\nDefault value is "__MODULE_STRING(SN9C102_FRAME_TIMEOUT)"." 97 + "\n"); 98 98 99 99 #ifdef SN9C102_DEBUG 100 100 static unsigned short debug = SN9C102_DEBUG_LEVEL; 101 101 module_param(debug, ushort, 0644); 102 102 MODULE_PARM_DESC(debug, 103 - "\n<n> Debugging information level, from 0 to 3:" 104 - "\n0 = none (use carefully)" 105 - "\n1 = critical errors" 106 - "\n2 = significant informations" 107 - "\n3 = more verbose messages" 108 - "\nLevel 3 is useful for testing only, when only " 109 - "one device is used." 110 - "\nDefault value is "__MODULE_STRING(SN9C102_DEBUG_LEVEL)"." 111 - "\n"); 103 + "\n<n> Debugging information level, from 0 to 3:" 104 + "\n0 = none (use carefully)" 105 + "\n1 = critical errors" 106 + "\n2 = significant informations" 107 + "\n3 = more verbose messages" 108 + "\nLevel 3 is useful for testing only, when only " 109 + "one device is used." 110 + "\nDefault value is "__MODULE_STRING(SN9C102_DEBUG_LEVEL)"." 111 + "\n"); 112 112 #endif 113 113 114 114 /*****************************************************************************/ ··· 131 131 132 132 /*****************************************************************************/ 133 133 134 - static u32 135 - sn9c102_request_buffers(struct sn9c102_device* cam, u32 count, 136 - enum sn9c102_io_method io) 134 + static u32 135 + sn9c102_request_buffers(struct sn9c102_device* cam, u32 count, 136 + enum sn9c102_io_method io) 137 137 { 138 138 struct v4l2_pix_format* p = &(cam->sensor.pix_format); 139 139 struct v4l2_rect* r = &(cam->sensor.cropcap.bounds); 140 140 const size_t imagesize = cam->module_param.force_munmap || 141 - io == IO_READ ? 142 - (p->width * p->height * p->priv) / 8 : 143 - (r->width * r->height * p->priv) / 8; 141 + io == IO_READ ? 142 + (p->width * p->height * p->priv) / 8 : 143 + (r->width * r->height * p->priv) / 8; 144 144 void* buff = NULL; 145 145 u32 i; 146 146 ··· 232 232 return -1; 233 233 234 234 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41, 235 - index, 0, buff, sizeof(buff), 236 - SN9C102_CTRL_TIMEOUT*sizeof(buff)); 235 + index, 0, buff, sizeof(buff), 236 + SN9C102_CTRL_TIMEOUT*sizeof(buff)); 237 237 if (res < 0) { 238 238 DBG(3, "Failed to write registers (index 0x%02X, error %d)", 239 239 index, res); ··· 259 259 *buff = value; 260 260 261 261 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41, 262 - index, 0, buff, 1, SN9C102_CTRL_TIMEOUT); 262 + index, 0, buff, 1, SN9C102_CTRL_TIMEOUT); 263 263 if (res < 0) { 264 264 DBG(3, "Failed to write a register (value 0x%02X, index " 265 265 "0x%02X, error %d)", value, index, res); ··· 280 280 int res; 281 281 282 282 res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1, 283 - index, 0, buff, 1, SN9C102_CTRL_TIMEOUT); 283 + index, 0, buff, 1, SN9C102_CTRL_TIMEOUT); 284 284 if (res < 0) 285 285 DBG(3, "Failed to read a register (index 0x%02X, error %d)", 286 286 index, res); ··· 319 319 320 320 321 321 static int 322 - sn9c102_i2c_detect_read_error(struct sn9c102_device* cam, 323 - struct sn9c102_sensor* sensor) 322 + sn9c102_i2c_detect_read_error(struct sn9c102_device* cam, 323 + struct sn9c102_sensor* sensor) 324 324 { 325 325 int r; 326 326 r = sn9c102_read_reg(cam, 0x08); ··· 329 329 330 330 331 331 static int 332 - sn9c102_i2c_detect_write_error(struct sn9c102_device* cam, 333 - struct sn9c102_sensor* sensor) 332 + sn9c102_i2c_detect_write_error(struct sn9c102_device* cam, 333 + struct sn9c102_sensor* sensor) 334 334 { 335 335 int r; 336 336 r = sn9c102_read_reg(cam, 0x08); ··· 338 338 } 339 339 340 340 341 - int 341 + int 342 342 sn9c102_i2c_try_raw_read(struct sn9c102_device* cam, 343 - struct sn9c102_sensor* sensor, u8 data0, u8 data1, 344 - u8 n, u8 buffer[]) 343 + struct sn9c102_sensor* sensor, u8 data0, u8 data1, 344 + u8 n, u8 buffer[]) 345 345 { 346 346 struct usb_device* udev = cam->usbdev; 347 347 u8* data = cam->control_buffer; ··· 349 349 350 350 /* Write cycle */ 351 351 data[0] = ((sensor->interface == SN9C102_I2C_2WIRES) ? 0x80 : 0) | 352 - ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) | 0x10; 352 + ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) | 0x10; 353 353 data[1] = data0; /* I2C slave id */ 354 354 data[2] = data1; /* address */ 355 355 data[7] = 0x10; 356 356 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41, 357 - 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); 357 + 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); 358 358 if (res < 0) 359 359 err += res; 360 360 ··· 362 362 363 363 /* Read cycle - n bytes */ 364 364 data[0] = ((sensor->interface == SN9C102_I2C_2WIRES) ? 0x80 : 0) | 365 - ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) | 366 - (n << 4) | 0x02; 365 + ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) | 366 + (n << 4) | 0x02; 367 367 data[1] = data0; 368 368 data[7] = 0x10; 369 369 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41, 370 - 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); 370 + 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); 371 371 if (res < 0) 372 372 err += res; 373 373 ··· 375 375 376 376 /* The first read byte will be placed in data[4] */ 377 377 res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00, 0xc1, 378 - 0x0a, 0, data, 5, SN9C102_CTRL_TIMEOUT); 378 + 0x0a, 0, data, 5, SN9C102_CTRL_TIMEOUT); 379 379 if (res < 0) 380 380 err += res; 381 381 ··· 396 396 } 397 397 398 398 399 - int 399 + int 400 400 sn9c102_i2c_try_raw_write(struct sn9c102_device* cam, 401 - struct sn9c102_sensor* sensor, u8 n, u8 data0, 402 - u8 data1, u8 data2, u8 data3, u8 data4, u8 data5) 401 + struct sn9c102_sensor* sensor, u8 n, u8 data0, 402 + u8 data1, u8 data2, u8 data3, u8 data4, u8 data5) 403 403 { 404 404 struct usb_device* udev = cam->usbdev; 405 405 u8* data = cam->control_buffer; ··· 407 407 408 408 /* Write cycle. It usually is address + value */ 409 409 data[0] = ((sensor->interface == SN9C102_I2C_2WIRES) ? 0x80 : 0) | 410 - ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) 411 - | ((n - 1) << 4); 410 + ((sensor->frequency & SN9C102_I2C_400KHZ) ? 0x01 : 0) 411 + | ((n - 1) << 4); 412 412 data[1] = data0; 413 413 data[2] = data1; 414 414 data[3] = data2; ··· 417 417 data[6] = data5; 418 418 data[7] = 0x14; 419 419 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x08, 0x41, 420 - 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); 420 + 0x08, 0, data, 8, SN9C102_CTRL_TIMEOUT); 421 421 if (res < 0) 422 422 err += res; 423 423 ··· 437 437 438 438 int 439 439 sn9c102_i2c_try_read(struct sn9c102_device* cam, 440 - struct sn9c102_sensor* sensor, u8 address) 440 + struct sn9c102_sensor* sensor, u8 address) 441 441 { 442 442 return sn9c102_i2c_try_raw_read(cam, sensor, sensor->i2c_slave_id, 443 - address, 1, NULL); 443 + address, 1, NULL); 444 444 } 445 445 446 446 447 447 int 448 448 sn9c102_i2c_try_write(struct sn9c102_device* cam, 449 - struct sn9c102_sensor* sensor, u8 address, u8 value) 449 + struct sn9c102_sensor* sensor, u8 address, u8 value) 450 450 { 451 - return sn9c102_i2c_try_raw_write(cam, sensor, 3, 452 - sensor->i2c_slave_id, address, 453 - value, 0, 0, 0); 451 + return sn9c102_i2c_try_raw_write(cam, sensor, 3, 452 + sensor->i2c_slave_id, address, 453 + value, 0, 0, 0); 454 454 } 455 455 456 456 ··· 484 484 n = sizeof(sn9c103_sof_header) / soflen; 485 485 } 486 486 487 - for (i = 0; (len >= soflen) && (i <= len - soflen); i++) 487 + for (i = 0; (len >= soflen) && (i <= len - soflen); i++) 488 488 for (j = 0; j < n; j++) 489 489 /* The invariable part of the header is 6 bytes long */ 490 490 if ((cam->bridge != BRIDGE_SN9C103 && ··· 552 552 553 553 if (!(*f)) 554 554 (*f) = list_entry(cam->inqueue.next, struct sn9c102_frame_t, 555 - frame); 555 + frame); 556 556 557 557 imagesize = (cam->sensor.pix_format.width * 558 - cam->sensor.pix_format.height * 559 - cam->sensor.pix_format.priv) / 8; 558 + cam->sensor.pix_format.height * 559 + cam->sensor.pix_format.priv) / 8; 560 560 561 561 soflen = (cam->bridge) == BRIDGE_SN9C103 ? 562 - sizeof(sn9c103_sof_header_t) : 563 - sizeof(sn9c102_sof_header_t); 562 + sizeof(sn9c103_sof_header_t) : 563 + sizeof(sn9c102_sof_header_t); 564 564 565 565 for (i = 0; i < urb->number_of_packets; i++) { 566 566 unsigned int img, len, status; ··· 611 611 612 612 if ((*f)->buf.bytesused == imagesize || 613 613 (cam->sensor.pix_format.pixelformat == 614 - V4L2_PIX_FMT_SN9C10X && eof)) { 614 + V4L2_PIX_FMT_SN9C10X && eof)) { 615 615 u32 b; 616 616 b = (*f)->buf.bytesused; 617 617 (*f)->state = F_DONE; 618 618 (*f)->buf.sequence= ++cam->frame_count; 619 619 spin_lock(&cam->queue_lock); 620 620 list_move_tail(&(*f)->frame, 621 - &cam->outqueue); 621 + &cam->outqueue); 622 622 if (!list_empty(&cam->inqueue)) 623 623 (*f) = list_entry( 624 - cam->inqueue.next, 625 - struct sn9c102_frame_t, 626 - frame ); 624 + cam->inqueue.next, 625 + struct sn9c102_frame_t, 626 + frame ); 627 627 else 628 628 (*f) = NULL; 629 629 spin_unlock(&cam->queue_lock); ··· 638 638 } else if (eof) { 639 639 (*f)->state = F_ERROR; 640 640 DBG(3, "Not expected EOF after %lu " 641 - "bytes of image data", 641 + "bytes of image data", 642 642 (unsigned long) 643 643 ((*f)->buf.bytesused)); 644 644 } ··· 676 676 goto end_of_frame; 677 677 } else { 678 678 DBG(3, "SOF before expected EOF after " 679 - "%lu bytes of image data", 679 + "%lu bytes of image data", 680 680 (unsigned long) 681 681 ((*f)->buf.bytesused)); 682 682 goto start_of_frame; ··· 702 702 struct usb_device *udev = cam->usbdev; 703 703 struct urb* urb; 704 704 const unsigned int sn9c102_wMaxPacketSize[] = {0, 128, 256, 384, 512, 705 - 680, 800, 900, 1023}; 705 + 680, 800, 900, 1023}; 706 706 const unsigned int sn9c103_wMaxPacketSize[] = {0, 128, 256, 384, 512, 707 - 680, 800, 900, 1003}; 707 + 680, 800, 900, 1003}; 708 708 const unsigned int psz = (cam->bridge == BRIDGE_SN9C103) ? 709 - sn9c103_wMaxPacketSize[SN9C102_ALTERNATE_SETTING] : 710 - sn9c102_wMaxPacketSize[SN9C102_ALTERNATE_SETTING]; 709 + sn9c103_wMaxPacketSize[SN9C102_ALTERNATE_SETTING] : 710 + sn9c102_wMaxPacketSize[SN9C102_ALTERNATE_SETTING]; 711 711 s8 i, j; 712 712 int err = 0; 713 713 714 714 for (i = 0; i < SN9C102_URBS; i++) { 715 715 cam->transfer_buffer[i] = kzalloc(SN9C102_ISO_PACKETS * psz, 716 - GFP_KERNEL); 716 + GFP_KERNEL); 717 717 if (!cam->transfer_buffer[i]) { 718 718 err = -ENOMEM; 719 719 DBG(1, "Not enough memory"); ··· 815 815 816 816 cam->stream = STREAM_INTERRUPT; 817 817 timeout = wait_event_timeout(cam->wait_stream, 818 - (cam->stream == STREAM_OFF) || 819 - (cam->state & DEV_DISCONNECTED), 820 - SN9C102_URB_TIMEOUT); 818 + (cam->stream == STREAM_OFF) || 819 + (cam->state & DEV_DISCONNECTED), 820 + SN9C102_URB_TIMEOUT); 821 821 if (cam->state & DEV_DISCONNECTED) 822 822 return -ENODEV; 823 823 else if (cam->stream != STREAM_OFF) { ··· 861 861 862 862 /* 863 863 NOTE 1: being inside one of the following methods implies that the v4l 864 - device exists for sure (see kobjects and reference counters) 864 + device exists for sure (see kobjects and reference counters) 865 865 NOTE 2: buffers are PAGE_SIZE long 866 866 */ 867 867 ··· 884 884 mutex_unlock(&sn9c102_sysfs_lock); 885 885 886 886 return count; 887 - } 887 + } 888 888 889 889 890 - static ssize_t 890 + static ssize_t 891 891 sn9c102_store_reg(struct class_device* cd, const char* buf, size_t len) 892 892 { 893 893 struct sn9c102_device* cam; ··· 947 947 mutex_unlock(&sn9c102_sysfs_lock); 948 948 949 949 return count; 950 - } 950 + } 951 951 952 952 953 953 static ssize_t ··· 1013 1013 } 1014 1014 1015 1015 1016 - static ssize_t 1016 + static ssize_t 1017 1017 sn9c102_store_i2c_reg(struct class_device* cd, const char* buf, size_t len) 1018 1018 { 1019 1019 struct sn9c102_device* cam; ··· 1078 1078 mutex_unlock(&sn9c102_sysfs_lock); 1079 1079 1080 1080 return count; 1081 - } 1081 + } 1082 1082 1083 1083 1084 1084 static ssize_t ··· 1222 1222 DBG(3, "Frame header, read bytes: %zd", count); 1223 1223 1224 1224 return count; 1225 - } 1225 + } 1226 1226 1227 1227 1228 1228 static CLASS_DEVICE_ATTR(reg, S_IRUGO | S_IWUSR, 1229 - sn9c102_show_reg, sn9c102_store_reg); 1229 + sn9c102_show_reg, sn9c102_store_reg); 1230 1230 static CLASS_DEVICE_ATTR(val, S_IRUGO | S_IWUSR, 1231 - sn9c102_show_val, sn9c102_store_val); 1231 + sn9c102_show_val, sn9c102_store_val); 1232 1232 static CLASS_DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR, 1233 - sn9c102_show_i2c_reg, sn9c102_store_i2c_reg); 1233 + sn9c102_show_i2c_reg, sn9c102_store_i2c_reg); 1234 1234 static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, 1235 - sn9c102_show_i2c_val, sn9c102_store_i2c_val); 1235 + sn9c102_show_i2c_val, sn9c102_store_i2c_val); 1236 1236 static CLASS_DEVICE_ATTR(green, S_IWUGO, NULL, sn9c102_store_green); 1237 1237 static CLASS_DEVICE_ATTR(blue, S_IWUGO, NULL, sn9c102_store_blue); 1238 1238 static CLASS_DEVICE_ATTR(red, S_IWUGO, NULL, sn9c102_store_red); 1239 1239 static CLASS_DEVICE_ATTR(frame_header, S_IRUGO, 1240 - sn9c102_show_frame_header, NULL); 1240 + sn9c102_show_frame_header, NULL); 1241 1241 1242 1242 1243 1243 static void sn9c102_create_sysfs(struct sn9c102_device* cam) ··· 1278 1278 1279 1279 static int 1280 1280 sn9c102_set_compression(struct sn9c102_device* cam, 1281 - struct v4l2_jpegcompression* compression) 1281 + struct v4l2_jpegcompression* compression) 1282 1282 { 1283 1283 int err = 0; 1284 1284 ··· 1469 1469 } 1470 1470 mutex_unlock(&cam->dev_mutex); 1471 1471 err = wait_event_interruptible_exclusive(cam->open, 1472 - cam->state & DEV_DISCONNECTED 1473 - || !cam->users); 1472 + cam->state & DEV_DISCONNECTED 1473 + || !cam->users); 1474 1474 if (err) { 1475 1475 up_read(&sn9c102_disconnect); 1476 1476 return err; ··· 1600 1600 return -EAGAIN; 1601 1601 } 1602 1602 timeout = wait_event_interruptible_timeout 1603 - ( cam->wait_frame, 1604 - (!list_empty(&cam->outqueue)) || 1605 - (cam->state & DEV_DISCONNECTED) || 1606 - (cam->state & DEV_MISCONFIGURED), 1607 - cam->module_param.frame_timeout * 1608 - 1000 * msecs_to_jiffies(1) ); 1603 + ( cam->wait_frame, 1604 + (!list_empty(&cam->outqueue)) || 1605 + (cam->state & DEV_DISCONNECTED) || 1606 + (cam->state & DEV_MISCONFIGURED), 1607 + cam->module_param.frame_timeout * 1608 + 1000 * msecs_to_jiffies(1) ); 1609 1609 if (timeout < 0) { 1610 1610 mutex_unlock(&cam->fileop_mutex); 1611 1611 return timeout; ··· 1672 1672 1673 1673 if (cam->io == IO_NONE) { 1674 1674 if (!sn9c102_request_buffers(cam, cam->nreadbuffers, 1675 - IO_READ)) { 1675 + IO_READ)) { 1676 1676 DBG(1, "poll() failed, not enough memory"); 1677 1677 goto error; 1678 1678 } ··· 1729 1729 { 1730 1730 struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); 1731 1731 unsigned long size = vma->vm_end - vma->vm_start, 1732 - start = vma->vm_start; 1732 + start = vma->vm_start; 1733 1733 void *pos; 1734 1734 u32 i; 1735 1735 ··· 1797 1797 .driver = "sn9c102", 1798 1798 .version = SN9C102_MODULE_VERSION_CODE, 1799 1799 .capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | 1800 - V4L2_CAP_STREAMING, 1800 + V4L2_CAP_STREAMING, 1801 1801 }; 1802 1802 1803 1803 strlcpy(cap.card, cam->v4ldev->name, sizeof(cap.card)); 1804 1804 if (usb_make_path(cam->usbdev, cap.bus_info, sizeof(cap.bus_info)) < 0) 1805 1805 strlcpy(cap.bus_info, cam->usbdev->dev.bus_id, 1806 - sizeof(cap.bus_info)); 1806 + sizeof(cap.bus_info)); 1807 1807 1808 1808 if (copy_to_user(arg, &cap, sizeof(cap))) 1809 1809 return -EFAULT; ··· 2138 2138 return -EINVAL; 2139 2139 2140 2140 pfmt->bytesperline = (pfmt->pixelformat==V4L2_PIX_FMT_SN9C10X) 2141 - ? 0 : (pfmt->width * pfmt->priv) / 8; 2141 + ? 0 : (pfmt->width * pfmt->priv) / 8; 2142 2142 pfmt->sizeimage = pfmt->height * ((pfmt->width*pfmt->priv)/8); 2143 2143 pfmt->field = V4L2_FIELD_NONE; 2144 2144 memcpy(&(format.fmt.pix), pfmt, sizeof(*pfmt)); ··· 2152 2152 2153 2153 static int 2154 2154 sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd, 2155 - void __user * arg) 2155 + void __user * arg) 2156 2156 { 2157 2157 struct sn9c102_sensor* s = &cam->sensor; 2158 2158 struct v4l2_format format; ··· 2214 2214 pix->priv = pfmt->priv; /* bpp */ 2215 2215 pix->colorspace = pfmt->colorspace; 2216 2216 pix->bytesperline = (pix->pixelformat == V4L2_PIX_FMT_SN9C10X) 2217 - ? 0 : (pix->width * pix->priv) / 8; 2217 + ? 0 : (pix->width * pix->priv) / 8; 2218 2218 pix->sizeimage = pix->height * ((pix->width * pix->priv) / 8); 2219 2219 pix->field = V4L2_FIELD_NONE; 2220 2220 ··· 2287 2287 sn9c102_vidioc_g_jpegcomp(struct sn9c102_device* cam, void __user * arg) 2288 2288 { 2289 2289 if (copy_to_user(arg, &cam->compression, 2290 - sizeof(cam->compression))) 2290 + sizeof(cam->compression))) 2291 2291 return -EFAULT; 2292 2292 2293 2293 return 0; ··· 2436 2436 2437 2437 static int 2438 2438 sn9c102_vidioc_dqbuf(struct sn9c102_device* cam, struct file* filp, 2439 - void __user * arg) 2439 + void __user * arg) 2440 2440 { 2441 2441 struct v4l2_buffer b; 2442 2442 struct sn9c102_frame_t *f; ··· 2455 2455 if (filp->f_flags & O_NONBLOCK) 2456 2456 return -EAGAIN; 2457 2457 timeout = wait_event_interruptible_timeout 2458 - ( cam->wait_frame, 2459 - (!list_empty(&cam->outqueue)) || 2460 - (cam->state & DEV_DISCONNECTED) || 2461 - (cam->state & DEV_MISCONFIGURED), 2462 - cam->module_param.frame_timeout * 2463 - 1000 * msecs_to_jiffies(1) ); 2458 + ( cam->wait_frame, 2459 + (!list_empty(&cam->outqueue)) || 2460 + (cam->state & DEV_DISCONNECTED) || 2461 + (cam->state & DEV_MISCONFIGURED), 2462 + cam->module_param.frame_timeout * 2463 + 1000 * msecs_to_jiffies(1) ); 2464 2464 if (timeout < 0) 2465 2465 return timeout; 2466 2466 if (cam->state & DEV_DISCONNECTED) ··· 2584 2584 2585 2585 2586 2586 static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, 2587 - unsigned int cmd, void __user * arg) 2587 + unsigned int cmd, void __user * arg) 2588 2588 { 2589 2589 struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); 2590 2590 ··· 2678 2678 2679 2679 2680 2680 static int sn9c102_ioctl(struct inode* inode, struct file* filp, 2681 - unsigned int cmd, unsigned long arg) 2681 + unsigned int cmd, unsigned long arg) 2682 2682 { 2683 2683 struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); 2684 2684 int err = 0; ··· 2761 2761 } 2762 2762 2763 2763 cam->bridge = (id->idProduct & 0xffc0) == 0x6080 ? 2764 - BRIDGE_SN9C103 : BRIDGE_SN9C102; 2764 + BRIDGE_SN9C103 : BRIDGE_SN9C102; 2765 2765 switch (cam->bridge) { 2766 2766 case BRIDGE_SN9C101: 2767 2767 case BRIDGE_SN9C102: ··· 2807 2807 mutex_lock(&cam->dev_mutex); 2808 2808 2809 2809 err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER, 2810 - video_nr[dev_nr]); 2810 + video_nr[dev_nr]); 2811 2811 if (err) { 2812 2812 DBG(1, "V4L2 device registration failed"); 2813 2813 if (err == -ENFILE && video_nr[dev_nr] == -1)
+8 -8
drivers/media/video/sn9c102/sn9c102_hv7131d.c
··· 44 44 } 45 45 46 46 47 - static int hv7131d_get_ctrl(struct sn9c102_device* cam, 48 - struct v4l2_control* ctrl) 47 + static int hv7131d_get_ctrl(struct sn9c102_device* cam, 48 + struct v4l2_control* ctrl) 49 49 { 50 50 switch (ctrl->id) { 51 51 case V4L2_CID_EXPOSURE: ··· 88 88 } 89 89 90 90 91 - static int hv7131d_set_ctrl(struct sn9c102_device* cam, 92 - const struct v4l2_control* ctrl) 91 + static int hv7131d_set_ctrl(struct sn9c102_device* cam, 92 + const struct v4l2_control* ctrl) 93 93 { 94 94 int err = 0; 95 95 ··· 121 121 } 122 122 123 123 124 - static int hv7131d_set_crop(struct sn9c102_device* cam, 125 - const struct v4l2_rect* rect) 124 + static int hv7131d_set_crop(struct sn9c102_device* cam, 125 + const struct v4l2_rect* rect) 126 126 { 127 127 struct sn9c102_sensor* s = &hv7131d; 128 128 int err = 0; ··· 136 136 } 137 137 138 138 139 - static int hv7131d_set_pix_format(struct sn9c102_device* cam, 140 - const struct v4l2_pix_format* pix) 139 + static int hv7131d_set_pix_format(struct sn9c102_device* cam, 140 + const struct v4l2_pix_format* pix) 141 141 { 142 142 int err = 0; 143 143
+53 -53
drivers/media/video/sn9c102/sn9c102_mi0343.c
··· 39 39 err += sn9c102_write_reg(cam, 0xa0, 0x19); 40 40 41 41 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, 42 - 0x0d, 0x00, 0x01, 0, 0); 42 + 0x0d, 0x00, 0x01, 0, 0); 43 43 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, 44 - 0x0d, 0x00, 0x00, 0, 0); 44 + 0x0d, 0x00, 0x00, 0, 0); 45 45 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, 46 - 0x03, 0x01, 0xe1, 0, 0); 46 + 0x03, 0x01, 0xe1, 0, 0); 47 47 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, 48 - 0x04, 0x02, 0x81, 0, 0); 48 + 0x04, 0x02, 0x81, 0, 0); 49 49 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, 50 - 0x05, 0x00, 0x17, 0, 0); 50 + 0x05, 0x00, 0x17, 0, 0); 51 51 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, 52 - 0x06, 0x00, 0x11, 0, 0); 52 + 0x06, 0x00, 0x11, 0, 0); 53 53 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, mi0343.i2c_slave_id, 54 - 0x62, 0x04, 0x9a, 0, 0); 54 + 0x62, 0x04, 0x9a, 0, 0); 55 55 56 56 return err; 57 57 } 58 58 59 59 60 - static int mi0343_get_ctrl(struct sn9c102_device* cam, 61 - struct v4l2_control* ctrl) 60 + static int mi0343_get_ctrl(struct sn9c102_device* cam, 61 + struct v4l2_control* ctrl) 62 62 { 63 63 switch (ctrl->id) { 64 64 case V4L2_CID_EXPOSURE: 65 65 if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, 66 - 0x09, 2+1, mi0343_i2c_data) < 0) 66 + 0x09, 2+1, mi0343_i2c_data) < 0) 67 67 return -EIO; 68 68 ctrl->value = mi0343_i2c_data[2]; 69 69 return 0; 70 70 case V4L2_CID_GAIN: 71 71 if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, 72 - 0x35, 2+1, mi0343_i2c_data) < 0) 72 + 0x35, 2+1, mi0343_i2c_data) < 0) 73 73 return -EIO; 74 74 break; 75 75 case V4L2_CID_HFLIP: 76 76 if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, 77 - 0x20, 2+1, mi0343_i2c_data) < 0) 77 + 0x20, 2+1, mi0343_i2c_data) < 0) 78 78 return -EIO; 79 79 ctrl->value = mi0343_i2c_data[3] & 0x20 ? 1 : 0; 80 80 return 0; 81 81 case V4L2_CID_VFLIP: 82 82 if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, 83 - 0x20, 2+1, mi0343_i2c_data) < 0) 83 + 0x20, 2+1, mi0343_i2c_data) < 0) 84 84 return -EIO; 85 85 ctrl->value = mi0343_i2c_data[3] & 0x80 ? 1 : 0; 86 86 return 0; 87 87 case V4L2_CID_RED_BALANCE: 88 88 if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, 89 - 0x2d, 2+1, mi0343_i2c_data) < 0) 89 + 0x2d, 2+1, mi0343_i2c_data) < 0) 90 90 return -EIO; 91 91 break; 92 92 case V4L2_CID_BLUE_BALANCE: 93 93 if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, 94 - 0x2c, 2+1, mi0343_i2c_data) < 0) 94 + 0x2c, 2+1, mi0343_i2c_data) < 0) 95 95 return -EIO; 96 96 break; 97 97 case SN9C102_V4L2_CID_GREEN_BALANCE: 98 98 if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, 99 - 0x2e, 2+1, mi0343_i2c_data) < 0) 99 + 0x2e, 2+1, mi0343_i2c_data) < 0) 100 100 return -EIO; 101 101 break; 102 102 default: ··· 121 121 } 122 122 123 123 124 - static int mi0343_set_ctrl(struct sn9c102_device* cam, 125 - const struct v4l2_control* ctrl) 124 + static int mi0343_set_ctrl(struct sn9c102_device* cam, 125 + const struct v4l2_control* ctrl) 126 126 { 127 127 u16 reg = 0; 128 128 int err = 0; ··· 144 144 switch (ctrl->id) { 145 145 case V4L2_CID_EXPOSURE: 146 146 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, 147 - mi0343.i2c_slave_id, 148 - 0x09, ctrl->value, 0x00, 149 - 0, 0); 147 + mi0343.i2c_slave_id, 148 + 0x09, ctrl->value, 0x00, 149 + 0, 0); 150 150 break; 151 151 case V4L2_CID_GAIN: 152 152 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, 153 - mi0343.i2c_slave_id, 154 - 0x35, reg >> 8, reg & 0xff, 155 - 0, 0); 153 + mi0343.i2c_slave_id, 154 + 0x35, reg >> 8, reg & 0xff, 155 + 0, 0); 156 156 break; 157 157 case V4L2_CID_HFLIP: 158 158 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, 159 - mi0343.i2c_slave_id, 160 - 0x20, ctrl->value ? 0x40:0x00, 161 - ctrl->value ? 0x20:0x00, 162 - 0, 0); 159 + mi0343.i2c_slave_id, 160 + 0x20, ctrl->value ? 0x40:0x00, 161 + ctrl->value ? 0x20:0x00, 162 + 0, 0); 163 163 break; 164 164 case V4L2_CID_VFLIP: 165 165 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, 166 - mi0343.i2c_slave_id, 167 - 0x20, ctrl->value ? 0x80:0x00, 168 - ctrl->value ? 0x80:0x00, 169 - 0, 0); 166 + mi0343.i2c_slave_id, 167 + 0x20, ctrl->value ? 0x80:0x00, 168 + ctrl->value ? 0x80:0x00, 169 + 0, 0); 170 170 break; 171 171 case V4L2_CID_RED_BALANCE: 172 172 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, 173 - mi0343.i2c_slave_id, 174 - 0x2d, reg >> 8, reg & 0xff, 175 - 0, 0); 173 + mi0343.i2c_slave_id, 174 + 0x2d, reg >> 8, reg & 0xff, 175 + 0, 0); 176 176 break; 177 177 case V4L2_CID_BLUE_BALANCE: 178 178 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, 179 - mi0343.i2c_slave_id, 180 - 0x2c, reg >> 8, reg & 0xff, 181 - 0, 0); 179 + mi0343.i2c_slave_id, 180 + 0x2c, reg >> 8, reg & 0xff, 181 + 0, 0); 182 182 break; 183 183 case SN9C102_V4L2_CID_GREEN_BALANCE: 184 184 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, 185 - mi0343.i2c_slave_id, 186 - 0x2b, reg >> 8, reg & 0xff, 187 - 0, 0); 185 + mi0343.i2c_slave_id, 186 + 0x2b, reg >> 8, reg & 0xff, 187 + 0, 0); 188 188 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, 189 - mi0343.i2c_slave_id, 190 - 0x2e, reg >> 8, reg & 0xff, 191 - 0, 0); 189 + mi0343.i2c_slave_id, 190 + 0x2e, reg >> 8, reg & 0xff, 191 + 0, 0); 192 192 break; 193 193 default: 194 194 return -EINVAL; ··· 198 198 } 199 199 200 200 201 - static int mi0343_set_crop(struct sn9c102_device* cam, 202 - const struct v4l2_rect* rect) 201 + static int mi0343_set_crop(struct sn9c102_device* cam, 202 + const struct v4l2_rect* rect) 203 203 { 204 204 struct sn9c102_sensor* s = &mi0343; 205 205 int err = 0; ··· 213 213 } 214 214 215 215 216 - static int mi0343_set_pix_format(struct sn9c102_device* cam, 217 - const struct v4l2_pix_format* pix) 216 + static int mi0343_set_pix_format(struct sn9c102_device* cam, 217 + const struct v4l2_pix_format* pix) 218 218 { 219 219 int err = 0; 220 220 221 221 if (pix->pixelformat == V4L2_PIX_FMT_SN9C10X) { 222 222 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, 223 - mi0343.i2c_slave_id, 224 - 0x0a, 0x00, 0x03, 0, 0); 223 + mi0343.i2c_slave_id, 224 + 0x0a, 0x00, 0x03, 0, 0); 225 225 err += sn9c102_write_reg(cam, 0x20, 0x19); 226 226 } else { 227 227 err += sn9c102_i2c_try_raw_write(cam, &mi0343, 4, 228 - mi0343.i2c_slave_id, 229 - 0x0a, 0x00, 0x05, 0, 0); 228 + mi0343.i2c_slave_id, 229 + 0x0a, 0x00, 0x05, 0, 0); 230 230 err += sn9c102_write_reg(cam, 0xa0, 0x19); 231 231 } 232 232 ··· 351 351 return -EIO; 352 352 353 353 if (sn9c102_i2c_try_raw_read(cam, &mi0343, mi0343.i2c_slave_id, 0x00, 354 - 2, mi0343_i2c_data) < 0) 354 + 2, mi0343_i2c_data) < 0) 355 355 return -EIO; 356 356 357 357 if (mi0343_i2c_data[4] != 0x32 && mi0343_i2c_data[3] != 0xe3)
+7 -7
drivers/media/video/sn9c102/sn9c102_ov7630.c
··· 69 69 70 70 71 71 static int ov7630_set_ctrl(struct sn9c102_device* cam, 72 - const struct v4l2_control* ctrl) 72 + const struct v4l2_control* ctrl) 73 73 { 74 74 int err = 0; 75 75 ··· 89 89 break; 90 90 case V4L2_CID_CONTRAST: 91 91 err += ctrl->value ? sn9c102_i2c_write(cam, 0x05, 92 - (ctrl->value-1) | 0x20) 93 - : sn9c102_i2c_write(cam, 0x05, 0x00); 92 + (ctrl->value-1) | 0x20) 93 + : sn9c102_i2c_write(cam, 0x05, 0x00); 94 94 break; 95 95 case V4L2_CID_BRIGHTNESS: 96 96 err += sn9c102_i2c_write(cam, 0x06, ctrl->value); ··· 100 100 break; 101 101 case V4L2_CID_HUE: 102 102 err += ctrl->value ? sn9c102_i2c_write(cam, 0x04, 103 - (ctrl->value-1) | 0x20) 104 - : sn9c102_i2c_write(cam, 0x04, 0x00); 103 + (ctrl->value-1) | 0x20) 104 + : sn9c102_i2c_write(cam, 0x04, 0x00); 105 105 break; 106 106 case V4L2_CID_DO_WHITE_BALANCE: 107 107 err += sn9c102_i2c_write(cam, 0x0c, ctrl->value); ··· 139 139 140 140 141 141 static int ov7630_set_crop(struct sn9c102_device* cam, 142 - const struct v4l2_rect* rect) 142 + const struct v4l2_rect* rect) 143 143 { 144 144 struct sn9c102_sensor* s = &ov7630; 145 145 int err = 0; ··· 152 152 153 153 154 154 static int ov7630_set_pix_format(struct sn9c102_device* cam, 155 - const struct v4l2_pix_format* pix) 155 + const struct v4l2_pix_format* pix) 156 156 { 157 157 int err = 0; 158 158
+8 -8
drivers/media/video/sn9c102/sn9c102_pas106b.c
··· 53 53 } 54 54 55 55 56 - static int pas106b_get_ctrl(struct sn9c102_device* cam, 57 - struct v4l2_control* ctrl) 56 + static int pas106b_get_ctrl(struct sn9c102_device* cam, 57 + struct v4l2_control* ctrl) 58 58 { 59 59 switch (ctrl->id) { 60 60 case V4L2_CID_EXPOSURE: ··· 102 102 } 103 103 104 104 105 - static int pas106b_set_ctrl(struct sn9c102_device* cam, 106 - const struct v4l2_control* ctrl) 105 + static int pas106b_set_ctrl(struct sn9c102_device* cam, 106 + const struct v4l2_control* ctrl) 107 107 { 108 108 int err = 0; 109 109 ··· 140 140 } 141 141 142 142 143 - static int pas106b_set_crop(struct sn9c102_device* cam, 144 - const struct v4l2_rect* rect) 143 + static int pas106b_set_crop(struct sn9c102_device* cam, 144 + const struct v4l2_rect* rect) 145 145 { 146 146 struct sn9c102_sensor* s = &pas106b; 147 147 int err = 0; ··· 155 155 } 156 156 157 157 158 - static int pas106b_set_pix_format(struct sn9c102_device* cam, 159 - const struct v4l2_pix_format* pix) 158 + static int pas106b_set_pix_format(struct sn9c102_device* cam, 159 + const struct v4l2_pix_format* pix) 160 160 { 161 161 int err = 0; 162 162
+3 -3
drivers/media/video/sn9c102/sn9c102_pas202bca.c
··· 54 54 55 55 56 56 static int pas202bca_set_pix_format(struct sn9c102_device* cam, 57 - const struct v4l2_pix_format* pix) 57 + const struct v4l2_pix_format* pix) 58 58 { 59 59 int err = 0; 60 60 ··· 68 68 69 69 70 70 static int pas202bca_set_ctrl(struct sn9c102_device* cam, 71 - const struct v4l2_control* ctrl) 71 + const struct v4l2_control* ctrl) 72 72 { 73 73 int err = 0; 74 74 ··· 102 102 103 103 104 104 static int pas202bca_set_crop(struct sn9c102_device* cam, 105 - const struct v4l2_rect* rect) 105 + const struct v4l2_rect* rect) 106 106 { 107 107 struct sn9c102_sensor* s = &pas202bca; 108 108 int err = 0;
+9 -9
drivers/media/video/sn9c102/sn9c102_pas202bcb.c
··· 58 58 } 59 59 60 60 61 - static int pas202bcb_get_ctrl(struct sn9c102_device* cam, 62 - struct v4l2_control* ctrl) 61 + static int pas202bcb_get_ctrl(struct sn9c102_device* cam, 62 + struct v4l2_control* ctrl) 63 63 { 64 64 switch (ctrl->id) { 65 65 case V4L2_CID_EXPOSURE: ··· 101 101 } 102 102 103 103 104 - static int pas202bcb_set_pix_format(struct sn9c102_device* cam, 105 - const struct v4l2_pix_format* pix) 104 + static int pas202bcb_set_pix_format(struct sn9c102_device* cam, 105 + const struct v4l2_pix_format* pix) 106 106 { 107 107 int err = 0; 108 108 ··· 115 115 } 116 116 117 117 118 - static int pas202bcb_set_ctrl(struct sn9c102_device* cam, 119 - const struct v4l2_control* ctrl) 118 + static int pas202bcb_set_ctrl(struct sn9c102_device* cam, 119 + const struct v4l2_control* ctrl) 120 120 { 121 121 int err = 0; 122 122 ··· 149 149 } 150 150 151 151 152 - static int pas202bcb_set_crop(struct sn9c102_device* cam, 153 - const struct v4l2_rect* rect) 152 + static int pas202bcb_set_crop(struct sn9c102_device* cam, 153 + const struct v4l2_rect* rect) 154 154 { 155 155 struct sn9c102_sensor* s = &pas202bcb; 156 156 int err = 0; ··· 167 167 static struct sn9c102_sensor pas202bcb = { 168 168 .name = "PAS202BCB", 169 169 .maintainer = "Carlos Eduardo Medaglia Dyonisio " 170 - "<medaglia@undl.org.br>", 170 + "<medaglia@undl.org.br>", 171 171 .sysfs_ops = SN9C102_I2C_READ | SN9C102_I2C_WRITE, 172 172 .frequency = SN9C102_I2C_400KHZ | SN9C102_I2C_100KHZ, 173 173 .interface = SN9C102_I2C_2WIRES,
+35 -35
drivers/media/video/sn9c102/sn9c102_sensor.h
··· 58 58 Probing functions: on success, you must attach the sensor to the camera 59 59 by calling sn9c102_attach_sensor() provided below. 60 60 To enable the I2C communication, you might need to perform a really basic 61 - initialization of the SN9C10X chip by using the write function declared 61 + initialization of the SN9C10X chip by using the write function declared 62 62 ahead. 63 63 Functions must return 0 on success, the appropriate error otherwise. 64 64 */ ··· 73 73 74 74 /* 75 75 Add the above entries to this table. Be sure to add the entry in the right 76 - place, since, on failure, the next probing routine is called according to 76 + place, since, on failure, the next probing routine is called according to 77 77 the order of the list below, from top to bottom. 78 78 */ 79 79 #define SN9C102_SENSOR_TABLE \ ··· 94 94 sn9c102_match_id(struct sn9c102_device* cam, const struct usb_device_id *id); 95 95 96 96 /* Attach a probed sensor to the camera. */ 97 - extern void 97 + extern void 98 98 sn9c102_attach_sensor(struct sn9c102_device* cam, 99 - struct sn9c102_sensor* sensor); 99 + struct sn9c102_sensor* sensor); 100 100 101 101 /* 102 102 Each SN9C10x camera has proper PID/VID identifiers. ··· 105 105 */ 106 106 #define SN9C102_USB_DEVICE(vend, prod, intclass) \ 107 107 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ 108 - USB_DEVICE_ID_MATCH_INT_CLASS, \ 108 + USB_DEVICE_ID_MATCH_INT_CLASS, \ 109 109 .idVendor = (vend), \ 110 110 .idProduct = (prod), \ 111 111 .bInterfaceClass = (intclass) ··· 162 162 Read/write routines: they always return -1 on error, 0 or the read value 163 163 otherwise. NOTE that a real read operation is not supported by the SN9C10X 164 164 chip for some of its registers. To work around this problem, a pseudo-read 165 - call is provided instead: it returns the last successfully written value 165 + call is provided instead: it returns the last successfully written value 166 166 on the register (0 if it has never been written), the usual -1 on error. 167 167 */ 168 168 169 169 /* The "try" I2C I/O versions are used when probing the sensor */ 170 170 extern int sn9c102_i2c_try_write(struct sn9c102_device*,struct sn9c102_sensor*, 171 - u8 address, u8 value); 171 + u8 address, u8 value); 172 172 extern int sn9c102_i2c_try_read(struct sn9c102_device*,struct sn9c102_sensor*, 173 - u8 address); 173 + u8 address); 174 174 175 175 /* 176 176 These must be used if and only if the sensor doesn't implement the standard 177 - I2C protocol. There are a number of good reasons why you must use the 177 + I2C protocol. There are a number of good reasons why you must use the 178 178 single-byte versions of these functions: do not abuse. The first function 179 179 writes n bytes, from data0 to datan, to registers 0x09 - 0x09+n of SN9C10X 180 180 chip. The second one programs the registers 0x09 and 0x10 with data0 and ··· 184 184 byte. 185 185 */ 186 186 extern int sn9c102_i2c_try_raw_write(struct sn9c102_device* cam, 187 - struct sn9c102_sensor* sensor, u8 n, 188 - u8 data0, u8 data1, u8 data2, u8 data3, 189 - u8 data4, u8 data5); 187 + struct sn9c102_sensor* sensor, u8 n, 188 + u8 data0, u8 data1, u8 data2, u8 data3, 189 + u8 data4, u8 data5); 190 190 extern int sn9c102_i2c_try_raw_read(struct sn9c102_device* cam, 191 - struct sn9c102_sensor* sensor, u8 data0, 192 - u8 data1, u8 n, u8 buffer[]); 191 + struct sn9c102_sensor* sensor, u8 data0, 192 + u8 data1, u8 n, u8 buffer[]); 193 193 194 194 /* To be used after the sensor struct has been attached to the camera struct */ 195 195 extern int sn9c102_i2c_write(struct sn9c102_device*, u8 address, u8 value); ··· 252 252 253 253 /* 254 254 NOTE: Where not noted,most of the functions below are not mandatory. 255 - Set to null if you do not implement them. If implemented, 256 - they must return 0 on success, the proper error otherwise. 255 + Set to null if you do not implement them. If implemented, 256 + they must return 0 on success, the proper error otherwise. 257 257 */ 258 258 259 259 int (*init)(struct sn9c102_device* cam); 260 260 /* 261 - This function will be called after the sensor has been attached. 261 + This function will be called after the sensor has been attached. 262 262 It should be used to initialize the sensor only, but may also 263 263 configure part of the SN9C10X chip if necessary. You don't need to 264 264 setup picture settings like brightness, contrast, etc.. here, if 265 - the corrisponding controls are implemented (see below), since 265 + the corrisponding controls are implemented (see below), since 266 266 they are adjusted in the core driver by calling the set_ctrl() 267 267 method after init(), where the arguments are the default values 268 268 specified in the v4l2_queryctrl list of supported controls; ··· 273 273 274 274 struct v4l2_queryctrl qctrl[SN9C102_MAX_CTRLS]; 275 275 /* 276 - Optional list of default controls, defined as indicated in the 276 + Optional list of default controls, defined as indicated in the 277 277 V4L2 API. Menu type controls are not handled by this interface. 278 278 */ 279 279 280 280 int (*get_ctrl)(struct sn9c102_device* cam, struct v4l2_control* ctrl); 281 281 int (*set_ctrl)(struct sn9c102_device* cam, 282 - const struct v4l2_control* ctrl); 282 + const struct v4l2_control* ctrl); 283 283 /* 284 284 You must implement at least the set_ctrl method if you have defined 285 285 the list above. The returned value must follow the V4L2 ··· 306 306 specified in the cropcap substructures 'bounds' and 'defrect'. 307 307 By default, the source rectangle should cover the largest possible 308 308 area. Again, it is not always true that the largest source rectangle 309 - can cover the entire active window, although it is a rare case for 309 + can cover the entire active window, although it is a rare case for 310 310 the hardware we have. The bounds of the source rectangle _must_ be 311 311 multiple of 16 and must use the same coordinate system as indicated 312 312 before; their centers shall align initially. ··· 317 317 defined the correct default bounds in the structures. 318 318 See the V4L2 API for further details. 319 319 NOTE: once you have defined the bounds of the active window 320 - (struct cropcap.bounds) you must not change them.anymore. 320 + (struct cropcap.bounds) you must not change them.anymore. 321 321 Only 'bounds' and 'defrect' fields are mandatory, other fields 322 322 will be ignored. 323 323 */ 324 324 325 325 int (*set_crop)(struct sn9c102_device* cam, 326 - const struct v4l2_rect* rect); 326 + const struct v4l2_rect* rect); 327 327 /* 328 328 To be called on VIDIOC_C_SETCROP. The core module always calls a 329 329 default routine which configures the appropriate SN9C10X regs (also ··· 332 332 case you override the default function, you always have to program 333 333 the chip to match those values; on error return the corresponding 334 334 error code without rolling back. 335 - NOTE: in case, you must program the SN9C10X chip to get rid of 336 - blank pixels or blank lines at the _start_ of each line or 337 - frame after each HSYNC or VSYNC, so that the image starts with 338 - real RGB data (see regs 0x12, 0x13) (having set H_SIZE and, 339 - V_SIZE you don't have to care about blank pixels or blank 340 - lines at the end of each line or frame). 335 + NOTE: in case, you must program the SN9C10X chip to get rid of 336 + blank pixels or blank lines at the _start_ of each line or 337 + frame after each HSYNC or VSYNC, so that the image starts with 338 + real RGB data (see regs 0x12, 0x13) (having set H_SIZE and, 339 + V_SIZE you don't have to care about blank pixels or blank 340 + lines at the end of each line or frame). 341 341 */ 342 342 343 343 struct v4l2_pix_format pix_format; ··· 349 349 number of bits per pixel for uncompressed video, 8 or 9 (despite the 350 350 current value of 'pixelformat'). 351 351 NOTE 1: both 'width' and 'height' _must_ be either 1/1 or 1/2 or 1/4 352 - of cropcap.defrect.width and cropcap.defrect.height. I 353 - suggest 1/1. 352 + of cropcap.defrect.width and cropcap.defrect.height. I 353 + suggest 1/1. 354 354 NOTE 2: The initial compression quality is defined by the first bit 355 - of reg 0x17 during the initialization of the image sensor. 355 + of reg 0x17 during the initialization of the image sensor. 356 356 NOTE 3: as said above, you have to program the SN9C10X chip to get 357 - rid of any blank pixels, so that the output of the sensor 358 - matches the RGB bayer sequence (i.e. BGBGBG...GRGRGR). 357 + rid of any blank pixels, so that the output of the sensor 358 + matches the RGB bayer sequence (i.e. BGBGBG...GRGRGR). 359 359 */ 360 360 361 361 int (*set_pix_format)(struct sn9c102_device* cam, 362 - const struct v4l2_pix_format* pix); 362 + const struct v4l2_pix_format* pix); 363 363 /* 364 364 To be called on VIDIOC_S_FMT, when switching from the SBGGR8 to 365 365 SN9C10X pixel format or viceversa. On error return the corresponding
+6 -6
drivers/media/video/sn9c102/sn9c102_tas5110c1b.c
··· 44 44 } 45 45 46 46 47 - static int tas5110c1b_set_ctrl(struct sn9c102_device* cam, 48 - const struct v4l2_control* ctrl) 47 + static int tas5110c1b_set_ctrl(struct sn9c102_device* cam, 48 + const struct v4l2_control* ctrl) 49 49 { 50 50 int err = 0; 51 51 ··· 61 61 } 62 62 63 63 64 - static int tas5110c1b_set_crop(struct sn9c102_device* cam, 65 - const struct v4l2_rect* rect) 64 + static int tas5110c1b_set_crop(struct sn9c102_device* cam, 65 + const struct v4l2_rect* rect) 66 66 { 67 67 struct sn9c102_sensor* s = &tas5110c1b; 68 68 int err = 0; ··· 81 81 } 82 82 83 83 84 - static int tas5110c1b_set_pix_format(struct sn9c102_device* cam, 85 - const struct v4l2_pix_format* pix) 84 + static int tas5110c1b_set_pix_format(struct sn9c102_device* cam, 85 + const struct v4l2_pix_format* pix) 86 86 { 87 87 int err = 0; 88 88
+6 -6
drivers/media/video/sn9c102/sn9c102_tas5130d1b.c
··· 42 42 } 43 43 44 44 45 - static int tas5130d1b_set_ctrl(struct sn9c102_device* cam, 46 - const struct v4l2_control* ctrl) 45 + static int tas5130d1b_set_ctrl(struct sn9c102_device* cam, 46 + const struct v4l2_control* ctrl) 47 47 { 48 48 int err = 0; 49 49 ··· 62 62 } 63 63 64 64 65 - static int tas5130d1b_set_crop(struct sn9c102_device* cam, 66 - const struct v4l2_rect* rect) 65 + static int tas5130d1b_set_crop(struct sn9c102_device* cam, 66 + const struct v4l2_rect* rect) 67 67 { 68 68 struct sn9c102_sensor* s = &tas5130d1b; 69 69 u8 h_start = (u8)(rect->left - s->cropcap.bounds.left) + 104, ··· 82 82 } 83 83 84 84 85 - static int tas5130d1b_set_pix_format(struct sn9c102_device* cam, 86 - const struct v4l2_pix_format* pix) 85 + static int tas5130d1b_set_pix_format(struct sn9c102_device* cam, 86 + const struct v4l2_pix_format* pix) 87 87 { 88 88 int err = 0; 89 89
+5 -5
drivers/media/video/stradis.c
··· 1 - /* 1 + /* 2 2 * stradis.c - stradis 4:2:2 mpeg decoder driver 3 3 * 4 4 * Stradis 4:2:2 MPEG-2 Decoder Driver ··· 1191 1191 } 1192 1192 1193 1193 /* clip_draw_rectangle(cm,x,y,w,h) -- handle clipping an area 1194 - * bitmap is fixed width, 128 bytes (1024 pixels represented) 1195 - * arranged most-sigificant-bit-left in 32-bit words 1196 - * based on saa7146 clipping hardware, it swaps bytes if LE 1194 + * bitmap is fixed width, 128 bytes (1024 pixels represented) 1195 + * arranged most-sigificant-bit-left in 32-bit words 1196 + * based on saa7146 clipping hardware, it swaps bytes if LE 1197 1197 * much of this makes up for egcs brain damage -- so if you 1198 1198 * are wondering "why did he do this?" it is because the C 1199 1199 * was adjusted to generate the optimal asm output without ··· 1259 1259 clip_draw_rectangle(clipmap, cr[i].x, cr[i].y, 1260 1260 cr[i].width, cr[i].height); 1261 1261 } 1262 - /* clip against viewing window AND screen 1262 + /* clip against viewing window AND screen 1263 1263 so we do not have to rely on the user program 1264 1264 */ 1265 1265 clip_draw_rectangle(clipmap, (saa->win.x + width > saa->win.swidth) ?
+24 -24
drivers/media/video/stv680.c
··· 1 1 /* 2 2 * STV0680 USB Camera Driver, by Kevin Sisson (kjsisson@bellsouth.net) 3 - * 4 - * Thanks to STMicroelectronics for information on the usb commands, and 5 - * to Steve Miller at STM for his help and encouragement while I was 3 + * 4 + * Thanks to STMicroelectronics for information on the usb commands, and 5 + * to Steve Miller at STM for his help and encouragement while I was 6 6 * writing this driver. 7 7 * 8 - * This driver is based heavily on the 8 + * This driver is based heavily on the 9 9 * Endpoints (formerly known as AOX) se401 USB Camera Driver 10 10 * Copyright (c) 2000 Jeroen B. Vreeken (pe1rxq@amsat.org) 11 11 * 12 12 * Still somewhat based on the Linux ov511 driver. 13 - * 13 + * 14 14 * This program is free software; you can redistribute it and/or modify it 15 15 * under the terms of the GNU General Public License as published by the 16 16 * Free Software Foundation; either version 2 of the License, or (at your ··· 25 25 * along with this program; if not, write to the Free Software Foundation, 26 26 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 27 27 * 28 - * History: 29 - * ver 0.1 October, 2001. Initial attempt. 28 + * History: 29 + * ver 0.1 October, 2001. Initial attempt. 30 30 * 31 31 * ver 0.2 November, 2001. Fixed asbility to resize, added brightness 32 32 * function, made more stable (?) 33 33 * 34 - * ver 0.21 Nov, 2001. Added gamma correction and white balance, 35 - * due to Alexander Schwartz. Still trying to 34 + * ver 0.21 Nov, 2001. Added gamma correction and white balance, 35 + * due to Alexander Schwartz. Still trying to 36 36 * improve stablility. Moved stuff into stv680.h 37 37 * 38 - * ver 0.22 Nov, 2001. Added sharpen function (by Michael Sweet, 39 - * mike@easysw.com) from GIMP, also used in pencam. 38 + * ver 0.22 Nov, 2001. Added sharpen function (by Michael Sweet, 39 + * mike@easysw.com) from GIMP, also used in pencam. 40 40 * Simple, fast, good integer math routine. 41 41 * 42 42 * ver 0.23 Dec, 2001 (gkh) ··· 44 44 * Lindent, and did other minor tweaks to get 45 45 * things to work properly with 2.5.1 46 46 * 47 - * ver 0.24 Jan, 2002 (kjs) 47 + * ver 0.24 Jan, 2002 (kjs) 48 48 * Fixed the problem with webcam crashing after 49 - * two pictures. Changed the way pic is halved to 50 - * improve quality. Got rid of green line around 51 - * frame. Fix brightness reset when changing size 49 + * two pictures. Changed the way pic is halved to 50 + * improve quality. Got rid of green line around 51 + * frame. Fix brightness reset when changing size 52 52 * bug. Adjusted gamma filters slightly. 53 53 * 54 54 * ver 0.25 Jan, 2002 (kjs) ··· 484 484 PDEBUG (1, "STV(i): swapRGB is (forced) ON"); 485 485 else if (swapRGB_on == -1) 486 486 PDEBUG (1, "STV(i): swapRGB is (forced) OFF"); 487 - 487 + 488 488 if (stv_set_video_mode (stv680) < 0) { 489 489 PDEBUG (0, "STV(e): Could not set video mode in stv_init"); 490 490 return -1; ··· 570 570 if (stv680->brightness != p->brightness) { 571 571 stv680->chgbright = 1; 572 572 stv680->brightness = p->brightness; 573 - } 573 + } 574 574 575 575 stv680->whiteness = p->whiteness; /* greyscale */ 576 576 stv680->colour = p->colour; ··· 612 612 613 613 case BUFFER_UNUSED: 614 614 memcpy (stv680->scratch[stv680->scratch_next].data, 615 - (unsigned char *) urb->transfer_buffer, length); 615 + (unsigned char *) urb->transfer_buffer, length); 616 616 stv680->scratch[stv680->scratch_next].state = BUFFER_READY; 617 617 stv680->scratch[stv680->scratch_next].length = length; 618 618 if (waitqueue_active (&stv680->wq)) { ··· 752 752 PDEBUG (1, "STV(e): request for non-supported size: request: v.width = %i, v.height = %i actual: stv.width = %i, stv.height = %i", width, height, stv680->vwidth, stv680->vheight); 753 753 return 1; 754 754 } 755 - 755 + 756 756 /* Stop a current stream and start it again at the new size */ 757 757 if (wasstreaming) 758 758 stv680_stop_stream (stv680); ··· 773 773 774 774 /* 775 775 * STV0680 Vision Camera Chipset Driver 776 - * Copyright (C) 2000 Adam Harrison <adam@antispin.org> 776 + * Copyright (C) 2000 Adam Harrison <adam@antispin.org> 777 777 */ 778 778 779 779 #define RED 0 ··· 842 842 colour = 2; 843 843 break; 844 844 } 845 - i = (y * vw + x) * 3; 845 + i = (y * vw + x) * 3; 846 846 *(output + i + colour) = (unsigned char) p; 847 847 } /* for x */ 848 848 ··· 850 850 851 851 /****** gamma correction plus hardcoded white balance */ 852 852 /* Thanks to Alexander Schwartx <alexander.schwartx@gmx.net> for this code. 853 - Correction values red[], green[], blue[], are generated by 854 - (pow(i/256.0, GAMMA)*255.0)*white balanceRGB where GAMMA=0.55, 1<i<255. 855 - White balance (RGB)= 1.0, 1.17, 1.48. Values are calculated as double float and 853 + Correction values red[], green[], blue[], are generated by 854 + (pow(i/256.0, GAMMA)*255.0)*white balanceRGB where GAMMA=0.55, 1<i<255. 855 + White balance (RGB)= 1.0, 1.17, 1.48. Values are calculated as double float and 856 856 converted to unsigned char. Values are in stv680.h */ 857 857 858 858 for (y = 0; y < vh; y++) {
+71 -71
drivers/media/video/stv680.h
··· 9 9 * it under the terms of the GNU General Public License as published by 10 10 * the Free Software Foundation; either version 2 of the License, or 11 11 * (at your option) any later version. 12 - * 12 + * 13 13 * This program is distributed in the hope that it will be useful, 14 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 * GNU General Public License for more details. 17 - * 17 + * 18 18 * You should have received a copy of the GNU General Public License 19 19 * along with this program; if not, write to the Free Software 20 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ··· 152 152 153 153 154 154 static const unsigned char red[256] = { 155 - 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 156 - 18, 18, 18, 18, 18, 18, 18, 25, 30, 35, 38, 42, 157 - 44, 47, 50, 53, 54, 57, 59, 61, 63, 65, 67, 69, 158 - 71, 71, 73, 75, 77, 78, 80, 81, 82, 84, 85, 87, 159 - 88, 89, 90, 91, 93, 94, 95, 97, 98, 98, 99, 101, 160 - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 161 - 114, 115, 116, 116, 117, 118, 119, 120, 121, 122, 123, 124, 162 - 125, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 163 - 134, 135, 135, 136, 137, 138, 139, 140, 140, 141, 142, 143, 164 - 143, 143, 144, 145, 146, 147, 147, 148, 149, 150, 150, 151, 165 - 152, 152, 152, 153, 154, 154, 155, 156, 157, 157, 158, 159, 166 - 159, 160, 161, 161, 161, 162, 163, 163, 164, 165, 165, 166, 167 - 167, 167, 168, 168, 169, 170, 170, 170, 171, 171, 172, 173, 168 - 173, 174, 174, 175, 176, 176, 177, 178, 178, 179, 179, 179, 169 - 180, 180, 181, 181, 182, 183, 183, 184, 184, 185, 185, 186, 170 - 187, 187, 188, 188, 188, 188, 189, 190, 190, 191, 191, 192, 171 - 192, 193, 193, 194, 195, 195, 196, 196, 197, 197, 197, 197, 172 - 198, 198, 199, 199, 200, 201, 201, 202, 202, 203, 203, 204, 173 - 204, 205, 205, 206, 206, 206, 206, 207, 207, 208, 208, 209, 174 - 209, 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, 215, 175 - 215, 215, 215, 216, 216, 217, 217, 218, 218, 218, 219, 219, 176 - 220, 220, 221, 221 177 - }; 155 + 0, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 156 + 18, 18, 18, 18, 18, 18, 18, 25, 30, 35, 38, 42, 157 + 44, 47, 50, 53, 54, 57, 59, 61, 63, 65, 67, 69, 158 + 71, 71, 73, 75, 77, 78, 80, 81, 82, 84, 85, 87, 159 + 88, 89, 90, 91, 93, 94, 95, 97, 98, 98, 99, 101, 160 + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 161 + 114, 115, 116, 116, 117, 118, 119, 120, 121, 122, 123, 124, 162 + 125, 125, 126, 127, 128, 129, 129, 130, 131, 132, 133, 134, 163 + 134, 135, 135, 136, 137, 138, 139, 140, 140, 141, 142, 143, 164 + 143, 143, 144, 145, 146, 147, 147, 148, 149, 150, 150, 151, 165 + 152, 152, 152, 153, 154, 154, 155, 156, 157, 157, 158, 159, 166 + 159, 160, 161, 161, 161, 162, 163, 163, 164, 165, 165, 166, 167 + 167, 167, 168, 168, 169, 170, 170, 170, 171, 171, 172, 173, 168 + 173, 174, 174, 175, 176, 176, 177, 178, 178, 179, 179, 179, 169 + 180, 180, 181, 181, 182, 183, 183, 184, 184, 185, 185, 186, 170 + 187, 187, 188, 188, 188, 188, 189, 190, 190, 191, 191, 192, 171 + 192, 193, 193, 194, 195, 195, 196, 196, 197, 197, 197, 197, 172 + 198, 198, 199, 199, 200, 201, 201, 202, 202, 203, 203, 204, 173 + 204, 205, 205, 206, 206, 206, 206, 207, 207, 208, 208, 209, 174 + 209, 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, 215, 175 + 215, 215, 215, 216, 216, 217, 217, 218, 218, 218, 219, 219, 176 + 220, 220, 221, 221 177 + }; 178 178 179 179 static const unsigned char green[256] = { 180 - 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 181 - 21, 21, 21, 21, 21, 21, 21, 28, 34, 39, 43, 47, 182 - 50, 53, 56, 59, 61, 64, 66, 68, 71, 73, 75, 77, 183 - 79, 80, 82, 84, 86, 87, 89, 91, 92, 94, 95, 97, 184 - 98, 100, 101, 102, 104, 105, 106, 108, 109, 110, 111, 113, 185 - 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 186 - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 187 - 139, 140, 141, 142, 143, 144, 144, 145, 146, 147, 148, 149, 188 - 150, 151, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159, 189 - 160, 160, 161, 162, 163, 164, 164, 165, 166, 167, 167, 168, 190 - 169, 170, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 191 - 177, 178, 179, 179, 180, 181, 182, 182, 183, 184, 184, 185, 192 - 186, 186, 187, 187, 188, 189, 189, 190, 191, 191, 192, 193, 193 - 193, 194, 194, 195, 196, 196, 197, 198, 198, 199, 199, 200, 194 - 201, 201, 202, 202, 203, 204, 204, 205, 205, 206, 206, 207, 195 - 208, 208, 209, 209, 210, 210, 211, 212, 212, 213, 213, 214, 196 - 214, 215, 215, 216, 217, 217, 218, 218, 219, 219, 220, 220, 197 - 221, 221, 222, 222, 223, 224, 224, 225, 225, 226, 226, 227, 198 - 227, 228, 228, 229, 229, 230, 230, 231, 231, 232, 232, 233, 199 - 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238, 239, 200 - 239, 240, 240, 241, 241, 242, 242, 243, 243, 243, 244, 244, 201 - 245, 245, 246, 246 202 - }; 180 + 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 181 + 21, 21, 21, 21, 21, 21, 21, 28, 34, 39, 43, 47, 182 + 50, 53, 56, 59, 61, 64, 66, 68, 71, 73, 75, 77, 183 + 79, 80, 82, 84, 86, 87, 89, 91, 92, 94, 95, 97, 184 + 98, 100, 101, 102, 104, 105, 106, 108, 109, 110, 111, 113, 185 + 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 186 + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 187 + 139, 140, 141, 142, 143, 144, 144, 145, 146, 147, 148, 149, 188 + 150, 151, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159, 189 + 160, 160, 161, 162, 163, 164, 164, 165, 166, 167, 167, 168, 190 + 169, 170, 170, 171, 172, 172, 173, 174, 175, 175, 176, 177, 191 + 177, 178, 179, 179, 180, 181, 182, 182, 183, 184, 184, 185, 192 + 186, 186, 187, 187, 188, 189, 189, 190, 191, 191, 192, 193, 193 + 193, 194, 194, 195, 196, 196, 197, 198, 198, 199, 199, 200, 194 + 201, 201, 202, 202, 203, 204, 204, 205, 205, 206, 206, 207, 195 + 208, 208, 209, 209, 210, 210, 211, 212, 212, 213, 213, 214, 196 + 214, 215, 215, 216, 217, 217, 218, 218, 219, 219, 220, 220, 197 + 221, 221, 222, 222, 223, 224, 224, 225, 225, 226, 226, 227, 198 + 227, 228, 228, 229, 229, 230, 230, 231, 231, 232, 232, 233, 199 + 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238, 239, 200 + 239, 240, 240, 241, 241, 242, 242, 243, 243, 243, 244, 244, 201 + 245, 245, 246, 246 202 + }; 203 203 204 204 static const unsigned char blue[256] = { 205 - 0, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 206 - 23, 23, 23, 23, 23, 23, 23, 30, 37, 42, 47, 51, 207 - 55, 58, 61, 64, 67, 70, 72, 74, 78, 80, 82, 84, 208 - 86, 88, 90, 92, 94, 95, 97, 100, 101, 103, 104, 106, 209 - 107, 110, 111, 112, 114, 115, 116, 118, 119, 121, 122, 124, 210 - 125, 126, 127, 128, 129, 132, 133, 134, 135, 136, 137, 138, 211 - 139, 140, 141, 143, 144, 145, 146, 147, 148, 149, 150, 151, 212 - 152, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 163, 213 - 165, 166, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 214 - 176, 176, 177, 178, 179, 180, 180, 181, 182, 183, 183, 184, 215 - 185, 187, 187, 188, 189, 189, 190, 191, 192, 192, 193, 194, 216 - 194, 195, 196, 196, 198, 199, 200, 200, 201, 202, 202, 203, 217 - 204, 204, 205, 205, 206, 207, 207, 209, 210, 210, 211, 212, 218 - 212, 213, 213, 214, 215, 215, 216, 217, 217, 218, 218, 220, 219 - 221, 221, 222, 222, 223, 224, 224, 225, 225, 226, 226, 227, 220 - 228, 228, 229, 229, 231, 231, 232, 233, 233, 234, 234, 235, 221 - 235, 236, 236, 237, 238, 238, 239, 239, 240, 240, 242, 242, 222 - 243, 243, 244, 244, 245, 246, 246, 247, 247, 248, 248, 249, 223 - 249, 250, 250, 251, 251, 253, 253, 254, 254, 255, 255, 255, 224 - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225 - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 226 - 255, 255, 255, 255 227 - }; 205 + 0, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 206 + 23, 23, 23, 23, 23, 23, 23, 30, 37, 42, 47, 51, 207 + 55, 58, 61, 64, 67, 70, 72, 74, 78, 80, 82, 84, 208 + 86, 88, 90, 92, 94, 95, 97, 100, 101, 103, 104, 106, 209 + 107, 110, 111, 112, 114, 115, 116, 118, 119, 121, 122, 124, 210 + 125, 126, 127, 128, 129, 132, 133, 134, 135, 136, 137, 138, 211 + 139, 140, 141, 143, 144, 145, 146, 147, 148, 149, 150, 151, 212 + 152, 154, 155, 156, 157, 158, 158, 159, 160, 161, 162, 163, 213 + 165, 166, 166, 167, 168, 169, 170, 171, 171, 172, 173, 174, 214 + 176, 176, 177, 178, 179, 180, 180, 181, 182, 183, 183, 184, 215 + 185, 187, 187, 188, 189, 189, 190, 191, 192, 192, 193, 194, 216 + 194, 195, 196, 196, 198, 199, 200, 200, 201, 202, 202, 203, 217 + 204, 204, 205, 205, 206, 207, 207, 209, 210, 210, 211, 212, 218 + 212, 213, 213, 214, 215, 215, 216, 217, 217, 218, 218, 220, 219 + 221, 221, 222, 222, 223, 224, 224, 225, 225, 226, 226, 227, 220 + 228, 228, 229, 229, 231, 231, 232, 233, 233, 234, 234, 235, 221 + 235, 236, 236, 237, 238, 238, 239, 239, 240, 240, 242, 242, 222 + 243, 243, 244, 244, 245, 246, 246, 247, 247, 248, 248, 249, 223 + 249, 250, 250, 251, 251, 253, 253, 254, 254, 255, 255, 255, 224 + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 225 + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 226 + 255, 255, 255, 255 227 + };
+1 -1
drivers/media/video/tda9840.c
··· 35 35 module_param(debug, int, 0644); 36 36 MODULE_PARM_DESC(debug, "Turn on/off device debugging (default:off)."); 37 37 #define dprintk(args...) \ 38 - do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0) 38 + do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0) 39 39 40 40 #define SWITCH 0x00 41 41 #define LEVEL_ADJUST 0x02
+1 -1
drivers/media/video/tea6415c.c
··· 37 37 module_param(debug, int, 0644); 38 38 MODULE_PARM_DESC(debug, "Turn on/off device debugging (default:off)."); 39 39 #define dprintk(args...) \ 40 - do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0) 40 + do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0) 41 41 42 42 #define TEA6415C_NUM_INPUTS 8 43 43 #define TEA6415C_NUM_OUTPUTS 6
+1 -1
drivers/media/video/tea6420.c
··· 37 37 module_param(debug, int, 0644); 38 38 MODULE_PARM_DESC(debug, "Turn on/off device debugging (default:off)."); 39 39 #define dprintk(args...) \ 40 - do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0) 40 + do { if (debug) { printk("%s: %s()[%d]: ", KBUILD_MODNAME, __FUNCTION__, __LINE__); printk(args); } } while (0) 41 41 42 42 /* addresses to scan, found only at 0x4c and/or 0x4d (7-Bit) */ 43 43 static unsigned short normal_i2c[] = { I2C_ADDR_TEA6420_1, I2C_ADDR_TEA6420_2, I2C_CLIENT_END };
+25 -25
drivers/media/video/tuner-3036.c
··· 5 5 * 6 6 * The SAB3036 is just about different enough from the chips that 7 7 * tuner.c copes with to make it not worth the effort to crowbar 8 - * the support into that file. So instead we have a separate driver. 8 + * the support into that file. So instead we have a separate driver. 9 9 * 10 10 * This program is free software; you can redistribute it and/or 11 11 * modify it under the terms of the GNU General Public License ··· 56 56 57 57 #define TUNER_FL 0x80 58 58 59 - static int 59 + static int 60 60 tuner_islocked (struct i2c_client *c) 61 61 { 62 - return (tuner_getstatus(c) & TUNER_FL); 62 + return (tuner_getstatus(c) & TUNER_FL); 63 63 } 64 64 65 65 /* ---------------------------------------------------------------------- */ 66 66 67 - static void 67 + static void 68 68 set_tv_freq(struct i2c_client *c, int freq) 69 69 { 70 70 u16 div = ((freq * 20) / 16); ··· 73 73 74 74 if (debug) 75 75 printk(KERN_DEBUG "tuner: setting frequency %dMHz, divisor %x\n", freq / 16, div); 76 - 76 + 77 77 /* Select high tuning current */ 78 78 buffer[0] = 0x29; 79 79 buffer[1] = 0x3e; 80 80 81 81 if (i2c_master_send(c, buffer, 2) != 2) 82 82 printk("tuner: i2c i/o error 1\n"); 83 - 83 + 84 84 buffer[0] = 0x80 | ((div>>8) & 0x7f); 85 85 buffer[1] = div & 0xff; 86 86 87 87 if (i2c_master_send(c, buffer, 2) != 2) 88 88 printk("tuner: i2c i/o error 2\n"); 89 - 89 + 90 90 while (!tuner_islocked(c) && time_before(jiffies, give_up)) 91 91 schedule(); 92 - 92 + 93 93 if (!tuner_islocked(c)) 94 94 printk(KERN_WARNING "tuner: failed to achieve PLL lock\n"); 95 - 95 + 96 96 /* Select low tuning current and engage AFC */ 97 97 buffer[0] = 0x29; 98 98 buffer[1] = 0xb2; ··· 106 106 107 107 /* ---------------------------------------------------------------------- */ 108 108 109 - static int 109 + static int 110 110 tuner_attach(struct i2c_adapter *adap, int addr, int kind) 111 111 { 112 112 static unsigned char buffer[] = { 0x29, 0x32, 0x2a, 0, 0x2b, 0 }; ··· 116 116 if (this_adap > 0) 117 117 return -1; 118 118 this_adap++; 119 - 120 - client_template.adapter = adap; 121 - client_template.addr = addr; 119 + 120 + client_template.adapter = adap; 121 + client_template.addr = addr; 122 122 123 123 client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 124 - if (client == NULL) 125 - return -ENOMEM; 126 - memcpy(client, &client_template, sizeof(struct i2c_client)); 124 + if (client == NULL) 125 + return -ENOMEM; 126 + memcpy(client, &client_template, sizeof(struct i2c_client)); 127 127 128 128 printk("tuner: SAB3036 found, status %02x\n", tuner_getstatus(client)); 129 129 130 - i2c_attach_client(client); 130 + i2c_attach_client(client); 131 131 132 132 if (i2c_master_send(client, buffer, 2) != 2) 133 133 printk("tuner: i2c i/o error 1\n"); ··· 138 138 return 0; 139 139 } 140 140 141 - static int 141 + static int 142 142 tuner_detach(struct i2c_client *c) 143 143 { 144 144 return 0; 145 145 } 146 146 147 - static int 147 + static int 148 148 tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) 149 149 { 150 150 int *iarg = (int*)arg; 151 151 152 - switch (cmd) 152 + switch (cmd) 153 153 { 154 154 case VIDIOCSFREQ: 155 155 set_tv_freq(client, *iarg); 156 156 break; 157 - 157 + 158 158 default: 159 159 return -EINVAL; 160 160 } 161 161 return 0; 162 162 } 163 163 164 - static int 164 + static int 165 165 tuner_probe(struct i2c_adapter *adap) 166 166 { 167 167 this_adap = 0; ··· 172 172 173 173 /* ----------------------------------------------------------------------- */ 174 174 175 - static struct i2c_driver 176 - i2c_driver_tuner = 175 + static struct i2c_driver 176 + i2c_driver_tuner = 177 177 { 178 178 .driver = { 179 179 .name = "sab3036", ··· 186 186 187 187 static struct i2c_client client_template = 188 188 { 189 - .driver = &i2c_driver_tuner, 189 + .driver = &i2c_driver_tuner, 190 190 .name = "SAB3036", 191 191 }; 192 192
+5 -5
drivers/media/video/usbvideo/ibmcam.c
··· 1300 1300 /* 1301 1301 * ibmcam_model3_Packet1() 1302 1302 * 1303 - * 00_0078_012d 1303 + * 00_0078_012d 1304 1304 * 00_0097_012f 1305 - * 00_d141_0124 1305 + * 00_d141_0124 1306 1306 * 00_0096_0127 1307 - * 00_fea8_0124 1307 + * 00_fea8_0124 1308 1308 */ 1309 1309 static void ibmcam_model3_Packet1(struct uvd *uvd, unsigned short v1, unsigned short v2) 1310 1310 { ··· 2687 2687 ibmcam_veio(uvd, 0, 0x0004, 0x0127); 2688 2688 ibmcam_veio(uvd, 0, 0xfea8, 0x0124); 2689 2689 ibmcam_veio(uvd, 0, 0x00c0, 0x010c); 2690 - break; 2690 + break; 2691 2691 } 2692 2692 usb_clear_halt(uvd->dev, usb_rcvisocpipe(uvd->dev, uvd->video_endp)); 2693 2693 } ··· 3238 3238 {0, 0x0062, 0x0107}, 3239 3239 {0, 0x0003, 0x0111}, 3240 3240 }; 3241 - #define NUM_INIT_DATA 3241 + #define NUM_INIT_DATA 3242 3242 3243 3243 unsigned short compression = 0; /* 0=none, 7=best frame rate */ 3244 3244 int f_rate; /* 0=Fastest 7=slowest */
+24 -24
drivers/media/video/usbvideo/konicawc.c
··· 36 36 enum ctrl_req { 37 37 SetWhitebal = 0x01, 38 38 SetBrightness = 0x02, 39 - SetSharpness = 0x03, 39 + SetSharpness = 0x03, 40 40 SetContrast = 0x04, 41 41 SetSaturation = 0x05, 42 42 }; ··· 47 47 SIZE_160X136 = 1, 48 48 SIZE_176X144 = 2, 49 49 SIZE_320X240 = 3, 50 - 50 + 51 51 }; 52 52 53 53 #define MAX_FRAME_SIZE SIZE_320X240 ··· 69 69 /* Some default values for initial camera settings, 70 70 can be set by modprobe */ 71 71 72 - static int size; 72 + static int size; 73 73 static int speed = 6; /* Speed (fps) 0 (slowest) to 6 (fastest) */ 74 74 static int brightness = MAX_BRIGHTNESS/2; 75 75 static int contrast = MAX_CONTRAST/2; ··· 132 132 133 133 static int konicawc_ctrl_msg(struct uvd *uvd, u8 dir, u8 request, u16 value, u16 index, void *buf, int len) 134 134 { 135 - int retval = usb_control_msg(uvd->dev, 135 + int retval = usb_control_msg(uvd->dev, 136 136 dir ? usb_rcvctrlpipe(uvd->dev, 0) : usb_sndctrlpipe(uvd->dev, 0), 137 137 request, 0x40 | dir, value, index, buf, len, 1000); 138 - return retval < 0 ? retval : 0; 138 + return retval < 0 ? retval : 0; 139 139 } 140 140 141 141 142 142 static inline void konicawc_camera_on(struct uvd *uvd) 143 143 { 144 - DEBUG(0, "camera on"); 145 - konicawc_set_misc(uvd, 0x2, 1, 0x0b); 144 + DEBUG(0, "camera on"); 145 + konicawc_set_misc(uvd, 0x2, 1, 0x0b); 146 146 } 147 147 148 148 149 149 static inline void konicawc_camera_off(struct uvd *uvd) 150 150 { 151 - DEBUG(0, "camera off"); 152 - konicawc_set_misc(uvd, 0x2, 0, 0x0b); 151 + DEBUG(0, "camera off"); 152 + konicawc_set_misc(uvd, 0x2, 0, 0x0b); 153 153 } 154 154 155 155 ··· 317 317 button = !!(sts & 0x40); 318 318 sts &= ~0x40; 319 319 } 320 - 320 + 321 321 /* work out the button status, but don't do 322 322 anything with it for now */ 323 323 ··· 331 331 discard++; 332 332 continue; 333 333 } 334 - 334 + 335 335 if((sts > 0x01) && (sts < 0x80)) { 336 336 info("unknown status %2.2x", sts); 337 337 bad++; ··· 350 350 DEBUG(2, "found initial image"); 351 351 cam->lastframe = -1; 352 352 } 353 - 353 + 354 354 marker[3] = sts & 0x7F; 355 355 RingQueue_Enqueue(&uvd->dp, marker, 4); 356 356 totlen += 4; ··· 367 367 368 368 static void resubmit_urb(struct uvd *uvd, struct urb *urb) 369 369 { 370 - int i, ret; 371 - for (i = 0; i < FRAMES_PER_DESC; i++) { 372 - urb->iso_frame_desc[i].status = 0; 373 - } 374 - urb->dev = uvd->dev; 375 - urb->status = 0; 370 + int i, ret; 371 + for (i = 0; i < FRAMES_PER_DESC; i++) { 372 + urb->iso_frame_desc[i].status = 0; 373 + } 374 + urb->dev = uvd->dev; 375 + urb->status = 0; 376 376 ret = usb_submit_urb(urb, GFP_ATOMIC); 377 377 DEBUG(3, "submitting urb of length %d", urb->transfer_buffer_length); 378 - if(ret) 379 - err("usb_submit_urb error (%d)", ret); 378 + if(ret) 379 + err("usb_submit_urb error (%d)", ret); 380 380 381 381 } 382 382 ··· 490 490 } 491 491 492 492 cam->last_data_urb = NULL; 493 - 493 + 494 494 /* Submit all URBs */ 495 495 for (i=0; i < USBVIDEO_NUMSBUF; i++) { 496 496 errFlag = usb_submit_urb(cam->sts_urb[i], GFP_KERNEL); ··· 539 539 540 540 541 541 static void konicawc_process_isoc(struct uvd *uvd, struct usbvideo_frame *frame) 542 - { 542 + { 543 543 struct konicawc *cam = (struct konicawc *)uvd->user_data; 544 544 int maxline = cam->maxline; 545 545 int yplanesz = cam->yplanesz; ··· 583 583 584 584 if(frame->scanstate == ScanState_Scanning) 585 585 return; 586 - 586 + 587 587 /* Try to move data from queue into frame buffer 588 588 * We get data in blocks of 384 bytes made up of: 589 589 * 256 Y, 64 U, 64 V. 590 590 * This needs to be written out as a Y plane, a U plane and a V plane. 591 591 */ 592 - 592 + 593 593 while ( frame->curline < maxline && (RingQueue_GetLength(&uvd->dp) >= 384)) { 594 594 /* Y */ 595 595 RingQueue_Dequeue(&uvd->dp, frame->data + (frame->curline * 256), 256);
+1 -1
drivers/media/video/usbvideo/ultracam.c
··· 23 23 typedef struct { 24 24 int initialized; /* Had we already sent init sequence? */ 25 25 int camera_model; /* What type of IBM camera we got? */ 26 - int has_hdr; 26 + int has_hdr; 27 27 } ultracam_t; 28 28 #define ULTRACAM_T(uvd) ((ultracam_t *)((uvd)->user_data)) 29 29
+21 -21
drivers/media/video/usbvideo/usbvideo.c
··· 574 574 } else { 575 575 /* Just the blue screen */ 576 576 } 577 - 577 + 578 578 *f++ = cb; 579 579 *f++ = cg; 580 580 *f++ = cr; ··· 1243 1243 1244 1244 #if USBVIDEO_REPORT_STATS 1245 1245 usbvideo_ReportStatistics(uvd); 1246 - #endif 1246 + #endif 1247 1247 1248 1248 uvd->user--; 1249 1249 if (uvd->remove_pending) { ··· 1290 1290 return 0; 1291 1291 } 1292 1292 case VIDIOCSCHAN: 1293 - { 1293 + { 1294 1294 struct video_channel *v = arg; 1295 1295 if (v->channel != 0) 1296 1296 return -EINVAL; ··· 1347 1347 vw->chromakey = 0; 1348 1348 if (VALID_CALLBACK(uvd, getFPS)) 1349 1349 vw->flags = GET_CALLBACK(uvd, getFPS)(uvd); 1350 - else 1350 + else 1351 1351 vw->flags = 10; /* FIXME: do better! */ 1352 1352 return 0; 1353 1353 } ··· 1359 1359 memset(vm, 0, sizeof(*vm)); 1360 1360 vm->size = uvd->max_frame_size * USBVIDEO_NUMFRAMES; 1361 1361 vm->frames = USBVIDEO_NUMFRAMES; 1362 - for(i = 0; i < USBVIDEO_NUMFRAMES; i++) 1362 + for(i = 0; i < USBVIDEO_NUMFRAMES; i++) 1363 1363 vm->offsets[i] = i * uvd->max_frame_size; 1364 1364 1365 1365 return 0; ··· 1425 1425 1426 1426 if (*frameNum < 0 || *frameNum >= USBVIDEO_NUMFRAMES) 1427 1427 return -EINVAL; 1428 - 1428 + 1429 1429 if (uvd->debug >= 1) 1430 1430 info("VIDIOCSYNC: syncing to frame %d.", *frameNum); 1431 1431 if (uvd->flags & FLAGS_NO_DECODING) ··· 1454 1454 struct video_buffer *vb = arg; 1455 1455 1456 1456 memset(vb, 0, sizeof(*vb)); 1457 - return 0; 1458 - } 1457 + return 0; 1458 + } 1459 1459 case VIDIOCKEY: 1460 1460 return 0; 1461 1461 ··· 1704 1704 info("Not streaming, but interrupt!"); 1705 1705 return; 1706 1706 } 1707 - 1707 + 1708 1708 uvd->stats.urb_count++; 1709 1709 if (urb->actual_length <= 0) 1710 1710 goto urb_done_with; ··· 1763 1763 } 1764 1764 if (VALID_CALLBACK(uvd, videoStart)) 1765 1765 GET_CALLBACK(uvd, videoStart)(uvd); 1766 - else 1766 + else 1767 1767 err("%s: videoStart not set", __FUNCTION__); 1768 1768 1769 1769 /* We double buffer the Iso lists */ ··· 1830 1830 /* Invoke minidriver's magic to stop the camera */ 1831 1831 if (VALID_CALLBACK(uvd, videoStop)) 1832 1832 GET_CALLBACK(uvd, videoStop)(uvd); 1833 - else 1833 + else 1834 1834 err("%s: videoStop not set", __FUNCTION__); 1835 1835 1836 1836 /* Set packet size to 0 */ ··· 1963 1963 info("%s($%p,%d.)", __FUNCTION__, uvd, frameNum); 1964 1964 1965 1965 switch (frame->frameState) { 1966 - case FrameState_Unused: 1966 + case FrameState_Unused: 1967 1967 if (uvd->debug >= 2) 1968 1968 info("%s: FrameState_Unused", __FUNCTION__); 1969 1969 return -EINVAL; 1970 - case FrameState_Ready: 1971 - case FrameState_Grabbing: 1972 - case FrameState_Error: 1973 - { 1970 + case FrameState_Ready: 1971 + case FrameState_Grabbing: 1972 + case FrameState_Error: 1973 + { 1974 1974 int ntries, signalPending; 1975 1975 redo: 1976 1976 if (!CAMERA_IS_OPERATIONAL(uvd)) { ··· 1978 1978 info("%s: Camera is not operational (1)", __FUNCTION__); 1979 1979 return -EIO; 1980 1980 } 1981 - ntries = 0; 1981 + ntries = 0; 1982 1982 do { 1983 1983 RingQueue_InterruptibleSleepOn(&uvd->dp); 1984 1984 signalPending = signal_pending(current); ··· 2010 2010 usbvideo_CollectRawData(uvd, frame); 2011 2011 else if (VALID_CALLBACK(uvd, processData)) 2012 2012 GET_CALLBACK(uvd, processData)(uvd, frame); 2013 - else 2013 + else 2014 2014 err("%s: processData not set", __FUNCTION__); 2015 2015 } 2016 2016 } while (frame->frameState == FrameState_Grabbing); ··· 2027 2027 goto redo; 2028 2028 } 2029 2029 /* Note that we fall through to meet our destiny below */ 2030 - } 2031 - case FrameState_Done: 2030 + } 2031 + case FrameState_Done: 2032 2032 /* 2033 2033 * Do all necessary postprocessing of data prepared in 2034 2034 * "interrupt" code and the collecting code above. The ··· 2157 2157 * History: 2158 2158 * 09-Feb-2001 Created. 2159 2159 */ 2160 - static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd, 2160 + static void usbvideo_SoftwareContrastAdjustment(struct uvd *uvd, 2161 2161 struct usbvideo_frame *frame) 2162 2162 { 2163 2163 int i, j, v4l_linesize;
+5 -5
drivers/media/video/usbvideo/usbvideo.h
··· 189 189 190 190 /* Statistics that can be overlaid on screen */ 191 191 struct usbvideo_statistics { 192 - unsigned long frame_num; /* Sequential number of the frame */ 193 - unsigned long urb_count; /* How many URBs we received so far */ 194 - unsigned long urb_length; /* Length of last URB */ 195 - unsigned long data_count; /* How many bytes we received */ 196 - unsigned long header_count; /* How many frame headers we found */ 192 + unsigned long frame_num; /* Sequential number of the frame */ 193 + unsigned long urb_count; /* How many URBs we received so far */ 194 + unsigned long urb_length; /* Length of last URB */ 195 + unsigned long data_count; /* How many bytes we received */ 196 + unsigned long header_count; /* How many frame headers we found */ 197 197 unsigned long iso_skip_count; /* How many empty ISO packets received */ 198 198 unsigned long iso_err_count; /* How many bad ISO packets received */ 199 199 };
+14 -14
drivers/media/video/usbvideo/vicam.c
··· 69 69 #define VICAM_HEADER_SIZE 64 70 70 71 71 #define clamp( x, l, h ) max_t( __typeof__( x ), \ 72 - ( l ), \ 73 - min_t( __typeof__( x ), \ 74 - ( h ), \ 75 - ( x ) ) ) 72 + ( l ), \ 73 + min_t( __typeof__( x ), \ 74 + ( h ), \ 75 + ( x ) ) ) 76 76 77 77 /* Not sure what all the bytes in these char 78 78 * arrays do, but they're necessary to make ··· 357 357 * Not sure why these are not yet non-statics which I can reference through 358 358 * usbvideo.h the same as it is in 2.4.20. I bet this will get fixed sometime 359 359 * in the future. 360 - * 360 + * 361 361 */ 362 362 static void *rvmalloc(unsigned long size) 363 363 { ··· 603 603 case VIDIOCSPICT: 604 604 { 605 605 struct video_picture vp; 606 - 606 + 607 607 if (copy_from_user(&vp, user_arg, sizeof(vp))) { 608 608 retval = -EFAULT; 609 609 break; 610 610 } 611 - 611 + 612 612 DBG("VIDIOCSPICT depth = %d, pal = %d\n", vp.depth, 613 613 vp.palette); 614 614 ··· 655 655 } 656 656 657 657 DBG("VIDIOCSWIN %d x %d\n", vw.width, vw.height); 658 - 658 + 659 659 if ( vw.width != 320 || vw.height != 240 ) 660 660 retval = -EFAULT; 661 661 ··· 809 809 cam->needsDummyRead = 1; 810 810 cam->open_count++; 811 811 812 - file->private_data = cam; 813 - 812 + file->private_data = cam; 813 + 814 814 return 0; 815 815 } 816 816 817 - static int 817 + static int 818 818 vicam_close(struct inode *inode, struct file *file) 819 819 { 820 820 struct vicam_camera *cam = file->private_data; ··· 1187 1187 1188 1188 if ( !cam->proc_dir ) 1189 1189 return; // FIXME: We should probably return an error here 1190 - 1190 + 1191 1191 ent = create_proc_entry("shutter", S_IFREG | S_IRUGO | S_IWUSR, 1192 1192 cam->proc_dir); 1193 1193 if (ent) { ··· 1282 1282 const struct usb_host_interface *interface; 1283 1283 const struct usb_endpoint_descriptor *endpoint; 1284 1284 struct vicam_camera *cam; 1285 - 1285 + 1286 1286 printk(KERN_INFO "ViCam based webcam connected\n"); 1287 1287 1288 1288 interface = intf->cur_altsetting; ··· 1331 1331 printk(KERN_INFO "ViCam webcam driver now controlling video device %d\n",cam->vdev.minor); 1332 1332 1333 1333 usb_set_intfdata (intf, cam); 1334 - 1334 + 1335 1335 return 0; 1336 1336 } 1337 1337
+26 -26
drivers/media/video/videocodec.h
··· 57 57 therfor they may not be initialized. 58 58 59 59 The other fuctions are just for convenience, as they are for sure used by 60 - most/all of the codecs. The last ones may be ommited, too. 60 + most/all of the codecs. The last ones may be ommited, too. 61 61 62 62 See the structure declaration below for more information and which data has 63 63 to be set up for the master and the slave. ··· 75 75 /* ========================================== */ 76 76 77 77 /* 78 - ==== master setup ==== 78 + ==== master setup ==== 79 79 name -> name of the device structure for reference and debugging 80 80 master_data -> data ref. for the master (e.g. the zr36055,57,67) 81 81 readreg -> ref. to read-fn from register (setup by master, used by slave) 82 82 writereg -> ref. to write-fn to register (setup by master, used by slave) 83 - this two functions do the lowlevel I/O job 83 + this two functions do the lowlevel I/O job 84 84 85 - ==== slave functionality setup ==== 86 - slave_data -> data ref. for the slave (e.g. the zr36050,60) 85 + ==== slave functionality setup ==== 86 + slave_data -> data ref. for the slave (e.g. the zr36050,60) 87 87 check -> fn-ref. checks availability of an device, returns -EIO on failure or 88 - the type on success 89 - this makes espcecially sense if a driver module supports more than 90 - one codec which may be quite similar to access, nevertheless it 91 - is good for a first functionality check 88 + the type on success 89 + this makes espcecially sense if a driver module supports more than 90 + one codec which may be quite similar to access, nevertheless it 91 + is good for a first functionality check 92 92 93 - -- main functions you always need for compression/decompression -- 93 + -- main functions you always need for compression/decompression -- 94 94 95 95 set_mode -> this fn-ref. resets the entire codec, and sets up the mode 96 - with the last defined norm/size (or device default if not 97 - available) - it returns 0 if the mode is possible 96 + with the last defined norm/size (or device default if not 97 + available) - it returns 0 if the mode is possible 98 98 set_size -> this fn-ref. sets the norm and image size for 99 - compression/decompression (returns 0 on success) 100 - the norm param is defined in videodev.h (VIDEO_MODE_*) 99 + compression/decompression (returns 0 on success) 100 + the norm param is defined in videodev.h (VIDEO_MODE_*) 101 101 102 102 additional setup may be available, too - but the codec should work with 103 - some default values even without this 103 + some default values even without this 104 104 105 - set_data -> sets device-specific data (tables, quality etc.) 106 - get_data -> query device-specific data (tables, quality etc.) 105 + set_data -> sets device-specific data (tables, quality etc.) 106 + get_data -> query device-specific data (tables, quality etc.) 107 107 108 - if the device delivers interrupts, they may be setup/handled here 109 - setup_interrupt -> codec irq setup (not needed for 36050/60) 110 - handle_interrupt -> codec irq handling (not needed for 36050/60) 108 + if the device delivers interrupts, they may be setup/handled here 109 + setup_interrupt -> codec irq setup (not needed for 36050/60) 110 + handle_interrupt -> codec irq handling (not needed for 36050/60) 111 111 112 - if the device delivers pictures, they may be handled here 113 - put_image -> puts image data to the codec (not needed for 36050/60) 114 - get_image -> gets image data from the codec (not needed for 36050/60) 115 - the calls include frame numbers and flags (even/odd/...) 116 - if needed and a flag which allows blocking until its ready 112 + if the device delivers pictures, they may be handled here 113 + put_image -> puts image data to the codec (not needed for 36050/60) 114 + get_image -> gets image data from the codec (not needed for 36050/60) 115 + the calls include frame numbers and flags (even/odd/...) 116 + if needed and a flag which allows blocking until its ready 117 117 */ 118 118 119 119 /* ============== */ 120 120 /* user interface */ 121 121 /* ============== */ 122 122 123 - /* 123 + /* 124 124 Currently there is only a information display planned, as the layer 125 125 is not visible for the user space at all. 126 126
+2 -2
drivers/media/video/vino.c
··· 1555 1555 unsigned int w = vcs->clipping.right - vcs->clipping.left; 1556 1556 unsigned int d = vcs->decimation; 1557 1557 unsigned int bpp = vino_data_formats[vcs->data_format].bpp; 1558 - unsigned int lsize; 1558 + unsigned int lsize; 1559 1559 1560 1560 dprintk("update_line_size(): before: w = %d, d = %d, " 1561 1561 "line_size = %d\n", w, d, vcs->line_size); 1562 1562 1563 - /* line size must be multiple of 8 bytes */ 1563 + /* line size must be multiple of 8 bytes */ 1564 1564 lsize = (bpp * (w / d)) & ~7; 1565 1565 w = (lsize / bpp) * d; 1566 1566
+10 -10
drivers/media/video/vpx3220.c
··· 1 - /* 1 + /* 2 2 * vpx3220a, vpx3216b & vpx3214c video decoder driver version 0.0.1 3 3 * 4 4 * Copyright (C) 2001 Laurent Pinchart <lpinchart@freegates.be> ··· 176 176 177 177 static int 178 178 vpx3220_write_fp_block (struct i2c_client *client, 179 - const u16 *data, 180 - unsigned int len) 179 + const u16 *data, 180 + unsigned int len) 181 181 { 182 182 u8 reg; 183 183 int ret = 0; ··· 316 316 vpx3220_write_fp_block(client, init_fp, 317 317 sizeof(init_fp) >> 1); 318 318 switch (decoder->norm) { 319 - 319 + 320 320 case VIDEO_MODE_NTSC: 321 321 vpx3220_write_fp_block(client, init_ntsc, 322 322 sizeof(init_ntsc) >> 1); ··· 324 324 325 325 case VIDEO_MODE_PAL: 326 326 vpx3220_write_fp_block(client, init_pal, 327 - sizeof(init_pal) >> 1); 327 + sizeof(init_pal) >> 1); 328 328 break; 329 329 case VIDEO_MODE_SECAM: 330 330 vpx3220_write_fp_block(client, init_secam, ··· 332 332 break; 333 333 default: 334 334 vpx3220_write_fp_block(client, init_pal, 335 - sizeof(init_pal) >> 1); 335 + sizeof(init_pal) >> 1); 336 336 break; 337 337 } 338 - } 338 + } 339 339 break; 340 340 341 341 case DECODER_DUMP: ··· 411 411 412 412 /* Here we back up the input selection because it gets 413 413 overwritten when we fill the registers with the 414 - choosen video norm */ 414 + choosen video norm */ 415 415 temp_input = vpx3220_fp_read(client, 0xf2); 416 416 417 417 dprintk(1, KERN_DEBUG "%s: DECODER_SET_NORM %d\n", ··· 578 578 }; 579 579 580 580 static unsigned short ignore = I2C_CLIENT_END; 581 - 581 + 582 582 static struct i2c_client_address_data addr_data = { 583 583 .normal_i2c = normal_i2c, 584 584 .probe = &ignore, ··· 661 661 break; 662 662 default: 663 663 dprintk(1, 664 - KERN_INFO 664 + KERN_INFO 665 665 "%s: Wrong part number (0x%04x)\n", 666 666 __func__, pn); 667 667 kfree(client);
+51 -51
drivers/media/video/w9966.c
··· 26 26 Does any other model using the w9966 interface chip exist ? 27 27 28 28 Todo: 29 - 29 + 30 30 *Add a working EPP mode, since DMA ECP read isn't implemented 31 31 in the parport drivers. (That's why it's so sloow) 32 32 ··· 47 47 *Probably some bugs that I don't know of 48 48 49 49 Please support me by sending feedback! 50 - 50 + 51 51 Changes: 52 - 52 + 53 53 Alan Cox: Removed RGB mode for kernel merge, added THIS_MODULE 54 54 and owner support for newer module locks 55 55 */ ··· 204 204 */ 205 205 206 206 207 - // Set camera phase flags, so we know what to uninit when terminating 207 + // Set camera phase flags, so we know what to uninit when terminating 208 208 static inline void w9966_setState(struct w9966_dev* cam, int mask, int val) 209 209 { 210 210 cam->dev_state = (cam->dev_state & ~mask) ^ val; ··· 233 233 parport_release(cam->pdev); 234 234 w9966_setState(cam, W9966_STATE_CLAIMED, 0); 235 235 } 236 - 236 + 237 237 // Read register from W9966 interface-chip 238 238 // Expects a claimed pdev 239 239 // -1 on error, else register data (byte) ··· 242 242 // ECP, read, regtransfer, REG, REG, REG, REG, REG 243 243 const unsigned char addr = 0x80 | (reg & 0x1f); 244 244 unsigned char val; 245 - 245 + 246 246 if (parport_negotiate(cam->pport, cam->ppmode | IEEE1284_ADDR) != 0) 247 247 return -1; 248 248 if (parport_write(cam->pport, &addr, 1) != 1) ··· 263 263 // ECP, write, regtransfer, REG, REG, REG, REG, REG 264 264 const unsigned char addr = 0xc0 | (reg & 0x1f); 265 265 const unsigned char val = data; 266 - 266 + 267 267 if (parport_negotiate(cam->pport, cam->ppmode | IEEE1284_ADDR) != 0) 268 268 return -1; 269 269 if (parport_write(cam->pport, &addr, 1) != 1) ··· 284 284 { 285 285 if (cam->dev_state != 0) 286 286 return -1; 287 - 287 + 288 288 cam->pport = port; 289 289 cam->brightness = 128; 290 290 cam->contrast = 64; ··· 302 302 cam->ppmode = IEEE1284_MODE_EPP; 303 303 else 304 304 cam->ppmode = IEEE1284_MODE_ECP; 305 - break; 305 + break; 306 306 case 1: // hw- or sw-ecp 307 307 cam->ppmode = IEEE1284_MODE_ECP; 308 308 break; ··· 310 310 cam->ppmode = IEEE1284_MODE_EPP; 311 311 break; 312 312 } 313 - 313 + 314 314 // Tell the parport driver that we exists 315 315 cam->pdev = parport_register_device(port, "w9966", NULL, NULL, NULL, 0, NULL); 316 316 if (cam->pdev == NULL) { ··· 320 320 w9966_setState(cam, W9966_STATE_PDEV, W9966_STATE_PDEV); 321 321 322 322 w9966_pdev_claim(cam); 323 - 323 + 324 324 // Setup a default capture mode 325 325 if (w9966_setup(cam, 0, 0, 1023, 1023, 200, 160) != 0) { 326 326 DPRINTF("w9966_setup() failed.\n"); ··· 333 333 memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device)); 334 334 cam->vdev.priv = cam; 335 335 336 - if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1) 336 + if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1) 337 337 return -1; 338 - 338 + 339 339 w9966_setState(cam, W9966_STATE_VDEV, W9966_STATE_VDEV); 340 - 340 + 341 341 // All ok 342 342 printk( 343 343 "w9966cf: Found and initialized a webcam on %s.\n", ··· 391 391 // Only continue as long as we keep getting better values 392 392 if (err > besterr) 393 393 break; 394 - 394 + 395 395 besterr = err; 396 396 bestlen = len; 397 397 } ··· 399 399 return bestlen; 400 400 } 401 401 402 - // Modify capture window (if necessary) 402 + // Modify capture window (if necessary) 403 403 // and calculate downscaling 404 404 // Return -1 on error 405 405 static int w9966_calcscale(int size, int min, int max, int* beg, int* end, unsigned char* factor) ··· 407 407 int maxlen = max - min; 408 408 int len = *end - *beg + 1; 409 409 int newlen = w9966_findlen(len, size, maxlen); 410 - int err = newlen - len; 410 + int err = newlen - len; 411 411 412 412 // Check for bad format 413 413 if (newlen > maxlen || newlen < size) ··· 452 452 0x48, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 453 453 0x00, 0x00, 0x00, 0x71, 0xe7, 0x00, 0x00, 0xc0 454 454 }; 455 - 456 - 455 + 456 + 457 457 if (w*h*2 > W9966_SRAMSIZE) 458 458 { 459 459 DPRINTF("capture window exceeds SRAM size!.\n"); ··· 469 469 cam->width = w; 470 470 cam->height = h; 471 471 472 - enh_s = 0; 472 + enh_s = 0; 473 473 enh_e = w*h*2; 474 - 474 + 475 475 // Modify capture window if necessary and calculate downscaling 476 476 if ( 477 477 w9966_calcscale(w, W9966_WND_MIN_X, W9966_WND_MAX_X, &x1, &x2, &scale_x) != 0 || ··· 482 482 "%dx%d, x: %d<->%d, y: %d<->%d, sx: %d/64, sy: %d/64.\n", 483 483 w, h, x1, x2, y1, y2, scale_x&~0x80, scale_y&~0x80 484 484 ); 485 - 485 + 486 486 // Setup registers 487 487 regs[0x00] = 0x00; // Set normal operation 488 488 regs[0x01] = 0x18; // Capture mode 489 489 regs[0x02] = scale_y; // V-scaling 490 490 regs[0x03] = scale_x; // H-scaling 491 - 492 - // Capture window 491 + 492 + // Capture window 493 493 regs[0x04] = (x1 & 0x0ff); // X-start (8 low bits) 494 494 regs[0x05] = (x1 & 0x300)>>8; // X-start (2 high bits) 495 495 regs[0x06] = (y1 & 0x0ff); // Y-start (8 low bits) ··· 499 499 regs[0x0a] = (y2 & 0x0ff); // Y-end (8 low bits) 500 500 501 501 regs[0x0c] = W9966_SRAMID; // SRAM-banks (1x 128kb) 502 - 502 + 503 503 // Enhancement layer 504 504 regs[0x0d] = (enh_s& 0x000ff); // Enh. start (0-7) 505 505 regs[0x0e] = (enh_s& 0x0ff00)>>8; // Enh. start (8-15) ··· 515 515 regs[0x19] = 0xff; // I/O port direction control 516 516 regs[0x1a] = 0xff; // I/O port data register 517 517 regs[0x1b] = 0x10; // ??? 518 - 518 + 519 519 // SAA7111 chip settings 520 520 saa7111_regs[0x0a] = cam->brightness; 521 521 saa7111_regs[0x0b] = cam->contrast; ··· 551 551 cam->i2c_state |= W9966_I2C_W_DATA; 552 552 else 553 553 cam->i2c_state &= ~W9966_I2C_W_DATA; 554 - 554 + 555 555 w9966_wReg(cam, 0x18, cam->i2c_state); 556 556 udelay(5); 557 557 } ··· 577 577 578 578 w9966_wReg(cam, 0x18, cam->i2c_state); 579 579 udelay(5); 580 - 580 + 581 581 // we go to high, we also expect the peripheral to ack. 582 582 if (state) { 583 583 timeout = jiffies + 100; ··· 607 607 w9966_i2c_setsda(cam, (data >> i) & 0x01); 608 608 609 609 if (w9966_i2c_setscl(cam, 1) == -1) 610 - return -1; 610 + return -1; 611 611 w9966_i2c_setscl(cam, 0); 612 612 } 613 613 614 614 w9966_i2c_setsda(cam, 1); 615 - 615 + 616 616 if (w9966_i2c_setscl(cam, 1) == -1) 617 617 return -1; 618 618 w9966_i2c_setscl(cam, 0); 619 - 619 + 620 620 return 0; 621 621 } 622 622 ··· 626 626 static int w9966_i2c_rbyte(struct w9966_dev* cam) 627 627 { 628 628 unsigned char data = 0x00; 629 - int i; 630 - 629 + int i; 630 + 631 631 w9966_i2c_setsda(cam, 1); 632 632 633 633 for (i = 0; i < 8; i++) ··· 637 637 data = data << 1; 638 638 if (w9966_i2c_getsda(cam)) 639 639 data |= 0x01; 640 - 640 + 641 641 w9966_i2c_setscl(cam, 0); 642 642 } 643 643 return data; ··· 673 673 return -1; 674 674 675 675 w9966_i2c_setsda(cam, 0); 676 - 676 + 677 677 if (w9966_i2c_setscl(cam, 1) == -1) 678 678 return -1; 679 679 w9966_i2c_setsda(cam, 1); 680 - 680 + 681 681 return data; 682 682 } 683 683 #endif ··· 699 699 w9966_i2c_setsda(cam, 0); 700 700 if (w9966_i2c_setscl(cam, 1) == -1) 701 701 return -1; 702 - 702 + 703 703 w9966_i2c_setsda(cam, 1); 704 704 705 705 return 0; ··· 714 714 { 715 715 struct video_device *vdev = video_devdata(file); 716 716 struct w9966_dev *cam = vdev->priv; 717 - 717 + 718 718 switch(cmd) 719 719 { 720 720 case VIDIOCGCAP: ··· 790 790 struct video_picture *vpic = arg; 791 791 if (vpic->depth != 16 || vpic->palette != VIDEO_PALETTE_YUV422) 792 792 return -EINVAL; 793 - 793 + 794 794 cam->brightness = vpic->brightness >> 8; 795 795 cam->hue = (vpic->hue >> 8) - 128; 796 796 cam->color = vpic->colour >> 9; 797 797 cam->contrast = vpic->contrast >> 9; 798 798 799 799 w9966_pdev_claim(cam); 800 - 800 + 801 801 if ( 802 802 w9966_wReg_i2c(cam, 0x0a, cam->brightness) == -1 || 803 803 w9966_wReg_i2c(cam, 0x0b, cam->contrast) == -1 || ··· 807 807 w9966_pdev_release(cam); 808 808 return -EIO; 809 809 } 810 - 810 + 811 811 w9966_pdev_release(cam); 812 812 return 0; 813 813 } ··· 815 815 { 816 816 int ret; 817 817 struct video_window *vwin = arg; 818 - 818 + 819 819 if (vwin->flags != 0) 820 820 return -EINVAL; 821 821 if (vwin->clipcount != 0) 822 822 return -EINVAL; 823 823 if (vwin->width < 2 || vwin->width > W9966_WND_MAX_W) 824 - return -EINVAL; 824 + return -EINVAL; 825 825 if (vwin->height < 1 || vwin->height > W9966_WND_MAX_H) 826 826 return -EINVAL; 827 827 ··· 829 829 w9966_pdev_claim(cam); 830 830 ret = w9966_setup(cam, 0, 0, 1023, 1023, vwin->width, vwin->height); 831 831 w9966_pdev_release(cam); 832 - 832 + 833 833 if (ret != 0) { 834 834 DPRINTF("VIDIOCSWIN: w9966_setup() failed.\n"); 835 835 return -EIO; 836 836 } 837 - 837 + 838 838 return 0; 839 839 } 840 840 case VIDIOCGWIN: ··· 846 846 return 0; 847 847 } 848 848 // Unimplemented 849 - case VIDIOCCAPTURE: 849 + case VIDIOCCAPTURE: 850 850 case VIDIOCGFBUF: 851 851 case VIDIOCSFBUF: 852 852 case VIDIOCKEY: ··· 877 877 unsigned char __user *dest = (unsigned char __user *)buf; 878 878 unsigned long dleft = count; 879 879 unsigned char *tbuf; 880 - 880 + 881 881 // Why would anyone want more than this?? 882 882 if (count > cam->width * cam->height * 2) 883 883 return -EINVAL; 884 - 884 + 885 885 w9966_pdev_claim(cam); 886 886 w9966_wReg(cam, 0x00, 0x02); // Reset ECP-FIFO buffer 887 887 w9966_wReg(cam, 0x00, 0x00); // Return to normal operation 888 888 w9966_wReg(cam, 0x01, 0x98); // Enable capture 889 889 890 - // write special capture-addr and negotiate into data transfer 890 + // write special capture-addr and negotiate into data transfer 891 891 if ( 892 892 (parport_negotiate(cam->pport, cam->ppmode|IEEE1284_ADDR) != 0 )|| 893 893 (parport_write(cam->pport, &addr, 1) != 1 )|| ··· 906 906 while(dleft > 0) 907 907 { 908 908 unsigned long tsize = (dleft > W9966_RBUFFER) ? W9966_RBUFFER : dleft; 909 - 909 + 910 910 if (parport_read(cam->pport, tbuf, tsize) < tsize) { 911 911 count = -EFAULT; 912 912 goto out; ··· 933 933 static void w9966_attach(struct parport *port) 934 934 { 935 935 int i; 936 - 936 + 937 937 for (i = 0; i < W9966_MAXCAMS; i++) 938 938 { 939 939 if (w9966_cams[i].dev_state != 0) // Cam is already assigned
+465 -465
drivers/media/video/w9968cf.c
··· 71 71 static int ovmod_load = W9968CF_OVMOD_LOAD; 72 72 static unsigned short simcams = W9968CF_SIMCAMS; 73 73 static short video_nr[]={[0 ... W9968CF_MAX_DEVICES-1] = -1}; /*-1=first free*/ 74 - static unsigned int packet_size[] = {[0 ... W9968CF_MAX_DEVICES-1] = 75 - W9968CF_PACKET_SIZE}; 76 - static unsigned short max_buffers[] = {[0 ... W9968CF_MAX_DEVICES-1] = 77 - W9968CF_BUFFERS}; 78 - static int double_buffer[] = {[0 ... W9968CF_MAX_DEVICES-1] = 79 - W9968CF_DOUBLE_BUFFER}; 74 + static unsigned int packet_size[] = {[0 ... W9968CF_MAX_DEVICES-1] = 75 + W9968CF_PACKET_SIZE}; 76 + static unsigned short max_buffers[] = {[0 ... W9968CF_MAX_DEVICES-1] = 77 + W9968CF_BUFFERS}; 78 + static int double_buffer[] = {[0 ... W9968CF_MAX_DEVICES-1] = 79 + W9968CF_DOUBLE_BUFFER}; 80 80 static int clamping[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_CLAMPING}; 81 - static unsigned short filter_type[]= {[0 ... W9968CF_MAX_DEVICES-1] = 82 - W9968CF_FILTER_TYPE}; 81 + static unsigned short filter_type[]= {[0 ... W9968CF_MAX_DEVICES-1] = 82 + W9968CF_FILTER_TYPE}; 83 83 static int largeview[]= {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_LARGEVIEW}; 84 - static unsigned short decompression[] = {[0 ... W9968CF_MAX_DEVICES-1] = 85 - W9968CF_DECOMPRESSION}; 84 + static unsigned short decompression[] = {[0 ... W9968CF_MAX_DEVICES-1] = 85 + W9968CF_DECOMPRESSION}; 86 86 static int upscaling[]= {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_UPSCALING}; 87 87 static unsigned short force_palette[] = {[0 ... W9968CF_MAX_DEVICES-1] = 0}; 88 88 static int force_rgb[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_FORCE_RGB}; 89 89 static int autobright[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_AUTOBRIGHT}; 90 90 static int autoexp[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_AUTOEXP}; 91 - static unsigned short lightfreq[] = {[0 ... W9968CF_MAX_DEVICES-1] = 92 - W9968CF_LIGHTFREQ}; 91 + static unsigned short lightfreq[] = {[0 ... W9968CF_MAX_DEVICES-1] = 92 + W9968CF_LIGHTFREQ}; 93 93 static int bandingfilter[] = {[0 ... W9968CF_MAX_DEVICES-1]= 94 - W9968CF_BANDINGFILTER}; 94 + W9968CF_BANDINGFILTER}; 95 95 static short clockdiv[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_CLOCKDIV}; 96 96 static int backlight[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_BACKLIGHT}; 97 97 static int mirror[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_MIRROR}; 98 98 static int monochrome[] = {[0 ... W9968CF_MAX_DEVICES-1]=W9968CF_MONOCHROME}; 99 - static unsigned int brightness[] = {[0 ... W9968CF_MAX_DEVICES-1] = 100 - W9968CF_BRIGHTNESS}; 99 + static unsigned int brightness[] = {[0 ... W9968CF_MAX_DEVICES-1] = 100 + W9968CF_BRIGHTNESS}; 101 101 static unsigned int hue[] = {[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_HUE}; 102 102 static unsigned int colour[]={[0 ... W9968CF_MAX_DEVICES-1] = W9968CF_COLOUR}; 103 - static unsigned int contrast[] = {[0 ... W9968CF_MAX_DEVICES-1] = 104 - W9968CF_CONTRAST}; 105 - static unsigned int whiteness[] = {[0 ... W9968CF_MAX_DEVICES-1] = 106 - W9968CF_WHITENESS}; 103 + static unsigned int contrast[] = {[0 ... W9968CF_MAX_DEVICES-1] = 104 + W9968CF_CONTRAST}; 105 + static unsigned int whiteness[] = {[0 ... W9968CF_MAX_DEVICES-1] = 106 + W9968CF_WHITENESS}; 107 107 #ifdef W9968CF_DEBUG 108 108 static unsigned short debug = W9968CF_DEBUG_LEVEL; 109 109 static int specific_debug = W9968CF_SPECIFIC_DEBUG; ··· 145 145 #endif 146 146 147 147 #ifdef CONFIG_KMOD 148 - MODULE_PARM_DESC(ovmod_load, 149 - "\n<0|1> Automatic 'ovcamchip' module loading." 150 - "\n0 disabled, 1 enabled." 151 - "\nIf enabled,'insmod' searches for the required 'ovcamchip'" 152 - "\nmodule in the system, according to its configuration, and" 153 - "\nattempts to load that module automatically. This action is" 154 - "\nperformed once as soon as the 'w9968cf' module is loaded" 155 - "\ninto memory." 156 - "\nDefault value is "__MODULE_STRING(W9968CF_OVMOD_LOAD)"." 157 - "\n"); 148 + MODULE_PARM_DESC(ovmod_load, 149 + "\n<0|1> Automatic 'ovcamchip' module loading." 150 + "\n0 disabled, 1 enabled." 151 + "\nIf enabled,'insmod' searches for the required 'ovcamchip'" 152 + "\nmodule in the system, according to its configuration, and" 153 + "\nattempts to load that module automatically. This action is" 154 + "\nperformed once as soon as the 'w9968cf' module is loaded" 155 + "\ninto memory." 156 + "\nDefault value is "__MODULE_STRING(W9968CF_OVMOD_LOAD)"." 157 + "\n"); 158 158 #endif 159 - MODULE_PARM_DESC(simcams, 160 - "\n<n> Number of cameras allowed to stream simultaneously." 161 - "\nn may vary from 0 to " 162 - __MODULE_STRING(W9968CF_MAX_DEVICES)"." 163 - "\nDefault value is "__MODULE_STRING(W9968CF_SIMCAMS)"." 164 - "\n"); 159 + MODULE_PARM_DESC(simcams, 160 + "\n<n> Number of cameras allowed to stream simultaneously." 161 + "\nn may vary from 0 to " 162 + __MODULE_STRING(W9968CF_MAX_DEVICES)"." 163 + "\nDefault value is "__MODULE_STRING(W9968CF_SIMCAMS)"." 164 + "\n"); 165 165 MODULE_PARM_DESC(video_nr, 166 - "\n<-1|n[,...]> Specify V4L minor mode number." 167 - "\n -1 = use next available (default)" 168 - "\n n = use minor number n (integer >= 0)" 169 - "\nYou can specify up to "__MODULE_STRING(W9968CF_MAX_DEVICES) 170 - " cameras this way." 171 - "\nFor example:" 172 - "\nvideo_nr=-1,2,-1 would assign minor number 2 to" 173 - "\nthe second camera and use auto for the first" 174 - "\none and for every other camera." 175 - "\n"); 166 + "\n<-1|n[,...]> Specify V4L minor mode number." 167 + "\n -1 = use next available (default)" 168 + "\n n = use minor number n (integer >= 0)" 169 + "\nYou can specify up to "__MODULE_STRING(W9968CF_MAX_DEVICES) 170 + " cameras this way." 171 + "\nFor example:" 172 + "\nvideo_nr=-1,2,-1 would assign minor number 2 to" 173 + "\nthe second camera and use auto for the first" 174 + "\none and for every other camera." 175 + "\n"); 176 176 MODULE_PARM_DESC(packet_size, 177 - "\n<n[,...]> Specify the maximum data payload" 178 - "\nsize in bytes for alternate settings, for each device." 179 - "\nn is scaled between 63 and 1023 " 180 - "(default is "__MODULE_STRING(W9968CF_PACKET_SIZE)")." 181 - "\n"); 177 + "\n<n[,...]> Specify the maximum data payload" 178 + "\nsize in bytes for alternate settings, for each device." 179 + "\nn is scaled between 63 and 1023 " 180 + "(default is "__MODULE_STRING(W9968CF_PACKET_SIZE)")." 181 + "\n"); 182 182 MODULE_PARM_DESC(max_buffers, 183 - "\n<n[,...]> For advanced users." 184 - "\nSpecify the maximum number of video frame buffers" 185 - "\nto allocate for each device, from 2 to " 186 - __MODULE_STRING(W9968CF_MAX_BUFFERS) 187 - ". (default is "__MODULE_STRING(W9968CF_BUFFERS)")." 188 - "\n"); 189 - MODULE_PARM_DESC(double_buffer, 190 - "\n<0|1[,...]> " 191 - "Hardware double buffering: 0 disabled, 1 enabled." 192 - "\nIt should be enabled if you want smooth video output: if" 193 - "\nyou obtain out of sync. video, disable it, or try to" 194 - "\ndecrease the 'clockdiv' module parameter value." 195 - "\nDefault value is "__MODULE_STRING(W9968CF_DOUBLE_BUFFER) 196 - " for every device." 197 - "\n"); 198 - MODULE_PARM_DESC(clamping, 199 - "\n<0|1[,...]> Video data clamping: 0 disabled, 1 enabled." 200 - "\nDefault value is "__MODULE_STRING(W9968CF_CLAMPING) 201 - " for every device." 202 - "\n"); 203 - MODULE_PARM_DESC(filter_type, 204 - "\n<0|1|2[,...]> Video filter type." 205 - "\n0 none, 1 (1-2-1) 3-tap filter, " 206 - "2 (2-3-6-3-2) 5-tap filter." 207 - "\nDefault value is "__MODULE_STRING(W9968CF_FILTER_TYPE) 208 - " for every device." 209 - "\nThe filter is used to reduce noise and aliasing artifacts" 210 - "\nproduced by the CCD or CMOS image sensor, and the scaling" 211 - " process." 212 - "\n"); 213 - MODULE_PARM_DESC(largeview, 214 - "\n<0|1[,...]> Large view: 0 disabled, 1 enabled." 215 - "\nDefault value is "__MODULE_STRING(W9968CF_LARGEVIEW) 216 - " for every device." 217 - "\n"); 218 - MODULE_PARM_DESC(upscaling, 219 - "\n<0|1[,...]> Software scaling (for non-compressed video):" 220 - "\n0 disabled, 1 enabled." 221 - "\nDisable it if you have a slow CPU or you don't have" 222 - " enough memory." 223 - "\nDefault value is "__MODULE_STRING(W9968CF_UPSCALING) 224 - " for every device." 225 - "\nIf 'w9968cf-vpp' is not present, this parameter is" 226 - " set to 0." 227 - "\n"); 183 + "\n<n[,...]> For advanced users." 184 + "\nSpecify the maximum number of video frame buffers" 185 + "\nto allocate for each device, from 2 to " 186 + __MODULE_STRING(W9968CF_MAX_BUFFERS) 187 + ". (default is "__MODULE_STRING(W9968CF_BUFFERS)")." 188 + "\n"); 189 + MODULE_PARM_DESC(double_buffer, 190 + "\n<0|1[,...]> " 191 + "Hardware double buffering: 0 disabled, 1 enabled." 192 + "\nIt should be enabled if you want smooth video output: if" 193 + "\nyou obtain out of sync. video, disable it, or try to" 194 + "\ndecrease the 'clockdiv' module parameter value." 195 + "\nDefault value is "__MODULE_STRING(W9968CF_DOUBLE_BUFFER) 196 + " for every device." 197 + "\n"); 198 + MODULE_PARM_DESC(clamping, 199 + "\n<0|1[,...]> Video data clamping: 0 disabled, 1 enabled." 200 + "\nDefault value is "__MODULE_STRING(W9968CF_CLAMPING) 201 + " for every device." 202 + "\n"); 203 + MODULE_PARM_DESC(filter_type, 204 + "\n<0|1|2[,...]> Video filter type." 205 + "\n0 none, 1 (1-2-1) 3-tap filter, " 206 + "2 (2-3-6-3-2) 5-tap filter." 207 + "\nDefault value is "__MODULE_STRING(W9968CF_FILTER_TYPE) 208 + " for every device." 209 + "\nThe filter is used to reduce noise and aliasing artifacts" 210 + "\nproduced by the CCD or CMOS image sensor, and the scaling" 211 + " process." 212 + "\n"); 213 + MODULE_PARM_DESC(largeview, 214 + "\n<0|1[,...]> Large view: 0 disabled, 1 enabled." 215 + "\nDefault value is "__MODULE_STRING(W9968CF_LARGEVIEW) 216 + " for every device." 217 + "\n"); 218 + MODULE_PARM_DESC(upscaling, 219 + "\n<0|1[,...]> Software scaling (for non-compressed video):" 220 + "\n0 disabled, 1 enabled." 221 + "\nDisable it if you have a slow CPU or you don't have" 222 + " enough memory." 223 + "\nDefault value is "__MODULE_STRING(W9968CF_UPSCALING) 224 + " for every device." 225 + "\nIf 'w9968cf-vpp' is not present, this parameter is" 226 + " set to 0." 227 + "\n"); 228 228 MODULE_PARM_DESC(decompression, 229 - "\n<0|1|2[,...]> Software video decompression:" 230 - "\n- 0 disables decompression (doesn't allow formats needing" 231 - " decompression)" 232 - "\n- 1 forces decompression (allows formats needing" 233 - " decompression only);" 234 - "\n- 2 allows any permitted formats." 235 - "\nFormats supporting compressed video are YUV422P and" 236 - " YUV420P/YUV420 " 237 - "\nin any resolutions where both width and height are " 238 - "a multiple of 16." 239 - "\nDefault value is "__MODULE_STRING(W9968CF_DECOMPRESSION) 240 - " for every device." 241 - "\nIf 'w9968cf-vpp' is not present, forcing decompression is " 242 - "\nnot allowed; in this case this parameter is set to 2." 243 - "\n"); 229 + "\n<0|1|2[,...]> Software video decompression:" 230 + "\n- 0 disables decompression (doesn't allow formats needing" 231 + " decompression)" 232 + "\n- 1 forces decompression (allows formats needing" 233 + " decompression only);" 234 + "\n- 2 allows any permitted formats." 235 + "\nFormats supporting compressed video are YUV422P and" 236 + " YUV420P/YUV420 " 237 + "\nin any resolutions where both width and height are " 238 + "a multiple of 16." 239 + "\nDefault value is "__MODULE_STRING(W9968CF_DECOMPRESSION) 240 + " for every device." 241 + "\nIf 'w9968cf-vpp' is not present, forcing decompression is " 242 + "\nnot allowed; in this case this parameter is set to 2." 243 + "\n"); 244 244 MODULE_PARM_DESC(force_palette, 245 - "\n<0" 246 - "|" __MODULE_STRING(VIDEO_PALETTE_UYVY) 247 - "|" __MODULE_STRING(VIDEO_PALETTE_YUV420) 248 - "|" __MODULE_STRING(VIDEO_PALETTE_YUV422P) 249 - "|" __MODULE_STRING(VIDEO_PALETTE_YUV420P) 250 - "|" __MODULE_STRING(VIDEO_PALETTE_YUYV) 251 - "|" __MODULE_STRING(VIDEO_PALETTE_YUV422) 252 - "|" __MODULE_STRING(VIDEO_PALETTE_GREY) 253 - "|" __MODULE_STRING(VIDEO_PALETTE_RGB555) 254 - "|" __MODULE_STRING(VIDEO_PALETTE_RGB565) 255 - "|" __MODULE_STRING(VIDEO_PALETTE_RGB24) 256 - "|" __MODULE_STRING(VIDEO_PALETTE_RGB32) 257 - "[,...]>" 258 - " Force picture palette." 259 - "\nIn order:" 260 - "\n- 0 allows any of the following formats:" 261 - "\n- UYVY 16 bpp - Original video, compression disabled" 262 - "\n- YUV420 12 bpp - Original video, compression enabled" 263 - "\n- YUV422P 16 bpp - Original video, compression enabled" 264 - "\n- YUV420P 12 bpp - Original video, compression enabled" 265 - "\n- YUVY 16 bpp - Software conversion from UYVY" 266 - "\n- YUV422 16 bpp - Software conversion from UYVY" 267 - "\n- GREY 8 bpp - Software conversion from UYVY" 268 - "\n- RGB555 16 bpp - Software conversion from UYVY" 269 - "\n- RGB565 16 bpp - Software conversion from UYVY" 270 - "\n- RGB24 24 bpp - Software conversion from UYVY" 271 - "\n- RGB32 32 bpp - Software conversion from UYVY" 272 - "\nWhen not 0, this parameter will override 'decompression'." 273 - "\nDefault value is 0 for every device." 274 - "\nInitial palette is " 275 - __MODULE_STRING(W9968CF_PALETTE_DECOMP_ON)"." 276 - "\nIf 'w9968cf-vpp' is not present, this parameter is" 277 - " set to 9 (UYVY)." 278 - "\n"); 279 - MODULE_PARM_DESC(force_rgb, 280 - "\n<0|1[,...]> Read RGB video data instead of BGR:" 281 - "\n 1 = use RGB component ordering." 282 - "\n 0 = use BGR component ordering." 283 - "\nThis parameter has effect when using RGBX palettes only." 284 - "\nDefault value is "__MODULE_STRING(W9968CF_FORCE_RGB) 285 - " for every device." 286 - "\n"); 245 + "\n<0" 246 + "|" __MODULE_STRING(VIDEO_PALETTE_UYVY) 247 + "|" __MODULE_STRING(VIDEO_PALETTE_YUV420) 248 + "|" __MODULE_STRING(VIDEO_PALETTE_YUV422P) 249 + "|" __MODULE_STRING(VIDEO_PALETTE_YUV420P) 250 + "|" __MODULE_STRING(VIDEO_PALETTE_YUYV) 251 + "|" __MODULE_STRING(VIDEO_PALETTE_YUV422) 252 + "|" __MODULE_STRING(VIDEO_PALETTE_GREY) 253 + "|" __MODULE_STRING(VIDEO_PALETTE_RGB555) 254 + "|" __MODULE_STRING(VIDEO_PALETTE_RGB565) 255 + "|" __MODULE_STRING(VIDEO_PALETTE_RGB24) 256 + "|" __MODULE_STRING(VIDEO_PALETTE_RGB32) 257 + "[,...]>" 258 + " Force picture palette." 259 + "\nIn order:" 260 + "\n- 0 allows any of the following formats:" 261 + "\n- UYVY 16 bpp - Original video, compression disabled" 262 + "\n- YUV420 12 bpp - Original video, compression enabled" 263 + "\n- YUV422P 16 bpp - Original video, compression enabled" 264 + "\n- YUV420P 12 bpp - Original video, compression enabled" 265 + "\n- YUVY 16 bpp - Software conversion from UYVY" 266 + "\n- YUV422 16 bpp - Software conversion from UYVY" 267 + "\n- GREY 8 bpp - Software conversion from UYVY" 268 + "\n- RGB555 16 bpp - Software conversion from UYVY" 269 + "\n- RGB565 16 bpp - Software conversion from UYVY" 270 + "\n- RGB24 24 bpp - Software conversion from UYVY" 271 + "\n- RGB32 32 bpp - Software conversion from UYVY" 272 + "\nWhen not 0, this parameter will override 'decompression'." 273 + "\nDefault value is 0 for every device." 274 + "\nInitial palette is " 275 + __MODULE_STRING(W9968CF_PALETTE_DECOMP_ON)"." 276 + "\nIf 'w9968cf-vpp' is not present, this parameter is" 277 + " set to 9 (UYVY)." 278 + "\n"); 279 + MODULE_PARM_DESC(force_rgb, 280 + "\n<0|1[,...]> Read RGB video data instead of BGR:" 281 + "\n 1 = use RGB component ordering." 282 + "\n 0 = use BGR component ordering." 283 + "\nThis parameter has effect when using RGBX palettes only." 284 + "\nDefault value is "__MODULE_STRING(W9968CF_FORCE_RGB) 285 + " for every device." 286 + "\n"); 287 287 MODULE_PARM_DESC(autobright, 288 - "\n<0|1[,...]> Image sensor automatically changes brightness:" 289 - "\n 0 = no, 1 = yes" 290 - "\nDefault value is "__MODULE_STRING(W9968CF_AUTOBRIGHT) 291 - " for every device." 292 - "\n"); 288 + "\n<0|1[,...]> Image sensor automatically changes brightness:" 289 + "\n 0 = no, 1 = yes" 290 + "\nDefault value is "__MODULE_STRING(W9968CF_AUTOBRIGHT) 291 + " for every device." 292 + "\n"); 293 293 MODULE_PARM_DESC(autoexp, 294 - "\n<0|1[,...]> Image sensor automatically changes exposure:" 295 - "\n 0 = no, 1 = yes" 296 - "\nDefault value is "__MODULE_STRING(W9968CF_AUTOEXP) 297 - " for every device." 298 - "\n"); 294 + "\n<0|1[,...]> Image sensor automatically changes exposure:" 295 + "\n 0 = no, 1 = yes" 296 + "\nDefault value is "__MODULE_STRING(W9968CF_AUTOEXP) 297 + " for every device." 298 + "\n"); 299 299 MODULE_PARM_DESC(lightfreq, 300 - "\n<50|60[,...]> Light frequency in Hz:" 301 - "\n 50 for European and Asian lighting," 302 - " 60 for American lighting." 303 - "\nDefault value is "__MODULE_STRING(W9968CF_LIGHTFREQ) 304 - " for every device." 305 - "\n"); 300 + "\n<50|60[,...]> Light frequency in Hz:" 301 + "\n 50 for European and Asian lighting," 302 + " 60 for American lighting." 303 + "\nDefault value is "__MODULE_STRING(W9968CF_LIGHTFREQ) 304 + " for every device." 305 + "\n"); 306 306 MODULE_PARM_DESC(bandingfilter, 307 - "\n<0|1[,...]> Banding filter to reduce effects of" 308 - " fluorescent lighting:" 309 - "\n 0 disabled, 1 enabled." 310 - "\nThis filter tries to reduce the pattern of horizontal" 311 - "\nlight/dark bands caused by some (usually fluorescent)" 312 - " lighting." 313 - "\nDefault value is "__MODULE_STRING(W9968CF_BANDINGFILTER) 314 - " for every device." 315 - "\n"); 307 + "\n<0|1[,...]> Banding filter to reduce effects of" 308 + " fluorescent lighting:" 309 + "\n 0 disabled, 1 enabled." 310 + "\nThis filter tries to reduce the pattern of horizontal" 311 + "\nlight/dark bands caused by some (usually fluorescent)" 312 + " lighting." 313 + "\nDefault value is "__MODULE_STRING(W9968CF_BANDINGFILTER) 314 + " for every device." 315 + "\n"); 316 316 MODULE_PARM_DESC(clockdiv, 317 - "\n<-1|n[,...]> " 318 - "Force pixel clock divisor to a specific value (for experts):" 319 - "\n n may vary from 0 to 127." 320 - "\n -1 for automatic value." 321 - "\nSee also the 'double_buffer' module parameter." 322 - "\nDefault value is "__MODULE_STRING(W9968CF_CLOCKDIV) 323 - " for every device." 324 - "\n"); 317 + "\n<-1|n[,...]> " 318 + "Force pixel clock divisor to a specific value (for experts):" 319 + "\n n may vary from 0 to 127." 320 + "\n -1 for automatic value." 321 + "\nSee also the 'double_buffer' module parameter." 322 + "\nDefault value is "__MODULE_STRING(W9968CF_CLOCKDIV) 323 + " for every device." 324 + "\n"); 325 325 MODULE_PARM_DESC(backlight, 326 - "\n<0|1[,...]> Objects are lit from behind:" 327 - "\n 0 = no, 1 = yes" 328 - "\nDefault value is "__MODULE_STRING(W9968CF_BACKLIGHT) 329 - " for every device." 330 - "\n"); 326 + "\n<0|1[,...]> Objects are lit from behind:" 327 + "\n 0 = no, 1 = yes" 328 + "\nDefault value is "__MODULE_STRING(W9968CF_BACKLIGHT) 329 + " for every device." 330 + "\n"); 331 331 MODULE_PARM_DESC(mirror, 332 - "\n<0|1[,...]> Reverse image horizontally:" 333 - "\n 0 = no, 1 = yes" 334 - "\nDefault value is "__MODULE_STRING(W9968CF_MIRROR) 335 - " for every device." 336 - "\n"); 332 + "\n<0|1[,...]> Reverse image horizontally:" 333 + "\n 0 = no, 1 = yes" 334 + "\nDefault value is "__MODULE_STRING(W9968CF_MIRROR) 335 + " for every device." 336 + "\n"); 337 337 MODULE_PARM_DESC(monochrome, 338 - "\n<0|1[,...]> Use image sensor as monochrome sensor:" 339 - "\n 0 = no, 1 = yes" 340 - "\nNot all the sensors support monochrome color." 341 - "\nDefault value is "__MODULE_STRING(W9968CF_MONOCHROME) 342 - " for every device." 343 - "\n"); 344 - MODULE_PARM_DESC(brightness, 345 - "\n<n[,...]> Set picture brightness (0-65535)." 346 - "\nDefault value is "__MODULE_STRING(W9968CF_BRIGHTNESS) 347 - " for every device." 348 - "\nThis parameter has no effect if 'autobright' is enabled." 349 - "\n"); 350 - MODULE_PARM_DESC(hue, 351 - "\n<n[,...]> Set picture hue (0-65535)." 352 - "\nDefault value is "__MODULE_STRING(W9968CF_HUE) 353 - " for every device." 354 - "\n"); 355 - MODULE_PARM_DESC(colour, 356 - "\n<n[,...]> Set picture saturation (0-65535)." 357 - "\nDefault value is "__MODULE_STRING(W9968CF_COLOUR) 358 - " for every device." 359 - "\n"); 360 - MODULE_PARM_DESC(contrast, 361 - "\n<n[,...]> Set picture contrast (0-65535)." 362 - "\nDefault value is "__MODULE_STRING(W9968CF_CONTRAST) 363 - " for every device." 364 - "\n"); 365 - MODULE_PARM_DESC(whiteness, 366 - "\n<n[,...]> Set picture whiteness (0-65535)." 367 - "\nDefault value is "__MODULE_STRING(W9968CF_WHITENESS) 368 - " for every device." 369 - "\n"); 338 + "\n<0|1[,...]> Use image sensor as monochrome sensor:" 339 + "\n 0 = no, 1 = yes" 340 + "\nNot all the sensors support monochrome color." 341 + "\nDefault value is "__MODULE_STRING(W9968CF_MONOCHROME) 342 + " for every device." 343 + "\n"); 344 + MODULE_PARM_DESC(brightness, 345 + "\n<n[,...]> Set picture brightness (0-65535)." 346 + "\nDefault value is "__MODULE_STRING(W9968CF_BRIGHTNESS) 347 + " for every device." 348 + "\nThis parameter has no effect if 'autobright' is enabled." 349 + "\n"); 350 + MODULE_PARM_DESC(hue, 351 + "\n<n[,...]> Set picture hue (0-65535)." 352 + "\nDefault value is "__MODULE_STRING(W9968CF_HUE) 353 + " for every device." 354 + "\n"); 355 + MODULE_PARM_DESC(colour, 356 + "\n<n[,...]> Set picture saturation (0-65535)." 357 + "\nDefault value is "__MODULE_STRING(W9968CF_COLOUR) 358 + " for every device." 359 + "\n"); 360 + MODULE_PARM_DESC(contrast, 361 + "\n<n[,...]> Set picture contrast (0-65535)." 362 + "\nDefault value is "__MODULE_STRING(W9968CF_CONTRAST) 363 + " for every device." 364 + "\n"); 365 + MODULE_PARM_DESC(whiteness, 366 + "\n<n[,...]> Set picture whiteness (0-65535)." 367 + "\nDefault value is "__MODULE_STRING(W9968CF_WHITENESS) 368 + " for every device." 369 + "\n"); 370 370 #ifdef W9968CF_DEBUG 371 371 MODULE_PARM_DESC(debug, 372 - "\n<n> Debugging information level, from 0 to 6:" 373 - "\n0 = none (use carefully)" 374 - "\n1 = critical errors" 375 - "\n2 = significant informations" 376 - "\n3 = configuration or general messages" 377 - "\n4 = warnings" 378 - "\n5 = called functions" 379 - "\n6 = function internals" 380 - "\nLevel 5 and 6 are useful for testing only, when only " 381 - "one device is used." 382 - "\nDefault value is "__MODULE_STRING(W9968CF_DEBUG_LEVEL)"." 383 - "\n"); 372 + "\n<n> Debugging information level, from 0 to 6:" 373 + "\n0 = none (use carefully)" 374 + "\n1 = critical errors" 375 + "\n2 = significant informations" 376 + "\n3 = configuration or general messages" 377 + "\n4 = warnings" 378 + "\n5 = called functions" 379 + "\n6 = function internals" 380 + "\nLevel 5 and 6 are useful for testing only, when only " 381 + "one device is used." 382 + "\nDefault value is "__MODULE_STRING(W9968CF_DEBUG_LEVEL)"." 383 + "\n"); 384 384 MODULE_PARM_DESC(specific_debug, 385 - "\n<0|1> Enable or disable specific debugging messages:" 386 - "\n0 = print messages concerning every level" 387 - " <= 'debug' level." 388 - "\n1 = print messages concerning the level" 389 - " indicated by 'debug'." 390 - "\nDefault value is " 391 - __MODULE_STRING(W9968CF_SPECIFIC_DEBUG)"." 392 - "\n"); 385 + "\n<0|1> Enable or disable specific debugging messages:" 386 + "\n0 = print messages concerning every level" 387 + " <= 'debug' level." 388 + "\n1 = print messages concerning the level" 389 + " indicated by 'debug'." 390 + "\nDefault value is " 391 + __MODULE_STRING(W9968CF_SPECIFIC_DEBUG)"." 392 + "\n"); 393 393 #endif /* W9968CF_DEBUG */ 394 394 395 395 ··· 406 406 static int w9968cf_ioctl(struct inode*, struct file*, unsigned, unsigned long); 407 407 static ssize_t w9968cf_read(struct file*, char __user *, size_t, loff_t*); 408 408 static int w9968cf_v4l_ioctl(struct inode*, struct file*, unsigned int, 409 - void __user *); 409 + void __user *); 410 410 411 411 /* USB-specific */ 412 412 static int w9968cf_start_transfer(struct w9968cf_device*); ··· 428 428 static int w9968cf_smbus_read_ack(struct w9968cf_device*); 429 429 static int w9968cf_smbus_refresh_bus(struct w9968cf_device*); 430 430 static int w9968cf_i2c_adap_read_byte(struct w9968cf_device* cam, 431 - u16 address, u8* value); 432 - static int w9968cf_i2c_adap_read_byte_data(struct w9968cf_device*, u16 address, 433 - u8 subaddress, u8* value); 431 + u16 address, u8* value); 432 + static int w9968cf_i2c_adap_read_byte_data(struct w9968cf_device*, u16 address, 433 + u8 subaddress, u8* value); 434 434 static int w9968cf_i2c_adap_write_byte(struct w9968cf_device*, 435 - u16 address, u8 subaddress); 435 + u16 address, u8 subaddress); 436 436 static int w9968cf_i2c_adap_fastwrite_byte_data(struct w9968cf_device*, 437 - u16 address, u8 subaddress, 438 - u8 value); 437 + u16 address, u8 subaddress, 438 + u8 value); 439 439 440 440 /* I2C interface to kernel */ 441 441 static int w9968cf_i2c_init(struct w9968cf_device*); 442 - static int w9968cf_i2c_smbus_xfer(struct i2c_adapter*, u16 addr, 443 - unsigned short flags, char read_write, 444 - u8 command, int size, union i2c_smbus_data*); 442 + static int w9968cf_i2c_smbus_xfer(struct i2c_adapter*, u16 addr, 443 + unsigned short flags, char read_write, 444 + u8 command, int size, union i2c_smbus_data*); 445 445 static u32 w9968cf_i2c_func(struct i2c_adapter*); 446 446 static int w9968cf_i2c_attach_inform(struct i2c_client*); 447 447 static int w9968cf_i2c_detach_inform(struct i2c_client*); 448 448 static int w9968cf_i2c_control(struct i2c_adapter*, unsigned int cmd, 449 - unsigned long arg); 449 + unsigned long arg); 450 450 451 451 /* Memory management */ 452 452 static void* rvmalloc(unsigned long size); ··· 458 458 static int w9968cf_sensor_set_control(struct w9968cf_device*,int cid,int val); 459 459 static int w9968cf_sensor_get_control(struct w9968cf_device*,int cid,int *val); 460 460 static int w9968cf_sensor_cmd(struct w9968cf_device*, 461 - unsigned int cmd, void *arg); 461 + unsigned int cmd, void *arg); 462 462 static int w9968cf_sensor_init(struct w9968cf_device*); 463 463 static int w9968cf_sensor_update_settings(struct w9968cf_device*); 464 464 static int w9968cf_sensor_get_picture(struct w9968cf_device*); 465 - static int w9968cf_sensor_update_picture(struct w9968cf_device*, 466 - struct video_picture pict); 465 + static int w9968cf_sensor_update_picture(struct w9968cf_device*, 466 + struct video_picture pict); 467 467 468 468 /* Other helper functions */ 469 469 static void w9968cf_configure_camera(struct w9968cf_device*,struct usb_device*, 470 - enum w9968cf_model_id, 471 - const unsigned short dev_nr); 470 + enum w9968cf_model_id, 471 + const unsigned short dev_nr); 472 472 static void w9968cf_adjust_configuration(struct w9968cf_device*); 473 473 static int w9968cf_turn_on_led(struct w9968cf_device*); 474 474 static int w9968cf_init_chip(struct w9968cf_device*); ··· 477 477 static inline u8 w9968cf_need_decompression(u16 palette); 478 478 static int w9968cf_set_picture(struct w9968cf_device*, struct video_picture); 479 479 static int w9968cf_set_window(struct w9968cf_device*, struct video_window); 480 - static int w9968cf_postprocess_frame(struct w9968cf_device*, 481 - struct w9968cf_frame_t*); 480 + static int w9968cf_postprocess_frame(struct w9968cf_device*, 481 + struct w9968cf_frame_t*); 482 482 static int w9968cf_adjust_window_size(struct w9968cf_device*, u16* w, u16* h); 483 483 static void w9968cf_init_framelist(struct w9968cf_device*); 484 484 static void w9968cf_push_frame(struct w9968cf_device*, u8 f_num); ··· 497 497 const char *name; 498 498 }; 499 499 500 - /*-------------------------------------------------------------------------- 500 + /*-------------------------------------------------------------------------- 501 501 Returns the name of the matching element in the symbolic_list array. The 502 502 end of the list must be marked with an element that has a NULL name. 503 503 --------------------------------------------------------------------------*/ 504 - static inline const char * 504 + static inline const char * 505 505 symbolic(struct w9968cf_symbolic_list list[], const int num) 506 506 { 507 507 int i; ··· 568 568 static struct w9968cf_symbolic_list decoder_errlist[] = { 569 569 { W9968CF_DEC_ERR_CORRUPTED_DATA, "Corrupted data" }, 570 570 { W9968CF_DEC_ERR_BUF_OVERFLOW, "Buffer overflow" }, 571 - { W9968CF_DEC_ERR_NO_SOI, "SOI marker not found" }, 571 + { W9968CF_DEC_ERR_NO_SOI, "SOI marker not found" }, 572 572 { W9968CF_DEC_ERR_NO_SOF0, "SOF0 marker not found" }, 573 573 { W9968CF_DEC_ERR_NO_SOS, "SOS marker not found" }, 574 574 { W9968CF_DEC_ERR_NO_EOI, "EOI marker not found" }, ··· 695 695 bpp = (w9968cf_vpp) ? 4 : 2; 696 696 if (cam->upscaling) 697 697 vpp_bufsize = max(W9968CF_MAX_WIDTH*W9968CF_MAX_HEIGHT*bpp, 698 - cam->maxwidth*cam->maxheight*bpp); 698 + cam->maxwidth*cam->maxheight*bpp); 699 699 else 700 700 vpp_bufsize = cam->maxwidth*cam->maxheight*bpp; 701 701 ··· 704 704 if (!(cam->transfer_buffer[i] = 705 705 kzalloc(W9968CF_ISO_PACKETS*p_size, GFP_KERNEL))) { 706 706 DBG(1, "Couldn't allocate memory for the isochronous " 707 - "transfer buffers (%u bytes)", 707 + "transfer buffers (%u bytes)", 708 708 p_size * W9968CF_ISO_PACKETS) 709 709 return -ENOMEM; 710 710 } ··· 780 780 of the next video frame; if an error is encountered in a packet, the entire 781 781 video frame is discarded and grabbed again. 782 782 If there are no requested frames in the FIFO list, packets are collected into 783 - a temporary buffer. 783 + a temporary buffer. 784 784 --------------------------------------------------------------------------*/ 785 785 static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs) 786 786 { ··· 799 799 /* "(*f)" will be used instead of "cam->frame_current" */ 800 800 f = &cam->frame_current; 801 801 802 - /* If a frame has been requested and we are grabbing into 802 + /* If a frame has been requested and we are grabbing into 803 803 the temporary frame, we'll switch to that requested frame */ 804 804 if ((*f) == &cam->frame_tmp && *cam->requested_frame) { 805 805 if (cam->frame_tmp.status == F_GRABBING) { ··· 808 808 (*f)->length = cam->frame_tmp.length; 809 809 memcpy((*f)->buffer, cam->frame_tmp.buffer, 810 810 (*f)->length); 811 - DBG(6, "Switched from temp. frame to frame #%d", 811 + DBG(6, "Switched from temp. frame to frame #%d", 812 812 (*f)->number) 813 813 } 814 814 } ··· 850 850 851 851 if (cam->vpp_flag & VPP_DECOMPRESSION) { 852 852 err = w9968cf_vpp->check_headers((*f)->buffer, 853 - (*f)->length); 853 + (*f)->length); 854 854 if (err) { 855 855 DBG(4, "Skip corrupted frame: %s", 856 856 symbolic(decoder_errlist, err)) ··· 975 975 cam->frame_current = &cam->frame_tmp; 976 976 977 977 if (!(cam->vpp_flag & VPP_DECOMPRESSION)) 978 - DBG(5, "Isochronous transfer size: %lu bytes/frame", 978 + DBG(5, "Isochronous transfer size: %lu bytes/frame", 979 979 (unsigned long)t_size*2) 980 980 981 981 DBG(5, "Starting the isochronous transfer...") ··· 992 992 usb_free_urb(cam->urb[j]); 993 993 } 994 994 DBG(1, "Couldn't send a transfer request to the " 995 - "USB core (error #%d, %s)", err, 995 + "USB core (error #%d, %s)", err, 996 996 symbolic(urb_errlist, err)) 997 997 return err; 998 998 } ··· 1016 1016 if (!cam->streaming) 1017 1017 return 0; 1018 1018 1019 - /* This avoids race conditions with usb_submit_urb() 1019 + /* This avoids race conditions with usb_submit_urb() 1020 1020 in the URB completition handler */ 1021 1021 spin_lock_irqsave(&cam->urb_lock, lock_flags); 1022 1022 cam->streaming = 0; ··· 1050 1050 1051 1051 1052 1052 /*-------------------------------------------------------------------------- 1053 - Write a W9968CF register. 1053 + Write a W9968CF register. 1054 1054 Return 0 on success, -1 otherwise. 1055 1055 --------------------------------------------------------------------------*/ 1056 1056 static int w9968cf_write_reg(struct w9968cf_device* cam, u16 value, u16 index) ··· 1059 1059 int res; 1060 1060 1061 1061 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0, 1062 - USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, 1063 - value, index, NULL, 0, W9968CF_USB_CTRL_TIMEOUT); 1062 + USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, 1063 + value, index, NULL, 0, W9968CF_USB_CTRL_TIMEOUT); 1064 1064 1065 1065 if (res < 0) 1066 1066 DBG(4, "Failed to write a register " ··· 1072 1072 1073 1073 1074 1074 /*-------------------------------------------------------------------------- 1075 - Read a W9968CF register. 1075 + Read a W9968CF register. 1076 1076 Return the register value on success, -1 otherwise. 1077 1077 --------------------------------------------------------------------------*/ 1078 1078 static int w9968cf_read_reg(struct w9968cf_device* cam, u16 index) ··· 1082 1082 int res; 1083 1083 1084 1084 res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 1, 1085 - USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 1086 - 0, index, buff, 2, W9968CF_USB_CTRL_TIMEOUT); 1085 + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 1086 + 0, index, buff, 2, W9968CF_USB_CTRL_TIMEOUT); 1087 1087 1088 1088 if (res < 0) 1089 1089 DBG(4, "Failed to read a register " ··· 1107 1107 value = *data++; 1108 1108 1109 1109 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0, 1110 - USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, 1111 - value, 0x06, data, 6, W9968CF_USB_CTRL_TIMEOUT); 1110 + USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, 1111 + value, 0x06, data, 6, W9968CF_USB_CTRL_TIMEOUT); 1112 1112 1113 1113 if (res < 0) 1114 1114 DBG(4, "Failed to write the FSB registers " ··· 1287 1287 1288 1288 1289 1289 /* SMBus protocol: S Addr Wr [A] Subaddr [A] Value [A] P */ 1290 - static int 1291 - w9968cf_i2c_adap_fastwrite_byte_data(struct w9968cf_device* cam, 1292 - u16 address, u8 subaddress,u8 value) 1290 + static int 1291 + w9968cf_i2c_adap_fastwrite_byte_data(struct w9968cf_device* cam, 1292 + u16 address, u8 subaddress,u8 value) 1293 1293 { 1294 1294 u16* data = cam->data_buffer; 1295 1295 int err = 0; ··· 1348 1348 "value 0x%02X", address, subaddress, value) 1349 1349 else 1350 1350 DBG(5, "I2C write byte data failed, addr.0x%04X, " 1351 - "subaddr.0x%02X, value 0x%02X", 1351 + "subaddr.0x%02X, value 0x%02X", 1352 1352 address, subaddress, value) 1353 1353 1354 1354 return err; ··· 1356 1356 1357 1357 1358 1358 /* SMBus protocol: S Addr Wr [A] Subaddr [A] P S Addr+1 Rd [A] [Value] NA P */ 1359 - static int 1360 - w9968cf_i2c_adap_read_byte_data(struct w9968cf_device* cam, 1361 - u16 address, u8 subaddress, 1362 - u8* value) 1359 + static int 1360 + w9968cf_i2c_adap_read_byte_data(struct w9968cf_device* cam, 1361 + u16 address, u8 subaddress, 1362 + u8* value) 1363 1363 { 1364 1364 int err = 0; 1365 1365 ··· 1384 1384 1385 1385 if (!err) 1386 1386 DBG(5, "I2C read byte data done, addr.0x%04X, " 1387 - "subaddr.0x%02X, value 0x%02X", 1387 + "subaddr.0x%02X, value 0x%02X", 1388 1388 address, subaddress, *value) 1389 1389 else 1390 1390 DBG(5, "I2C read byte data failed, addr.0x%04X, " ··· 1396 1396 1397 1397 1398 1398 /* SMBus protocol: S Addr+1 Rd [A] [Value] NA P */ 1399 - static int 1399 + static int 1400 1400 w9968cf_i2c_adap_read_byte(struct w9968cf_device* cam, 1401 - u16 address, u8* value) 1401 + u16 address, u8* value) 1402 1402 { 1403 1403 int err = 0; 1404 1404 ··· 1411 1411 err += w9968cf_smbus_read_byte(cam, value); 1412 1412 err += w9968cf_smbus_write_ack(cam); 1413 1413 err += w9968cf_smbus_stop(cam); 1414 - 1414 + 1415 1415 /* Serial data disable */ 1416 1416 err += w9968cf_write_sb(cam, 0x0000); 1417 1417 ··· 1427 1427 1428 1428 1429 1429 /* SMBus protocol: S Addr Wr [A] Value [A] P */ 1430 - static int 1430 + static int 1431 1431 w9968cf_i2c_adap_write_byte(struct w9968cf_device* cam, 1432 - u16 address, u8 value) 1432 + u16 address, u8 value) 1433 1433 { 1434 1434 DBG(4, "i2c_write_byte() is an unsupported transfer mode") 1435 1435 return -EINVAL; ··· 1442 1442 ****************************************************************************/ 1443 1443 1444 1444 static int 1445 - w9968cf_i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, 1446 - unsigned short flags, char read_write, u8 command, 1447 - int size, union i2c_smbus_data *data) 1445 + w9968cf_i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, 1446 + unsigned short flags, char read_write, u8 command, 1447 + int size, union i2c_smbus_data *data) 1448 1448 { 1449 1449 struct w9968cf_device* cam = i2c_get_adapdata(adapter); 1450 1450 u8 i; 1451 - int err = 0; 1451 + int err = 0; 1452 1452 1453 1453 switch (addr) { 1454 1454 case OV6xx0_SID: ··· 1464 1464 addr <<= 1; 1465 1465 1466 1466 if (read_write == I2C_SMBUS_WRITE) 1467 - err = w9968cf_i2c_adap_write_byte(cam, addr, command); 1468 - else if (read_write == I2C_SMBUS_READ) 1467 + err = w9968cf_i2c_adap_write_byte(cam, addr, command); 1468 + else if (read_write == I2C_SMBUS_READ) 1469 1469 err = w9968cf_i2c_adap_read_byte(cam,addr,&data->byte); 1470 1470 1471 1471 } else if (size == I2C_SMBUS_BYTE_DATA) { 1472 1472 addr <<= 1; 1473 1473 1474 1474 if (read_write == I2C_SMBUS_WRITE) 1475 - err = w9968cf_i2c_adap_fastwrite_byte_data(cam, addr, 1476 - command, data->byte); 1475 + err = w9968cf_i2c_adap_fastwrite_byte_data(cam, addr, 1476 + command, data->byte); 1477 1477 else if (read_write == I2C_SMBUS_READ) { 1478 1478 for (i = 1; i <= W9968CF_I2C_RW_RETRIES; i++) { 1479 1479 err = w9968cf_i2c_adap_read_byte_data(cam,addr, 1480 - command, &data->byte); 1480 + command, &data->byte); 1481 1481 if (err) { 1482 1482 if (w9968cf_smbus_refresh_bus(cam)) { 1483 1483 err = -EIO; ··· 1520 1520 return err; 1521 1521 } 1522 1522 } else { 1523 - DBG(4, "Rejected client [%s] with driver [%s]", 1523 + DBG(4, "Rejected client [%s] with driver [%s]", 1524 1524 client->name, client->driver->driver.name) 1525 1525 return -EINVAL; 1526 1526 } ··· 1545 1545 } 1546 1546 1547 1547 1548 - static int 1548 + static int 1549 1549 w9968cf_i2c_control(struct i2c_adapter* adapter, unsigned int cmd, 1550 - unsigned long arg) 1550 + unsigned long arg) 1551 1551 { 1552 1552 return 0; 1553 1553 } ··· 1625 1625 static int w9968cf_init_chip(struct w9968cf_device* cam) 1626 1626 { 1627 1627 unsigned long hw_bufsize = cam->maxwidth*cam->maxheight*2, 1628 - y0 = 0x0000, 1629 - u0 = y0 + hw_bufsize/2, 1630 - v0 = u0 + hw_bufsize/4, 1631 - y1 = v0 + hw_bufsize/4, 1632 - u1 = y1 + hw_bufsize/2, 1633 - v1 = u1 + hw_bufsize/4; 1628 + y0 = 0x0000, 1629 + u0 = y0 + hw_bufsize/2, 1630 + v0 = u0 + hw_bufsize/4, 1631 + y1 = v0 + hw_bufsize/4, 1632 + u1 = y1 + hw_bufsize/2, 1633 + v1 = u1 + hw_bufsize/4; 1634 1634 int err = 0; 1635 1635 1636 1636 err += w9968cf_write_reg(cam, 0xff00, 0x00); /* power off */ ··· 1762 1762 cam->vpp_flag = VPP_SWAP_YUV_BYTES; 1763 1763 hw_palette = VIDEO_PALETTE_UYVY; 1764 1764 break; 1765 - /* Original video is used instead of RGBX palettes. 1765 + /* Original video is used instead of RGBX palettes. 1766 1766 Software conversion later. */ 1767 1767 case VIDEO_PALETTE_GREY: 1768 1768 case VIDEO_PALETTE_RGB555: ··· 1777 1777 } 1778 1778 1779 1779 /* NOTE: due to memory issues, it is better to disable the hardware 1780 - double buffering during compression */ 1780 + double buffering during compression */ 1781 1781 if (cam->double_buffer && !(cam->vpp_flag & VPP_DECOMPRESSION)) 1782 1782 reg_v |= 0x0080; 1783 1783 ··· 1832 1832 #define __UNSC(x) ((x) >> 10) 1833 1833 1834 1834 /* Make sure we are using a supported resolution */ 1835 - if ((err = w9968cf_adjust_window_size(cam, (u16*)&win.width, 1836 - (u16*)&win.height))) 1835 + if ((err = w9968cf_adjust_window_size(cam, (u16*)&win.width, 1836 + (u16*)&win.height))) 1837 1837 goto error; 1838 1838 1839 1839 /* Scaling factors */ ··· 1962 1962 /* Settings changed, so we clear the frame buffers */ 1963 1963 memset(cam->frame[0].buffer, 0, cam->nbuffers*cam->frame[0].size); 1964 1964 1965 - DBG(4, "The capture area is %dx%d, Offset (x,y)=(%u,%u)", 1965 + DBG(4, "The capture area is %dx%d, Offset (x,y)=(%u,%u)", 1966 1966 win.width, win.height, win.x, win.y) 1967 1967 1968 1968 PDBGG("x=%u ,y=%u, w=%u, h=%u, ax=%u, ay=%u, s_win.x=%u, s_win.y=%u, " ··· 1978 1978 } 1979 1979 1980 1980 1981 - /*-------------------------------------------------------------------------- 1981 + /*-------------------------------------------------------------------------- 1982 1982 Adjust the asked values for window width and height. 1983 1983 Return 0 on success, -1 otherwise. 1984 1984 --------------------------------------------------------------------------*/ 1985 - static int 1985 + static int 1986 1986 w9968cf_adjust_window_size(struct w9968cf_device* cam, u16* width, u16* height) 1987 1987 { 1988 1988 u16 maxw, maxh; ··· 1992 1992 1993 1993 maxw = cam->upscaling && !(cam->vpp_flag & VPP_DECOMPRESSION) && 1994 1994 w9968cf_vpp ? max((u16)W9968CF_MAX_WIDTH, cam->maxwidth) 1995 - : cam->maxwidth; 1995 + : cam->maxwidth; 1996 1996 maxh = cam->upscaling && !(cam->vpp_flag & VPP_DECOMPRESSION) && 1997 1997 w9968cf_vpp ? max((u16)W9968CF_MAX_HEIGHT, cam->maxheight) 1998 - : cam->maxheight; 1998 + : cam->maxheight; 1999 1999 2000 2000 if (*width > maxw) 2001 2001 *width = maxw; ··· 2054 2054 Read, store and remove the first pointer in the FIFO list of requested 2055 2055 frames. This function is called in interrupt context. 2056 2056 --------------------------------------------------------------------------*/ 2057 - static void 2057 + static void 2058 2058 w9968cf_pop_frame(struct w9968cf_device* cam, struct w9968cf_frame_t** framep) 2059 2059 { 2060 2060 u8 i; ··· 2078 2078 High-level video post-processing routine on grabbed frames. 2079 2079 Return 0 on success, a negative number otherwise. 2080 2080 --------------------------------------------------------------------------*/ 2081 - static int 2082 - w9968cf_postprocess_frame(struct w9968cf_device* cam, 2083 - struct w9968cf_frame_t* fr) 2081 + static int 2082 + w9968cf_postprocess_frame(struct w9968cf_device* cam, 2083 + struct w9968cf_frame_t* fr) 2084 2084 { 2085 2085 void *pIn = fr->buffer, *pOut = cam->frame_vpp.buffer, *tmp; 2086 2086 u16 w = cam->window.width, ··· 2127 2127 w9968cf_vpp->uyvy_to_rgbx(pIn, fr->length, pOut, fmt, rgb); 2128 2128 fr->length = (w*h*d)/8; 2129 2129 _PSWAP(pIn, pOut) 2130 - DBG(6, "UYVY-16bit to %s conversion done", 2130 + DBG(6, "UYVY-16bit to %s conversion done", 2131 2131 symbolic(v4l1_plist, fmt)) 2132 2132 } 2133 2133 ··· 2143 2143 * Image sensor control routines * 2144 2144 ****************************************************************************/ 2145 2145 2146 - static int 2146 + static int 2147 2147 w9968cf_sensor_set_control(struct w9968cf_device* cam, int cid, int val) 2148 2148 { 2149 2149 struct ovcamchip_control ctl; ··· 2158 2158 } 2159 2159 2160 2160 2161 - static int 2161 + static int 2162 2162 w9968cf_sensor_get_control(struct w9968cf_device* cam, int cid, int* val) 2163 2163 { 2164 2164 struct ovcamchip_control ctl; ··· 2198 2198 int err = 0; 2199 2199 2200 2200 /* Auto brightness */ 2201 - err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_AUTOBRIGHT, 2202 - cam->auto_brt); 2201 + err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_AUTOBRIGHT, 2202 + cam->auto_brt); 2203 2203 if (err) 2204 2204 return err; 2205 2205 2206 2206 /* Auto exposure */ 2207 - err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_AUTOEXP, 2208 - cam->auto_exp); 2207 + err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_AUTOEXP, 2208 + cam->auto_exp); 2209 2209 if (err) 2210 2210 return err; 2211 2211 2212 2212 /* Banding filter */ 2213 - err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BANDFILT, 2214 - cam->bandfilt); 2213 + err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BANDFILT, 2214 + cam->bandfilt); 2215 2215 if (err) 2216 2216 return err; 2217 2217 2218 2218 /* Light frequency */ 2219 2219 err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_FREQ, 2220 - cam->lightfreq); 2220 + cam->lightfreq); 2221 2221 if (err) 2222 2222 return err; 2223 2223 2224 2224 /* Back light */ 2225 2225 err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BACKLIGHT, 2226 - cam->backlight); 2226 + cam->backlight); 2227 2227 if (err) 2228 2228 return err; 2229 2229 2230 2230 /* Mirror */ 2231 2231 err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_MIRROR, 2232 - cam->mirror); 2232 + cam->mirror); 2233 2233 if (err) 2234 2234 return err; 2235 2235 ··· 2281 2281 Returns: 0 on success, a negative number otherwise. 2282 2282 --------------------------------------------------------------------------*/ 2283 2283 static int 2284 - w9968cf_sensor_update_picture(struct w9968cf_device* cam, 2285 - struct video_picture pict) 2284 + w9968cf_sensor_update_picture(struct w9968cf_device* cam, 2285 + struct video_picture pict) 2286 2286 { 2287 2287 int err = 0; 2288 2288 2289 2289 if ((!cam->sensor_initialized) 2290 2290 || pict.contrast != cam->picture.contrast) { 2291 2291 err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_CONT, 2292 - pict.contrast); 2292 + pict.contrast); 2293 2293 if (err) 2294 2294 goto fail; 2295 2295 DBG(4, "Contrast changed from %u to %u", ··· 2297 2297 cam->picture.contrast = pict.contrast; 2298 2298 } 2299 2299 2300 - if (((!cam->sensor_initialized) || 2300 + if (((!cam->sensor_initialized) || 2301 2301 pict.brightness != cam->picture.brightness) && (!cam->auto_brt)) { 2302 - err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BRIGHT, 2303 - pict.brightness); 2302 + err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_BRIGHT, 2303 + pict.brightness); 2304 2304 if (err) 2305 2305 goto fail; 2306 2306 DBG(4, "Brightness changed from %u to %u", ··· 2309 2309 } 2310 2310 2311 2311 if ((!cam->sensor_initialized) || pict.colour != cam->picture.colour) { 2312 - err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_SAT, 2313 - pict.colour); 2312 + err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_SAT, 2313 + pict.colour); 2314 2314 if (err) 2315 2315 goto fail; 2316 2316 DBG(4, "Colour changed from %u to %u", ··· 2319 2319 } 2320 2320 2321 2321 if ((!cam->sensor_initialized) || pict.hue != cam->picture.hue) { 2322 - err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_HUE, 2323 - pict.hue); 2322 + err = w9968cf_sensor_set_control(cam, OVCAMCHIP_CID_HUE, 2323 + pict.hue); 2324 2324 if (err) 2325 2325 goto fail; 2326 2326 DBG(4, "Hue changed from %u to %u", ··· 2349 2349 { 2350 2350 int err = 0; 2351 2351 2352 - if ((err = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_INITIALIZE, 2353 - &cam->monochrome))) 2352 + if ((err = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_INITIALIZE, 2353 + &cam->monochrome))) 2354 2354 goto error; 2355 2355 2356 - if ((err = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_Q_SUBTYPE, 2357 - &cam->sensor))) 2356 + if ((err = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_Q_SUBTYPE, 2357 + &cam->sensor))) 2358 2358 goto error; 2359 2359 2360 2360 /* NOTE: Make sure width and height are a multiple of 16 */ ··· 2416 2416 2417 2417 /*-------------------------------------------------------------------------- 2418 2418 Fill some basic fields in the main device data structure. 2419 - This function is called once on w9968cf_usb_probe() for each recognized 2419 + This function is called once on w9968cf_usb_probe() for each recognized 2420 2420 camera. 2421 2421 --------------------------------------------------------------------------*/ 2422 2422 static void 2423 2423 w9968cf_configure_camera(struct w9968cf_device* cam, 2424 - struct usb_device* udev, 2425 - enum w9968cf_model_id mod_id, 2426 - const unsigned short dev_nr) 2424 + struct usb_device* udev, 2425 + enum w9968cf_model_id mod_id, 2426 + const unsigned short dev_nr) 2427 2427 { 2428 2428 mutex_init(&cam->fileop_mutex); 2429 2429 init_waitqueue_head(&cam->open); ··· 2444 2444 packet_size[dev_nr] < wMaxPacketSize[cam->altsetting-1]; 2445 2445 cam->altsetting++); 2446 2446 2447 - cam->max_buffers = (max_buffers[dev_nr] < 2 || 2448 - max_buffers[dev_nr] > W9968CF_MAX_BUFFERS) 2449 - ? W9968CF_BUFFERS : (u8)max_buffers[dev_nr]; 2447 + cam->max_buffers = (max_buffers[dev_nr] < 2 || 2448 + max_buffers[dev_nr] > W9968CF_MAX_BUFFERS) 2449 + ? W9968CF_BUFFERS : (u8)max_buffers[dev_nr]; 2450 2450 2451 - cam->double_buffer = (double_buffer[dev_nr] == 0 || 2452 - double_buffer[dev_nr] == 1) 2453 - ? (u8)double_buffer[dev_nr]:W9968CF_DOUBLE_BUFFER; 2451 + cam->double_buffer = (double_buffer[dev_nr] == 0 || 2452 + double_buffer[dev_nr] == 1) 2453 + ? (u8)double_buffer[dev_nr]:W9968CF_DOUBLE_BUFFER; 2454 2454 2455 2455 cam->clamping = (clamping[dev_nr] == 0 || clamping[dev_nr] == 1) 2456 - ? (u8)clamping[dev_nr] : W9968CF_CLAMPING; 2457 - 2456 + ? (u8)clamping[dev_nr] : W9968CF_CLAMPING; 2457 + 2458 2458 cam->filter_type = (filter_type[dev_nr] == 0 || 2459 - filter_type[dev_nr] == 1 || 2460 - filter_type[dev_nr] == 2) 2461 - ? (u8)filter_type[dev_nr] : W9968CF_FILTER_TYPE; 2459 + filter_type[dev_nr] == 1 || 2460 + filter_type[dev_nr] == 2) 2461 + ? (u8)filter_type[dev_nr] : W9968CF_FILTER_TYPE; 2462 2462 2463 2463 cam->capture = 1; 2464 2464 2465 2465 cam->largeview = (largeview[dev_nr] == 0 || largeview[dev_nr] == 1) 2466 - ? (u8)largeview[dev_nr] : W9968CF_LARGEVIEW; 2466 + ? (u8)largeview[dev_nr] : W9968CF_LARGEVIEW; 2467 2467 2468 - cam->decompression = (decompression[dev_nr] == 0 || 2469 - decompression[dev_nr] == 1 || 2470 - decompression[dev_nr] == 2) 2471 - ? (u8)decompression[dev_nr]:W9968CF_DECOMPRESSION; 2468 + cam->decompression = (decompression[dev_nr] == 0 || 2469 + decompression[dev_nr] == 1 || 2470 + decompression[dev_nr] == 2) 2471 + ? (u8)decompression[dev_nr]:W9968CF_DECOMPRESSION; 2472 2472 2473 - cam->upscaling = (upscaling[dev_nr] == 0 || 2474 - upscaling[dev_nr] == 1) 2475 - ? (u8)upscaling[dev_nr] : W9968CF_UPSCALING; 2473 + cam->upscaling = (upscaling[dev_nr] == 0 || 2474 + upscaling[dev_nr] == 1) 2475 + ? (u8)upscaling[dev_nr] : W9968CF_UPSCALING; 2476 2476 2477 2477 cam->auto_brt = (autobright[dev_nr] == 0 || autobright[dev_nr] == 1) 2478 - ? (u8)autobright[dev_nr] : W9968CF_AUTOBRIGHT; 2478 + ? (u8)autobright[dev_nr] : W9968CF_AUTOBRIGHT; 2479 2479 2480 2480 cam->auto_exp = (autoexp[dev_nr] == 0 || autoexp[dev_nr] == 1) 2481 - ? (u8)autoexp[dev_nr] : W9968CF_AUTOEXP; 2481 + ? (u8)autoexp[dev_nr] : W9968CF_AUTOEXP; 2482 2482 2483 2483 cam->lightfreq = (lightfreq[dev_nr] == 50 || lightfreq[dev_nr] == 60) 2484 - ? (u8)lightfreq[dev_nr] : W9968CF_LIGHTFREQ; 2484 + ? (u8)lightfreq[dev_nr] : W9968CF_LIGHTFREQ; 2485 2485 2486 - cam->bandfilt = (bandingfilter[dev_nr] == 0 || 2487 - bandingfilter[dev_nr] == 1) 2488 - ? (u8)bandingfilter[dev_nr] : W9968CF_BANDINGFILTER; 2486 + cam->bandfilt = (bandingfilter[dev_nr] == 0 || 2487 + bandingfilter[dev_nr] == 1) 2488 + ? (u8)bandingfilter[dev_nr] : W9968CF_BANDINGFILTER; 2489 2489 2490 2490 cam->backlight = (backlight[dev_nr] == 0 || backlight[dev_nr] == 1) 2491 - ? (u8)backlight[dev_nr] : W9968CF_BACKLIGHT; 2491 + ? (u8)backlight[dev_nr] : W9968CF_BACKLIGHT; 2492 2492 2493 2493 cam->clockdiv = (clockdiv[dev_nr] == -1 || clockdiv[dev_nr] >= 0) 2494 - ? (s8)clockdiv[dev_nr] : W9968CF_CLOCKDIV; 2494 + ? (s8)clockdiv[dev_nr] : W9968CF_CLOCKDIV; 2495 2495 2496 2496 cam->mirror = (mirror[dev_nr] == 0 || mirror[dev_nr] == 1) 2497 - ? (u8)mirror[dev_nr] : W9968CF_MIRROR; 2497 + ? (u8)mirror[dev_nr] : W9968CF_MIRROR; 2498 2498 2499 2499 cam->monochrome = (monochrome[dev_nr] == 0 || monochrome[dev_nr] == 1) 2500 - ? monochrome[dev_nr] : W9968CF_MONOCHROME; 2500 + ? monochrome[dev_nr] : W9968CF_MONOCHROME; 2501 2501 2502 2502 cam->picture.brightness = (u16)brightness[dev_nr]; 2503 2503 cam->picture.hue = (u16)hue[dev_nr]; ··· 2519 2519 cam->picture.depth = w9968cf_valid_depth(cam->picture.palette); 2520 2520 2521 2521 cam->force_rgb = (force_rgb[dev_nr] == 0 || force_rgb[dev_nr] == 1) 2522 - ? (u8)force_rgb[dev_nr] : W9968CF_FORCE_RGB; 2522 + ? (u8)force_rgb[dev_nr] : W9968CF_FORCE_RGB; 2523 2523 2524 2524 cam->window.x = 0; 2525 2525 cam->window.y = 0; ··· 2531 2531 2532 2532 DBG(3, "%s configured with settings #%u:", 2533 2533 symbolic(camlist, cam->id), dev_nr) 2534 - 2534 + 2535 2535 DBG(3, "- Data packet size for USB isochrnous transfer: %u bytes", 2536 2536 wMaxPacketSize[cam->altsetting-1]) 2537 - 2537 + 2538 2538 DBG(3, "- Number of requested video frame buffers: %u", 2539 2539 cam->max_buffers) 2540 2540 2541 2541 if (cam->double_buffer) 2542 2542 DBG(3, "- Hardware double buffering enabled") 2543 - else 2543 + else 2544 2544 DBG(3, "- Hardware double buffering disabled") 2545 2545 2546 2546 if (cam->filter_type == 0) ··· 2648 2648 2649 2649 /*-------------------------------------------------------------------------- 2650 2650 Release the resources used by the driver. 2651 - This function is called on disconnect 2651 + This function is called on disconnect 2652 2652 (or on close if deallocation has been deferred) 2653 2653 --------------------------------------------------------------------------*/ 2654 2654 static void w9968cf_release_resources(struct w9968cf_device* cam) ··· 2706 2706 } 2707 2707 mutex_unlock(&cam->dev_mutex); 2708 2708 err = wait_event_interruptible_exclusive(cam->open, 2709 - cam->disconnected || 2710 - !cam->users); 2709 + cam->disconnected || 2710 + !cam->users); 2711 2711 if (err) { 2712 2712 up_read(&w9968cf_disconnect); 2713 2713 return err; ··· 2820 2820 w9968cf_push_frame(cam, 1); 2821 2821 2822 2822 err = wait_event_interruptible(cam->wait_queue, 2823 - cam->frame[0].status == F_READY || 2824 - cam->frame[1].status == F_READY || 2825 - cam->disconnected); 2823 + cam->frame[0].status == F_READY || 2824 + cam->frame[1].status == F_READY || 2825 + cam->disconnected); 2826 2826 if (err) { 2827 2827 mutex_unlock(&cam->fileop_mutex); 2828 2828 return err; ··· 2859 2859 static int w9968cf_mmap(struct file* filp, struct vm_area_struct *vma) 2860 2860 { 2861 2861 struct w9968cf_device* cam = (struct w9968cf_device*) 2862 - video_get_drvdata(video_devdata(filp)); 2862 + video_get_drvdata(video_devdata(filp)); 2863 2863 unsigned long vsize = vma->vm_end - vma->vm_start, 2864 - psize = cam->nbuffers * cam->frame[0].size, 2865 - start = vma->vm_start, 2866 - pos = (unsigned long)cam->frame[0].buffer, 2867 - page; 2864 + psize = cam->nbuffers * cam->frame[0].size, 2865 + start = vma->vm_start, 2866 + pos = (unsigned long)cam->frame[0].buffer, 2867 + page; 2868 2868 2869 2869 if (cam->disconnected) { 2870 2870 DBG(2, "Device not present") ··· 2898 2898 2899 2899 static int 2900 2900 w9968cf_ioctl(struct inode* inode, struct file* filp, 2901 - unsigned int cmd, unsigned long arg) 2901 + unsigned int cmd, unsigned long arg) 2902 2902 { 2903 2903 struct w9968cf_device* cam; 2904 2904 int err; ··· 2928 2928 2929 2929 2930 2930 static int w9968cf_v4l_ioctl(struct inode* inode, struct file* filp, 2931 - unsigned int cmd, void __user * arg) 2931 + unsigned int cmd, void __user * arg) 2932 2932 { 2933 2933 struct w9968cf_device* cam; 2934 2934 const char* v4l1_ioctls[] = { 2935 - "?", "CGAP", "GCHAN", "SCHAN", "GTUNER", "STUNER", 2935 + "?", "CGAP", "GCHAN", "SCHAN", "GTUNER", "STUNER", 2936 2936 "GPICT", "SPICT", "CCAPTURE", "GWIN", "SWIN", "GFBUF", 2937 2937 "SFBUF", "KEY", "GFREQ", "SFREQ", "GAUDIO", "SAUDIO", 2938 2938 "SYNC", "MCAPTURE", "GMBUF", "GUNIT", "GCAPTURE", "SCAPTURE", 2939 - "SPLAYMODE", "SWRITEMODE", "GPLAYINFO", "SMICROCODE", 2940 - "GVBIFMT", "SVBIFMT" 2939 + "SPLAYMODE", "SWRITEMODE", "GPLAYINFO", "SMICROCODE", 2940 + "GVBIFMT", "SVBIFMT" 2941 2941 }; 2942 2942 2943 2943 #define V4L1_IOCTL(cmd) \ 2944 - ((_IOC_NR((cmd)) < ARRAY_SIZE(v4l1_ioctls)) ? \ 2945 - v4l1_ioctls[_IOC_NR((cmd))] : "?") 2944 + ((_IOC_NR((cmd)) < ARRAY_SIZE(v4l1_ioctls)) ? \ 2945 + v4l1_ioctls[_IOC_NR((cmd))] : "?") 2946 2946 2947 2947 cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp)); 2948 2948 ··· 2957 2957 .minwidth = cam->minwidth, 2958 2958 .minheight = cam->minheight, 2959 2959 }; 2960 - sprintf(cap.name, "W996[87]CF USB Camera #%d", 2961 - cam->v4ldev->minor); 2960 + sprintf(cap.name, "W996[87]CF USB Camera #%d", 2961 + cam->v4ldev->minor); 2962 2962 cap.maxwidth = (cam->upscaling && w9968cf_vpp) 2963 - ? max((u16)W9968CF_MAX_WIDTH, cam->maxwidth) 2964 - : cam->maxwidth; 2963 + ? max((u16)W9968CF_MAX_WIDTH, cam->maxwidth) 2964 + : cam->maxwidth; 2965 2965 cap.maxheight = (cam->upscaling && w9968cf_vpp) 2966 - ? max((u16)W9968CF_MAX_HEIGHT, cam->maxheight) 2967 - : cam->maxheight; 2966 + ? max((u16)W9968CF_MAX_HEIGHT, cam->maxheight) 2967 + : cam->maxheight; 2968 2968 2969 2969 if (copy_to_user(arg, &cap, sizeof(cap))) 2970 2970 return -EFAULT; ··· 3029 3029 if (copy_from_user(&pict, arg, sizeof(pict))) 3030 3030 return -EFAULT; 3031 3031 3032 - if ( (cam->force_palette || !w9968cf_vpp) 3032 + if ( (cam->force_palette || !w9968cf_vpp) 3033 3033 && pict.palette != cam->picture.palette ) { 3034 3034 DBG(4, "Palette %s rejected: only %s is allowed", 3035 3035 symbolic(v4l1_plist, pict.palette), ··· 3046 3046 if (!cam->force_palette) { 3047 3047 if (cam->decompression == 0) { 3048 3048 if (w9968cf_need_decompression(pict.palette)) { 3049 - DBG(4, "Decompression disabled: palette %s is not " 3050 - "allowed. VIDIOCSPICT failed", 3051 - symbolic(v4l1_plist, pict.palette)) 3052 - return -EINVAL; 3049 + DBG(4, "Decompression disabled: palette %s is not " 3050 + "allowed. VIDIOCSPICT failed", 3051 + symbolic(v4l1_plist, pict.palette)) 3052 + return -EINVAL; 3053 3053 } 3054 3054 } else if (cam->decompression == 1) { 3055 3055 if (!w9968cf_need_decompression(pict.palette)) { 3056 - DBG(4, "Decompression forced: palette %s is not " 3057 - "allowed. VIDIOCSPICT failed", 3058 - symbolic(v4l1_plist, pict.palette)) 3059 - return -EINVAL; 3056 + DBG(4, "Decompression forced: palette %s is not " 3057 + "allowed. VIDIOCSPICT failed", 3058 + symbolic(v4l1_plist, pict.palette)) 3059 + return -EINVAL; 3060 3060 } 3061 3061 } 3062 3062 } 3063 3063 3064 3064 if (pict.depth != w9968cf_valid_depth(pict.palette)) { 3065 3065 DBG(4, "Requested depth %u bpp is not valid for %s " 3066 - "palette: ignored and changed to %u bpp", 3066 + "palette: ignored and changed to %u bpp", 3067 3067 pict.depth, symbolic(v4l1_plist, pict.palette), 3068 3068 w9968cf_valid_depth(pict.palette)) 3069 3069 pict.depth = w9968cf_valid_depth(pict.palette); ··· 3074 3074 || cam->frame_current->queued) { 3075 3075 err = wait_event_interruptible 3076 3076 ( cam->wait_queue, 3077 - cam->disconnected || 3078 - (!*cam->requested_frame && 3079 - !cam->frame_current->queued) ); 3077 + cam->disconnected || 3078 + (!*cam->requested_frame && 3079 + !cam->frame_current->queued) ); 3080 3080 if (err) 3081 3081 return err; 3082 3082 if (cam->disconnected) ··· 3116 3116 return -EINVAL; 3117 3117 3118 3118 if ((err = w9968cf_adjust_window_size(cam, (u16*)&win.width, 3119 - (u16*)&win.height))) { 3119 + (u16*)&win.height))) { 3120 3120 DBG(4, "Resolution not supported (%ux%u). " 3121 3121 "VIDIOCSWIN failed", win.width, win.height) 3122 3122 return err; ··· 3130 3130 || cam->frame_current->queued) { 3131 3131 err = wait_event_interruptible 3132 3132 ( cam->wait_queue, 3133 - cam->disconnected || 3134 - (!*cam->requested_frame && 3135 - !cam->frame_current->queued) ); 3133 + cam->disconnected || 3134 + (!*cam->requested_frame && 3135 + !cam->frame_current->queued) ); 3136 3136 if (err) 3137 3137 return err; 3138 3138 if (cam->disconnected) ··· 3175 3175 mbuf.frames = cam->nbuffers; 3176 3176 for (i = 0; i < cam->nbuffers; i++) 3177 3177 mbuf.offsets[i] = (unsigned long)cam->frame[i].buffer - 3178 - (unsigned long)cam->frame[0].buffer; 3178 + (unsigned long)cam->frame[0].buffer; 3179 3179 3180 3180 if (copy_to_user(arg, &mbuf, sizeof(mbuf))) 3181 3181 return -EFAULT; ··· 3194 3194 return -EFAULT; 3195 3195 3196 3196 DBG(6, "VIDIOCMCAPTURE called: frame #%u, format=%s, %dx%d", 3197 - mmap.frame, symbolic(v4l1_plist, mmap.format), 3197 + mmap.frame, symbolic(v4l1_plist, mmap.format), 3198 3198 mmap.width, mmap.height) 3199 3199 3200 3200 if (mmap.frame >= cam->nbuffers) { ··· 3203 3203 return -EINVAL; 3204 3204 } 3205 3205 3206 - if (mmap.format!=cam->picture.palette && 3206 + if (mmap.format!=cam->picture.palette && 3207 3207 (cam->force_palette || !w9968cf_vpp)) { 3208 3208 DBG(4, "Palette %s rejected: only %s is allowed", 3209 3209 symbolic(v4l1_plist, mmap.format), ··· 3213 3213 3214 3214 if (!w9968cf_valid_palette(mmap.format)) { 3215 3215 DBG(4, "Palette %s not supported. " 3216 - "VIDIOCMCAPTURE failed", 3216 + "VIDIOCMCAPTURE failed", 3217 3217 symbolic(v4l1_plist, mmap.format)) 3218 3218 return -EINVAL; 3219 3219 } ··· 3221 3221 if (!cam->force_palette) { 3222 3222 if (cam->decompression == 0) { 3223 3223 if (w9968cf_need_decompression(mmap.format)) { 3224 - DBG(4, "Decompression disabled: palette %s is not " 3225 - "allowed. VIDIOCSPICT failed", 3226 - symbolic(v4l1_plist, mmap.format)) 3227 - return -EINVAL; 3224 + DBG(4, "Decompression disabled: palette %s is not " 3225 + "allowed. VIDIOCSPICT failed", 3226 + symbolic(v4l1_plist, mmap.format)) 3227 + return -EINVAL; 3228 3228 } 3229 3229 } else if (cam->decompression == 1) { 3230 3230 if (!w9968cf_need_decompression(mmap.format)) { 3231 - DBG(4, "Decompression forced: palette %s is not " 3232 - "allowed. VIDIOCSPICT failed", 3233 - symbolic(v4l1_plist, mmap.format)) 3234 - return -EINVAL; 3231 + DBG(4, "Decompression forced: palette %s is not " 3232 + "allowed. VIDIOCSPICT failed", 3233 + symbolic(v4l1_plist, mmap.format)) 3234 + return -EINVAL; 3235 3235 } 3236 3236 } 3237 3237 } 3238 3238 3239 - if ((err = w9968cf_adjust_window_size(cam, (u16*)&mmap.width, 3240 - (u16*)&mmap.height))) { 3239 + if ((err = w9968cf_adjust_window_size(cam, (u16*)&mmap.width, 3240 + (u16*)&mmap.height))) { 3241 3241 DBG(4, "Resolution not supported (%dx%d). " 3242 3242 "VIDIOCMCAPTURE failed", 3243 3243 mmap.width, mmap.height) ··· 3258 3258 DBG(6, "VIDIOCMCAPTURE. Change settings for " 3259 3259 "frame #%u: %dx%d, format %s. Wait...", 3260 3260 mmap.frame, mmap.width, mmap.height, 3261 - symbolic(v4l1_plist, mmap.format)) 3261 + symbolic(v4l1_plist, mmap.format)) 3262 3262 err = wait_event_interruptible 3263 3263 ( cam->wait_queue, 3264 - cam->disconnected || 3265 - (!*cam->requested_frame && 3266 - !cam->frame_current->queued) ); 3264 + cam->disconnected || 3265 + (!*cam->requested_frame && 3266 + !cam->frame_current->queued) ); 3267 3267 if (err) 3268 3268 return err; 3269 3269 if (cam->disconnected) ··· 3280 3280 goto ioctl_fail; 3281 3281 3282 3282 /* This before set_window */ 3283 - if (w9968cf_set_picture(cam, pict)) 3283 + if (w9968cf_set_picture(cam, pict)) 3284 3284 goto ioctl_fail; 3285 3285 3286 3286 if (w9968cf_set_window(cam, win)) ··· 3292 3292 } else if (fr->queued) { 3293 3293 3294 3294 DBG(6, "Wait until frame #%u is free", mmap.frame) 3295 - 3296 - err = wait_event_interruptible(cam->wait_queue, 3297 - cam->disconnected || 3298 - (!fr->queued)); 3295 + 3296 + err = wait_event_interruptible(cam->wait_queue, 3297 + cam->disconnected || 3298 + (!fr->queued)); 3299 3299 if (err) 3300 3300 return err; 3301 3301 if (cam->disconnected) ··· 3335 3335 } 3336 3336 case F_ERROR: 3337 3337 case F_GRABBING: 3338 - err = wait_event_interruptible(cam->wait_queue, 3339 - (fr->status == F_READY) 3340 - || cam->disconnected); 3338 + err = wait_event_interruptible(cam->wait_queue, 3339 + (fr->status == F_READY) 3340 + || cam->disconnected); 3341 3341 if (err) 3342 3342 return err; 3343 3343 if (cam->disconnected) ··· 3439 3439 DBG(4, "Unsupported V4L1 IOCtl: VIDIOC%s " 3440 3440 "(type 0x%01X, " 3441 3441 "n. 0x%01X, " 3442 - "dir. 0x%01X, " 3442 + "dir. 0x%01X, " 3443 3443 "size 0x%02X)", 3444 3444 V4L1_IOCTL(cmd), 3445 3445 _IOC_TYPE(cmd),_IOC_NR(cmd),_IOC_DIR(cmd),_IOC_SIZE(cmd)) ··· 3499 3499 le16_to_cpu(udev->descriptor.idProduct) == winbond_id_table[0].idProduct) 3500 3500 mod_id = W9968CF_MOD_CLVBWGP; /* see camlist[] table */ 3501 3501 else if (le16_to_cpu(udev->descriptor.idVendor) == winbond_id_table[1].idVendor && 3502 - le16_to_cpu(udev->descriptor.idProduct) == winbond_id_table[1].idProduct) 3502 + le16_to_cpu(udev->descriptor.idProduct) == winbond_id_table[1].idProduct) 3503 3503 mod_id = W9968CF_MOD_GENERIC; /* see camlist[] table */ 3504 3504 else 3505 3505 return -ENODEV; 3506 3506 3507 3507 cam = (struct w9968cf_device*) 3508 - kzalloc(sizeof(struct w9968cf_device), GFP_KERNEL); 3508 + kzalloc(sizeof(struct w9968cf_device), GFP_KERNEL); 3509 3509 if (!cam) 3510 3510 return -ENOMEM; 3511 3511 ··· 3569 3569 cam->v4ldev->dev = &cam->dev; 3570 3570 3571 3571 err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER, 3572 - video_nr[dev_nr]); 3572 + video_nr[dev_nr]); 3573 3573 if (err) { 3574 3574 DBG(1, "V4L device registration failed") 3575 3575 if (err == -ENFILE && video_nr[dev_nr] == -1) ··· 3611 3611 3612 3612 static void w9968cf_usb_disconnect(struct usb_interface* intf) 3613 3613 { 3614 - struct w9968cf_device* cam = 3614 + struct w9968cf_device* cam = 3615 3615 (struct w9968cf_device*)usb_get_intfdata(intf); 3616 3616 3617 3617 down_write(&w9968cf_disconnect);
+6 -6
drivers/media/video/w9968cf.h
··· 61 61 62 62 /* Maximum data payload sizes in bytes for alternate settings */ 63 63 static const u16 wMaxPacketSize[] = {1023, 959, 895, 831, 767, 703, 639, 575, 64 - 511, 447, 383, 319, 255, 191, 127, 63}; 64 + 511, 447, 383, 319, 255, 191, 127, 63}; 65 65 #define W9968CF_PACKET_SIZE 1023 /* according to wMaxPacketSizes[] */ 66 66 #define W9968CF_MIN_PACKET_SIZE 63 /* minimum value */ 67 67 #define W9968CF_ISO_PACKETS 5 /* n.of packets for isochronous transfers */ ··· 134 134 ****************************************************************************/ 135 135 136 136 #define W9968CF_MODULE_NAME "V4L driver for W996[87]CF JPEG USB " \ 137 - "Dual Mode Camera Chip" 137 + "Dual Mode Camera Chip" 138 138 #define W9968CF_MODULE_VERSION "1:1.33-basic" 139 139 #define W9968CF_MODULE_AUTHOR "(C) 2002-2004 Luca Risolia" 140 140 #define W9968CF_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>" ··· 270 270 271 271 /* Locks */ 272 272 struct mutex dev_mutex, /* for probe, disconnect,open and close */ 273 - fileop_mutex; /* for read and ioctl */ 273 + fileop_mutex; /* for read and ioctl */ 274 274 spinlock_t urb_lock, /* for submit_urb() and unlink_urb() */ 275 - flist_lock; /* for requested frame list accesses */ 275 + flist_lock; /* for requested frame list accesses */ 276 276 wait_queue_head_t open, wait_queue; 277 277 278 278 char command[16]; /* name of the program holding the device */ ··· 299 299 dev_warn(&cam->dev, fmt "\n", ## args); \ 300 300 else if ((level) >= 5) \ 301 301 dev_info(&cam->dev, "[%s:%d] " fmt "\n", \ 302 - __FUNCTION__, __LINE__ , ## args); \ 302 + __FUNCTION__, __LINE__ , ## args); \ 303 303 } \ 304 304 } 305 305 /* For generic kernel (not device specific) messages */ ··· 311 311 pr_info("w9968cf: " fmt "\n", ## args); \ 312 312 else if ((level) >= 5) \ 313 313 pr_debug("w9968cf: [%s:%d] " fmt "\n", __FUNCTION__, \ 314 - __LINE__ , ## args); \ 314 + __LINE__ , ## args); \ 315 315 } \ 316 316 } 317 317 #else
+4 -4
drivers/media/video/w9968cf_decoder.h
··· 78 78 #define W9968CF_DEC_ERR_NO_EOI -6 79 79 80 80 extern void w9968cf_init_decoder(void); 81 - extern int w9968cf_check_headers(const unsigned char* Pin, 82 - const unsigned long BUF_SIZE); 83 - extern int w9968cf_decode(const char* Pin, const unsigned long BUF_SIZE, 84 - const unsigned W, const unsigned H, char* Pout); 81 + extern int w9968cf_check_headers(const unsigned char* Pin, 82 + const unsigned long BUF_SIZE); 83 + extern int w9968cf_decode(const char* Pin, const unsigned long BUF_SIZE, 84 + const unsigned W, const unsigned H, char* Pout); 85 85 86 86 #endif /* _W9968CF_DECODER_H_ */
+1 -1
drivers/media/video/w9968cf_vpp.h
··· 29 29 struct module* owner; 30 30 int (*check_headers)(const unsigned char*, const unsigned long); 31 31 int (*decode)(const char*, const unsigned long, const unsigned, 32 - const unsigned, char*); 32 + const unsigned, char*); 33 33 void (*swap_yuvbytes)(void*, unsigned long); 34 34 void (*uyvy_to_rgbx)(u8*, unsigned long, u8*, u16, u8); 35 35 void (*scale_up)(u8*, u8*, u16, u16, u16, u16, u16);
+3 -3
drivers/media/video/zc0301/zc0301.h
··· 157 157 dev_info(&cam->usbdev->dev, fmt "\n", ## args); \ 158 158 else if ((level) >= 3) \ 159 159 dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ 160 - __FUNCTION__, __LINE__ , ## args); \ 160 + __FUNCTION__, __LINE__ , ## args); \ 161 161 } \ 162 162 } while (0) 163 163 # define KDBG(level, fmt, args...) \ ··· 167 167 pr_info("zc0301: " fmt "\n", ## args); \ 168 168 else if ((level) == 3) \ 169 169 pr_debug("zc0301: [%s:%d] " fmt "\n", __FUNCTION__, \ 170 - __LINE__ , ## args); \ 170 + __LINE__ , ## args); \ 171 171 } \ 172 172 } while (0) 173 173 # define V4LDBG(level, name, cmd) \ ··· 184 184 #undef PDBG 185 185 #define PDBG(fmt, args...) \ 186 186 dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ 187 - __FUNCTION__, __LINE__ , ## args) 187 + __FUNCTION__, __LINE__ , ## args) 188 188 189 189 #undef PDBGG 190 190 #define PDBGG(fmt, args...) do {;} while(0) /* placeholder */
+74 -74
drivers/media/video/zc0301/zc0301_core.c
··· 48 48 /*****************************************************************************/ 49 49 50 50 #define ZC0301_MODULE_NAME "V4L2 driver for ZC0301 " \ 51 - "Image Processor and Control Chip" 51 + "Image Processor and Control Chip" 52 52 #define ZC0301_MODULE_AUTHOR "(C) 2006 Luca Risolia" 53 53 #define ZC0301_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>" 54 54 #define ZC0301_MODULE_LICENSE "GPL" ··· 67 67 static short video_nr[] = {[0 ... ZC0301_MAX_DEVICES-1] = -1}; 68 68 module_param_array(video_nr, short, NULL, 0444); 69 69 MODULE_PARM_DESC(video_nr, 70 - "\n<-1|n[,...]> Specify V4L2 minor mode number." 71 - "\n -1 = use next available (default)" 72 - "\n n = use minor number n (integer >= 0)" 73 - "\nYou can specify up to " 74 - __MODULE_STRING(ZC0301_MAX_DEVICES) " cameras this way." 75 - "\nFor example:" 76 - "\nvideo_nr=-1,2,-1 would assign minor number 2 to" 77 - "\nthe second registered camera and use auto for the first" 78 - "\none and for every other camera." 79 - "\n"); 70 + "\n<-1|n[,...]> Specify V4L2 minor mode number." 71 + "\n -1 = use next available (default)" 72 + "\n n = use minor number n (integer >= 0)" 73 + "\nYou can specify up to " 74 + __MODULE_STRING(ZC0301_MAX_DEVICES) " cameras this way." 75 + "\nFor example:" 76 + "\nvideo_nr=-1,2,-1 would assign minor number 2 to" 77 + "\nthe second registered camera and use auto for the first" 78 + "\none and for every other camera." 79 + "\n"); 80 80 81 81 static short force_munmap[] = {[0 ... ZC0301_MAX_DEVICES-1] = 82 - ZC0301_FORCE_MUNMAP}; 82 + ZC0301_FORCE_MUNMAP}; 83 83 module_param_array(force_munmap, bool, NULL, 0444); 84 84 MODULE_PARM_DESC(force_munmap, 85 - "\n<0|1[,...]> Force the application to unmap previously" 86 - "\nmapped buffer memory before calling any VIDIOC_S_CROP or" 87 - "\nVIDIOC_S_FMT ioctl's. Not all the applications support" 88 - "\nthis feature. This parameter is specific for each" 89 - "\ndetected camera." 90 - "\n 0 = do not force memory unmapping" 91 - "\n 1 = force memory unmapping (save memory)" 92 - "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"." 93 - "\n"); 85 + "\n<0|1[,...]> Force the application to unmap previously" 86 + "\nmapped buffer memory before calling any VIDIOC_S_CROP or" 87 + "\nVIDIOC_S_FMT ioctl's. Not all the applications support" 88 + "\nthis feature. This parameter is specific for each" 89 + "\ndetected camera." 90 + "\n 0 = do not force memory unmapping" 91 + "\n 1 = force memory unmapping (save memory)" 92 + "\nDefault value is "__MODULE_STRING(SN9C102_FORCE_MUNMAP)"." 93 + "\n"); 94 94 95 95 static unsigned int frame_timeout[] = {[0 ... ZC0301_MAX_DEVICES-1] = 96 - ZC0301_FRAME_TIMEOUT}; 96 + ZC0301_FRAME_TIMEOUT}; 97 97 module_param_array(frame_timeout, uint, NULL, 0644); 98 98 MODULE_PARM_DESC(frame_timeout, 99 - "\n<n[,...]> Timeout for a video frame in seconds." 100 - "\nThis parameter is specific for each detected camera." 101 - "\nDefault value is "__MODULE_STRING(ZC0301_FRAME_TIMEOUT)"." 102 - "\n"); 99 + "\n<n[,...]> Timeout for a video frame in seconds." 100 + "\nThis parameter is specific for each detected camera." 101 + "\nDefault value is "__MODULE_STRING(ZC0301_FRAME_TIMEOUT)"." 102 + "\n"); 103 103 104 104 #ifdef ZC0301_DEBUG 105 105 static unsigned short debug = ZC0301_DEBUG_LEVEL; 106 106 module_param(debug, ushort, 0644); 107 107 MODULE_PARM_DESC(debug, 108 - "\n<n> Debugging information level, from 0 to 3:" 109 - "\n0 = none (use carefully)" 110 - "\n1 = critical errors" 111 - "\n2 = significant informations" 112 - "\n3 = more verbose messages" 113 - "\nLevel 3 is useful for testing only, when only " 114 - "one device is used." 115 - "\nDefault value is "__MODULE_STRING(ZC0301_DEBUG_LEVEL)"." 116 - "\n"); 108 + "\n<n> Debugging information level, from 0 to 3:" 109 + "\n0 = none (use carefully)" 110 + "\n1 = critical errors" 111 + "\n2 = significant informations" 112 + "\n3 = more verbose messages" 113 + "\nLevel 3 is useful for testing only, when only " 114 + "one device is used." 115 + "\nDefault value is "__MODULE_STRING(ZC0301_DEBUG_LEVEL)"." 116 + "\n"); 117 117 #endif 118 118 119 119 /*****************************************************************************/ 120 120 121 121 static u32 122 122 zc0301_request_buffers(struct zc0301_device* cam, u32 count, 123 - enum zc0301_io_method io) 123 + enum zc0301_io_method io) 124 124 { 125 125 struct v4l2_pix_format* p = &(cam->sensor.pix_format); 126 126 struct v4l2_rect* r = &(cam->sensor.cropcap.bounds); 127 127 const size_t imagesize = cam->module_param.force_munmap || 128 - io == IO_READ ? 129 - (p->width * p->height * p->priv) / 8 : 130 - (r->width * r->height * p->priv) / 8; 128 + io == IO_READ ? 129 + (p->width * p->height * p->priv) / 8 : 130 + (r->width * r->height * p->priv) / 8; 131 131 void* buff = NULL; 132 132 u32 i; 133 133 ··· 216 216 int res; 217 217 218 218 res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0xa0, 0x40, 219 - value, index, NULL, 0, ZC0301_CTRL_TIMEOUT); 219 + value, index, NULL, 0, ZC0301_CTRL_TIMEOUT); 220 220 if (res < 0) { 221 221 DBG(3, "Failed to write a register (index 0x%04X, " 222 222 "value 0x%02X, error %d)",index, value, res); ··· 234 234 int res; 235 235 236 236 res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0xa1, 0xc0, 237 - 0x0001, index, buff, 1, ZC0301_CTRL_TIMEOUT); 237 + 0x0001, index, buff, 1, ZC0301_CTRL_TIMEOUT); 238 238 if (res < 0) 239 239 DBG(3, "Failed to read a register (index 0x%04X, error %d)", 240 240 index, res); ··· 337 337 338 338 if (!(*f)) 339 339 (*f) = list_entry(cam->inqueue.next, struct zc0301_frame_t, 340 - frame); 340 + frame); 341 341 342 342 imagesize = (cam->sensor.pix_format.width * 343 - cam->sensor.pix_format.height * 344 - cam->sensor.pix_format.priv) / 8; 343 + cam->sensor.pix_format.height * 344 + cam->sensor.pix_format.priv) / 8; 345 345 346 346 for (i = 0; i < urb->number_of_packets; i++) { 347 347 unsigned int len, status; ··· 395 395 list_move_tail(&(*f)->frame, &cam->outqueue); 396 396 if (!list_empty(&cam->inqueue)) 397 397 (*f) = list_entry(cam->inqueue.next, 398 - struct zc0301_frame_t, 399 - frame); 398 + struct zc0301_frame_t, 399 + frame); 400 400 else 401 401 (*f) = NULL; 402 402 spin_unlock(&cam->queue_lock); ··· 429 429 struct usb_device *udev = cam->usbdev; 430 430 struct urb* urb; 431 431 const unsigned int wMaxPacketSize[] = {0, 128, 192, 256, 384, 432 - 512, 768, 1023}; 432 + 512, 768, 1023}; 433 433 const unsigned int psz = wMaxPacketSize[ZC0301_ALTERNATE_SETTING]; 434 434 s8 i, j; 435 435 int err = 0; 436 436 437 437 for (i = 0; i < ZC0301_URBS; i++) { 438 438 cam->transfer_buffer[i] = kzalloc(ZC0301_ISO_PACKETS * psz, 439 - GFP_KERNEL); 439 + GFP_KERNEL); 440 440 if (!cam->transfer_buffer[i]) { 441 441 err = -ENOMEM; 442 442 DBG(1, "Not enough memory"); ··· 528 528 529 529 cam->stream = STREAM_INTERRUPT; 530 530 timeout = wait_event_timeout(cam->wait_stream, 531 - (cam->stream == STREAM_OFF) || 532 - (cam->state & DEV_DISCONNECTED), 533 - ZC0301_URB_TIMEOUT); 531 + (cam->stream == STREAM_OFF) || 532 + (cam->state & DEV_DISCONNECTED), 533 + ZC0301_URB_TIMEOUT); 534 534 if (cam->state & DEV_DISCONNECTED) 535 535 return -ENODEV; 536 536 else if (cam->stream != STREAM_OFF) { ··· 548 548 549 549 static int 550 550 zc0301_set_compression(struct zc0301_device* cam, 551 - struct v4l2_jpegcompression* compression) 551 + struct v4l2_jpegcompression* compression) 552 552 { 553 553 int r, err = 0; 554 554 ··· 670 670 } 671 671 mutex_unlock(&cam->dev_mutex); 672 672 err = wait_event_interruptible_exclusive(cam->open, 673 - cam->state & DEV_DISCONNECTED 674 - || !cam->users); 673 + cam->state & DEV_DISCONNECTED 674 + || !cam->users); 675 675 if (err) { 676 676 up_read(&zc0301_disconnect); 677 677 return err; ··· 802 802 return -EAGAIN; 803 803 } 804 804 timeout = wait_event_interruptible_timeout 805 - ( cam->wait_frame, 806 - (!list_empty(&cam->outqueue)) || 807 - (cam->state & DEV_DISCONNECTED) || 808 - (cam->state & DEV_MISCONFIGURED), 809 - cam->module_param.frame_timeout * 810 - 1000 * msecs_to_jiffies(1) ); 805 + ( cam->wait_frame, 806 + (!list_empty(&cam->outqueue)) || 807 + (cam->state & DEV_DISCONNECTED) || 808 + (cam->state & DEV_MISCONFIGURED), 809 + cam->module_param.frame_timeout * 810 + 1000 * msecs_to_jiffies(1) ); 811 811 if (timeout < 0) { 812 812 mutex_unlock(&cam->fileop_mutex); 813 813 return timeout; ··· 930 930 { 931 931 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 932 932 unsigned long size = vma->vm_end - vma->vm_start, 933 - start = vma->vm_start; 933 + start = vma->vm_start; 934 934 void *pos; 935 935 u32 i; 936 936 ··· 998 998 .driver = "zc0301", 999 999 .version = ZC0301_MODULE_VERSION_CODE, 1000 1000 .capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | 1001 - V4L2_CAP_STREAMING, 1001 + V4L2_CAP_STREAMING, 1002 1002 }; 1003 1003 1004 1004 strlcpy(cap.card, cam->v4ldev->name, sizeof(cap.card)); 1005 1005 if (usb_make_path(cam->usbdev, cap.bus_info, sizeof(cap.bus_info)) < 0) 1006 1006 strlcpy(cap.bus_info, cam->usbdev->dev.bus_id, 1007 - sizeof(cap.bus_info)); 1007 + sizeof(cap.bus_info)); 1008 1008 1009 1009 if (copy_to_user(arg, &cap, sizeof(cap))) 1010 1010 return -EFAULT; ··· 1337 1337 1338 1338 static int 1339 1339 zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd, 1340 - void __user * arg) 1340 + void __user * arg) 1341 1341 { 1342 1342 struct zc0301_sensor* s = &cam->sensor; 1343 1343 struct v4l2_format format; ··· 1600 1600 1601 1601 static int 1602 1602 zc0301_vidioc_dqbuf(struct zc0301_device* cam, struct file* filp, 1603 - void __user * arg) 1603 + void __user * arg) 1604 1604 { 1605 1605 struct v4l2_buffer b; 1606 1606 struct zc0301_frame_t *f; ··· 1619 1619 if (filp->f_flags & O_NONBLOCK) 1620 1620 return -EAGAIN; 1621 1621 timeout = wait_event_interruptible_timeout 1622 - ( cam->wait_frame, 1623 - (!list_empty(&cam->outqueue)) || 1624 - (cam->state & DEV_DISCONNECTED) || 1625 - (cam->state & DEV_MISCONFIGURED), 1626 - cam->module_param.frame_timeout * 1627 - 1000 * msecs_to_jiffies(1) ); 1622 + ( cam->wait_frame, 1623 + (!list_empty(&cam->outqueue)) || 1624 + (cam->state & DEV_DISCONNECTED) || 1625 + (cam->state & DEV_MISCONFIGURED), 1626 + cam->module_param.frame_timeout * 1627 + 1000 * msecs_to_jiffies(1) ); 1628 1628 if (timeout < 0) 1629 1629 return timeout; 1630 1630 if (cam->state & DEV_DISCONNECTED) ··· 1748 1748 1749 1749 1750 1750 static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp, 1751 - unsigned int cmd, void __user * arg) 1751 + unsigned int cmd, void __user * arg) 1752 1752 { 1753 1753 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 1754 1754 ··· 1842 1842 1843 1843 1844 1844 static int zc0301_ioctl(struct inode* inode, struct file* filp, 1845 - unsigned int cmd, unsigned long arg) 1845 + unsigned int cmd, unsigned long arg) 1846 1846 { 1847 1847 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 1848 1848 int err = 0; ··· 1948 1948 mutex_lock(&cam->dev_mutex); 1949 1949 1950 1950 err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER, 1951 - video_nr[dev_nr]); 1951 + video_nr[dev_nr]); 1952 1952 if (err) { 1953 1953 DBG(1, "V4L2 device registration failed"); 1954 1954 if (err == -ENFILE && video_nr[dev_nr] == -1)
+6 -6
drivers/media/video/zc0301/zc0301_pas202bcb.c
··· 24 24 25 25 /* 26 26 NOTE: Sensor controls are disabled for now, becouse changing them while 27 - streaming sometimes results in out-of-sync video frames. We'll use 28 - the default initialization, until we know how to stop and start video 29 - in the chip. However, the image quality still looks good under various 30 - light conditions. 27 + streaming sometimes results in out-of-sync video frames. We'll use 28 + the default initialization, until we know how to stop and start video 29 + in the chip. However, the image quality still looks good under various 30 + light conditions. 31 31 */ 32 32 33 33 #include <linux/delay.h> ··· 165 165 166 166 167 167 static int pas202bcb_get_ctrl(struct zc0301_device* cam, 168 - struct v4l2_control* ctrl) 168 + struct v4l2_control* ctrl) 169 169 { 170 170 switch (ctrl->id) { 171 171 case V4L2_CID_EXPOSURE: ··· 208 208 209 209 210 210 static int pas202bcb_set_ctrl(struct zc0301_device* cam, 211 - const struct v4l2_control* ctrl) 211 + const struct v4l2_control* ctrl) 212 212 { 213 213 int err = 0; 214 214
+2 -2
drivers/media/video/zc0301/zc0301_sensor.h
··· 51 51 52 52 #define ZC0301_USB_DEVICE(vend, prod, intclass) \ 53 53 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ 54 - USB_DEVICE_ID_MATCH_INT_CLASS, \ 54 + USB_DEVICE_ID_MATCH_INT_CLASS, \ 55 55 .idVendor = (vend), \ 56 56 .idProduct = (prod), \ 57 57 .bInterfaceClass = (intclass) ··· 92 92 int (*init)(struct zc0301_device*); 93 93 int (*get_ctrl)(struct zc0301_device*, struct v4l2_control* ctrl); 94 94 int (*set_ctrl)(struct zc0301_device*, 95 - const struct v4l2_control* ctrl); 95 + const struct v4l2_control* ctrl); 96 96 int (*set_crop)(struct zc0301_device*, const struct v4l2_rect* rect); 97 97 98 98 /* Private */
+1 -1
drivers/media/video/zoran.h
··· 1 - /* 1 + /* 2 2 * zoran - Iomega Buz driver 3 3 * 4 4 * Copyright (C) 1999 Rainer Johanni <Rainer@Johanni.de>
+1 -1
drivers/media/video/zoran_card.c
··· 4 4 * Media Labs LML33/LML33R10. 5 5 * 6 6 * This part handles card-specific data and detection 7 - * 7 + * 8 8 * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx> 9 9 * 10 10 * Currently maintained by:
+1 -1
drivers/media/video/zoran_card.h
··· 4 4 * Media Labs LML33/LML33R10. 5 5 * 6 6 * This part handles card-specific data and detection 7 - * 7 + * 8 8 * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx> 9 9 * 10 10 * Currently maintained by:
+8 -8
drivers/media/video/zoran_device.c
··· 4 4 * Media Labs LML33/LML33R10. 5 5 * 6 6 * This part handles device access (PCI/I2C/codec/...) 7 - * 7 + * 8 8 * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx> 9 9 * 10 10 * Currently maintained by: ··· 492 492 /* (Ronald) don't write this if overlay_mask = NULL */ 493 493 if (zr->overlay_mask) { 494 494 /* Write overlay clipping mask data, but don't enable overlay clipping */ 495 - /* RJ: since this makes only sense on the screen, we use 495 + /* RJ: since this makes only sense on the screen, we use 496 496 * zr->overlay_settings.width instead of video_width */ 497 497 498 498 mask_line_size = (BUZ_MAX_WIDTH + 31) / 32; ··· 819 819 if (zr->card.vfe_pol.hsync_pol) 820 820 btor(ZR36057_VFEHCR_HSPol, ZR36057_VFEHCR); 821 821 else 822 - btand(~ZR36057_VFEHCR_HSPol, ZR36057_VFEHCR); 822 + btand(~ZR36057_VFEHCR_HSPol, ZR36057_VFEHCR); 823 823 reg = ((tvn->HSyncStart) << ZR36057_HSP_HsyncStart) | 824 824 (tvn->Wt << ZR36057_HSP_LineTot); 825 825 btwrite(reg, ZR36057_HSP); 826 826 reg = ((zr->jpg_settings.img_x + 827 - tvn->HStart + 4) << ZR36057_FHAP_NAX) | 827 + tvn->HStart + 4) << ZR36057_FHAP_NAX) | 828 828 (zr->jpg_settings.img_width << ZR36057_FHAP_PAX); 829 829 btwrite(reg, ZR36057_FHAP); 830 830 ··· 1272 1272 if (zr->JPEG_error != 1) { 1273 1273 /* 1274 1274 * First entry: error just happened during normal operation 1275 - * 1275 + * 1276 1276 * In BUZ_MODE_MOTION_COMPRESS: 1277 - * 1277 + * 1278 1278 * Possible glitch in TV signal. In this case we should 1279 1279 * stop the codec and wait for good quality signal before 1280 1280 * restarting it to avoid further problems 1281 - * 1281 + * 1282 1282 * In BUZ_MODE_MOTION_DECOMPRESS: 1283 - * 1283 + * 1284 1284 * Bad JPEG frame: we have to mark it as processed (codec crashed 1285 1285 * and was not able to do it itself), and to remove it from queue. 1286 1286 */
+1 -1
drivers/media/video/zoran_device.h
··· 4 4 * Media Labs LML33/LML33R10. 5 5 * 6 6 * This part handles card-specific data and detection 7 - * 7 + * 8 8 * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx> 9 9 * 10 10 * Currently maintained by:
+8 -8
drivers/media/video/zoran_driver.c
··· 94 94 V4L2_CAP_VIDEO_CAPTURE |\ 95 95 V4L2_CAP_VIDEO_OUTPUT |\ 96 96 V4L2_CAP_VIDEO_OVERLAY \ 97 - ) 97 + ) 98 98 #endif 99 99 100 100 #include <asm/byteorder.h> ··· 165 165 #endif 166 166 .depth = 16, 167 167 .flags = ZORAN_FORMAT_CAPTURE | 168 - ZORAN_FORMAT_OVERLAY, 168 + ZORAN_FORMAT_OVERLAY, 169 169 }, { 170 170 .name = "Hardware-encoded Motion-JPEG", 171 171 .palette = -1, ··· 670 670 j])))); 671 671 free_page((unsigned long) 672 672 bus_to_virt 673 - (le32_to_cpu 673 + (le32_to_cpu 674 674 (fh->jpg_buffers. 675 675 buffer[i]. 676 676 frag_tab[2 * j]))); ··· 1871 1871 1872 1872 static int 1873 1873 zoran_set_norm (struct zoran *zr, 1874 - int norm) /* VIDEO_MODE_* */ 1874 + int norm) /* VIDEO_MODE_* */ 1875 1875 { 1876 1876 int norm_encoder, on; 1877 1877 ··· 2006 2006 2007 2007 static int 2008 2008 zoran_do_ioctl (struct inode *inode, 2009 - struct file *file, 2010 - unsigned int cmd, 2011 - void *arg) 2009 + struct file *file, 2010 + unsigned int cmd, 2011 + void *arg) 2012 2012 { 2013 2013 struct zoran_fh *fh = file->private_data; 2014 2014 struct zoran *zr = fh->zr; ··· 2095 2095 break; 2096 2096 2097 2097 /* RJ: the documentation at http://roadrunner.swansea.linux.org.uk/v4lapi.shtml says: 2098 - * 2098 + * 2099 2099 * * "The VIDIOCSCHAN ioctl takes an integer argument and switches the capture to this input." 2100 2100 * * ^^^^^^^ 2101 2101 * * The famos BTTV driver has it implemented with a struct video_channel argument
+1 -1
drivers/media/video/zoran_procfs.c
··· 4 4 * Media Labs LML33/LML33R10. 5 5 * 6 6 * This part handles the procFS entries (/proc/ZORAN[%d]) 7 - * 7 + * 8 8 * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx> 9 9 * 10 10 * Currently maintained by:
+1 -1
drivers/media/video/zoran_procfs.h
··· 4 4 * Media Labs LML33/LML33R10. 5 5 * 6 6 * This part handles card-specific data and detection 7 - * 7 + * 8 8 * Copyright (C) 2000 Serguei Miridonov <mirsev@cicese.mx> 9 9 * 10 10 * Currently maintained by:
+11 -11
drivers/media/video/zr36016.c
··· 34 34 #include <linux/types.h> 35 35 #include <linux/wait.h> 36 36 37 - /* includes for structures and defines regarding video 37 + /* includes for structures and defines regarding video 38 38 #include<linux/videodev.h> */ 39 39 40 40 /* I/O commands, error codes */ ··· 143 143 144 144 static void 145 145 zr36016_writei (struct zr36016 *ptr, 146 - u16 reg, 147 - u8 value) 146 + u16 reg, 147 + u8 value) 148 148 { 149 149 dprintk(4, "%s: writing indirect 0x%02x to 0x%04x\n", ptr->name, 150 150 value, reg); ··· 192 192 dprintk(1, "\n"); 193 193 } 194 194 // for testing just write 0, then the default value to a register and read 195 - // it back in both cases 195 + // it back in both cases 196 196 zr36016_writei(ptr, ZR016I_PAX_LO, 0x00); 197 197 if (zr36016_readi(ptr, ZR016I_PAX_LO) != 0x0) { 198 198 dprintk(1, ··· 232 232 static int zr36016_pushit (struct zr36016 *ptr, 233 233 u16 startreg, 234 234 u16 len, 235 - const char *data) 235 + const char *data) 236 236 { 237 - int i=0; 237 + int i=0; 238 238 239 - dprintk(4, "%s: write data block to 0x%04x (len=%d)\n", 239 + dprintk(4, "%s: write data block to 0x%04x (len=%d)\n", 240 240 ptr->name, startreg,len); 241 - while (i<len) { 242 - zr36016_writei(ptr, startreg++, data[i++]); 243 - } 241 + while (i<len) { 242 + zr36016_writei(ptr, startreg++, data[i++]); 243 + } 244 244 245 - return i; 245 + return i; 246 246 } 247 247 #endif 248 248
+8 -8
drivers/media/video/zr36050.c
··· 34 34 #include <linux/types.h> 35 35 #include <linux/wait.h> 36 36 37 - /* includes for structures and defines regarding video 37 + /* includes for structures and defines regarding video 38 38 #include<linux/videodev.h> */ 39 39 40 40 /* I/O commands, error codes */ ··· 171 171 /* ========================================================================= 172 172 Local helper function: 173 173 174 - basic test of "connectivity", writes/reads to/from memory the SOF marker 174 + basic test of "connectivity", writes/reads to/from memory the SOF marker 175 175 ========================================================================= */ 176 176 177 177 static int ··· 218 218 219 219 static int 220 220 zr36050_pushit (struct zr36050 *ptr, 221 - u16 startreg, 222 - u16 len, 223 - const char *data) 221 + u16 startreg, 222 + u16 len, 223 + const char *data) 224 224 { 225 225 int i = 0; 226 226 ··· 345 345 /* ------------------------------------------------------------------------- */ 346 346 347 347 /* SOF (start of frame) segment depends on width, height and sampling ratio 348 - of each color component */ 348 + of each color component */ 349 349 350 350 static int 351 351 zr36050_set_sof (struct zr36050 *ptr) ··· 376 376 377 377 /* ------------------------------------------------------------------------- */ 378 378 379 - /* SOS (start of scan) segment depends on the used scan components 380 - of each color component */ 379 + /* SOS (start of scan) segment depends on the used scan components 380 + of each color component */ 381 381 382 382 static int 383 383 zr36050_set_sos (struct zr36050 *ptr)
+5 -5
drivers/media/video/zr36057.h
··· 1 - /* 1 + /* 2 2 * zr36057.h - zr36057 register offsets 3 3 * 4 4 * Copyright (C) 1998 Dave Perks <dperks@ibm.net> ··· 27 27 #define ZR36057_VFEHCR 0x000 /* Video Front End, Horizontal Configuration Register */ 28 28 #define ZR36057_VFEHCR_HSPol (1<<30) 29 29 #define ZR36057_VFEHCR_HStart 10 30 - #define ZR36057_VFEHCR_HEnd 0 31 - #define ZR36057_VFEHCR_Hmask 0x3ff 30 + #define ZR36057_VFEHCR_HEnd 0 31 + #define ZR36057_VFEHCR_Hmask 0x3ff 32 32 33 33 #define ZR36057_VFEVCR 0x004 /* Video Front End, Vertical Configuration Register */ 34 34 #define ZR36057_VFEVCR_VSPol (1<<30) 35 35 #define ZR36057_VFEVCR_VStart 10 36 - #define ZR36057_VFEVCR_VEnd 0 37 - #define ZR36057_VFEVCR_Vmask 0x3ff 36 + #define ZR36057_VFEVCR_VEnd 0 37 + #define ZR36057_VFEVCR_Vmask 0x3ff 38 38 39 39 #define ZR36057_VFESPFR 0x008 /* Video Front End, Scaler and Pixel Format Register */ 40 40 #define ZR36057_VFESPFR_ExtFl (1<<26)
+10 -10
drivers/media/video/zr36060.c
··· 34 34 #include <linux/types.h> 35 35 #include <linux/wait.h> 36 36 37 - /* includes for structures and defines regarding video 37 + /* includes for structures and defines regarding video 38 38 #include<linux/videodev.h> */ 39 39 40 40 /* I/O commands, error codes */ ··· 173 173 /* ========================================================================= 174 174 Local helper function: 175 175 176 - basic test of "connectivity", writes/reads to/from memory the SOF marker 176 + basic test of "connectivity", writes/reads to/from memory the SOF marker 177 177 ========================================================================= */ 178 178 179 179 static int ··· 208 208 209 209 static int 210 210 zr36060_pushit (struct zr36060 *ptr, 211 - u16 startreg, 212 - u16 len, 213 - const char *data) 211 + u16 startreg, 212 + u16 len, 213 + const char *data) 214 214 { 215 215 int i = 0; 216 216 ··· 335 335 /* ------------------------------------------------------------------------- */ 336 336 337 337 /* SOF (start of frame) segment depends on width, height and sampling ratio 338 - of each color component */ 338 + of each color component */ 339 339 340 340 static int 341 341 zr36060_set_sof (struct zr36060 *ptr) ··· 367 367 368 368 /* ------------------------------------------------------------------------- */ 369 369 370 - /* SOS (start of scan) segment depends on the used scan components 371 - of each color component */ 370 + /* SOS (start of scan) segment depends on the used scan components 371 + of each color component */ 372 372 373 373 static int 374 374 zr36060_set_sos (struct zr36060 *ptr) ··· 385 385 for (i = 0; i < NO_OF_COMPONENTS; i++) { 386 386 sos_data[5 + (i * 2)] = i; // index 387 387 sos_data[6 + (i * 2)] = (zr36060_td[i] << 4) | 388 - zr36060_ta[i]; // AC/DC tbl.sel. 388 + zr36060_ta[i]; // AC/DC tbl.sel. 389 389 } 390 390 sos_data[2 + 1 + (2 * NO_OF_COMPONENTS) + 2] = 00; // scan start 391 391 sos_data[2 + 1 + (2 * NO_OF_COMPONENTS) + 3] = 0x3f; ··· 999 999 dprintk(1, 1000 1000 "zr36060: something's wrong - %d codecs left somehow.\n", 1001 1001 zr36060_codecs); 1002 - } 1002 + } 1003 1003 1004 1004 /* however, we can't just stay alive */ 1005 1005 videocodec_unregister(&zr36060_codec);
+23 -23
drivers/media/video/zr36120.c
··· 316 316 item->status = FBUFFER_BUSY; 317 317 if (!lastitem) 318 318 ztv->workqueue = item; 319 - else 319 + else 320 320 lastitem->next = item; 321 321 lastitem = item; 322 322 } ··· 516 516 zraor((ztv->vidInterlace*ystep)<<0,~ZORAN_OCR_MASKSTRIDE,ZORAN_OCR); 517 517 } 518 518 519 - struct tvnorm 519 + struct tvnorm 520 520 { 521 521 u16 Wt, Wa, Ht, Ha, HStart, VStart; 522 522 }; ··· 660 660 int HorDcm = 64-X; 661 661 int hcrop1 = 2*(Wa-We)/4; 662 662 /* 663 - * BUGFIX: Juha Nurmela <junki@qn-lpr2-165.quicknet.inet.fi> 663 + * BUGFIX: Juha Nurmela <junki@qn-lpr2-165.quicknet.inet.fi> 664 664 * found the solution to the color phase shift. 665 665 * See ChangeLog for the full explanation) 666 666 */ ··· 812 812 813 813 zoran_common_close(ztv); 814 814 815 - /* 816 - * This is sucky but right now I can't find a good way to 817 - * be sure its safe to free the buffer. We wait 5-6 fields 818 - * which is more than sufficient to be sure. 819 - */ 820 - msleep(100); /* Wait 1/10th of a second */ 815 + /* 816 + * This is sucky but right now I can't find a good way to 817 + * be sure its safe to free the buffer. We wait 5-6 fields 818 + * which is more than sufficient to be sure. 819 + */ 820 + msleep(100); /* Wait 1/10th of a second */ 821 821 822 822 /* free the allocated framebuffer */ 823 823 bfree(ztv->fbuffer, ZORAN_MAX_FBUFSIZE); ··· 1436 1436 1437 1437 /* Why isn't this in the API? 1438 1438 * And why doesn't it take a buffer number? 1439 - case BTTV_FIELDNR: 1439 + case BTTV_FIELDNR: 1440 1440 { 1441 1441 unsigned long v = ztv->lastfieldnr; 1442 1442 if (copy_to_user(arg,&v,sizeof(v))) ··· 1557 1557 1558 1558 zoran_common_close(ztv); 1559 1559 1560 - /* 1561 - * This is sucky but right now I can't find a good way to 1562 - * be sure its safe to free the buffer. We wait 5-6 fields 1563 - * which is more than sufficient to be sure. 1564 - */ 1565 - msleep(100); /* Wait 1/10th of a second */ 1560 + /* 1561 + * This is sucky but right now I can't find a good way to 1562 + * be sure its safe to free the buffer. We wait 5-6 fields 1563 + * which is more than sufficient to be sure. 1564 + */ 1565 + msleep(100); /* Wait 1/10th of a second */ 1566 1566 1567 1567 for (item=ztv->readinfo; item!=ztv->readinfo+ZORAN_VBI_BUFFERS; item++) 1568 1568 { ··· 1620 1620 write_unlock_irq(&ztv->lock); 1621 1621 return -EWOULDBLOCK; 1622 1622 } 1623 - 1623 + 1624 1624 /* mark the unused buffer as wanted */ 1625 1625 unused->status = FBUFFER_BUSY; 1626 1626 unused->next = 0; ··· 1671 1671 if (count == 2*19*2048) { 1672 1672 /* 1673 1673 * Extreme HACK, old VBI programs expect 2048 points 1674 - * of data, and we only got 864 orso. Double each 1674 + * of data, and we only got 864 orso. Double each 1675 1675 * datapoint and clear the rest of the line. 1676 1676 * This way we have appear to have a 1677 1677 * sample_frequency of 29.5 Mc. ··· 1956 1956 zrand(~ZORAN_VDC_TRICOM, ZORAN_VDC); 1957 1957 1958 1958 /* external FL determines TOP frame */ 1959 - zror(ZORAN_VFEC_EXTFL, ZORAN_VFEC); 1959 + zror(ZORAN_VFEC_EXTFL, ZORAN_VFEC); 1960 1960 1961 1961 /* set HSpol */ 1962 1962 if (ztv->card->hsync_pos) ··· 2012 2012 struct zoran *ztv; 2013 2013 int i; 2014 2014 2015 - for (i=0;i<max; i++) 2015 + for (i=0;i<max; i++) 2016 2016 { 2017 2017 ztv = &zorans[i]; 2018 2018 ··· 2029 2029 2030 2030 /* free it */ 2031 2031 free_irq(ztv->dev->irq,ztv); 2032 - 2032 + 2033 2033 /* unregister i2c_bus */ 2034 2034 i2c_unregister_bus((&ztv->i2c)); 2035 2035 ··· 2050 2050 int __init zr36120_init(void) 2051 2051 { 2052 2052 int card; 2053 - 2053 + 2054 2054 handle_chipset(); 2055 2055 zoran_cards = find_zoran(); 2056 2056 if (zoran_cards<0) ··· 2063 2063 /* only release the zorans we have registered */ 2064 2064 release_zoran(card); 2065 2065 return -EIO; 2066 - } 2066 + } 2067 2067 } 2068 2068 return 0; 2069 2069 }
+3 -3
drivers/media/video/zr36120.h
··· 1 - /* 1 + /* 2 2 zr36120.h - Zoran 36120/36125 based framegrabbers 3 3 4 4 Copyright (C) 1998-1999 Pauline Middelink (middelin@polyware.nl) ··· 89 89 ulong* overlay; /* kernel addr of overlay mask */ 90 90 }; 91 91 92 - struct zoran 92 + struct zoran 93 93 { 94 94 struct video_device video_dev; 95 95 #define CARD_DEBUG KERN_DEBUG "%s(%lu): " ··· 106 106 uint norm; /* 0=PAL, 1=NTSC, 2=SECAM */ 107 107 uint tuner_freq; /* Current freq in kHz */ 108 108 struct video_picture picture; /* Current picture params */ 109 - 109 + 110 110 /* videocard details */ 111 111 uint swidth; /* screen width */ 112 112 uint sheight; /* screen height */