aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c
index 9c79a516db61..7967a651c4db 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.c
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c
@@ -662,12 +662,7 @@ int ov9650_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
662 PDEBUG(D_V4L2, "Set horizontal flip to %d", val); 662 PDEBUG(D_V4L2, "Set horizontal flip to %d", val);
663 663
664 sensor_settings[HFLIP_IDX] = val; 664 sensor_settings[HFLIP_IDX] = val;
665 err = m5602_read_sensor(sd, OV9650_MVFP, &i2c_data, 1); 665 i2c_data = ((val & 0x01) << 5) | (sensor_settings[VFLIP_IDX] << 4);
666 if (err < 0)
667 return err;
668
669 i2c_data = ((i2c_data & 0xdf) | ((val & 0x01) << 5));
670
671 err = m5602_write_sensor(sd, OV9650_MVFP, &i2c_data, 1); 666 err = m5602_write_sensor(sd, OV9650_MVFP, &i2c_data, 1);
672 667
673 return err; 668 return err;
@@ -692,19 +687,14 @@ int ov9650_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
692 s32 *sensor_settings = sd->sensor_priv; 687 s32 *sensor_settings = sd->sensor_priv;
693 688
694 PDEBUG(D_V4L2, "Set vertical flip to %d", val); 689 PDEBUG(D_V4L2, "Set vertical flip to %d", val);
695
696 sensor_settings[VFLIP_IDX] = val; 690 sensor_settings[VFLIP_IDX] = val;
697 err = m5602_read_sensor(sd, OV9650_MVFP, &i2c_data, 1);
698 if (err < 0)
699 return err;
700
701 i2c_data = ((i2c_data & 0xef) | ((val & 0x01) << 4));
702 691
692 i2c_data = ((val & 0x01) << 4) | (sensor_settings[VFLIP_IDX] << 5);
703 err = m5602_write_sensor(sd, OV9650_MVFP, &i2c_data, 1); 693 err = m5602_write_sensor(sd, OV9650_MVFP, &i2c_data, 1);
704
705 if (err < 0) 694 if (err < 0)
706 return err; 695 return err;
707 696
697 /* When vflip is toggled we need to readjust the bridge hsync/vsync */
708 if (gspca_dev->streaming) 698 if (gspca_dev->streaming)
709 err = ov9650_start(sd); 699 err = ov9650_start(sd);
710 700