The patch number 11640 was added via Erik Andr?n <erik.and...@gmail.com>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

From: Erik Andr?n  <erik.and...@gmail.com>
gspca - m5602-s5k4aa: Flip hflip and vflip together


Priority: normal

Signed-off-by: Erik Andr?n <erik.and...@gmail.com>


---

 linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c |   30 +++++++----
 1 file changed, 21 insertions(+), 9 deletions(-)

diff -r 2bc8f20cdc0a -r 37de43873460 
linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
--- a/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c      Thu Jan 22 
07:32:32 2009 +0100
+++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k4aa.c      Thu Jan 22 
07:51:40 2009 +0100
@@ -420,17 +420,20 @@ static int s5k4aa_set_vflip(struct gspca
        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 & ~S5K4AA_RM_V_FLIP)
-                       | ((val & 0x01) << 7));
+               data = (data & 0x3f) |
+                      (!sensor_settings[HFLIP_IDX] << 6) |
+                      ((val & 0x01) << 7);
+       } else {
+               data = (data & 0x3f) |
+               (sensor_settings[HFLIP_IDX] << 6) |
+               ((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);
@@ -447,7 +450,6 @@ static int s5k4aa_set_vflip(struct gspca
                data--;
                err = m5602_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1);
        }
-
        return err;
 }
 
@@ -482,6 +484,17 @@ static int s5k4aa_set_hflip(struct gspca
        err = m5602_read_sensor(sd, S5K4AA_READ_MODE, &data, 1);
        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);
@@ -503,7 +516,6 @@ static int s5k4aa_set_hflip(struct gspca
                data--;
                err = m5602_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1);
        }
-
        return err;
 }
 


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/37de43873460606ba0ac4fe339b4b5b54c565e7d

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to