diff options
author | Erik Andrén <erik.andren@gmail.com> | 2009-01-22 03:51:40 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 18:20:47 -0300 |
commit | 2f17e1a1f0e545a80cb012cd10cef381acb07574 (patch) | |
tree | 41350dee07f2ecbb3d1dce33bdf71d743582c5f4 /drivers/media/video/gspca/m5602 | |
parent | c731e271afa85233a2e7f3c2be826a2729d1100c (diff) |
V4L/DVB (11640): gspca - m5602-s5k4aa: Flip hflip and vflip together
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/m5602')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c index 404439fa4bb..aa4d3fdaaee 100644 --- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c +++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c @@ -418,18 +418,21 @@ static int s5k4aa_set_vflip(struct gspca_dev *gspca_dev, __s32 val) if (err < 0) return err; - if (dmi_check_system(s5k4aa_vflip_dmi_table)) + if (dmi_check_system(s5k4aa_vflip_dmi_table)) { val = !val; + data = (data & 0x3f) | + (!sensor_settings[HFLIP_IDX] << 6) | + ((val & 0x01) << 7); + } else { + data = (data & 0x3f) | + (sensor_settings[HFLIP_IDX] << 6) | + ((val & 0x01) << 7); + } - data = ((data & ~S5K4AA_RM_V_FLIP) - | ((val & 0x01) << 7)); err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1); if (err < 0) return err; - if (dmi_check_system(s5k4aa_vflip_dmi_table)) - val = !val; - if (val) { err = m5602_read_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); if (err < 0) @@ -445,7 +448,6 @@ static int s5k4aa_set_vflip(struct gspca_dev *gspca_dev, __s32 val) data--; err = m5602_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); } - return err; } @@ -481,6 +483,17 @@ static int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val) if (err < 0) return err; + if (dmi_check_system(s5k4aa_vflip_dmi_table)) { + val = !val; + data = (data & 0x3f) | + (!sensor_settings[VFLIP_IDX] << 7) | + ((val & 0x01) << 6); + } else { + data = (data & 0x3f) | + (sensor_settings[VFLIP_IDX] << 7) | + ((val & 0x01) << 6); + } + data = ((data & ~S5K4AA_RM_H_FLIP) | ((val & 0x01) << 6)); err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1); if (err < 0) @@ -501,7 +514,6 @@ static int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val) data--; err = m5602_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); } - return err; } |