aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/sonixj.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-06-18 13:29:20 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-23 02:13:54 -0400
commitf800952c21157f11a5510d9cf700c9a7ba30800d (patch)
tree4f43a7786679abf6c26b779bedfbd50d942e3429 /drivers/media/video/gspca/sonixj.c
parent37c6dbe290c05023b47f52528e30ce51336b93eb (diff)
V4L/DVB (12092): gspca_sonixj + ov7630: invert vflip control instead of changing default
gspca_sonixj + ov7630 had the default value for flip enabled, as otherwise the picture is upside down. It is better to instead invert the meaning of the control in the set function, and have the default be no vflip, as one would expect vflip enabled to be upside down. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/sonixj.c')
-rw-r--r--drivers/media/video/gspca/sonixj.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index 7daa60299c0e..46ec24e40458 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -218,7 +218,7 @@ static struct ctrl sd_ctrls[] = {
218 .minimum = 0, 218 .minimum = 0,
219 .maximum = 1, 219 .maximum = 1,
220 .step = 1, 220 .step = 1,
221#define VFLIP_DEF 0 /* vflip def = 1 for ov7630 */ 221#define VFLIP_DEF 0
222 .default_value = VFLIP_DEF, 222 .default_value = VFLIP_DEF,
223 }, 223 },
224 .set = sd_setvflip, 224 .set = sd_setvflip,
@@ -1321,10 +1321,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
1321 sd->gamma = GAMMA_DEF; 1321 sd->gamma = GAMMA_DEF;
1322 sd->autogain = AUTOGAIN_DEF; 1322 sd->autogain = AUTOGAIN_DEF;
1323 sd->ag_cnt = -1; 1323 sd->ag_cnt = -1;
1324 if (sd->sensor != SENSOR_OV7630) 1324 sd->vflip = VFLIP_DEF;
1325 sd->vflip = 0;
1326 else
1327 sd->vflip = 1;
1328 sd->infrared = INFRARED_DEF; 1325 sd->infrared = INFRARED_DEF;
1329 sd->freq = FREQ_DEF; 1326 sd->freq = FREQ_DEF;
1330 sd->quality = QUALITY_DEF; 1327 sd->quality = QUALITY_DEF;
@@ -1613,12 +1610,15 @@ static void setvflip(struct sd *sd)
1613{ 1610{
1614 u8 comn; 1611 u8 comn;
1615 1612
1616 if (sd->sensor == SENSOR_OV7630) 1613 if (sd->sensor == SENSOR_OV7630) {
1617 comn = 0x02; 1614 comn = 0x02;
1618 else 1615 if (!sd->vflip)
1616 comn |= 0x80;
1617 } else {
1619 comn = 0x06; 1618 comn = 0x06;
1620 if (sd->vflip) 1619 if (sd->vflip)
1621 comn |= 0x80; 1620 comn |= 0x80;
1621 }
1622 i2c_w1(&sd->gspca_dev, 0x75, comn); 1622 i2c_w1(&sd->gspca_dev, 0x75, comn);
1623} 1623}
1624 1624