1 From e03a63b8d4a60ee49e3277ac7f7ea4c2998e7938 Mon Sep 17 00:00:00 2001
2 From: Kieran Bingham <kieran.bingham@ideasonboard.com>
3 Date: Thu, 10 Oct 2024 14:52:52 +0100
4 Subject: [PATCH 1325/1350] NotForUpstream: media: video-mux: Propagate
7 The i.MX8MP makes calls on it's source device to determine
8 the link-frequency that should be configured on the CSI2 receiver.
10 When the source is behind a video mux, we need to pass this call through
11 to the connected device.
13 Map the control handler of the source device to the video-mux,
14 essentially proxying all controls on the mux to the device which has
17 Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
19 drivers/media/platform/video-mux.c | 7 +++++++
20 1 file changed, 7 insertions(+)
22 --- a/drivers/media/platform/video-mux.c
23 +++ b/drivers/media/platform/video-mux.c
24 @@ -69,6 +69,7 @@ static int video_mux_link_setup(struct m
25 const struct media_pad *remote, u32 flags)
27 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
28 + struct v4l2_subdev *source_sd;
29 struct video_mux *vmux = v4l2_subdev_to_video_mux(sd);
30 u16 source_pad = entity->num_pads - 1;
32 @@ -111,6 +112,10 @@ static int video_mux_link_setup(struct m
33 *source_mbusformat = *v4l2_subdev_get_pad_format(sd, sd_state,
35 v4l2_subdev_unlock_state(sd_state);
37 + source_sd = media_entity_to_v4l2_subdev(remote->entity);
38 + vmux->subdev.ctrl_handler = source_sd->ctrl_handler;
41 if (vmux->active != local->index)
43 @@ -118,6 +123,8 @@ static int video_mux_link_setup(struct m
44 dev_dbg(sd->dev, "going inactive\n");
45 mux_control_deselect(vmux->mux);
48 + vmux->subdev.ctrl_handler = NULL;