aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-06-14 04:28:17 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-23 02:11:20 -0400
commit7d9713735d7537baf2b00be806a8de08a5c9f11b (patch)
treed596c1b9d1add18a41856c1ec5546f90dae8a110
parent02ab18b0f497bed623814677577b76cc97234085 (diff)
V4L/DVB (12073): gspca_ov519: limit ov6630 qvif uv swap fix to ov66308AF
The fix for the UV swapping in qcif mode with the ov6630, which I did to fix this issue on a ov518 cam with an ov66308AF, causes UV swapping in qcif with another cam of mine with the ov518 and an ov66308AE, so this patch changes the code to differentiate between the ov66308AF and other ov6630 versions, and restricts the UV swap fix to the ov66308AF. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/gspca/ov519.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c
index baa488dd33d8..2d5d95f02779 100644
--- a/drivers/media/video/gspca/ov519.c
+++ b/drivers/media/video/gspca/ov519.c
@@ -77,12 +77,13 @@ struct sd {
77#define SEN_UNKNOWN 0 77#define SEN_UNKNOWN 0
78#define SEN_OV6620 1 78#define SEN_OV6620 1
79#define SEN_OV6630 2 79#define SEN_OV6630 2
80#define SEN_OV7610 3 80#define SEN_OV66308AF 3
81#define SEN_OV7620 4 81#define SEN_OV7610 4
82#define SEN_OV7640 5 82#define SEN_OV7620 5
83#define SEN_OV7670 6 83#define SEN_OV7640 6
84#define SEN_OV76BE 7 84#define SEN_OV7670 7
85#define SEN_OV8610 8 85#define SEN_OV76BE 8
86#define SEN_OV8610 9
86}; 87};
87 88
88/* V4L2 controls supported by the driver */ 89/* V4L2 controls supported by the driver */
@@ -1415,13 +1416,14 @@ static int ov6xx0_configure(struct sd *sd)
1415 break; 1416 break;
1416 case 0x01: 1417 case 0x01:
1417 sd->sensor = SEN_OV6620; 1418 sd->sensor = SEN_OV6620;
1419 PDEBUG(D_PROBE, "Sensor is an OV6620");
1418 break; 1420 break;
1419 case 0x02: 1421 case 0x02:
1420 sd->sensor = SEN_OV6630; 1422 sd->sensor = SEN_OV6630;
1421 PDEBUG(D_PROBE, "Sensor is an OV66308AE"); 1423 PDEBUG(D_PROBE, "Sensor is an OV66308AE");
1422 break; 1424 break;
1423 case 0x03: 1425 case 0x03:
1424 sd->sensor = SEN_OV6630; 1426 sd->sensor = SEN_OV66308AF;
1425 PDEBUG(D_PROBE, "Sensor is an OV66308AF"); 1427 PDEBUG(D_PROBE, "Sensor is an OV66308AF");
1426 break; 1428 break;
1427 case 0x90: 1429 case 0x90:
@@ -1745,6 +1747,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
1745 return -EIO; 1747 return -EIO;
1746 break; 1748 break;
1747 case SEN_OV6630: 1749 case SEN_OV6630:
1750 case SEN_OV66308AF:
1748 if (write_i2c_regvals(sd, norm_6x30, ARRAY_SIZE(norm_6x30))) 1751 if (write_i2c_regvals(sd, norm_6x30, ARRAY_SIZE(norm_6x30)))
1749 return -EIO; 1752 return -EIO;
1750 break; 1753 break;
@@ -2081,6 +2084,7 @@ static int mode_init_ov_sensor_regs(struct sd *sd)
2081 break; 2084 break;
2082 case SEN_OV6620: 2085 case SEN_OV6620:
2083 case SEN_OV6630: 2086 case SEN_OV6630:
2087 case SEN_OV66308AF:
2084 i2c_w_mask(sd, 0x14, qvga ? 0x20 : 0x00, 0x20); 2088 i2c_w_mask(sd, 0x14, qvga ? 0x20 : 0x00, 0x20);
2085 break; 2089 break;
2086 default: 2090 default:
@@ -2101,7 +2105,8 @@ static int mode_init_ov_sensor_regs(struct sd *sd)
2101 2105
2102 /* OV7640 is 8-bit only */ 2106 /* OV7640 is 8-bit only */
2103 2107
2104 if (sd->sensor != SEN_OV6630 && sd->sensor != SEN_OV7640) 2108 if (sd->sensor != SEN_OV6630 && sd->sensor != SEN_OV66308AF &&
2109 sd->sensor != SEN_OV7640)
2105 i2c_w_mask(sd, 0x13, 0x00, 0x20); 2110 i2c_w_mask(sd, 0x13, 0x00, 0x20);
2106 2111
2107 /******** Clock programming ********/ 2112 /******** Clock programming ********/
@@ -2188,15 +2193,14 @@ static int set_ov_sensor_window(struct sd *sd)
2188 break; 2193 break;
2189 case SEN_OV6620: 2194 case SEN_OV6620:
2190 case SEN_OV6630: 2195 case SEN_OV6630:
2196 case SEN_OV66308AF:
2191 hwsbase = 0x38; 2197 hwsbase = 0x38;
2192 hwebase = 0x3a; 2198 hwebase = 0x3a;
2193 vwsbase = 0x05; 2199 vwsbase = 0x05;
2194 vwebase = 0x06; 2200 vwebase = 0x06;
2195 if (qvga) { 2201 if (sd->sensor == SEN_OV66308AF && qvga)
2196 /* HDG: this fixes U and V getting swapped */ 2202 /* HDG: this fixes U and V getting swapped */
2197 hwsbase--; 2203 hwsbase++;
2198 vwsbase--;
2199 }
2200 break; 2204 break;
2201 case SEN_OV7620: 2205 case SEN_OV7620:
2202 hwsbase = 0x2f; /* From 7620.SET (spec is wrong) */ 2206 hwsbase = 0x2f; /* From 7620.SET (spec is wrong) */
@@ -2220,6 +2224,7 @@ static int set_ov_sensor_window(struct sd *sd)
2220 switch (sd->sensor) { 2224 switch (sd->sensor) {
2221 case SEN_OV6620: 2225 case SEN_OV6620:
2222 case SEN_OV6630: 2226 case SEN_OV6630:
2227 case SEN_OV66308AF:
2223 if (qvga) { /* QCIF */ 2228 if (qvga) { /* QCIF */
2224 hwscale = 0; 2229 hwscale = 0;
2225 vwscale = 0; 2230 vwscale = 0;
@@ -2456,6 +2461,7 @@ static void setbrightness(struct gspca_dev *gspca_dev)
2456 case SEN_OV76BE: 2461 case SEN_OV76BE:
2457 case SEN_OV6620: 2462 case SEN_OV6620:
2458 case SEN_OV6630: 2463 case SEN_OV6630:
2464 case SEN_OV66308AF:
2459 case SEN_OV7640: 2465 case SEN_OV7640:
2460 i2c_w(sd, OV7610_REG_BRT, val); 2466 i2c_w(sd, OV7610_REG_BRT, val);
2461 break; 2467 break;
@@ -2484,6 +2490,7 @@ static void setcontrast(struct gspca_dev *gspca_dev)
2484 i2c_w(sd, OV7610_REG_CNT, val); 2490 i2c_w(sd, OV7610_REG_CNT, val);
2485 break; 2491 break;
2486 case SEN_OV6630: 2492 case SEN_OV6630:
2493 case SEN_OV66308AF:
2487 i2c_w_mask(sd, OV7610_REG_CNT, val >> 4, 0x0f); 2494 i2c_w_mask(sd, OV7610_REG_CNT, val >> 4, 0x0f);
2488 break; 2495 break;
2489 case SEN_OV8610: { 2496 case SEN_OV8610: {
@@ -2528,6 +2535,7 @@ static void setcolors(struct gspca_dev *gspca_dev)
2528 case SEN_OV76BE: 2535 case SEN_OV76BE:
2529 case SEN_OV6620: 2536 case SEN_OV6620:
2530 case SEN_OV6630: 2537 case SEN_OV6630:
2538 case SEN_OV66308AF:
2531 i2c_w(sd, OV7610_REG_SAT, val); 2539 i2c_w(sd, OV7610_REG_SAT, val);
2532 break; 2540 break;
2533 case SEN_OV7620: 2541 case SEN_OV7620:
@@ -2591,7 +2599,8 @@ static void setfreq(struct sd *sd)
2591 i2c_w_mask(sd, 0x2a, 0x80, 0x80); 2599 i2c_w_mask(sd, 0x2a, 0x80, 0x80);
2592 /* 20 fps -> 16.667 fps */ 2600 /* 20 fps -> 16.667 fps */
2593 if (sd->sensor == SEN_OV6620 || 2601 if (sd->sensor == SEN_OV6620 ||
2594 sd->sensor == SEN_OV6630) 2602 sd->sensor == SEN_OV6630 ||
2603 sd->sensor == SEN_OV66308AF)
2595 i2c_w(sd, 0x2b, 0x5e); 2604 i2c_w(sd, 0x2b, 0x5e);
2596 else 2605 else
2597 i2c_w(sd, 0x2b, 0xac); 2606 i2c_w(sd, 0x2b, 0xac);
@@ -2599,7 +2608,8 @@ static void setfreq(struct sd *sd)
2599 case 2: /* 60 hz (filter on, ...) */ 2608 case 2: /* 60 hz (filter on, ...) */
2600 i2c_w_mask(sd, 0x2d, 0x04, 0x04); 2609 i2c_w_mask(sd, 0x2d, 0x04, 0x04);
2601 if (sd->sensor == SEN_OV6620 || 2610 if (sd->sensor == SEN_OV6620 ||
2602 sd->sensor == SEN_OV6630) { 2611 sd->sensor == SEN_OV6630 ||
2612 sd->sensor == SEN_OV66308AF) {
2603 /* 20 fps -> 15 fps */ 2613 /* 20 fps -> 15 fps */
2604 i2c_w_mask(sd, 0x2a, 0x80, 0x80); 2614 i2c_w_mask(sd, 0x2a, 0x80, 0x80);
2605 i2c_w(sd, 0x2b, 0xa8); 2615 i2c_w(sd, 0x2b, 0xa8);