diff options
author | Erik Andrén <erik.andren@gmail.com> | 2009-01-22 01:32:32 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:47 -0400 |
commit | c731e271afa85233a2e7f3c2be826a2729d1100c (patch) | |
tree | c41cfb2905c399fd32a950b1a7ecf910d69f7baf | |
parent | 81b4293ae62b81b0b434f10c694f11fff93be8ca (diff) |
V4L/DVB (11639): gspca - m5602-mt9m111: Correct the hflip/vflip semantics
mt9m111: Hflip and vflip shall always be 0 at start and the image shall be correctly aligned.
The mt9m111 is hflipped and vflipped by default. Correct the semantics to make this happen.
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_mt9m111.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/drivers/media/video/gspca/m5602/m5602_mt9m111.c index 241108c786c3..ade7264d4dc2 100644 --- a/drivers/media/video/gspca/m5602/m5602_mt9m111.c +++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.c | |||
@@ -67,7 +67,7 @@ const static struct ctrl mt9m111_ctrls[] = { | |||
67 | .minimum = 0, | 67 | .minimum = 0, |
68 | .maximum = 1, | 68 | .maximum = 1, |
69 | .step = 1, | 69 | .step = 1, |
70 | .default_value = 1 | 70 | .default_value = 0 |
71 | }, | 71 | }, |
72 | .set = mt9m111_set_vflip, | 72 | .set = mt9m111_set_vflip, |
73 | .get = mt9m111_get_vflip | 73 | .get = mt9m111_get_vflip |
@@ -81,7 +81,7 @@ const static struct ctrl mt9m111_ctrls[] = { | |||
81 | .minimum = 0, | 81 | .minimum = 0, |
82 | .maximum = 1, | 82 | .maximum = 1, |
83 | .step = 1, | 83 | .step = 1, |
84 | .default_value = 1 | 84 | .default_value = 0 |
85 | }, | 85 | }, |
86 | .set = mt9m111_set_hflip, | 86 | .set = mt9m111_set_hflip, |
87 | .get = mt9m111_get_hflip | 87 | .get = mt9m111_get_hflip |
@@ -391,6 +391,9 @@ static int mt9m111_set_vflip(struct gspca_dev *gspca_dev, __s32 val) | |||
391 | 391 | ||
392 | sensor_settings[VFLIP_IDX] = val; | 392 | sensor_settings[VFLIP_IDX] = val; |
393 | 393 | ||
394 | /* The mt9m111 is flipped by default */ | ||
395 | val = !val; | ||
396 | |||
394 | /* Set the correct page map */ | 397 | /* Set the correct page map */ |
395 | err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2); | 398 | err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2); |
396 | if (err < 0) | 399 | if (err < 0) |
@@ -427,6 +430,10 @@ static int mt9m111_set_hflip(struct gspca_dev *gspca_dev, __s32 val) | |||
427 | PDEBUG(D_V4L2, "Set horizontal flip to %d", val); | 430 | PDEBUG(D_V4L2, "Set horizontal flip to %d", val); |
428 | 431 | ||
429 | sensor_settings[HFLIP_IDX] = val; | 432 | sensor_settings[HFLIP_IDX] = val; |
433 | |||
434 | /* The mt9m111 is flipped by default */ | ||
435 | val = !val; | ||
436 | |||
430 | /* Set the correct page map */ | 437 | /* Set the correct page map */ |
431 | err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2); | 438 | err = m5602_write_sensor(sd, MT9M111_PAGE_MAP, data, 2); |
432 | if (err < 0) | 439 | if (err < 0) |