diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2009-01-06 10:58:50 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:24 -0400 |
commit | 6f02d76161e7d1b52e4994d83177209a5a93bc7e (patch) | |
tree | 6a7e06fc8935005062fa34ba24c1ffaac8c62aa4 | |
parent | 09a7480ec127d26cade353b49f912c3348f6532e (diff) |
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>
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_ov9650.c | 21 |
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: | |||
289 | for (i = 0; i < ARRAY_SIZE(ov9650_ctrls); i++) | 289 | for (i = 0; i < ARRAY_SIZE(ov9650_ctrls); i++) |
290 | sensor_settings[i] = ov9650_ctrls[i].qctrl.default_value; | 290 | sensor_settings[i] = ov9650_ctrls[i].qctrl.default_value; |
291 | sd->sensor_priv = sensor_settings; | 291 | sd->sensor_priv = sensor_settings; |
292 | |||
293 | if (dmi_check_system(ov9650_flip_dmi_table) && !err) { | ||
294 | info("vflip quirk active"); | ||
295 | sensor_settings[VFLIP_IDX] = 1; | ||
296 | } | ||
297 | |||
298 | return 0; | 292 | return 0; |
299 | } | 293 | } |
300 | 294 | ||
@@ -360,7 +354,10 @@ int ov9650_start(struct sd *sd) | |||
360 | int ver_offs = cam->cam_mode[sd->gspca_dev.curr_mode].priv; | 354 | int ver_offs = cam->cam_mode[sd->gspca_dev.curr_mode].priv; |
361 | int hor_offs = OV9650_LEFT_OFFSET; | 355 | int hor_offs = OV9650_LEFT_OFFSET; |
362 | 356 | ||
363 | if (sensor_settings[VFLIP_IDX]) | 357 | if ((!dmi_check_system(ov9650_flip_dmi_table) && |
358 | sensor_settings[VFLIP_IDX]) || | ||
359 | (dmi_check_system(ov9650_flip_dmi_table) && | ||
360 | !sensor_settings[VFLIP_IDX])) | ||
364 | ver_offs--; | 361 | ver_offs--; |
365 | 362 | ||
366 | if (width <= 320) | 363 | if (width <= 320) |
@@ -629,7 +626,12 @@ int ov9650_set_hflip(struct gspca_dev *gspca_dev, __s32 val) | |||
629 | PDEBUG(D_V4L2, "Set horizontal flip to %d", val); | 626 | PDEBUG(D_V4L2, "Set horizontal flip to %d", val); |
630 | 627 | ||
631 | sensor_settings[HFLIP_IDX] = val; | 628 | sensor_settings[HFLIP_IDX] = val; |
632 | i2c_data = ((val & 0x01) << 5) | (sensor_settings[VFLIP_IDX] << 4); | 629 | |
630 | if (!dmi_check_system(ov9650_flip_dmi_table)) | ||
631 | i2c_data = ((val & 0x01) << 5) | (sensor_settings[VFLIP_IDX] << 4); | ||
632 | else | ||
633 | i2c_data = ((val & 0x01) << 5) | (!sensor_settings[VFLIP_IDX] << 4); | ||
634 | |||
633 | err = m5602_write_sensor(sd, OV9650_MVFP, &i2c_data, 1); | 635 | err = m5602_write_sensor(sd, OV9650_MVFP, &i2c_data, 1); |
634 | 636 | ||
635 | return err; | 637 | return err; |
@@ -656,6 +658,9 @@ int ov9650_set_vflip(struct gspca_dev *gspca_dev, __s32 val) | |||
656 | PDEBUG(D_V4L2, "Set vertical flip to %d", val); | 658 | PDEBUG(D_V4L2, "Set vertical flip to %d", val); |
657 | sensor_settings[VFLIP_IDX] = val; | 659 | sensor_settings[VFLIP_IDX] = val; |
658 | 660 | ||
661 | if (dmi_check_system(ov9650_flip_dmi_table)) | ||
662 | val = !val; | ||
663 | |||
659 | i2c_data = ((val & 0x01) << 4) | (sensor_settings[VFLIP_IDX] << 5); | 664 | i2c_data = ((val & 0x01) << 4) | (sensor_settings[VFLIP_IDX] << 5); |
660 | err = m5602_write_sensor(sd, OV9650_MVFP, &i2c_data, 1); | 665 | err = m5602_write_sensor(sd, OV9650_MVFP, &i2c_data, 1); |
661 | if (err < 0) | 666 | if (err < 0) |