aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-11-12 03:31:34 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 05:16:41 -0500
commit87bae740fd50df49337017b3ccbed9dbaeaad610 (patch)
tree2eb4a5a5d2f4af45e0e9caf9dac1762d6013309c /drivers
parent9be1d6cde936dcf9a325eeee01ed64005c98d456 (diff)
[media] gspca - ov519: Cleanup source
- move hexadecimal value to lowercase - remove/add empty lines and spaces - comment unused macros - change some comments Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/ov519.c265
-rw-r--r--drivers/media/video/gspca/w996Xcf.c27
2 files changed, 143 insertions, 149 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c
index 5da1a4e3737..85fc4336b79 100644
--- a/drivers/media/video/gspca/ov519.c
+++ b/drivers/media/video/gspca/ov519.c
@@ -226,7 +226,7 @@ static const struct ctrl sd_ctrls[] = {
226 .type = V4L2_CTRL_TYPE_MENU, 226 .type = V4L2_CTRL_TYPE_MENU,
227 .name = "Light frequency filter", 227 .name = "Light frequency filter",
228 .minimum = 0, 228 .minimum = 0,
229 .maximum = 2, /* 0: 0, 1: 50Hz, 2:60Hz */ 229 .maximum = 2, /* 0: no flicker, 1: 50Hz, 2:60Hz, 3: auto */
230 .step = 1, 230 .step = 1,
231 .default_value = 0, 231 .default_value = 0,
232 }, 232 },
@@ -413,7 +413,6 @@ static const struct v4l2_pix_format ovfx2_ov3610_mode[] = {
413 .priv = 0}, 413 .priv = 0},
414}; 414};
415 415
416
417/* Registers common to OV511 / OV518 */ 416/* Registers common to OV511 / OV518 */
418#define R51x_FIFO_PSIZE 0x30 /* 2 bytes wide w/ OV518(+) */ 417#define R51x_FIFO_PSIZE 0x30 /* 2 bytes wide w/ OV518(+) */
419#define R51x_SYS_RESET 0x50 418#define R51x_SYS_RESET 0x50
@@ -421,7 +420,7 @@ static const struct v4l2_pix_format ovfx2_ov3610_mode[] = {
421 #define OV511_RESET_OMNICE 0x08 420 #define OV511_RESET_OMNICE 0x08
422#define R51x_SYS_INIT 0x53 421#define R51x_SYS_INIT 0x53
423#define R51x_SYS_SNAP 0x52 422#define R51x_SYS_SNAP 0x52
424#define R51x_SYS_CUST_ID 0x5F 423#define R51x_SYS_CUST_ID 0x5f
425#define R51x_COMP_LUT_BEGIN 0x80 424#define R51x_COMP_LUT_BEGIN 0x80
426 425
427/* OV511 Camera interface register numbers */ 426/* OV511 Camera interface register numbers */
@@ -436,13 +435,13 @@ static const struct v4l2_pix_format ovfx2_ov3610_mode[] = {
436#define R511_CAM_OPTS 0x18 435#define R511_CAM_OPTS 0x18
437 436
438#define R511_SNAP_FRAME 0x19 437#define R511_SNAP_FRAME 0x19
439#define R511_SNAP_PXCNT 0x1A 438#define R511_SNAP_PXCNT 0x1a
440#define R511_SNAP_LNCNT 0x1B 439#define R511_SNAP_LNCNT 0x1b
441#define R511_SNAP_PXDIV 0x1C 440#define R511_SNAP_PXDIV 0x1c
442#define R511_SNAP_LNDIV 0x1D 441#define R511_SNAP_LNDIV 0x1d
443#define R511_SNAP_UV_EN 0x1E 442#define R511_SNAP_UV_EN 0x1e
444#define R511_SNAP_UV_EN 0x1E 443#define R511_SNAP_UV_EN 0x1e
445#define R511_SNAP_OPTS 0x1F 444#define R511_SNAP_OPTS 0x1f
446 445
447#define R511_DRAM_FLOW_CTL 0x20 446#define R511_DRAM_FLOW_CTL 0x20
448#define R511_FIFO_OPTS 0x31 447#define R511_FIFO_OPTS 0x31
@@ -467,13 +466,13 @@ static const struct v4l2_pix_format ovfx2_ov3610_mode[] = {
467#define OV519_R25_FORMAT 0x25 466#define OV519_R25_FORMAT 0x25
468 467
469/* OV519 System Controller register numbers */ 468/* OV519 System Controller register numbers */
470#define OV519_SYS_RESET1 0x51 469#define OV519_SYS_RESET1 0x51
471#define OV519_SYS_EN_CLK1 0x54 470#define OV519_SYS_EN_CLK1 0x54
472 471
473#define OV519_GPIO_DATA_OUT0 0x71 472#define OV519_GPIO_DATA_OUT0 0x71
474#define OV519_GPIO_IO_CTRL0 0x72 473#define OV519_GPIO_IO_CTRL0 0x72
475 474
476#define OV511_ENDPOINT_ADDRESS 1 /* Isoc endpoint number */ 475/*#define OV511_ENDPOINT_ADDRESS 1 * Isoc endpoint number */
477 476
478/* 477/*
479 * The FX2 chip does not give us a zero length read at end of frame. 478 * The FX2 chip does not give us a zero length read at end of frame.
@@ -528,71 +527,71 @@ static const struct v4l2_pix_format ovfx2_ov3610_mode[] = {
528#define OV7610_REG_COM_I 0x29 /* misc settings */ 527#define OV7610_REG_COM_I 0x29 /* misc settings */
529 528
530/* OV7670 registers */ 529/* OV7670 registers */
531#define OV7670_REG_GAIN 0x00 /* Gain lower 8 bits (rest in vref) */ 530#define OV7670_REG_GAIN 0x00 /* Gain lower 8 bits (rest in vref) */
532#define OV7670_REG_BLUE 0x01 /* blue gain */ 531#define OV7670_REG_BLUE 0x01 /* blue gain */
533#define OV7670_REG_RED 0x02 /* red gain */ 532#define OV7670_REG_RED 0x02 /* red gain */
534#define OV7670_REG_VREF 0x03 /* Pieces of GAIN, VSTART, VSTOP */ 533#define OV7670_REG_VREF 0x03 /* Pieces of GAIN, VSTART, VSTOP */
535#define OV7670_REG_COM1 0x04 /* Control 1 */ 534#define OV7670_REG_COM1 0x04 /* Control 1 */
536#define OV7670_REG_AECHH 0x07 /* AEC MS 5 bits */ 535/*#define OV7670_REG_AECHH 0x07 * AEC MS 5 bits */
537#define OV7670_REG_COM3 0x0c /* Control 3 */ 536#define OV7670_REG_COM3 0x0c /* Control 3 */
538#define OV7670_REG_COM4 0x0d /* Control 4 */ 537#define OV7670_REG_COM4 0x0d /* Control 4 */
539#define OV7670_REG_COM5 0x0e /* All "reserved" */ 538#define OV7670_REG_COM5 0x0e /* All "reserved" */
540#define OV7670_REG_COM6 0x0f /* Control 6 */ 539#define OV7670_REG_COM6 0x0f /* Control 6 */
541#define OV7670_REG_AECH 0x10 /* More bits of AEC value */ 540#define OV7670_REG_AECH 0x10 /* More bits of AEC value */
542#define OV7670_REG_CLKRC 0x11 /* Clock control */ 541#define OV7670_REG_CLKRC 0x11 /* Clock control */
543#define OV7670_REG_COM7 0x12 /* Control 7 */ 542#define OV7670_REG_COM7 0x12 /* Control 7 */
544#define OV7670_COM7_FMT_VGA 0x00 543#define OV7670_COM7_FMT_VGA 0x00
545#define OV7670_COM7_YUV 0x00 /* YUV */ 544/*#define OV7670_COM7_YUV 0x00 * YUV */
546#define OV7670_COM7_FMT_QVGA 0x10 /* QVGA format */ 545#define OV7670_COM7_FMT_QVGA 0x10 /* QVGA format */
547#define OV7670_COM7_FMT_MASK 0x38 546#define OV7670_COM7_FMT_MASK 0x38
548#define OV7670_COM7_RESET 0x80 /* Register reset */ 547#define OV7670_COM7_RESET 0x80 /* Register reset */
549#define OV7670_REG_COM8 0x13 /* Control 8 */ 548#define OV7670_REG_COM8 0x13 /* Control 8 */
550#define OV7670_COM8_AEC 0x01 /* Auto exposure enable */ 549#define OV7670_COM8_AEC 0x01 /* Auto exposure enable */
551#define OV7670_COM8_AWB 0x02 /* White balance enable */ 550#define OV7670_COM8_AWB 0x02 /* White balance enable */
552#define OV7670_COM8_AGC 0x04 /* Auto gain enable */ 551#define OV7670_COM8_AGC 0x04 /* Auto gain enable */
553#define OV7670_COM8_BFILT 0x20 /* Band filter enable */ 552#define OV7670_COM8_BFILT 0x20 /* Band filter enable */
554#define OV7670_COM8_AECSTEP 0x40 /* Unlimited AEC step size */ 553#define OV7670_COM8_AECSTEP 0x40 /* Unlimited AEC step size */
555#define OV7670_COM8_FASTAEC 0x80 /* Enable fast AGC/AEC */ 554#define OV7670_COM8_FASTAEC 0x80 /* Enable fast AGC/AEC */
556#define OV7670_REG_COM9 0x14 /* Control 9 - gain ceiling */ 555#define OV7670_REG_COM9 0x14 /* Control 9 - gain ceiling */
557#define OV7670_REG_COM10 0x15 /* Control 10 */ 556#define OV7670_REG_COM10 0x15 /* Control 10 */
558#define OV7670_REG_HSTART 0x17 /* Horiz start high bits */ 557#define OV7670_REG_HSTART 0x17 /* Horiz start high bits */
559#define OV7670_REG_HSTOP 0x18 /* Horiz stop high bits */ 558#define OV7670_REG_HSTOP 0x18 /* Horiz stop high bits */
560#define OV7670_REG_VSTART 0x19 /* Vert start high bits */ 559#define OV7670_REG_VSTART 0x19 /* Vert start high bits */
561#define OV7670_REG_VSTOP 0x1a /* Vert stop high bits */ 560#define OV7670_REG_VSTOP 0x1a /* Vert stop high bits */
562#define OV7670_REG_MVFP 0x1e /* Mirror / vflip */ 561#define OV7670_REG_MVFP 0x1e /* Mirror / vflip */
563#define OV7670_MVFP_VFLIP 0x10 /* vertical flip */ 562#define OV7670_MVFP_VFLIP 0x10 /* vertical flip */
564#define OV7670_MVFP_MIRROR 0x20 /* Mirror image */ 563#define OV7670_MVFP_MIRROR 0x20 /* Mirror image */
565#define OV7670_REG_AEW 0x24 /* AGC upper limit */ 564#define OV7670_REG_AEW 0x24 /* AGC upper limit */
566#define OV7670_REG_AEB 0x25 /* AGC lower limit */ 565#define OV7670_REG_AEB 0x25 /* AGC lower limit */
567#define OV7670_REG_VPT 0x26 /* AGC/AEC fast mode op region */ 566#define OV7670_REG_VPT 0x26 /* AGC/AEC fast mode op region */
568#define OV7670_REG_HREF 0x32 /* HREF pieces */ 567#define OV7670_REG_HREF 0x32 /* HREF pieces */
569#define OV7670_REG_TSLB 0x3a /* lots of stuff */ 568#define OV7670_REG_TSLB 0x3a /* lots of stuff */
570#define OV7670_REG_COM11 0x3b /* Control 11 */ 569#define OV7670_REG_COM11 0x3b /* Control 11 */
571#define OV7670_COM11_EXP 0x02 570#define OV7670_COM11_EXP 0x02
572#define OV7670_COM11_HZAUTO 0x10 /* Auto detect 50/60 Hz */ 571#define OV7670_COM11_HZAUTO 0x10 /* Auto detect 50/60 Hz */
573#define OV7670_REG_COM12 0x3c /* Control 12 */ 572#define OV7670_REG_COM12 0x3c /* Control 12 */
574#define OV7670_REG_COM13 0x3d /* Control 13 */ 573#define OV7670_REG_COM13 0x3d /* Control 13 */
575#define OV7670_COM13_GAMMA 0x80 /* Gamma enable */ 574#define OV7670_COM13_GAMMA 0x80 /* Gamma enable */
576#define OV7670_COM13_UVSAT 0x40 /* UV saturation auto adjustment */ 575#define OV7670_COM13_UVSAT 0x40 /* UV saturation auto adjustment */
577#define OV7670_REG_COM14 0x3e /* Control 14 */ 576#define OV7670_REG_COM14 0x3e /* Control 14 */
578#define OV7670_REG_EDGE 0x3f /* Edge enhancement factor */ 577#define OV7670_REG_EDGE 0x3f /* Edge enhancement factor */
579#define OV7670_REG_COM15 0x40 /* Control 15 */ 578#define OV7670_REG_COM15 0x40 /* Control 15 */
580#define OV7670_COM15_R00FF 0xc0 /* 00 to FF */ 579/*#define OV7670_COM15_R00FF 0xc0 * 00 to FF */
581#define OV7670_REG_COM16 0x41 /* Control 16 */ 580#define OV7670_REG_COM16 0x41 /* Control 16 */
582#define OV7670_COM16_AWBGAIN 0x08 /* AWB gain enable */ 581#define OV7670_COM16_AWBGAIN 0x08 /* AWB gain enable */
583#define OV7670_REG_BRIGHT 0x55 /* Brightness */ 582#define OV7670_REG_BRIGHT 0x55 /* Brightness */
584#define OV7670_REG_CONTRAS 0x56 /* Contrast control */ 583#define OV7670_REG_CONTRAS 0x56 /* Contrast control */
585#define OV7670_REG_GFIX 0x69 /* Fix gain control */ 584#define OV7670_REG_GFIX 0x69 /* Fix gain control */
586#define OV7670_REG_RGB444 0x8c /* RGB 444 control */ 585#define OV7670_REG_RGB444 0x8c /* RGB 444 control */
587#define OV7670_REG_HAECC1 0x9f /* Hist AEC/AGC control 1 */ 586#define OV7670_REG_HAECC1 0x9f /* Hist AEC/AGC control 1 */
588#define OV7670_REG_HAECC2 0xa0 /* Hist AEC/AGC control 2 */ 587#define OV7670_REG_HAECC2 0xa0 /* Hist AEC/AGC control 2 */
589#define OV7670_REG_BD50MAX 0xa5 /* 50hz banding step limit */ 588#define OV7670_REG_BD50MAX 0xa5 /* 50hz banding step limit */
590#define OV7670_REG_HAECC3 0xa6 /* Hist AEC/AGC control 3 */ 589#define OV7670_REG_HAECC3 0xa6 /* Hist AEC/AGC control 3 */
591#define OV7670_REG_HAECC4 0xa7 /* Hist AEC/AGC control 4 */ 590#define OV7670_REG_HAECC4 0xa7 /* Hist AEC/AGC control 4 */
592#define OV7670_REG_HAECC5 0xa8 /* Hist AEC/AGC control 5 */ 591#define OV7670_REG_HAECC5 0xa8 /* Hist AEC/AGC control 5 */
593#define OV7670_REG_HAECC6 0xa9 /* Hist AEC/AGC control 6 */ 592#define OV7670_REG_HAECC6 0xa9 /* Hist AEC/AGC control 6 */
594#define OV7670_REG_HAECC7 0xaa /* Hist AEC/AGC control 7 */ 593#define OV7670_REG_HAECC7 0xaa /* Hist AEC/AGC control 7 */
595#define OV7670_REG_BD60MAX 0xab /* 60hz banding step limit */ 594#define OV7670_REG_BD60MAX 0xab /* 60hz banding step limit */
596 595
597struct ov_regvals { 596struct ov_regvals {
598 u8 reg; 597 u8 reg;
@@ -618,7 +617,6 @@ static const struct ov_i2c_regvals norm_3620b[] = {
618 * "wait 4096 external clock ... to make sure the sensor is 617 * "wait 4096 external clock ... to make sure the sensor is
619 * stable and ready to access registers" i.e. 160us at 24MHz 618 * stable and ready to access registers" i.e. 160us at 24MHz
620 */ 619 */
621
622 { 0x12, 0x80 }, /* COMH reset */ 620 { 0x12, 0x80 }, /* COMH reset */
623 { 0x12, 0x00 }, /* QXGA, master */ 621 { 0x12, 0x00 }, /* QXGA, master */
624 622
@@ -651,7 +649,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
651 * COMI[0] "Exposure control" 649 * COMI[0] "Exposure control"
652 * = 0 (0x00) .......0 "Manual" 650 * = 0 (0x00) .......0 "Manual"
653 */ 651 */
654 { 0x13, 0xC0 }, 652 { 0x13, 0xc0 },
655 653
656 /* 654 /*
657 * 09 COMC "Common Control C" 655 * 09 COMC "Common Control C"
@@ -707,7 +705,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
707 * COME[0] "Auto zero circuit select" 705 * COME[0] "Auto zero circuit select"
708 * = 1 (0x01) .......1 "On" 706 * = 1 (0x01) .......1 "On"
709 */ 707 */
710 { 0x0d, 0xA1 }, 708 { 0x0d, 0xa1 },
711 709
712 /* 710 /*
713 * 0E COMF "Common Control F" 711 * 0E COMF "Common Control F"
@@ -771,7 +769,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
771 * COMJ[0] "Reserved" 769 * COMJ[0] "Reserved"
772 * = 0 (0x00) .......0 770 * = 0 (0x00) .......0
773 */ 771 */
774 { 0x14, 0xC6 }, 772 { 0x14, 0xc6 },
775 773
776 /* 774 /*
777 * 15 COMK "Common Control K" 775 * 15 COMK "Common Control K"
@@ -877,7 +875,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
877 * FVOPT[7:0] "Range" 875 * FVOPT[7:0] "Range"
878 * = 31 (0x1F) 00011111 876 * = 31 (0x1F) 00011111
879 */ 877 */
880 { 0x3c, 0x1F }, 878 { 0x3c, 0x1f },
881 879
882 /* 880 /*
883 * 44 Undocumented = 0 (0x00) 00000000 881 * 44 Undocumented = 0 (0x00) 00000000
@@ -926,7 +924,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
926 * 48[7:0] "It's a secret" 924 * 48[7:0] "It's a secret"
927 * = 192 (0xC0) 11000000 925 * = 192 (0xC0) 11000000
928 */ 926 */
929 { 0x48, 0xC0 }, 927 { 0x48, 0xc0 },
930 928
931 /* 929 /*
932 * 49 Undocumented = 25 (0x19) 00011001 930 * 49 Undocumented = 25 (0x19) 00011001
@@ -940,18 +938,18 @@ static const struct ov_i2c_regvals norm_3620b[] = {
940 * 4B[7:0] "It's a secret" 938 * 4B[7:0] "It's a secret"
941 * = 128 (0x80) 10000000 939 * = 128 (0x80) 10000000
942 */ 940 */
943 { 0x4B, 0x80 }, 941 { 0x4b, 0x80 },
944 942
945 /* 943 /*
946 * 4D Undocumented = 196 (0xC4) 11000100 944 * 4D Undocumented = 196 (0xC4) 11000100
947 * 4D[7:0] "It's a secret" 945 * 4D[7:0] "It's a secret"
948 * = 196 (0xC4) 11000100 946 * = 196 (0xC4) 11000100
949 */ 947 */
950 { 0x4D, 0xC4 }, 948 { 0x4d, 0xc4 },
951 949
952 /* 950 /*
953 * 35 VREF "Reference Voltage Control" 951 * 35 VREF "Reference Voltage Control"
954 * = 76 (0x4C) 01001100 952 * = 76 (0x4c) 01001100
955 * VREF[7:5] "Column high reference control" 953 * VREF[7:5] "Column high reference control"
956 * = 2 (0x02) 010..... "higher voltage" 954 * = 2 (0x02) 010..... "higher voltage"
957 * VREF[4:2] "Column low reference control" 955 * VREF[4:2] "Column low reference control"
@@ -959,21 +957,21 @@ static const struct ov_i2c_regvals norm_3620b[] = {
959 * VREF[1:0] "Reserved" 957 * VREF[1:0] "Reserved"
960 * = 0 (0x00) ......00 958 * = 0 (0x00) ......00
961 */ 959 */
962 { 0x35, 0x4C }, 960 { 0x35, 0x4c },
963 961
964 /* 962 /*
965 * 3D Undocumented = 0 (0x00) 00000000 963 * 3D Undocumented = 0 (0x00) 00000000
966 * 3D[7:0] "It's a secret" 964 * 3D[7:0] "It's a secret"
967 * = 0 (0x00) 00000000 965 * = 0 (0x00) 00000000
968 */ 966 */
969 { 0x3D, 0x00 }, 967 { 0x3d, 0x00 },
970 968
971 /* 969 /*
972 * 3E Undocumented = 0 (0x00) 00000000 970 * 3E Undocumented = 0 (0x00) 00000000
973 * 3E[7:0] "It's a secret" 971 * 3E[7:0] "It's a secret"
974 * = 0 (0x00) 00000000 972 * = 0 (0x00) 00000000
975 */ 973 */
976 { 0x3E, 0x00 }, 974 { 0x3e, 0x00 },
977 975
978 /* 976 /*
979 * 3B FREFB "Internal Reference Adjustment" 977 * 3B FREFB "Internal Reference Adjustment"
@@ -1013,7 +1011,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1013 * VBLM[3:0] "Sensor current control" 1011 * VBLM[3:0] "Sensor current control"
1014 * = 10 (0x0A) ....1010 1012 * = 10 (0x0A) ....1010
1015 */ 1013 */
1016 { 0x34, 0x5A }, 1014 { 0x34, 0x5a },
1017 1015
1018 /* 1016 /*
1019 * 3B FREFB "Internal Reference Adjustment" 1017 * 3B FREFB "Internal Reference Adjustment"
@@ -1079,7 +1077,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1079 * HREFST[7:0] "Horizontal window start, 8 MSBs" 1077 * HREFST[7:0] "Horizontal window start, 8 MSBs"
1080 * = 31 (0x1F) 00011111 1078 * = 31 (0x1F) 00011111
1081 */ 1079 */
1082 { 0x17, 0x1F }, 1080 { 0x17, 0x1f },
1083 1081
1084 /* 1082 /*
1085 * 18 HREFEND "Horizontal window end" 1083 * 18 HREFEND "Horizontal window end"
@@ -1087,7 +1085,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1087 * HREFEND[7:0] "Horizontal Window End, 8 MSBs" 1085 * HREFEND[7:0] "Horizontal Window End, 8 MSBs"
1088 * = 95 (0x5F) 01011111 1086 * = 95 (0x5F) 01011111
1089 */ 1087 */
1090 { 0x18, 0x5F }, 1088 { 0x18, 0x5f },
1091 1089
1092 /* 1090 /*
1093 * 19 VSTRT "Vertical window start" 1091 * 19 VSTRT "Vertical window start"
@@ -1127,7 +1125,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1127 * COMA[1:0] "Vertical window start line control 2 LSBs" 1125 * COMA[1:0] "Vertical window start line control 2 LSBs"
1128 * = 2 (0x02) ......10 1126 * = 2 (0x02) ......10
1129 */ 1127 */
1130 { 0x03, 0x4A }, 1128 { 0x03, 0x4a },
1131 1129
1132 /* 1130 /*
1133 * 11 CLKRC "Clock Rate Control" 1131 * 11 CLKRC "Clock Rate Control"
@@ -1184,7 +1182,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1184 * HREFST[7:0] "Horizontal window start, 8 MSBs" 1182 * HREFST[7:0] "Horizontal window start, 8 MSBs"
1185 * = 31 (0x1F) 00011111 1183 * = 31 (0x1F) 00011111
1186 */ 1184 */
1187 { 0x17, 0x1F }, 1185 { 0x17, 0x1f },
1188 1186
1189 /* 1187 /*
1190 * 18 HREFEND "Horizontal window end" 1188 * 18 HREFEND "Horizontal window end"
@@ -1192,7 +1190,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1192 * HREFEND[7:0] "Horizontal Window End, 8 MSBs" 1190 * HREFEND[7:0] "Horizontal Window End, 8 MSBs"
1193 * = 95 (0x5F) 01011111 1191 * = 95 (0x5F) 01011111
1194 */ 1192 */
1195 { 0x18, 0x5F }, 1193 { 0x18, 0x5f },
1196 1194
1197 /* 1195 /*
1198 * 19 VSTRT "Vertical window start" 1196 * 19 VSTRT "Vertical window start"
@@ -1232,7 +1230,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1232 * COMA[1:0] "Vertical window start line control 2 LSBs" 1230 * COMA[1:0] "Vertical window start line control 2 LSBs"
1233 * = 2 (0x02) ......10 1231 * = 2 (0x02) ......10
1234 */ 1232 */
1235 { 0x03, 0x4A }, 1233 { 0x03, 0x4a },
1236 1234
1237 /* 1235 /*
1238 * 02 RED "Red Gain Control" 1236 * 02 RED "Red Gain Control"
@@ -1242,7 +1240,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1242 * RED[6:0] "Value" 1240 * RED[6:0] "Value"
1243 * = 47 (0x2F) .0101111 1241 * = 47 (0x2F) .0101111
1244 */ 1242 */
1245 { 0x02, 0xAF }, 1243 { 0x02, 0xaf },
1246 1244
1247 /* 1245 /*
1248 * 2D ADDVSL "VSYNC Pulse Width" 1246 * 2D ADDVSL "VSYNC Pulse Width"
@@ -1250,7 +1248,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1250 * ADDVSL[7:0] "VSYNC pulse width, LSB" 1248 * ADDVSL[7:0] "VSYNC pulse width, LSB"
1251 * = 210 (0xD2) 11010010 1249 * = 210 (0xD2) 11010010
1252 */ 1250 */
1253 { 0x2d, 0xD2 }, 1251 { 0x2d, 0xd2 },
1254 1252
1255 /* 1253 /*
1256 * 00 GAIN = 24 (0x18) 00011000 1254 * 00 GAIN = 24 (0x18) 00011000
@@ -1273,7 +1271,7 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1273 * BLUE[6:0] "Value" 1271 * BLUE[6:0] "Value"
1274 * = 112 (0x70) .1110000 1272 * = 112 (0x70) .1110000
1275 */ 1273 */
1276 { 0x01, 0xF0 }, 1274 { 0x01, 0xf0 },
1277 1275
1278 /* 1276 /*
1279 * 10 AEC "Automatic Exposure Control" 1277 * 10 AEC "Automatic Exposure Control"
@@ -1281,14 +1279,14 @@ static const struct ov_i2c_regvals norm_3620b[] = {
1281 * AEC[7:0] "Automatic Exposure Control, 8 MSBs" 1279 * AEC[7:0] "Automatic Exposure Control, 8 MSBs"
1282 * = 10 (0x0A) 00001010 1280 * = 10 (0x0A) 00001010
1283 */ 1281 */
1284 { 0x10, 0x0A }, 1282 { 0x10, 0x0a },
1285 1283
1286 { 0xE1, 0x67 }, 1284 { 0xe1, 0x67 },
1287 { 0xE3, 0x03 }, 1285 { 0xe3, 0x03 },
1288 { 0xE4, 0x26 }, 1286 { 0xe4, 0x26 },
1289 { 0xE5, 0x3E }, 1287 { 0xe5, 0x3e },
1290 { 0xF8, 0x01 }, 1288 { 0xf8, 0x01 },
1291 { 0xFF, 0x01 }, 1289 { 0xff, 0x01 },
1292}; 1290};
1293 1291
1294static const struct ov_i2c_regvals norm_6x20[] = { 1292static const struct ov_i2c_regvals norm_6x20[] = {
@@ -1297,7 +1295,7 @@ static const struct ov_i2c_regvals norm_6x20[] = {
1297 { 0x03, 0x60 }, 1295 { 0x03, 0x60 },
1298 { 0x05, 0x7f }, /* For when autoadjust is off */ 1296 { 0x05, 0x7f }, /* For when autoadjust is off */
1299 { 0x07, 0xa8 }, 1297 { 0x07, 0xa8 },
1300 /* The ratio of 0x0c and 0x0d controls the white point */ 1298 /* The ratio of 0x0c and 0x0d controls the white point */
1301 { 0x0c, 0x24 }, 1299 { 0x0c, 0x24 },
1302 { 0x0d, 0x24 }, 1300 { 0x0d, 0x24 },
1303 { 0x0f, 0x15 }, /* COMS */ 1301 { 0x0f, 0x15 }, /* COMS */
@@ -2217,7 +2215,7 @@ static int i2c_w(struct sd *sd, u8 reg, u8 value)
2217 /* Up on sensor reset empty the register cache */ 2215 /* Up on sensor reset empty the register cache */
2218 if (reg == 0x12 && (value & 0x80)) 2216 if (reg == 0x12 && (value & 0x80))
2219 memset(sd->sensor_reg_cache, -1, 2217 memset(sd->sensor_reg_cache, -1,
2220 sizeof(sd->sensor_reg_cache)); 2218 sizeof(sd->sensor_reg_cache));
2221 else 2219 else
2222 sd->sensor_reg_cache[reg] = value; 2220 sd->sensor_reg_cache[reg] = value;
2223 } 2221 }
@@ -2366,6 +2364,7 @@ static int init_ov_sensor(struct sd *sd, u8 slave)
2366 return -EIO; 2364 return -EIO;
2367 /* Wait for it to initialize */ 2365 /* Wait for it to initialize */
2368 msleep(150); 2366 msleep(150);
2367
2369 /* Dummy read to sync I2C */ 2368 /* Dummy read to sync I2C */
2370 if (i2c_r(sd, 0x00) < 0) 2369 if (i2c_r(sd, 0x00) < 0)
2371 return -EIO; 2370 return -EIO;
@@ -2457,7 +2456,7 @@ static int ov_hires_configure(struct sd *sd)
2457 sd->sensor = SEN_OV3610; 2456 sd->sensor = SEN_OV3610;
2458 } else { 2457 } else {
2459 err("Error unknown sensor type: 0x%02x%02x", 2458 err("Error unknown sensor type: 0x%02x%02x",
2460 high, low); 2459 high, low);
2461 return -1; 2460 return -1;
2462 } 2461 }
2463 2462
@@ -2499,7 +2498,6 @@ static int ov7xx0_configure(struct sd *sd)
2499{ 2498{
2500 int rc, high, low; 2499 int rc, high, low;
2501 2500
2502
2503 PDEBUG(D_PROBE, "starting OV7xx0 configuration"); 2501 PDEBUG(D_PROBE, "starting OV7xx0 configuration");
2504 2502
2505 /* Detect sensor (sub)type */ 2503 /* Detect sensor (sub)type */
@@ -2711,7 +2709,6 @@ static int ov51x_upload_quan_tables(struct sd *sd)
2711 6, 6, 6, 6, 7, 7, 7, 8, 2709 6, 6, 6, 6, 7, 7, 7, 8,
2712 7, 7, 6, 7, 7, 7, 8, 8 2710 7, 7, 6, 7, 7, 7, 8, 8
2713 }; 2711 };
2714
2715 const unsigned char uvQuanTable518[] = { 2712 const unsigned char uvQuanTable518[] = {
2716 6, 6, 6, 7, 7, 7, 7, 7, 2713 6, 6, 6, 7, 7, 7, 7, 7,
2717 6, 6, 6, 7, 7, 7, 7, 7, 2714 6, 6, 6, 7, 7, 7, 7, 7,
@@ -2728,11 +2725,11 @@ static int ov51x_upload_quan_tables(struct sd *sd)
2728 if (sd->bridge == BRIDGE_OV511 || sd->bridge == BRIDGE_OV511PLUS) { 2725 if (sd->bridge == BRIDGE_OV511 || sd->bridge == BRIDGE_OV511PLUS) {
2729 pYTable = yQuanTable511; 2726 pYTable = yQuanTable511;
2730 pUVTable = uvQuanTable511; 2727 pUVTable = uvQuanTable511;
2731 size = 32; 2728 size = 32;
2732 } else { 2729 } else {
2733 pYTable = yQuanTable518; 2730 pYTable = yQuanTable518;
2734 pUVTable = uvQuanTable518; 2731 pUVTable = uvQuanTable518;
2735 size = 16; 2732 size = 16;
2736 } 2733 }
2737 2734
2738 for (i = 0; i < size; i++) { 2735 for (i = 0; i < size; i++) {
@@ -2893,7 +2890,7 @@ static int ov518_configure(struct gspca_dev *gspca_dev)
2893 2890
2894 /* First 5 bits of custom ID reg are a revision ID on OV518 */ 2891 /* First 5 bits of custom ID reg are a revision ID on OV518 */
2895 PDEBUG(D_PROBE, "Device revision %d", 2892 PDEBUG(D_PROBE, "Device revision %d",
2896 0x1F & reg_r(sd, R51x_SYS_CUST_ID)); 2893 0x1f & reg_r(sd, R51x_SYS_CUST_ID));
2897 2894
2898 rc = write_regvals(sd, init_518, ARRAY_SIZE(init_518)); 2895 rc = write_regvals(sd, init_518, ARRAY_SIZE(init_518));
2899 if (rc < 0) 2896 if (rc < 0)
@@ -2933,18 +2930,18 @@ static int ov518_configure(struct gspca_dev *gspca_dev)
2933static int ov519_configure(struct sd *sd) 2930static int ov519_configure(struct sd *sd)
2934{ 2931{
2935 static const struct ov_regvals init_519[] = { 2932 static const struct ov_regvals init_519[] = {
2936 { 0x5a, 0x6d }, /* EnableSystem */ 2933 { 0x5a, 0x6d }, /* EnableSystem */
2937 { 0x53, 0x9b }, 2934 { 0x53, 0x9b },
2938 { 0x54, 0xff }, /* set bit2 to enable jpeg */ 2935 { 0x54, 0xff }, /* set bit2 to enable jpeg */
2939 { 0x5d, 0x03 }, 2936 { 0x5d, 0x03 },
2940 { 0x49, 0x01 }, 2937 { 0x49, 0x01 },
2941 { 0x48, 0x00 }, 2938 { 0x48, 0x00 },
2942 /* Set LED pin to output mode. Bit 4 must be cleared or sensor 2939 /* Set LED pin to output mode. Bit 4 must be cleared or sensor
2943 * detection will fail. This deserves further investigation. */ 2940 * detection will fail. This deserves further investigation. */
2944 { OV519_GPIO_IO_CTRL0, 0xee }, 2941 { OV519_GPIO_IO_CTRL0, 0xee },
2945 { 0x51, 0x0f }, /* SetUsbInit */ 2942 { 0x51, 0x0f }, /* SetUsbInit */
2946 { 0x51, 0x00 }, 2943 { 0x51, 0x00 },
2947 { 0x22, 0x00 }, 2944 { 0x22, 0x00 },
2948 /* windows reads 0x55 at this point*/ 2945 /* windows reads 0x55 at this point*/
2949 }; 2946 };
2950 2947
@@ -3335,7 +3332,6 @@ static int ov518_mode_init_regs(struct sd *sd)
3335 ov518_reg_w32(sd, R51x_FIFO_PSIZE, packet_size & ~7, 2); 3332 ov518_reg_w32(sd, R51x_FIFO_PSIZE, packet_size & ~7, 2);
3336 3333
3337 /******** Set the mode ********/ 3334 /******** Set the mode ********/
3338
3339 reg_w(sd, 0x2b, 0); 3335 reg_w(sd, 0x2b, 0);
3340 reg_w(sd, 0x2c, 0); 3336 reg_w(sd, 0x2c, 0);
3341 reg_w(sd, 0x2d, 0); 3337 reg_w(sd, 0x2d, 0);
@@ -3369,7 +3365,7 @@ static int ov518_mode_init_regs(struct sd *sd)
3369 /* Windows driver does this here; who knows why */ 3365 /* Windows driver does this here; who knows why */
3370 reg_w(sd, 0x2f, 0x80); 3366 reg_w(sd, 0x2f, 0x80);
3371 3367
3372 /******** Set the framerate ********/ 3368 /******** Set the framerate ********/
3373 sd->clockdiv = 1; 3369 sd->clockdiv = 1;
3374 3370
3375 /* Mode independent, but framerate dependent, regs */ 3371 /* Mode independent, but framerate dependent, regs */
@@ -3436,7 +3432,6 @@ static int ov518_mode_init_regs(struct sd *sd)
3436 return 0; 3432 return 0;
3437} 3433}
3438 3434
3439
3440/* Sets up the OV519 with the given image parameters 3435/* Sets up the OV519 with the given image parameters
3441 * 3436 *
3442 * OV519 needs a completely different approach, until we can figure out what 3437 * OV519 needs a completely different approach, until we can figure out what
@@ -3609,7 +3604,7 @@ static int mode_init_ov_sensor_regs(struct sd *sd)
3609 u8 v; 3604 u8 v;
3610 3605
3611 gspca_dev = &sd->gspca_dev; 3606 gspca_dev = &sd->gspca_dev;
3612 qvga = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv & 1; 3607 qvga = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv & 1;
3613 3608
3614 /******** Mode (VGA/QVGA) and sensor specific regs ********/ 3609 /******** Mode (VGA/QVGA) and sensor specific regs ********/
3615 switch (sd->sensor) { 3610 switch (sd->sensor) {
@@ -3777,8 +3772,8 @@ static int set_ov_sensor_window(struct sd *sd)
3777 return mode_init_ov_sensor_regs(sd); 3772 return mode_init_ov_sensor_regs(sd);
3778 3773
3779 gspca_dev = &sd->gspca_dev; 3774 gspca_dev = &sd->gspca_dev;
3780 qvga = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv & 1; 3775 qvga = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv & 1;
3781 crop = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv & 2; 3776 crop = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].priv & 2;
3782 3777
3783 /* The different sensor ICs handle setting up of window differently. 3778 /* The different sensor ICs handle setting up of window differently.
3784 * IF YOU SET IT WRONG, YOU WILL GET ALL ZERO ISOC DATA FROM OV51x!! */ 3779 * IF YOU SET IT WRONG, YOU WILL GET ALL ZERO ISOC DATA FROM OV51x!! */
@@ -4458,14 +4453,14 @@ static const __devinitdata struct usb_device_id device_table[] = {
4458 {USB_DEVICE(0x041e, 0x4060), .driver_info = BRIDGE_OV519 }, 4453 {USB_DEVICE(0x041e, 0x4060), .driver_info = BRIDGE_OV519 },
4459 {USB_DEVICE(0x041e, 0x4061), .driver_info = BRIDGE_OV519 }, 4454 {USB_DEVICE(0x041e, 0x4061), .driver_info = BRIDGE_OV519 },
4460 {USB_DEVICE(0x041e, 0x4064), 4455 {USB_DEVICE(0x041e, 0x4064),
4461 .driver_info = BRIDGE_OV519 | BRIDGE_INVERT_LED }, 4456 .driver_info = BRIDGE_OV519 | BRIDGE_INVERT_LED },
4462 {USB_DEVICE(0x041e, 0x4067), .driver_info = BRIDGE_OV519 }, 4457 {USB_DEVICE(0x041e, 0x4067), .driver_info = BRIDGE_OV519 },
4463 {USB_DEVICE(0x041e, 0x4068), 4458 {USB_DEVICE(0x041e, 0x4068),
4464 .driver_info = BRIDGE_OV519 | BRIDGE_INVERT_LED }, 4459 .driver_info = BRIDGE_OV519 | BRIDGE_INVERT_LED },
4465 {USB_DEVICE(0x045e, 0x028c), .driver_info = BRIDGE_OV519 }, 4460 {USB_DEVICE(0x045e, 0x028c), .driver_info = BRIDGE_OV519 },
4466 {USB_DEVICE(0x054c, 0x0154), .driver_info = BRIDGE_OV519 }, 4461 {USB_DEVICE(0x054c, 0x0154), .driver_info = BRIDGE_OV519 },
4467 {USB_DEVICE(0x054c, 0x0155), 4462 {USB_DEVICE(0x054c, 0x0155),
4468 .driver_info = BRIDGE_OV519 | BRIDGE_INVERT_LED }, 4463 .driver_info = BRIDGE_OV519 | BRIDGE_INVERT_LED },
4469 {USB_DEVICE(0x05a9, 0x0511), .driver_info = BRIDGE_OV511 }, 4464 {USB_DEVICE(0x05a9, 0x0511), .driver_info = BRIDGE_OV511 },
4470 {USB_DEVICE(0x05a9, 0x0518), .driver_info = BRIDGE_OV518 }, 4465 {USB_DEVICE(0x05a9, 0x0518), .driver_info = BRIDGE_OV518 },
4471 {USB_DEVICE(0x05a9, 0x0519), .driver_info = BRIDGE_OV519 }, 4466 {USB_DEVICE(0x05a9, 0x0519), .driver_info = BRIDGE_OV519 },
@@ -4479,7 +4474,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
4479 {USB_DEVICE(0x0b62, 0x0059), .driver_info = BRIDGE_OVFX2 }, 4474 {USB_DEVICE(0x0b62, 0x0059), .driver_info = BRIDGE_OVFX2 },
4480 {USB_DEVICE(0x0e96, 0xc001), .driver_info = BRIDGE_OVFX2 }, 4475 {USB_DEVICE(0x0e96, 0xc001), .driver_info = BRIDGE_OVFX2 },
4481 {USB_DEVICE(0x1046, 0x9967), .driver_info = BRIDGE_W9968CF }, 4476 {USB_DEVICE(0x1046, 0x9967), .driver_info = BRIDGE_W9968CF },
4482 {USB_DEVICE(0x8020, 0xEF04), .driver_info = BRIDGE_OVFX2 }, 4477 {USB_DEVICE(0x8020, 0xef04), .driver_info = BRIDGE_OVFX2 },
4483 {} 4478 {}
4484}; 4479};
4485 4480
diff --git a/drivers/media/video/gspca/w996Xcf.c b/drivers/media/video/gspca/w996Xcf.c
index 5d7342089e4..8bffde198a1 100644
--- a/drivers/media/video/gspca/w996Xcf.c
+++ b/drivers/media/video/gspca/w996Xcf.c
@@ -150,10 +150,10 @@ static int w9968cf_upload_quantizationtables(struct sd *sd)
150 ret += reg_w(sd, 0x39, 0x0010); /* JPEG clock enable */ 150 ret += reg_w(sd, 0x39, 0x0010); /* JPEG clock enable */
151 151
152 for (i = 0, j = 0; i < 32; i++, j += 2) { 152 for (i = 0, j = 0; i < 32; i++, j += 2) {
153 a = Y_QUANTABLE[j] | ((unsigned)(Y_QUANTABLE[j+1]) << 8); 153 a = Y_QUANTABLE[j] | ((unsigned)(Y_QUANTABLE[j + 1]) << 8);
154 b = UV_QUANTABLE[j] | ((unsigned)(UV_QUANTABLE[j+1]) << 8); 154 b = UV_QUANTABLE[j] | ((unsigned)(UV_QUANTABLE[j + 1]) << 8);
155 ret += reg_w(sd, 0x40+i, a); 155 reg_w(sd, 0x40 + i, a);
156 ret += reg_w(sd, 0x60+i, b); 156 reg_w(sd, 0x60 + i, b);
157 } 157 }
158 ret += reg_w(sd, 0x39, 0x0012); /* JPEG encoder enable */ 158 ret += reg_w(sd, 0x39, 0x0012); /* JPEG encoder enable */
159 159
@@ -351,7 +351,6 @@ static int w9968cf_i2c_r(struct sd *sd, u8 reg)
351 return ret; 351 return ret;
352} 352}
353 353
354
355/*-------------------------------------------------------------------------- 354/*--------------------------------------------------------------------------
356 Turn on the LED on some webcams. A beep should be heard too. 355 Turn on the LED on some webcams. A beep should be heard too.
357 Return 0 on success, a negative number otherwise. 356 Return 0 on success, a negative number otherwise.
@@ -381,11 +380,11 @@ static int w9968cf_init(struct sd *sd)
381 int ret = 0; 380 int ret = 0;
382 unsigned long hw_bufsize = sd->sif ? (352 * 288 * 2) : (640 * 480 * 2), 381 unsigned long hw_bufsize = sd->sif ? (352 * 288 * 2) : (640 * 480 * 2),
383 y0 = 0x0000, 382 y0 = 0x0000,
384 u0 = y0 + hw_bufsize/2, 383 u0 = y0 + hw_bufsize / 2,
385 v0 = u0 + hw_bufsize/4, 384 v0 = u0 + hw_bufsize / 4,
386 y1 = v0 + hw_bufsize/4, 385 y1 = v0 + hw_bufsize / 4,
387 u1 = y1 + hw_bufsize/2, 386 u1 = y1 + hw_bufsize / 2,
388 v1 = u1 + hw_bufsize/4; 387 v1 = u1 + hw_bufsize / 4;
389 388
390 ret += reg_w(sd, 0x00, 0xff00); /* power off */ 389 ret += reg_w(sd, 0x00, 0xff00); /* power off */
391 ret += reg_w(sd, 0x00, 0xbf10); /* power on */ 390 ret += reg_w(sd, 0x00, 0xbf10); /* power on */
@@ -456,8 +455,8 @@ static int w9968cf_set_crop_window(struct sd *sd)
456 fw = SC(sd->gspca_dev.width) / max_width; 455 fw = SC(sd->gspca_dev.width) / max_width;
457 fh = SC(sd->gspca_dev.height) / max_height; 456 fh = SC(sd->gspca_dev.height) / max_height;
458 457
459 cw = (fw >= fh) ? max_width : SC(sd->gspca_dev.width)/fh; 458 cw = (fw >= fh) ? max_width : SC(sd->gspca_dev.width) / fh;
460 ch = (fw >= fh) ? SC(sd->gspca_dev.height)/fw : max_height; 459 ch = (fw >= fh) ? SC(sd->gspca_dev.height) / fw : max_height;
461 460
462 sd->sensor_width = max_width; 461 sd->sensor_width = max_width;
463 sd->sensor_height = max_height; 462 sd->sensor_height = max_height;
@@ -489,8 +488,8 @@ static int w9968cf_mode_init_regs(struct sd *sd)
489 /* Y & UV frame buffer strides (in WORD) */ 488 /* Y & UV frame buffer strides (in WORD) */
490 if (w9968cf_vga_mode[sd->gspca_dev.curr_mode].pixelformat == 489 if (w9968cf_vga_mode[sd->gspca_dev.curr_mode].pixelformat ==
491 V4L2_PIX_FMT_JPEG) { 490 V4L2_PIX_FMT_JPEG) {
492 ret += reg_w(sd, 0x2c, sd->gspca_dev.width/2); 491 ret += reg_w(sd, 0x2c, sd->gspca_dev.width / 2);
493 ret += reg_w(sd, 0x2d, sd->gspca_dev.width/4); 492 ret += reg_w(sd, 0x2d, sd->gspca_dev.width / 4);
494 } else 493 } else
495 ret += reg_w(sd, 0x2c, sd->gspca_dev.width); 494 ret += reg_w(sd, 0x2c, sd->gspca_dev.width);
496 495