summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndrei Andreyanau <a.andreyanau@sam-solutions.net>2013-02-05 17:32:23 +0300
committerJustin Waters <justin.waters@timesys.com>2013-11-07 12:19:23 -0500
commitdf1836dfc9165db304b0b9629ff26aba7465581a (patch)
treebf8273e7154c2b5fd5d368933458632fb34d2982 /drivers
parent3b6d4316ee4c2bfc3758c09f487f5e41184e1984 (diff)
Fixed mt9v024 camera support
modified: drivers/media/video/mt9v022.c Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/mt9v022.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/media/video/mt9v022.c b/drivers/media/video/mt9v022.c
index a46c198d1bf4..35f074e9b0fb 100644
--- a/drivers/media/video/mt9v022.c
+++ b/drivers/media/video/mt9v022.c
@@ -351,14 +351,27 @@ static int mt9v022_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
ret = reg_write(client, MT9V022_COLUMN_START, rect.left);
if (!ret)
ret = reg_write(client, MT9V022_ROW_START, rect.top);
- if (!ret)
- /*
- * Default 94, Phytec driver says:
- * "width + horizontal blank >= 660"
- */
- ret = reg_write(client, MT9V022_HORIZONTAL_BLANKING,
- rect.width > 660 - 43 ? 43 :
- 660 - rect.width);
+
+ if (is_mt9v024(mt9v022->chip_version)) {
+ if (!ret)
+ /*
+ * Default is 94. The Datasheet says:
+ * "width + horizontal blank >= 690"
+ */
+ ret = reg_write(client, MT9V022_HORIZONTAL_BLANKING,
+ rect.width > 690 - 61 ? 61 :
+ 690 - rect.width);
+ } else {
+ if (!ret)
+ /*
+ * Default 94, Phytec driver says:
+ * "width + horizontal blank >= 660"
+ */
+ ret = reg_write(client, MT9V022_HORIZONTAL_BLANKING,
+ rect.width > 660 - 43 ? 43 :
+ 660 - rect.width);
+ }
+
if (!ret)
ret = reg_write(client, MT9V022_VERTICAL_BLANKING, 45);
if (!ret)