aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-11-12 04:12:09 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-29 05:16:42 -0500
commit218678032589895f29f4ee01b9c330caaab44274 (patch)
tree3699be7747c3c680fe7bfba3c100f9d2ad0d6c93 /drivers/media
parent87bae740fd50df49337017b3ccbed9dbaeaad610 (diff)
[media] gspca - ov519: Set their numbers in the ov519 and ov7670 register names
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/ov519.c246
1 files changed, 123 insertions, 123 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c
index 85fc4336b796..519dec9774fd 100644
--- a/drivers/media/video/gspca/ov519.c
+++ b/drivers/media/video/gspca/ov519.c
@@ -466,8 +466,8 @@ static const struct v4l2_pix_format ovfx2_ov3610_mode[] = {
466#define OV519_R25_FORMAT 0x25 466#define OV519_R25_FORMAT 0x25
467 467
468/* OV519 System Controller register numbers */ 468/* OV519 System Controller register numbers */
469#define OV519_SYS_RESET1 0x51 469#define OV519_R51_RESET1 0x51
470#define OV519_SYS_EN_CLK1 0x54 470#define OV519_R54_EN_CLK1 0x54
471 471
472#define OV519_GPIO_DATA_OUT0 0x71 472#define OV519_GPIO_DATA_OUT0 0x71
473#define OV519_GPIO_IO_CTRL0 0x72 473#define OV519_GPIO_IO_CTRL0 0x72
@@ -527,71 +527,71 @@ static const struct v4l2_pix_format ovfx2_ov3610_mode[] = {
527#define OV7610_REG_COM_I 0x29 /* misc settings */ 527#define OV7610_REG_COM_I 0x29 /* misc settings */
528 528
529/* OV7670 registers */ 529/* OV7670 registers */
530#define OV7670_REG_GAIN 0x00 /* Gain lower 8 bits (rest in vref) */ 530#define OV7670_R00_GAIN 0x00 /* Gain lower 8 bits (rest in vref) */
531#define OV7670_REG_BLUE 0x01 /* blue gain */ 531#define OV7670_R01_BLUE 0x01 /* blue gain */
532#define OV7670_REG_RED 0x02 /* red gain */ 532#define OV7670_R02_RED 0x02 /* red gain */
533#define OV7670_REG_VREF 0x03 /* Pieces of GAIN, VSTART, VSTOP */ 533#define OV7670_R03_VREF 0x03 /* Pieces of GAIN, VSTART, VSTOP */
534#define OV7670_REG_COM1 0x04 /* Control 1 */ 534#define OV7670_R04_COM1 0x04 /* Control 1 */
535/*#define OV7670_REG_AECHH 0x07 * AEC MS 5 bits */ 535/*#define OV7670_R07_AECHH 0x07 * AEC MS 5 bits */
536#define OV7670_REG_COM3 0x0c /* Control 3 */ 536#define OV7670_R0C_COM3 0x0c /* Control 3 */
537#define OV7670_REG_COM4 0x0d /* Control 4 */ 537#define OV7670_R0D_COM4 0x0d /* Control 4 */
538#define OV7670_REG_COM5 0x0e /* All "reserved" */ 538#define OV7670_R0E_COM5 0x0e /* All "reserved" */
539#define OV7670_REG_COM6 0x0f /* Control 6 */ 539#define OV7670_R0F_COM6 0x0f /* Control 6 */
540#define OV7670_REG_AECH 0x10 /* More bits of AEC value */ 540#define OV7670_R10_AECH 0x10 /* More bits of AEC value */
541#define OV7670_REG_CLKRC 0x11 /* Clock control */ 541#define OV7670_R11_CLKRC 0x11 /* Clock control */
542#define OV7670_REG_COM7 0x12 /* Control 7 */ 542#define OV7670_R12_COM7 0x12 /* Control 7 */
543#define OV7670_COM7_FMT_VGA 0x00 543#define OV7670_COM7_FMT_VGA 0x00
544/*#define OV7670_COM7_YUV 0x00 * YUV */ 544/*#define OV7670_COM7_YUV 0x00 * YUV */
545#define OV7670_COM7_FMT_QVGA 0x10 /* QVGA format */ 545#define OV7670_COM7_FMT_QVGA 0x10 /* QVGA format */
546#define OV7670_COM7_FMT_MASK 0x38 546#define OV7670_COM7_FMT_MASK 0x38
547#define OV7670_COM7_RESET 0x80 /* Register reset */ 547#define OV7670_COM7_RESET 0x80 /* Register reset */
548#define OV7670_REG_COM8 0x13 /* Control 8 */ 548#define OV7670_R13_COM8 0x13 /* Control 8 */
549#define OV7670_COM8_AEC 0x01 /* Auto exposure enable */ 549#define OV7670_COM8_AEC 0x01 /* Auto exposure enable */
550#define OV7670_COM8_AWB 0x02 /* White balance enable */ 550#define OV7670_COM8_AWB 0x02 /* White balance enable */
551#define OV7670_COM8_AGC 0x04 /* Auto gain enable */ 551#define OV7670_COM8_AGC 0x04 /* Auto gain enable */
552#define OV7670_COM8_BFILT 0x20 /* Band filter enable */ 552#define OV7670_COM8_BFILT 0x20 /* Band filter enable */
553#define OV7670_COM8_AECSTEP 0x40 /* Unlimited AEC step size */ 553#define OV7670_COM8_AECSTEP 0x40 /* Unlimited AEC step size */
554#define OV7670_COM8_FASTAEC 0x80 /* Enable fast AGC/AEC */ 554#define OV7670_COM8_FASTAEC 0x80 /* Enable fast AGC/AEC */
555#define OV7670_REG_COM9 0x14 /* Control 9 - gain ceiling */ 555#define OV7670_R14_COM9 0x14 /* Control 9 - gain ceiling */
556#define OV7670_REG_COM10 0x15 /* Control 10 */ 556#define OV7670_R15_COM10 0x15 /* Control 10 */
557#define OV7670_REG_HSTART 0x17 /* Horiz start high bits */ 557#define OV7670_R17_HSTART 0x17 /* Horiz start high bits */
558#define OV7670_REG_HSTOP 0x18 /* Horiz stop high bits */ 558#define OV7670_R18_HSTOP 0x18 /* Horiz stop high bits */
559#define OV7670_REG_VSTART 0x19 /* Vert start high bits */ 559#define OV7670_R19_VSTART 0x19 /* Vert start high bits */
560#define OV7670_REG_VSTOP 0x1a /* Vert stop high bits */ 560#define OV7670_R1A_VSTOP 0x1a /* Vert stop high bits */
561#define OV7670_REG_MVFP 0x1e /* Mirror / vflip */ 561#define OV7670_R1E_MVFP 0x1e /* Mirror / vflip */
562#define OV7670_MVFP_VFLIP 0x10 /* vertical flip */ 562#define OV7670_MVFP_VFLIP 0x10 /* vertical flip */
563#define OV7670_MVFP_MIRROR 0x20 /* Mirror image */ 563#define OV7670_MVFP_MIRROR 0x20 /* Mirror image */
564#define OV7670_REG_AEW 0x24 /* AGC upper limit */ 564#define OV7670_R24_AEW 0x24 /* AGC upper limit */
565#define OV7670_REG_AEB 0x25 /* AGC lower limit */ 565#define OV7670_R25_AEB 0x25 /* AGC lower limit */
566#define OV7670_REG_VPT 0x26 /* AGC/AEC fast mode op region */ 566#define OV7670_R26_VPT 0x26 /* AGC/AEC fast mode op region */
567#define OV7670_REG_HREF 0x32 /* HREF pieces */ 567#define OV7670_R32_HREF 0x32 /* HREF pieces */
568#define OV7670_REG_TSLB 0x3a /* lots of stuff */ 568#define OV7670_R3A_TSLB 0x3a /* lots of stuff */
569#define OV7670_REG_COM11 0x3b /* Control 11 */ 569#define OV7670_R3B_COM11 0x3b /* Control 11 */
570#define OV7670_COM11_EXP 0x02 570#define OV7670_COM11_EXP 0x02
571#define OV7670_COM11_HZAUTO 0x10 /* Auto detect 50/60 Hz */ 571#define OV7670_COM11_HZAUTO 0x10 /* Auto detect 50/60 Hz */
572#define OV7670_REG_COM12 0x3c /* Control 12 */ 572#define OV7670_R3C_COM12 0x3c /* Control 12 */
573#define OV7670_REG_COM13 0x3d /* Control 13 */ 573#define OV7670_R3D_COM13 0x3d /* Control 13 */
574#define OV7670_COM13_GAMMA 0x80 /* Gamma enable */ 574#define OV7670_COM13_GAMMA 0x80 /* Gamma enable */
575#define OV7670_COM13_UVSAT 0x40 /* UV saturation auto adjustment */ 575#define OV7670_COM13_UVSAT 0x40 /* UV saturation auto adjustment */
576#define OV7670_REG_COM14 0x3e /* Control 14 */ 576#define OV7670_R3E_COM14 0x3e /* Control 14 */
577#define OV7670_REG_EDGE 0x3f /* Edge enhancement factor */ 577#define OV7670_R3F_EDGE 0x3f /* Edge enhancement factor */
578#define OV7670_REG_COM15 0x40 /* Control 15 */ 578#define OV7670_R40_COM15 0x40 /* Control 15 */
579/*#define OV7670_COM15_R00FF 0xc0 * 00 to FF */ 579/*#define OV7670_COM15_R00FF 0xc0 * 00 to FF */
580#define OV7670_REG_COM16 0x41 /* Control 16 */ 580#define OV7670_R41_COM16 0x41 /* Control 16 */
581#define OV7670_COM16_AWBGAIN 0x08 /* AWB gain enable */ 581#define OV7670_COM16_AWBGAIN 0x08 /* AWB gain enable */
582#define OV7670_REG_BRIGHT 0x55 /* Brightness */ 582#define OV7670_R55_BRIGHT 0x55 /* Brightness */
583#define OV7670_REG_CONTRAS 0x56 /* Contrast control */ 583#define OV7670_R56_CONTRAS 0x56 /* Contrast control */
584#define OV7670_REG_GFIX 0x69 /* Fix gain control */ 584#define OV7670_R69_GFIX 0x69 /* Fix gain control */
585#define OV7670_REG_RGB444 0x8c /* RGB 444 control */ 585/*#define OV7670_R8C_RGB444 0x8c * RGB 444 control */
586#define OV7670_REG_HAECC1 0x9f /* Hist AEC/AGC control 1 */ 586#define OV7670_R9F_HAECC1 0x9f /* Hist AEC/AGC control 1 */
587#define OV7670_REG_HAECC2 0xa0 /* Hist AEC/AGC control 2 */ 587#define OV7670_RA0_HAECC2 0xa0 /* Hist AEC/AGC control 2 */
588#define OV7670_REG_BD50MAX 0xa5 /* 50hz banding step limit */ 588#define OV7670_RA5_BD50MAX 0xa5 /* 50hz banding step limit */
589#define OV7670_REG_HAECC3 0xa6 /* Hist AEC/AGC control 3 */ 589#define OV7670_RA6_HAECC3 0xa6 /* Hist AEC/AGC control 3 */
590#define OV7670_REG_HAECC4 0xa7 /* Hist AEC/AGC control 4 */ 590#define OV7670_RA7_HAECC4 0xa7 /* Hist AEC/AGC control 4 */
591#define OV7670_REG_HAECC5 0xa8 /* Hist AEC/AGC control 5 */ 591#define OV7670_RA8_HAECC5 0xa8 /* Hist AEC/AGC control 5 */
592#define OV7670_REG_HAECC6 0xa9 /* Hist AEC/AGC control 6 */ 592#define OV7670_RA9_HAECC6 0xa9 /* Hist AEC/AGC control 6 */
593#define OV7670_REG_HAECC7 0xaa /* Hist AEC/AGC control 7 */ 593#define OV7670_RAA_HAECC7 0xaa /* Hist AEC/AGC control 7 */
594#define OV7670_REG_BD60MAX 0xab /* 60hz banding step limit */ 594#define OV7670_RAB_BD60MAX 0xab /* 60hz banding step limit */
595 595
596struct ov_regvals { 596struct ov_regvals {
597 u8 reg; 597 u8 reg;
@@ -1463,7 +1463,7 @@ static const struct ov_i2c_regvals norm_7620[] = {
1463 { 0x00, 0x00 }, /* gain */ 1463 { 0x00, 0x00 }, /* gain */
1464 { 0x01, 0x80 }, /* blue gain */ 1464 { 0x01, 0x80 }, /* blue gain */
1465 { 0x02, 0x80 }, /* red gain */ 1465 { 0x02, 0x80 }, /* red gain */
1466 { 0x03, 0xc0 }, /* OV7670_REG_VREF */ 1466 { 0x03, 0xc0 }, /* OV7670_R03_VREF */
1467 { 0x06, 0x60 }, 1467 { 0x06, 0x60 },
1468 { 0x07, 0x00 }, 1468 { 0x07, 0x00 },
1469 { 0x0c, 0x24 }, 1469 { 0x0c, 0x24 },
@@ -1534,30 +1534,30 @@ static const struct ov_i2c_regvals norm_7640[] = {
1534/* 7670. Defaults taken from OmniVision provided data, 1534/* 7670. Defaults taken from OmniVision provided data,
1535* as provided by Jonathan Corbet of OLPC */ 1535* as provided by Jonathan Corbet of OLPC */
1536static const struct ov_i2c_regvals norm_7670[] = { 1536static const struct ov_i2c_regvals norm_7670[] = {
1537 { OV7670_REG_COM7, OV7670_COM7_RESET }, 1537 { OV7670_R12_COM7, OV7670_COM7_RESET },
1538 { OV7670_REG_TSLB, 0x04 }, /* OV */ 1538 { OV7670_R3A_TSLB, 0x04 }, /* OV */
1539 { OV7670_REG_COM7, OV7670_COM7_FMT_VGA }, /* VGA */ 1539 { OV7670_R12_COM7, OV7670_COM7_FMT_VGA }, /* VGA */
1540 { OV7670_REG_CLKRC, 0x01 }, 1540 { OV7670_R11_CLKRC, 0x01 },
1541/* 1541/*
1542 * Set the hardware window. These values from OV don't entirely 1542 * Set the hardware window. These values from OV don't entirely
1543 * make sense - hstop is less than hstart. But they work... 1543 * make sense - hstop is less than hstart. But they work...
1544 */ 1544 */
1545 { OV7670_REG_HSTART, 0x13 }, 1545 { OV7670_R17_HSTART, 0x13 },
1546 { OV7670_REG_HSTOP, 0x01 }, 1546 { OV7670_R18_HSTOP, 0x01 },
1547 { OV7670_REG_HREF, 0xb6 }, 1547 { OV7670_R32_HREF, 0xb6 },
1548 { OV7670_REG_VSTART, 0x02 }, 1548 { OV7670_R19_VSTART, 0x02 },
1549 { OV7670_REG_VSTOP, 0x7a }, 1549 { OV7670_R1A_VSTOP, 0x7a },
1550 { OV7670_REG_VREF, 0x0a }, 1550 { OV7670_R03_VREF, 0x0a },
1551 1551
1552 { OV7670_REG_COM3, 0x00 }, 1552 { OV7670_R0C_COM3, 0x00 },
1553 { OV7670_REG_COM14, 0x00 }, 1553 { OV7670_R3E_COM14, 0x00 },
1554/* Mystery scaling numbers */ 1554/* Mystery scaling numbers */
1555 { 0x70, 0x3a }, 1555 { 0x70, 0x3a },
1556 { 0x71, 0x35 }, 1556 { 0x71, 0x35 },
1557 { 0x72, 0x11 }, 1557 { 0x72, 0x11 },
1558 { 0x73, 0xf0 }, 1558 { 0x73, 0xf0 },
1559 { 0xa2, 0x02 }, 1559 { 0xa2, 0x02 },
1560/* { OV7670_REG_COM10, 0x0 }, */ 1560/* { OV7670_R15_COM10, 0x0 }, */
1561 1561
1562/* Gamma curve values */ 1562/* Gamma curve values */
1563 { 0x7a, 0x20 }, 1563 { 0x7a, 0x20 },
@@ -1579,37 +1579,37 @@ static const struct ov_i2c_regvals norm_7670[] = {
1579 1579
1580/* AGC and AEC parameters. Note we start by disabling those features, 1580/* AGC and AEC parameters. Note we start by disabling those features,
1581 then turn them only after tweaking the values. */ 1581 then turn them only after tweaking the values. */
1582 { OV7670_REG_COM8, OV7670_COM8_FASTAEC 1582 { OV7670_R13_COM8, OV7670_COM8_FASTAEC
1583 | OV7670_COM8_AECSTEP 1583 | OV7670_COM8_AECSTEP
1584 | OV7670_COM8_BFILT }, 1584 | OV7670_COM8_BFILT },
1585 { OV7670_REG_GAIN, 0x00 }, 1585 { OV7670_R00_GAIN, 0x00 },
1586 { OV7670_REG_AECH, 0x00 }, 1586 { OV7670_R10_AECH, 0x00 },
1587 { OV7670_REG_COM4, 0x40 }, /* magic reserved bit */ 1587 { OV7670_R0D_COM4, 0x40 }, /* magic reserved bit */
1588 { OV7670_REG_COM9, 0x18 }, /* 4x gain + magic rsvd bit */ 1588 { OV7670_R14_COM9, 0x18 }, /* 4x gain + magic rsvd bit */
1589 { OV7670_REG_BD50MAX, 0x05 }, 1589 { OV7670_RA5_BD50MAX, 0x05 },
1590 { OV7670_REG_BD60MAX, 0x07 }, 1590 { OV7670_RAB_BD60MAX, 0x07 },
1591 { OV7670_REG_AEW, 0x95 }, 1591 { OV7670_R24_AEW, 0x95 },
1592 { OV7670_REG_AEB, 0x33 }, 1592 { OV7670_R25_AEB, 0x33 },
1593 { OV7670_REG_VPT, 0xe3 }, 1593 { OV7670_R26_VPT, 0xe3 },
1594 { OV7670_REG_HAECC1, 0x78 }, 1594 { OV7670_R9F_HAECC1, 0x78 },
1595 { OV7670_REG_HAECC2, 0x68 }, 1595 { OV7670_RA0_HAECC2, 0x68 },
1596 { 0xa1, 0x03 }, /* magic */ 1596 { 0xa1, 0x03 }, /* magic */
1597 { OV7670_REG_HAECC3, 0xd8 }, 1597 { OV7670_RA6_HAECC3, 0xd8 },
1598 { OV7670_REG_HAECC4, 0xd8 }, 1598 { OV7670_RA7_HAECC4, 0xd8 },
1599 { OV7670_REG_HAECC5, 0xf0 }, 1599 { OV7670_RA8_HAECC5, 0xf0 },
1600 { OV7670_REG_HAECC6, 0x90 }, 1600 { OV7670_RA9_HAECC6, 0x90 },
1601 { OV7670_REG_HAECC7, 0x94 }, 1601 { OV7670_RAA_HAECC7, 0x94 },
1602 { OV7670_REG_COM8, OV7670_COM8_FASTAEC 1602 { OV7670_R13_COM8, OV7670_COM8_FASTAEC
1603 | OV7670_COM8_AECSTEP 1603 | OV7670_COM8_AECSTEP
1604 | OV7670_COM8_BFILT 1604 | OV7670_COM8_BFILT
1605 | OV7670_COM8_AGC 1605 | OV7670_COM8_AGC
1606 | OV7670_COM8_AEC }, 1606 | OV7670_COM8_AEC },
1607 1607
1608/* Almost all of these are magic "reserved" values. */ 1608/* Almost all of these are magic "reserved" values. */
1609 { OV7670_REG_COM5, 0x61 }, 1609 { OV7670_R0E_COM5, 0x61 },
1610 { OV7670_REG_COM6, 0x4b }, 1610 { OV7670_R0F_COM6, 0x4b },
1611 { 0x16, 0x02 }, 1611 { 0x16, 0x02 },
1612 { OV7670_REG_MVFP, 0x07 }, 1612 { OV7670_R1E_MVFP, 0x07 },
1613 { 0x21, 0x02 }, 1613 { 0x21, 0x02 },
1614 { 0x22, 0x91 }, 1614 { 0x22, 0x91 },
1615 { 0x29, 0x07 }, 1615 { 0x29, 0x07 },
@@ -1618,10 +1618,10 @@ static const struct ov_i2c_regvals norm_7670[] = {
1618 { 0x37, 0x1d }, 1618 { 0x37, 0x1d },
1619 { 0x38, 0x71 }, 1619 { 0x38, 0x71 },
1620 { 0x39, 0x2a }, 1620 { 0x39, 0x2a },
1621 { OV7670_REG_COM12, 0x78 }, 1621 { OV7670_R3C_COM12, 0x78 },
1622 { 0x4d, 0x40 }, 1622 { 0x4d, 0x40 },
1623 { 0x4e, 0x20 }, 1623 { 0x4e, 0x20 },
1624 { OV7670_REG_GFIX, 0x00 }, 1624 { OV7670_R69_GFIX, 0x00 },
1625 { 0x6b, 0x4a }, 1625 { 0x6b, 0x4a },
1626 { 0x74, 0x10 }, 1626 { 0x74, 0x10 },
1627 { 0x8d, 0x4f }, 1627 { 0x8d, 0x4f },
@@ -1656,9 +1656,9 @@ static const struct ov_i2c_regvals norm_7670[] = {
1656 { 0x6f, 0x9f }, 1656 { 0x6f, 0x9f },
1657 /* "9e for advance AWB" */ 1657 /* "9e for advance AWB" */
1658 { 0x6a, 0x40 }, 1658 { 0x6a, 0x40 },
1659 { OV7670_REG_BLUE, 0x40 }, 1659 { OV7670_R01_BLUE, 0x40 },
1660 { OV7670_REG_RED, 0x60 }, 1660 { OV7670_R02_RED, 0x60 },
1661 { OV7670_REG_COM8, OV7670_COM8_FASTAEC 1661 { OV7670_R13_COM8, OV7670_COM8_FASTAEC
1662 | OV7670_COM8_AECSTEP 1662 | OV7670_COM8_AECSTEP
1663 | OV7670_COM8_BFILT 1663 | OV7670_COM8_BFILT
1664 | OV7670_COM8_AGC 1664 | OV7670_COM8_AGC
@@ -1674,22 +1674,22 @@ static const struct ov_i2c_regvals norm_7670[] = {
1674 { 0x54, 0x80 }, 1674 { 0x54, 0x80 },
1675 { 0x58, 0x9e }, 1675 { 0x58, 0x9e },
1676 1676
1677 { OV7670_REG_COM16, OV7670_COM16_AWBGAIN }, 1677 { OV7670_R41_COM16, OV7670_COM16_AWBGAIN },
1678 { OV7670_REG_EDGE, 0x00 }, 1678 { OV7670_R3F_EDGE, 0x00 },
1679 { 0x75, 0x05 }, 1679 { 0x75, 0x05 },
1680 { 0x76, 0xe1 }, 1680 { 0x76, 0xe1 },
1681 { 0x4c, 0x00 }, 1681 { 0x4c, 0x00 },
1682 { 0x77, 0x01 }, 1682 { 0x77, 0x01 },
1683 { OV7670_REG_COM13, OV7670_COM13_GAMMA 1683 { OV7670_R3D_COM13, OV7670_COM13_GAMMA
1684 | OV7670_COM13_UVSAT 1684 | OV7670_COM13_UVSAT
1685 | 2}, /* was 3 */ 1685 | 2}, /* was 3 */
1686 { 0x4b, 0x09 }, 1686 { 0x4b, 0x09 },
1687 { 0xc9, 0x60 }, 1687 { 0xc9, 0x60 },
1688 { OV7670_REG_COM16, 0x38 }, 1688 { OV7670_R41_COM16, 0x38 },
1689 { 0x56, 0x40 }, 1689 { 0x56, 0x40 },
1690 1690
1691 { 0x34, 0x11 }, 1691 { 0x34, 0x11 },
1692 { OV7670_REG_COM11, OV7670_COM11_EXP|OV7670_COM11_HZAUTO }, 1692 { OV7670_R3B_COM11, OV7670_COM11_EXP|OV7670_COM11_HZAUTO },
1693 { 0xa4, 0x88 }, 1693 { 0xa4, 0x88 },
1694 { 0x96, 0x00 }, 1694 { 0x96, 0x00 },
1695 { 0x97, 0x30 }, 1695 { 0x97, 0x30 },
@@ -2290,7 +2290,7 @@ static inline int ov51x_stop(struct sd *sd)
2290 case BRIDGE_OV518PLUS: 2290 case BRIDGE_OV518PLUS:
2291 return reg_w_mask(sd, R51x_SYS_RESET, 0x3a, 0x3a); 2291 return reg_w_mask(sd, R51x_SYS_RESET, 0x3a, 0x3a);
2292 case BRIDGE_OV519: 2292 case BRIDGE_OV519:
2293 return reg_w(sd, OV519_SYS_RESET1, 0x0f); 2293 return reg_w(sd, OV519_R51_RESET1, 0x0f);
2294 case BRIDGE_OVFX2: 2294 case BRIDGE_OVFX2:
2295 return reg_w_mask(sd, 0x0f, 0x00, 0x02); 2295 return reg_w_mask(sd, 0x0f, 0x00, 0x02);
2296 case BRIDGE_W9968CF: 2296 case BRIDGE_W9968CF:
@@ -2323,7 +2323,7 @@ static inline int ov51x_restart(struct sd *sd)
2323 return rc; 2323 return rc;
2324 return reg_w(sd, R51x_SYS_RESET, 0x00); 2324 return reg_w(sd, R51x_SYS_RESET, 0x00);
2325 case BRIDGE_OV519: 2325 case BRIDGE_OV519:
2326 return reg_w(sd, OV519_SYS_RESET1, 0x00); 2326 return reg_w(sd, OV519_R51_RESET1, 0x00);
2327 case BRIDGE_OVFX2: 2327 case BRIDGE_OVFX2:
2328 return reg_w_mask(sd, 0x0f, 0x02, 0x02); 2328 return reg_w_mask(sd, 0x0f, 0x02, 0x02);
2329 case BRIDGE_W9968CF: 2329 case BRIDGE_W9968CF:
@@ -2932,15 +2932,15 @@ static int ov519_configure(struct sd *sd)
2932 static const struct ov_regvals init_519[] = { 2932 static const struct ov_regvals init_519[] = {
2933 { 0x5a, 0x6d }, /* EnableSystem */ 2933 { 0x5a, 0x6d }, /* EnableSystem */
2934 { 0x53, 0x9b }, 2934 { 0x53, 0x9b },
2935 { 0x54, 0xff }, /* set bit2 to enable jpeg */ 2935 { OV519_R54_EN_CLK1, 0xff }, /* set bit2 to enable jpeg */
2936 { 0x5d, 0x03 }, 2936 { 0x5d, 0x03 },
2937 { 0x49, 0x01 }, 2937 { 0x49, 0x01 },
2938 { 0x48, 0x00 }, 2938 { 0x48, 0x00 },
2939 /* 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
2940 * detection will fail. This deserves further investigation. */ 2940 * detection will fail. This deserves further investigation. */
2941 { OV519_GPIO_IO_CTRL0, 0xee }, 2941 { OV519_GPIO_IO_CTRL0, 0xee },
2942 { 0x51, 0x0f }, /* SetUsbInit */ 2942 { OV519_R51_RESET1, 0x0f },
2943 { 0x51, 0x00 }, 2943 { OV519_R51_RESET1, 0x00 },
2944 { 0x22, 0x00 }, 2944 { 0x22, 0x00 },
2945 /* windows reads 0x55 at this point*/ 2945 /* windows reads 0x55 at this point*/
2946 }; 2946 };
@@ -3444,7 +3444,7 @@ static int ov519_mode_init_regs(struct sd *sd)
3444 static const struct ov_regvals mode_init_519_ov7670[] = { 3444 static const struct ov_regvals mode_init_519_ov7670[] = {
3445 { 0x5d, 0x03 }, /* Turn off suspend mode */ 3445 { 0x5d, 0x03 }, /* Turn off suspend mode */
3446 { 0x53, 0x9f }, /* was 9b in 1.65-1.08 */ 3446 { 0x53, 0x9f }, /* was 9b in 1.65-1.08 */
3447 { 0x54, 0x0f }, /* bit2 (jpeg enable) */ 3447 { OV519_R54_EN_CLK1, 0x0f }, /* bit2 (jpeg enable) */
3448 { 0xa2, 0x20 }, /* a2-a5 are undocumented */ 3448 { 0xa2, 0x20 }, /* a2-a5 are undocumented */
3449 { 0xa3, 0x18 }, 3449 { 0xa3, 0x18 },
3450 { 0xa4, 0x04 }, 3450 { 0xa4, 0x04 },
@@ -3467,7 +3467,7 @@ static int ov519_mode_init_regs(struct sd *sd)
3467 static const struct ov_regvals mode_init_519[] = { 3467 static const struct ov_regvals mode_init_519[] = {
3468 { 0x5d, 0x03 }, /* Turn off suspend mode */ 3468 { 0x5d, 0x03 }, /* Turn off suspend mode */
3469 { 0x53, 0x9f }, /* was 9b in 1.65-1.08 */ 3469 { 0x53, 0x9f }, /* was 9b in 1.65-1.08 */
3470 { 0x54, 0x0f }, /* bit2 (jpeg enable) */ 3470 { OV519_R54_EN_CLK1, 0x0f }, /* bit2 (jpeg enable) */
3471 { 0xa2, 0x20 }, /* a2-a5 are undocumented */ 3471 { 0xa2, 0x20 }, /* a2-a5 are undocumented */
3472 { 0xa3, 0x18 }, 3472 { 0xa3, 0x18 },
3473 { 0xa4, 0x04 }, 3473 { 0xa4, 0x04 },
@@ -3687,11 +3687,11 @@ static int mode_init_ov_sensor_regs(struct sd *sd)
3687 /* set COM7_FMT_VGA or COM7_FMT_QVGA 3687 /* set COM7_FMT_VGA or COM7_FMT_QVGA
3688 * do we need to set anything else? 3688 * do we need to set anything else?
3689 * HSTART etc are set in set_ov_sensor_window itself */ 3689 * HSTART etc are set in set_ov_sensor_window itself */
3690 i2c_w_mask(sd, OV7670_REG_COM7, 3690 i2c_w_mask(sd, OV7670_R12_COM7,
3691 qvga ? OV7670_COM7_FMT_QVGA : OV7670_COM7_FMT_VGA, 3691 qvga ? OV7670_COM7_FMT_QVGA : OV7670_COM7_FMT_VGA,
3692 OV7670_COM7_FMT_MASK); 3692 OV7670_COM7_FMT_MASK);
3693 i2c_w_mask(sd, 0x13, 0x00, 0x20); /* Select 16 bit data bus */ 3693 i2c_w_mask(sd, 0x13, 0x00, 0x20); /* Select 16 bit data bus */
3694 i2c_w_mask(sd, OV7670_REG_COM8, OV7670_COM8_AWB, 3694 i2c_w_mask(sd, OV7670_R13_COM8, OV7670_COM8_AWB,
3695 OV7670_COM8_AWB); 3695 OV7670_COM8_AWB);
3696 if (qvga) { /* QVGA from ov7670.c by 3696 if (qvga) { /* QVGA from ov7670.c by
3697 * Jonathan Corbet */ 3697 * Jonathan Corbet */
@@ -3707,21 +3707,21 @@ static int mode_init_ov_sensor_regs(struct sd *sd)
3707 } 3707 }
3708 /* OV7670 hardware window registers are split across 3708 /* OV7670 hardware window registers are split across
3709 * multiple locations */ 3709 * multiple locations */
3710 i2c_w(sd, OV7670_REG_HSTART, xstart >> 3); 3710 i2c_w(sd, OV7670_R17_HSTART, xstart >> 3);
3711 i2c_w(sd, OV7670_REG_HSTOP, xend >> 3); 3711 i2c_w(sd, OV7670_R18_HSTOP, xend >> 3);
3712 v = i2c_r(sd, OV7670_REG_HREF); 3712 v = i2c_r(sd, OV7670_R32_HREF);
3713 v = (v & 0xc0) | ((xend & 0x7) << 3) | (xstart & 0x07); 3713 v = (v & 0xc0) | ((xend & 0x7) << 3) | (xstart & 0x07);
3714 msleep(10); /* need to sleep between read and write to 3714 msleep(10); /* need to sleep between read and write to
3715 * same reg! */ 3715 * same reg! */
3716 i2c_w(sd, OV7670_REG_HREF, v); 3716 i2c_w(sd, OV7670_R32_HREF, v);
3717 3717
3718 i2c_w(sd, OV7670_REG_VSTART, ystart >> 2); 3718 i2c_w(sd, OV7670_R19_VSTART, ystart >> 2);
3719 i2c_w(sd, OV7670_REG_VSTOP, yend >> 2); 3719 i2c_w(sd, OV7670_R1A_VSTOP, yend >> 2);
3720 v = i2c_r(sd, OV7670_REG_VREF); 3720 v = i2c_r(sd, OV7670_R03_VREF);
3721 v = (v & 0xc0) | ((yend & 0x3) << 2) | (ystart & 0x03); 3721 v = (v & 0xc0) | ((yend & 0x3) << 2) | (ystart & 0x03);
3722 msleep(10); /* need to sleep between read and write to 3722 msleep(10); /* need to sleep between read and write to
3723 * same reg! */ 3723 * same reg! */
3724 i2c_w(sd, OV7670_REG_VREF, v); 3724 i2c_w(sd, OV7670_R03_VREF, v);
3725 break; 3725 break;
3726 case SEN_OV6620: 3726 case SEN_OV6620:
3727 i2c_w_mask(sd, 0x14, qvga ? 0x20 : 0x00, 0x20); 3727 i2c_w_mask(sd, 0x14, qvga ? 0x20 : 0x00, 0x20);
@@ -3751,7 +3751,7 @@ static void sethvflip(struct gspca_dev *gspca_dev)
3751 return; 3751 return;
3752 if (sd->gspca_dev.streaming) 3752 if (sd->gspca_dev.streaming)
3753 ov51x_stop(sd); 3753 ov51x_stop(sd);
3754 i2c_w_mask(sd, OV7670_REG_MVFP, 3754 i2c_w_mask(sd, OV7670_R1E_MVFP,
3755 OV7670_MVFP_MIRROR * sd->ctrls[HFLIP].val 3755 OV7670_MVFP_MIRROR * sd->ctrls[HFLIP].val
3756 | OV7670_MVFP_VFLIP * sd->ctrls[VFLIP].val, 3756 | OV7670_MVFP_VFLIP * sd->ctrls[VFLIP].val,
3757 OV7670_MVFP_MIRROR | OV7670_MVFP_VFLIP); 3757 OV7670_MVFP_MIRROR | OV7670_MVFP_VFLIP);
@@ -4191,8 +4191,8 @@ static void setbrightness(struct gspca_dev *gspca_dev)
4191 break; 4191 break;
4192 case SEN_OV7670: 4192 case SEN_OV7670:
4193/*win trace 4193/*win trace
4194 * i2c_w_mask(sd, OV7670_REG_COM8, 0, OV7670_COM8_AEC); */ 4194 * i2c_w_mask(sd, OV7670_R13_COM8, 0, OV7670_COM8_AEC); */
4195 i2c_w(sd, OV7670_REG_BRIGHT, ov7670_abs_to_sm(val)); 4195 i2c_w(sd, OV7670_R55_BRIGHT, ov7670_abs_to_sm(val));
4196 break; 4196 break;
4197 } 4197 }
4198} 4198}
@@ -4234,7 +4234,7 @@ static void setcontrast(struct gspca_dev *gspca_dev)
4234 } 4234 }
4235 case SEN_OV7670: 4235 case SEN_OV7670:
4236 /* check that this isn't just the same as ov7610 */ 4236 /* check that this isn't just the same as ov7610 */
4237 i2c_w(sd, OV7670_REG_CONTRAS, val >> 1); 4237 i2c_w(sd, OV7670_R56_CONTRAS, val >> 1);
4238 break; 4238 break;
4239 } 4239 }
4240} 4240}
@@ -4294,22 +4294,22 @@ static void setfreq_i(struct sd *sd)
4294 if (sd->sensor == SEN_OV7670) { 4294 if (sd->sensor == SEN_OV7670) {
4295 switch (sd->ctrls[FREQ].val) { 4295 switch (sd->ctrls[FREQ].val) {
4296 case 0: /* Banding filter disabled */ 4296 case 0: /* Banding filter disabled */
4297 i2c_w_mask(sd, OV7670_REG_COM8, 0, OV7670_COM8_BFILT); 4297 i2c_w_mask(sd, OV7670_R13_COM8, 0, OV7670_COM8_BFILT);
4298 break; 4298 break;
4299 case 1: /* 50 hz */ 4299 case 1: /* 50 hz */
4300 i2c_w_mask(sd, OV7670_REG_COM8, OV7670_COM8_BFILT, 4300 i2c_w_mask(sd, OV7670_R13_COM8, OV7670_COM8_BFILT,
4301 OV7670_COM8_BFILT); 4301 OV7670_COM8_BFILT);
4302 i2c_w_mask(sd, OV7670_REG_COM11, 0x08, 0x18); 4302 i2c_w_mask(sd, OV7670_R3B_COM11, 0x08, 0x18);
4303 break; 4303 break;
4304 case 2: /* 60 hz */ 4304 case 2: /* 60 hz */
4305 i2c_w_mask(sd, OV7670_REG_COM8, OV7670_COM8_BFILT, 4305 i2c_w_mask(sd, OV7670_R13_COM8, OV7670_COM8_BFILT,
4306 OV7670_COM8_BFILT); 4306 OV7670_COM8_BFILT);
4307 i2c_w_mask(sd, OV7670_REG_COM11, 0x00, 0x18); 4307 i2c_w_mask(sd, OV7670_R3B_COM11, 0x00, 0x18);
4308 break; 4308 break;
4309 case 3: /* Auto hz */ 4309 case 3: /* Auto hz - ov7670 only */
4310 i2c_w_mask(sd, OV7670_REG_COM8, OV7670_COM8_BFILT, 4310 i2c_w_mask(sd, OV7670_R13_COM8, OV7670_COM8_BFILT,
4311 OV7670_COM8_BFILT); 4311 OV7670_COM8_BFILT);
4312 i2c_w_mask(sd, OV7670_REG_COM11, OV7670_COM11_HZAUTO, 4312 i2c_w_mask(sd, OV7670_R3B_COM11, OV7670_COM11_HZAUTO,
4313 0x18); 4313 0x18);
4314 break; 4314 break;
4315 } 4315 }