Skip to content

Commit e03a63b

Browse files
kbinghampelwell
authored andcommitted
NotForUpstream: media: video-mux: Propagate controls to source
The i.MX8MP makes calls on it's source device to determine the link-frequency that should be configured on the CSI2 receiver. When the source is behind a video mux, we need to pass this call through to the connected device. Map the control handler of the source device to the video-mux, essentially proxying all controls on the mux to the device which has it's link enabled. Signed-off-by: Kieran Bingham <[email protected]>
1 parent 36faab6 commit e03a63b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/media/platform/video-mux.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static int video_mux_link_setup(struct media_entity *entity,
6969
const struct media_pad *remote, u32 flags)
7070
{
7171
struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
72+
struct v4l2_subdev *source_sd;
7273
struct video_mux *vmux = v4l2_subdev_to_video_mux(sd);
7374
u16 source_pad = entity->num_pads - 1;
7475
int ret = 0;
@@ -111,13 +112,19 @@ static int video_mux_link_setup(struct media_entity *entity,
111112
*source_mbusformat = *v4l2_subdev_get_pad_format(sd, sd_state,
112113
vmux->active);
113114
v4l2_subdev_unlock_state(sd_state);
115+
116+
source_sd = media_entity_to_v4l2_subdev(remote->entity);
117+
vmux->subdev.ctrl_handler = source_sd->ctrl_handler;
118+
114119
} else {
115120
if (vmux->active != local->index)
116121
goto out;
117122

118123
dev_dbg(sd->dev, "going inactive\n");
119124
mux_control_deselect(vmux->mux);
120125
vmux->active = -1;
126+
127+
vmux->subdev.ctrl_handler = NULL;
121128
}
122129

123130
out:

0 commit comments

Comments
 (0)