summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/adv748x/adv748x-csi2.c
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo+renesas@jmondi.org>2019-01-10 17:02:12 +0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-02-18 19:03:52 +0300
commita33df6ac31513c499e4b8dae9632e641ebe4a245 (patch)
tree9c6d6ba13fb8dd131fe9cef77e837587a99ed34c /drivers/media/i2c/adv748x/adv748x-csi2.c
parent3361b9c4ed8790666875cbac1729d5a15e982947 (diff)
downloadlinux-a33df6ac31513c499e4b8dae9632e641ebe4a245.tar.xz
media: adv748x: Store the TX sink in HDMI/AFE
Both the AFE and HDMI s_stream routines (adv748x_afe_s_stream() and adv748x_hdmi_s_stream()) have to enable the CSI-2 TX they are streaming video data to. With the introduction of dynamic routing between HDMI and AFE entities to TXA, the video stream sink needs to be set at run time, and not statically selected as the s_stream functions are currently doing. To fix this, store a reference to the active CSI-2 TX sink for both HDMI and AFE sources, and operate on it when starting/stopping the stream. Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/i2c/adv748x/adv748x-csi2.c')
-rw-r--r--drivers/media/i2c/adv748x/adv748x-csi2.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/i2c/adv748x/adv748x-csi2.c b/drivers/media/i2c/adv748x/adv748x-csi2.c
index 353b6b9bf6a7..2091cda50935 100644
--- a/drivers/media/i2c/adv748x/adv748x-csi2.c
+++ b/drivers/media/i2c/adv748x/adv748x-csi2.c
@@ -88,14 +88,25 @@ static int adv748x_csi2_registered(struct v4l2_subdev *sd)
is_txb(tx));
if (ret)
return ret;
+
+ /* TXB can output AFE signals only. */
+ if (is_txb(tx))
+ state->afe.tx = tx;
}
/* Register link to HDMI for TXA only. */
if (is_txb(tx) || !is_hdmi_enabled(state))
return 0;
- return adv748x_csi2_register_link(tx, sd->v4l2_dev, &state->hdmi.sd,
- ADV748X_HDMI_SOURCE, true);
+ ret = adv748x_csi2_register_link(tx, sd->v4l2_dev, &state->hdmi.sd,
+ ADV748X_HDMI_SOURCE, true);
+ if (ret)
+ return ret;
+
+ /* The default HDMI output is TXA. */
+ state->hdmi.tx = tx;
+
+ return 0;
}
static const struct v4l2_subdev_internal_ops adv748x_csi2_internal_ops = {