summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorErik Andr?n2009-01-06 16:58:50 +0100
committerMauro Carvalho Chehab2009-06-16 23:20:24 +0200
commit6f02d76161e7d1b52e4994d83177209a5a93bc7e (patch)
tree6a7e06fc8935005062fa34ba24c1ffaac8c62aa4 /drivers
parentV4L/DVB (11454): gspca - m5602-mt9m111: Remove the unused power_down struct m... (diff)
downloadkernel-qcow2-linux-6f02d76161e7d1b52e4994d83177209a5a93bc7e.tar.gz
kernel-qcow2-linux-6f02d76161e7d1b52e4994d83177209a5a93bc7e.tar.xz
kernel-qcow2-linux-6f02d76161e7d1b52e4994d83177209a5a93bc7e.zip
V4L/DVB (11455): gspca - m5602-ov9650: Improve the vflip quirk handling.
Regardless of the actual sensor orientation vflip = 0 is normal, and vflip = 1 is upside down. This patch makes that happen Signed-off-by: Erik Andr?n <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c
index 5ea93a85b7d8..2107f3cf6739 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.c
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c
@@ -289,12 +289,6 @@ sensor_found:
for (i = 0; i < ARRAY_SIZE(ov9650_ctrls); i++)
sensor_settings[i] = ov9650_ctrls[i].qctrl.default_value;
sd->sensor_priv = sensor_settings;
-
- if (dmi_check_system(ov9650_flip_dmi_table) && !err) {
- info("vflip quirk active");
- sensor_settings[VFLIP_IDX] = 1;
- }
-
return 0;
}
@@ -360,7 +354,10 @@ int ov9650_start(struct sd *sd)
int ver_offs = cam->cam_mode[sd->gspca_dev.curr_mode].priv;
int hor_offs = OV9650_LEFT_OFFSET;
- if (sensor_settings[VFLIP_IDX])
+ if ((!dmi_check_system(ov9650_flip_dmi_table) &&
+ sensor_settings[VFLIP_IDX]) ||
+ (dmi_check_system(ov9650_flip_dmi_table) &&
+ !sensor_settings[VFLIP_IDX]))
ver_offs--;
if (width <= 320)
@@ -629,7 +626,12 @@ int ov9650_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
PDEBUG(D_V4L2, "Set horizontal flip to %d", val);
sensor_settings[HFLIP_IDX] = val;
- i2c_data = ((val & 0x01) << 5) | (sensor_settings[VFLIP_IDX] << 4);
+
+ if (!dmi_check_system(ov9650_flip_dmi_table))
+ i2c_data = ((val & 0x01) << 5) | (sensor_settings[VFLIP_IDX] << 4);
+ else
+ i2c_data = ((val & 0x01) << 5) | (!sensor_settings[VFLIP_IDX] << 4);
+
err = m5602_write_sensor(sd, OV9650_MVFP, &i2c_data, 1);
return err;
@@ -656,6 +658,9 @@ int ov9650_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
PDEBUG(D_V4L2, "Set vertical flip to %d", val);
sensor_settings[VFLIP_IDX] = val;
+ if (dmi_check_system(ov9650_flip_dmi_table))
+ val = !val;
+
i2c_data = ((val & 0x01) << 4) | (sensor_settings[VFLIP_IDX] << 5);
err = m5602_write_sensor(sd, OV9650_MVFP, &i2c_data, 1);
if (err < 0)