aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3-adas/recipes-kernel/linux/linux-renesas/0033-media-soc-camera-fix-parallel-i-f-in-VIN.patch
blob: c56049aa35d8d174802ae1ce580fbd96ef1eef10 (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
From 112395ed601c67a6ba935cec0107335e966888dc Mon Sep 17 00:00:00 2001
From: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Date: Fri, 14 Jul 2017 21:55:20 +0300
Subject: [PATCH] media: soc_camera: fix parallel i/f in VIN

This fixes parallel interface in VIN

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
---
 drivers/media/platform/soc_camera/rcar_vin.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
index f5c2528..a9cb72d 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -149,6 +149,9 @@
 /* Video n Data Mode Register 2 bits */
 #define VNDMR2_VPS		(1 << 30)
 #define VNDMR2_HPS		(1 << 29)
+#define VNDMR2_CES		(1 << 28)
+#define VNDMR2_DES		(1 << 27)
+#define VNDMR2_CHS		(1 << 23)
 #define VNDMR2_FTEV		(1 << 17)
 #define VNDMR2_VLV(n)		((n & 0xf) << 12)
 
@@ -1850,10 +1853,15 @@ static int rcar_vin_set_bus_param(struct soc_camera_device *icd)
 		val = VNDMR2_FTEV;
 	else
 		val = VNDMR2_FTEV | VNDMR2_VLV(1);
+
 	if (!(common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW))
 		val |= VNDMR2_VPS;
 	if (!(common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW))
 		val |= VNDMR2_HPS;
+
+	val |= VNDMR2_CES;
+	dev_dbg(icd->parent, "VNDMR2=0x%x\n", val);
+
 	iowrite32(val, priv->base + VNDMR2_REG);
 
 	ret = rcar_vin_set_rect(icd);
@@ -2937,8 +2945,8 @@ static int rcar_vin_probe(struct platform_device *pdev)
 		priv->max_height = 2048;
 	}
 
-	if (priv->chip == RCAR_H3 || priv->chip == RCAR_M3 ||
-		priv->chip == RCAR_V3M) {
+	if ((priv->chip == RCAR_H3 || priv->chip == RCAR_M3 ||
+	    priv->chip == RCAR_V3M) && !of_property_read_string(np, "csi,select", &str)) {
 		u32 ifmd = 0;
 		bool match_flag = false;
 		const struct vin_gen3_ifmd *gen3_ifmd_table = NULL;
@@ -2973,12 +2981,6 @@ static int rcar_vin_probe(struct platform_device *pdev)
 		else
 			priv->index = RCAR_VIN_CH_NONE;
 
-		ret = of_property_read_string(np, "csi,select", &str);
-		if (ret) {
-			dev_err(&pdev->dev, "could not parse csi,select\n");
-			return ret;
-		}
-
 		if (strcmp(str, "csi40") == 0)
 			priv->csi_ch = RCAR_CSI40;
 		else if (strcmp(str, "csi20") == 0)
-- 
1.9.1