From: Hans de Goede Date: Thu, 18 Jun 2009 17:29:20 +0000 (-0300) Subject: V4L/DVB (12092): gspca_sonixj + ov7630: invert vflip control instead of changing... X-Git-Tag: v2.6.31-rc1~40^2~39 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=f800952c21157f11a5510d9cf700c9a7ba30800d;p=~emulex%2Finfiniband.git 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 7daa60299c0..46ec24e4045 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/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, @@ -1321,10 +1321,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; @@ -1613,12 +1610,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); }