Skip to content

Commit 904371f

Browse files
slongerbeammchehab
authored andcommitted
media: imx: csi: Allow unknown nearest upstream entities
On i.MX6, the nearest upstream entity to the CSI can only be the CSI video muxes or the Synopsys DW MIPI CSI-2 receiver. However the i.MX53 has no CSI video muxes or a MIPI CSI-2 receiver. So allow for the nearest upstream entity to the CSI to be something other than those. Fixes: bf3cfaa ("media: staging/imx: get CSI bus type from nearest upstream entity") Signed-off-by: Steve Longerbeam <[email protected]> Cc: [email protected] Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 3bb7b49 commit 904371f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

drivers/staging/media/imx/imx-media-csi.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ static inline bool requires_passthrough(struct v4l2_fwnode_endpoint *ep,
154154
/*
155155
* Parses the fwnode endpoint from the source pad of the entity
156156
* connected to this CSI. This will either be the entity directly
157-
* upstream from the CSI-2 receiver, or directly upstream from the
158-
* video mux. The endpoint is needed to determine the bus type and
159-
* bus config coming into the CSI.
157+
* upstream from the CSI-2 receiver, directly upstream from the
158+
* video mux, or directly upstream from the CSI itself. The endpoint
159+
* is needed to determine the bus type and bus config coming into
160+
* the CSI.
160161
*/
161162
static int csi_get_upstream_endpoint(struct csi_priv *priv,
162163
struct v4l2_fwnode_endpoint *ep)
@@ -172,7 +173,8 @@ static int csi_get_upstream_endpoint(struct csi_priv *priv,
172173
if (!priv->src_sd)
173174
return -EPIPE;
174175

175-
src = &priv->src_sd->entity;
176+
sd = priv->src_sd;
177+
src = &sd->entity;
176178

177179
if (src->function == MEDIA_ENT_F_VID_MUX) {
178180
/*
@@ -186,6 +188,14 @@ static int csi_get_upstream_endpoint(struct csi_priv *priv,
186188
src = &sd->entity;
187189
}
188190

191+
/*
192+
* If the source is neither the video mux nor the CSI-2 receiver,
193+
* get the source pad directly upstream from CSI itself.
194+
*/
195+
if (src->function != MEDIA_ENT_F_VID_MUX &&
196+
sd->grp_id != IMX_MEDIA_GRP_ID_CSI2)
197+
src = &priv->sd.entity;
198+
189199
/* get source pad of entity directly upstream from src */
190200
pad = imx_media_find_upstream_pad(priv->md, src, 0);
191201
if (IS_ERR(pad))

0 commit comments

Comments
 (0)