diff mbox

[28/32] media: rcar-vin: propagate format to bridge

Message ID 20161102132329.436-29-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State New, archived
Headers show

Commit Message

Niklas Söderlund Nov. 2, 2016, 1:23 p.m. UTC
The CSI2 bridge needs to know the video format, propagate it after the
video source have had its say on the format.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox

Patch

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index e99815f..d363531 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -193,6 +193,21 @@  static int __rvin_try_format_source(struct rvin_dev *vin,
 	if (ret < 0 && ret != -ENOIOCTLCMD)
 		goto done;
 
+	/* If we are part of a CSI2 group update bridge */
+	if (vin_have_bridge(vin)) {
+		struct v4l2_subdev *bridge = vin_to_bridge(vin);
+
+		if (!bridge) {
+			ret = -EINVAL;
+			goto done;
+		}
+
+		format.pad = 0;
+		ret = v4l2_subdev_call(bridge, pad, set_fmt, pad_cfg, &format);
+		if (ret < 0 && ret != -ENOIOCTLCMD)
+			goto done;
+	}
+
 	v4l2_fill_pix_format(pix, &format.format);
 
 	pix->field = field;