summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/sonixj.c
diff options
context:
space:
mode:
authorhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-06-18 19:29:20 +0200
committerhans@rhel5-devel.localdomain <hans@rhel5-devel.localdomain>2009-06-18 19:29:20 +0200
commit5e6bb851c631e3940d0d15d290f0a1eac1081d82 (patch)
tree4cdefae7f292626928b60558ea15e39a941ba784 /linux/drivers/media/video/gspca/sonixj.c
parent1bee18b3646766a3bcaf53f8826438032e0e91ed (diff)
downloadmediapointer-dvb-s2-5e6bb851c631e3940d0d15d290f0a1eac1081d82.tar.gz
mediapointer-dvb-s2-5e6bb851c631e3940d0d15d290f0a1eac1081d82.tar.bz2
gspca_sonixj + ov7630: invert vflip control instead of changing default
From: Hans de Goede <hdegoede@redhat.com> 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. Priority: normal Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/gspca/sonixj.c')
-rw-r--r--linux/drivers/media/video/gspca/sonixj.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/linux/drivers/media/video/gspca/sonixj.c b/linux/drivers/media/video/gspca/sonixj.c
index aeeab0b51..f47986a1c 100644
--- a/linux/drivers/media/video/gspca/sonixj.c
+++ b/linux/drivers/media/video/gspca/sonixj.c
@@ -218,7 +218,7 @@ static struct ctrl sd_ctrls[] = {
.minimum = 0,
.maximum = 1,
.step = 1,
-#define VFLIP_DEF 0 /* vflip def = 1 for ov7630 */
+#define VFLIP_DEF 0
.default_value = VFLIP_DEF,
},
.set = sd_setvflip,
@@ -1337,10 +1337,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
sd->gamma = GAMMA_DEF;
sd->autogain = AUTOGAIN_DEF;
sd->ag_cnt = -1;
- if (sd->sensor != SENSOR_OV7630)
- sd->vflip = 0;
- else
- sd->vflip = 1;
+ sd->vflip = VFLIP_DEF;
sd->infrared = INFRARED_DEF;
sd->freq = FREQ_DEF;
sd->quality = QUALITY_DEF;
@@ -1639,12 +1636,15 @@ static void setvflip(struct sd *sd)
{
u8 comn;
- if (sd->sensor == SENSOR_OV7630)
+ if (sd->sensor == SENSOR_OV7630) {
comn = 0x02;
- else
+ if (!sd->vflip)
+ comn |= 0x80;
+ } else {
comn = 0x06;
- if (sd->vflip)
- comn |= 0x80;
+ if (sd->vflip)
+ comn |= 0x80;
+ }
i2c_w1(&sd->gspca_dev, 0x75, comn);
}