diff options
author | Erik Andrén <erik.andren@gmail.com> | 2009-01-22 07:51:40 +0100 |
---|---|---|
committer | Erik Andrén <erik.andren@gmail.com> | 2009-01-22 07:51:40 +0100 |
commit | 14ac13100d3cf2c1b83e308815a03b1b50115481 (patch) | |
tree | 3e28aa7494e8fa928a5b44b4c0ac96697e3fd18b | |
parent | aaef55c44c4f4af3f656b7884de88f4343dc264a (diff) | |
download | mediapointer-dvb-s2-14ac13100d3cf2c1b83e308815a03b1b50115481.tar.gz mediapointer-dvb-s2-14ac13100d3cf2c1b83e308815a03b1b50115481.tar.bz2 |
gspca - m5602-s5k4aa: Flip hflip and vflip together
From: Erik Andrén <erik.andren@gmail.com>
Priority: normal
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
-rw-r--r-- | linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c index 06da4b3ed..3ec22ebd2 100644 --- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c +++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c @@ -420,18 +420,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) @@ -447,7 +450,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; } @@ -483,6 +485,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) @@ -503,7 +516,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; } |