difos/target/linux/bcm27xx/patches-6.12/950-0511-NotForUpstream-media-video-mux-Propagate-controls-to.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

51 lines
1.7 KiB
Diff

From 4565369de07b02cc4d00be00fb9ae7926afc009f Mon Sep 17 00:00:00 2001
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
Date: Thu, 10 Oct 2024 14:52:52 +0100
Subject: [PATCH] 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 <kieran.bingham@ideasonboard.com>
---
drivers/media/platform/video-mux.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/drivers/media/platform/video-mux.c
+++ b/drivers/media/platform/video-mux.c
@@ -69,6 +69,7 @@ static int video_mux_link_setup(struct m
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;
@@ -111,6 +112,10 @@ static int video_mux_link_setup(struct m
*source_mbusformat = *v4l2_subdev_state_get_format(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;
@@ -118,6 +123,8 @@ static int video_mux_link_setup(struct m
dev_dbg(sd->dev, "going inactive\n");
mux_control_deselect(vmux->mux);
vmux->active = -1;
+
+ vmux->subdev.ctrl_handler = NULL;
}
out: