summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Andreyanau <a.andreyanau@sam-solutions.net>2013-05-17 10:12:24 +0300
committerJustin Waters <justin.waters@timesys.com>2013-11-07 12:19:31 -0500
commit18efebd6811b9437c556f592d11c16dcf227bd93 (patch)
tree2d8a03fc115fcad8a4e54b8673a58cec287787b1
parent0e6a7f58209bec3fa72e1f0d26188fb04380db6c (diff)
Fixed top/left position calculation for mt9p031 camera driver
modified: drivers/media/video/mt9p031.c Signed-off-by: Uladzimir Bely <u.bely@sam-solutions.net> Signed-off-by: Christian Hemp <c.hemp@phytec.de>
-rw-r--r--drivers/media/video/mt9p031.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/media/video/mt9p031.c b/drivers/media/video/mt9p031.c
index ea5eec125b23..09faae993fc6 100644
--- a/drivers/media/video/mt9p031.c
+++ b/drivers/media/video/mt9p031.c
@@ -368,49 +368,47 @@ static int mt9p031_set_params(struct mt9p031 *mt9p031)
max(crop->height / 8, MT9P031_WINDOW_HEIGHT_MIN),
crop->height);
- mt9p031_write(client, MT9P031_SHUTTER_WIDTH_LOWER, height - 1);
-
switch (width) {
case (2048):
- crop_top = crop->top + ((2592 - 2048) / 2);
- crop_left = crop->left + ((1944 - 1536) / 2);
+ crop_left = crop->left + ((2592 - 2048) / 2);
+ crop_top = crop->top + ((1944 - 1536) / 2);
break;
case (1920):
- crop_top = crop->top + ((2592 - 1920) / 2);
- crop_left = crop->left + ((1944 - 1080) / 2);
+ crop_left = crop->left + ((2592 - 1920) / 2);
+ crop_top = crop->top + ((1944 - 1080) / 2);
break;
case (1600):
- crop_top = crop->top + ((2592 - 1600) / 2);
- crop_left = crop->left + ((1944 - 1200) / 2);
+ crop_left = crop->left + ((2592 - 1600) / 2);
+ crop_top = crop->top + ((1944 - 1200) / 2);
break;
case (1280):
if (height == 1024) {
- crop_top = crop->top + ((2592 - width) / 2);
- crop_left = crop->left + ((1944 - height) / 2);
+ crop_left = crop->left + ((2592 - width) / 2);
+ crop_top = crop->top + ((1944 - height) / 2);
} else if (height == 720) {
crop_width = 2560;
- crop_top = crop->top + ((2592 - crop_width) / 2);
+ crop_left = crop->left + ((2592 - crop_width) / 2);
crop_height = 1440;
- crop_left = crop->left + ((1944 - crop_height) / 2);
+ crop_top = crop->top + ((1944 - crop_height) / 2);
}
break;
case (1024):
crop_width = 2048;
- crop_top = crop->top + ((2592 - crop_width) / 2);
+ crop_left = crop->left + ((2592 - crop_width) / 2);
crop_height = 1536;
- crop_left = crop->left + ((1944 - crop_height) / 2);
+ crop_top = crop->top + ((1944 - crop_height) / 2);
break;
case (800):
crop_width = 1600;
- crop_top = crop->top + ((2592 - crop_width) / 2);
+ crop_left = crop->left + ((2592 - crop_width) / 2);
crop_height = 1200;
- crop_left = crop->left + ((1944 - crop_height) / 2);
+ crop_top = crop->top + ((1944 - crop_height) / 2);
break;
case (640):
crop_width = 2560;
- crop_top = crop->top + ((2592 - crop_width) / 2);
+ crop_left = crop->left + ((2592 - crop_width) / 2);
crop_height = 1920;
- crop_left = crop->left + ((1944 - crop_height) / 2);
+ crop_top = crop->top + ((1944 - crop_height) / 2);
break;
default:
break;