summaryrefslogtreecommitdiffstats
path: root/bsp/meta-rcar/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0405-media-i2c-ov10640-fix-controls.patch
blob: 179e28c75d2cbe324318e6da05b12e5990e803bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 9a56fad72e10479fb7ec44a9e871261daba75a18 Mon Sep 17 00:00:00 2001
From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Date: Sat, 3 Aug 2019 01:34:49 +0300
Subject: [PATCH] media: i2c: ov10640: fix controls

This fixes v4l2 controls

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
---
 drivers/media/i2c/soc_camera/ov10640.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/media/i2c/soc_camera/ov10640.c b/drivers/media/i2c/soc_camera/ov10640.c
index 31117e5..4ce6e15 100644
--- a/drivers/media/i2c/soc_camera/ov10640.c
+++ b/drivers/media/i2c/soc_camera/ov10640.c
@@ -320,7 +320,7 @@ static int ov10640_s_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_GAIN:
 		reg16_write(client, 0x30EC, ctrl->val);		// L
 		reg16_write(client, 0x30EE, ctrl->val);		// S
-		reg16_write(client, 0x30F0, ctrl->val);		// VS
+		ret = reg16_write(client, 0x30F0, ctrl->val);	// VS
 		break;
 	case V4L2_CID_ANALOGUE_GAIN:
 		reg16_read(client, 0x30EB, &val);
@@ -328,7 +328,7 @@ static int ov10640_s_ctrl(struct v4l2_ctrl *ctrl)
 		val |= ((ctrl->val / 2) << 0);	// L
 		val |= (ctrl->val << 2);	// S
 		val |= ((ctrl->val / 2) << 4);	// VS
-		reg16_write(client, 0x30EB, val);
+		ret = reg16_write(client, 0x30EB, val);
 		break;
 	case V4L2_CID_EXPOSURE:
 		val16 = 0xfff - ctrl->val;
@@ -337,16 +337,18 @@ static int ov10640_s_ctrl(struct v4l2_ctrl *ctrl)
 		reg16_write(client, 0x30E7, val16 & 0xff);	// L
 
 		reg16_write(client, 0x30E8, val16 >> 8);	// S
-		reg16_write(client, 0x30E9, val16 & 0xff);	// S
+		ret = reg16_write(client, 0x30E9, val16 & 0xff);// S
 
-//		reg16_write(client, 0x30EA, val >> 8);	// VS - fractional ...
+//		ret = reg16_write(client, 0x30EA, val >> 8);	// VS - fractional ...
 		break;
+#if 0
 	case V4L2_CID_EXPOSURE_AUTO:
 		reg16_read(client, 0x30FA, &val);
 		val &= ~(0x1 << 6);
 		val |= (ctrl->val << 6);
-		reg16_write(client, 0x30FA, val);
+		ret = reg16_write(client, 0x30FA, val);
 		break;
+#endif
 	case V4L2_CID_HFLIP:
 		reg16_read(client, 0x3128, &val);
 		val &= ~(0x1 << 0);
@@ -585,8 +587,10 @@ static int ov10640_probe(struct i2c_client *client,
 			  V4L2_CID_ANALOGUE_GAIN, 0, 3, 1, 1);
 	v4l2_ctrl_new_std(&priv->hdl, &ov10640_ctrl_ops,
 			  V4L2_CID_EXPOSURE, 0, 0xfff, 1, 0x448);
+#if 0
 	v4l2_ctrl_new_std(&priv->hdl, &ov10640_ctrl_ops,
 			  V4L2_CID_EXPOSURE_AUTO, 0, 1, 1, 0);
+#endif
 	v4l2_ctrl_new_std(&priv->hdl, &ov10640_ctrl_ops,
 			  V4L2_CID_HFLIP, 0, 1, 1, 1);
 	v4l2_ctrl_new_std(&priv->hdl, &ov10640_ctrl_ops,
-- 
2.7.4