Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6435604imu; Mon, 21 Jan 2019 08:52:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN5e7zGB3GQC9y6wEIecT+7N37cpuLzbZA7rLVOcWLq35Clqf+JgLkpaVcQtcrDKAqGP1RPG X-Received: by 2002:a62:931a:: with SMTP id b26mr31618196pfe.65.1548089544217; Mon, 21 Jan 2019 08:52:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548089544; cv=none; d=google.com; s=arc-20160816; b=ZidmVb7ayXlJn3s8zdyZaj7XE4V3Hs9XrGWpzEXv8O1v+lFzXg1dBjnYfdQqK8+LDr ri1Meu0uEhSDQ+muJeBx5vjY6UmRUfQEjb36oZALiXb8WyHzbRgcx3E8bMb/bOxiaFtl g0wSixedGeSNnm77u/FLTXPCkjyIZhxwbzl0Y/fViAqqef+QPGjz5FnLcPG0hKSxl5JO Xtvn7UPN0Ak53jsidtxnTxDX8ehejl4NAY4riwAT4niKCNAa3ycUTMVBcq/GB6A+jIQe g6WJFRYvcT+8v9AK6BiA0M4MO1XLdLWAGwuy/ii2qpNLSfO+8yQoDrlajosp2EMJPRDS OOhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=oRy7ecyktfl+Hhc12ErvaWJGxgdlam4balIMDjyjPo4=; b=krGtUU8MRh5J8wxIaa7Ed4hHSz6QI8dzRq2Fr/+jsBe6r0knTPKFvX06s5m+DlNgnw y2hEwgzhNY2yantlgQctynz6V07XbecCKXOGP2KzBUgRZ6h2kw3K6Pyj7qbYzff9LvU5 dn/3FuIHCmV7u2Zc4EsRA0CVJvpL+M95W3o7VSGb+onCOozbgDtV9o6O1pN/GXQ+xgZ/ vR7Nx+zuqJ7UVzKsA9ohPQLltyTEYkm4I/IYuxn2zwqtPxgXFU8hhVt8u1QeOaLams98 T5qElildQ4IpXvRZhlrYIB89Bh2GCQo+hwkFGBlndUV253ydWO65gSnzfUoEOyXwQT7s REyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t77si9943418pgb.51.2019.01.21.08.52.08; Mon, 21 Jan 2019 08:52:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730480AbfAUQuR (ORCPT + 99 others); Mon, 21 Jan 2019 11:50:17 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:49419 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729815AbfAUQuR (ORCPT ); Mon, 21 Jan 2019 11:50:17 -0500 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1glcm4-0006ej-3G; Mon, 21 Jan 2019 17:50:12 +0100 Message-ID: <1548089410.3287.16.camel@pengutronix.de> Subject: Re: [PATCH 1/4] media: imx: csi: Allow unknown nearest upstream entities From: Philipp Zabel To: Steve Longerbeam , linux-media@vger.kernel.org Cc: stable@vger.kernel.org, Mauro Carvalho Chehab , Greg Kroah-Hartman , "open list:STAGING SUBSYSTEM" , open list Date: Mon, 21 Jan 2019 17:50:10 +0100 In-Reply-To: <20190119214600.30897-2-slongerbeam@gmail.com> References: <20190119214600.30897-1-slongerbeam@gmail.com> <20190119214600.30897-2-slongerbeam@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2019-01-19 at 13:45 -0800, Steve Longerbeam wrote: > 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: bf3cfaa712e5c ("media: staging/imx: get CSI bus type from nearest > upstream entity") > > Signed-off-by: Steve Longerbeam > Cc: stable@vger.kernel.org > --- > drivers/staging/media/imx/imx-media-csi.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c > index 555aa45e02e3..b9af7d3d4974 100644 > --- a/drivers/staging/media/imx/imx-media-csi.c > +++ b/drivers/staging/media/imx/imx-media-csi.c > @@ -154,9 +154,10 @@ static inline bool requires_passthrough(struct v4l2_fwnode_endpoint *ep, > /* > * Parses the fwnode endpoint from the source pad of the entity > * connected to this CSI. This will either be the entity directly > - * upstream from the CSI-2 receiver, or directly upstream from the > - * video mux. The endpoint is needed to determine the bus type and > - * bus config coming into the CSI. > + * upstream from the CSI-2 receiver, directly upstream from the > + * video mux, or directly upstream from the CSI itself. The endpoint > + * is needed to determine the bus type and bus config coming into > + * the CSI. > */ > static int csi_get_upstream_endpoint(struct csi_priv *priv, > struct v4l2_fwnode_endpoint *ep) > @@ -172,7 +173,8 @@ static int csi_get_upstream_endpoint(struct csi_priv *priv, > if (!priv->src_sd) > return -EPIPE; > > - src = &priv->src_sd->entity; > + sd = priv->src_sd; > + src = &sd->entity; > > if (src->function == MEDIA_ENT_F_VID_MUX) { > /* > @@ -186,6 +188,14 @@ static int csi_get_upstream_endpoint(struct csi_priv *priv, > src = &sd->entity; > } > > + /* > + * If the source is neither the video mux nor the CSI-2 receiver, > + * get the source pad directly upstream from CSI itself. > + */ > + if (src->function != MEDIA_ENT_F_VID_MUX && Will it work correctly if there's an external MUX connected to the CSI? > + sd->grp_id != IMX_MEDIA_GRP_ID_CSI2) > + src = &priv->sd.entity; > + > /* get source pad of entity directly upstream from src */ > pad = imx_media_find_upstream_pad(priv->md, src, 0); > if (IS_ERR(pad)) regards Philipp