diff options
author | Steve Longerbeam <slongerbeam@gmail.com> | 2020-05-01 19:15:52 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-18 14:29:35 +0200 |
commit | 86e02d07871c2ea389cc94becb2009c59420cd57 (patch) | |
tree | f4dc9516e708ede31a4b715123e7c408cd30f223 /drivers/staging/media/imx/imx7-media-csi.c | |
parent | fe7aee5d353346968eba111a0414250d8cc09527 (diff) | |
download | linux-86e02d07871c2ea389cc94becb2009c59420cd57.tar.bz2 |
media: imx5/6/7: csi: Mark a bound video mux as a CSI mux
For i.MX5/6, if the bound subdev is a video mux, it must be one of the
CSI muxes, and for i.MX7, the bound subdev must always be a CSI mux.
So if the bound subdev is a video mux, mark it as a CSI mux with a new
group id IMX_MEDIA_GRP_ID_CSI_MUX.
In the process use the new group id in csi_get_upstream_endpoint(), and
do some cleanup in that function for better readability.
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/imx/imx7-media-csi.c')
-rw-r--r-- | drivers/staging/media/imx/imx7-media-csi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 69f7abb32ae1..a3f3df901704 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1164,6 +1164,13 @@ static int imx7_csi_notify_bound(struct v4l2_async_notifier *notifier, struct imx7_csi *csi = imx7_csi_notifier_to_dev(notifier); struct media_pad *sink = &csi->sd.entity.pads[IMX7_CSI_PAD_SINK]; + /* The bound subdev must always be the CSI mux */ + if (WARN_ON(sd->entity.function != MEDIA_ENT_F_VID_MUX)) + return -ENXIO; + + /* Mark it as such via its group id */ + sd->grp_id = IMX_MEDIA_GRP_ID_CSI_MUX; + return v4l2_create_fwnode_links_to_pad(sd, sink); } |