Skip to content

Commit

Permalink
NotForUpstream: media: video-mux: Propagate controls to source
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kbingham authored and pelwell committed Oct 17, 2024
1 parent 36faab6 commit e03a63b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/media/platform/video-mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ static int video_mux_link_setup(struct media_entity *entity,
const struct media_pad *remote, u32 flags)
{
struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(entity);
struct v4l2_subdev *source_sd;
struct video_mux *vmux = v4l2_subdev_to_video_mux(sd);
u16 source_pad = entity->num_pads - 1;
int ret = 0;
Expand Down Expand Up @@ -111,13 +112,19 @@ static int video_mux_link_setup(struct media_entity *entity,
*source_mbusformat = *v4l2_subdev_get_pad_format(sd, sd_state,
vmux->active);
v4l2_subdev_unlock_state(sd_state);

source_sd = media_entity_to_v4l2_subdev(remote->entity);
vmux->subdev.ctrl_handler = source_sd->ctrl_handler;

} else {
if (vmux->active != local->index)
goto out;

dev_dbg(sd->dev, "going inactive\n");
mux_control_deselect(vmux->mux);
vmux->active = -1;

vmux->subdev.ctrl_handler = NULL;
}

out:
Expand Down

0 comments on commit e03a63b

Please sign in to comment.