diff mbox

[v1,06/12] media: rcar: vin: Accept parallel input on Gen3

Message ID 1497891889-8038-7-git-send-email-jacopo+renesas@jmondi.org (mailing list archive)
State Changes Requested
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Jacopo Mondi June 19, 2017, 5:04 p.m. UTC
Accept parallel/BT.565 bus types when parsing OF on Gen3.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
 drivers/media/platform/rcar-vin/rcar-core.c | 37 +++++++++++++----------------
 1 file changed, 16 insertions(+), 21 deletions(-)
diff mbox

Patch

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
index ef61bcc..6738825 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -360,29 +360,24 @@  static int rvin_parse_v4l2(struct rvin_dev *vin,
 	}
 
 	mbus_cfg->type = v4l2_ep.bus_type;
+	mbus_cfg->flags = 0;
 
-	if (vin->info->chip == RCAR_GEN3) {
-		switch (mbus_cfg->type) {
-		case V4L2_MBUS_CSI2:
-			vin_dbg(vin, "Found CSI-2 media bus\n");
-			mbus_cfg->flags = 0;
-			return 0;
-		default:
-			break;
-		}
-	} else {
-		switch (mbus_cfg->type) {
-		case V4L2_MBUS_PARALLEL:
-			vin_dbg(vin, "Found PARALLEL media bus\n");
-			mbus_cfg->flags = v4l2_ep.bus.parallel.flags;
-			return 0;
-		case V4L2_MBUS_BT656:
-			vin_dbg(vin, "Found BT656 media bus\n");
-			mbus_cfg->flags = 0;
-			return 0;
-		default:
+	switch (mbus_cfg->type) {
+	case V4L2_MBUS_CSI2:
+		if (vin->info->chip < RCAR_GEN3)
 			break;
-		}
+
+		vin_dbg(vin, "Found CSI-2 media bus\n");
+		return 0;
+	case V4L2_MBUS_PARALLEL:
+		vin_dbg(vin, "Found PARALLEL media bus\n");
+		mbus_cfg->flags = v4l2_ep.bus.parallel.flags;
+		return 0;
+	case V4L2_MBUS_BT656:
+		vin_dbg(vin, "Found BT656 media bus\n");
+		return 0;
+	default:
+		break;
 	}
 
 	vin_err(vin, "Unknown media bus type\n");