diff options
author | Erik Andrén <erik.andren@gmail.com> | 2009-01-22 01:51:40 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:47 -0400 |
commit | 2f17e1a1f0e545a80cb012cd10cef381acb07574 (patch) | |
tree | 41350dee07f2ecbb3d1dce33bdf71d743582c5f4 | |
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>
-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 404439fa4bb8..aa4d3fdaaee2 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) | |||
418 | if (err < 0) | 418 | if (err < 0) |
419 | return err; | 419 | return err; |
420 | 420 | ||
421 | if (dmi_check_system(s5k4aa_vflip_dmi_table)) | 421 | if (dmi_check_system(s5k4aa_vflip_dmi_table)) { |
422 | val = !val; | 422 | val = !val; |
423 | data = (data & 0x3f) | | ||
424 | (!sensor_settings[HFLIP_IDX] << 6) | | ||
425 | ((val & 0x01) << 7); | ||
426 | } else { | ||
427 | data = (data & 0x3f) | | ||
428 | (sensor_settings[HFLIP_IDX] << 6) | | ||
429 | ((val & 0x01) << 7); | ||
430 | } | ||
423 | 431 | ||
424 | data = ((data & ~S5K4AA_RM_V_FLIP) | ||
425 | | ((val & 0x01) << 7)); | ||
426 | err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1); | 432 | err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1); |
427 | if (err < 0) | 433 | if (err < 0) |
428 | return err; | 434 | return err; |
429 | 435 | ||
430 | if (dmi_check_system(s5k4aa_vflip_dmi_table)) | ||
431 | val = !val; | ||
432 | |||
433 | if (val) { | 436 | if (val) { |
434 | err = m5602_read_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); | 437 | err = m5602_read_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); |
435 | if (err < 0) | 438 | if (err < 0) |
@@ -445,7 +448,6 @@ static int s5k4aa_set_vflip(struct gspca_dev *gspca_dev, __s32 val) | |||
445 | data--; | 448 | data--; |
446 | err = m5602_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); | 449 | err = m5602_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); |
447 | } | 450 | } |
448 | |||
449 | return err; | 451 | return err; |
450 | } | 452 | } |
451 | 453 | ||
@@ -481,6 +483,17 @@ static int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val) | |||
481 | if (err < 0) | 483 | if (err < 0) |
482 | return err; | 484 | return err; |
483 | 485 | ||
486 | if (dmi_check_system(s5k4aa_vflip_dmi_table)) { | ||
487 | val = !val; | ||
488 | data = (data & 0x3f) | | ||
489 | (!sensor_settings[VFLIP_IDX] << 7) | | ||
490 | ((val & 0x01) << 6); | ||
491 | } else { | ||
492 | data = (data & 0x3f) | | ||
493 | (sensor_settings[VFLIP_IDX] << 7) | | ||
494 | ((val & 0x01) << 6); | ||
495 | } | ||
496 | |||
484 | data = ((data & ~S5K4AA_RM_H_FLIP) | ((val & 0x01) << 6)); | 497 | data = ((data & ~S5K4AA_RM_H_FLIP) | ((val & 0x01) << 6)); |
485 | err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1); | 498 | err = m5602_write_sensor(sd, S5K4AA_READ_MODE, &data, 1); |
486 | if (err < 0) | 499 | if (err < 0) |
@@ -501,7 +514,6 @@ static int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val) | |||
501 | data--; | 514 | data--; |
502 | err = m5602_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); | 515 | err = m5602_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); |
503 | } | 516 | } |
504 | |||
505 | return err; | 517 | return err; |
506 | } | 518 | } |
507 | 519 | ||