Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2186828ybm; Thu, 23 May 2019 12:47:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYJeocSX5Rg7S1+F11qRiMpHMCq9F/+Do47+5ZukdImn/AcFfGDVQ2qH07ZjK7Yidaj/bf X-Received: by 2002:a17:902:8c82:: with SMTP id t2mr93025695plo.256.1558640865877; Thu, 23 May 2019 12:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558640865; cv=none; d=google.com; s=arc-20160816; b=O+ZbJwUXcON3piKXFn95R4x3GtZIMD36n2jQgfL0/gEzmQSQ2b/nDIXsydHKHhQM5w rQZ+pcbnuYfwtnphJcn1UAvLHMpEMS4f+UMq8bbGNJw2KShPHZaPH8JMjEkKhUkX5bFZ MAMCdo6GUATp4NI4d0gYxQkz8j36ceTSO+4/i8PDNqVnCX8wXNTwVOIPqKeQJbItP6/f n+4Ha1TgDYZxHZHI0UMvSBIOiE+P6oZiKYsOj3YkuFDUr4Ice+E6DRX80PzAWutwISfT 1GxkMT+tCFU5mnPS77UYWPszrmXKygMblgdS2Zv081y3J7Qk3AIooarJlh6UQu2PEiZl hHaw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ByJZPHPzk6Yn36sHN3kxg8c8TMIOqpGo11VW1eeDY5Y=; b=CBK5dHagEoir08MuCPbdMbxXBrgPuJxk8o1ZPpZhr3cASxbJ9DDsEHUB4avQS9VjAf Ctl6+OGEMmaCn7HzJZQyq4OD2T3G2C/2lBS7bshOp2ibg1viTqbHPZw3gQKmEgu3xstY cRmW8c1vBz86IsHFiTT/MQwa4bkN0kBvdZ9C4KGPIiqbTmUqZm/pIjymldRtHr6LTIOs xsSYu2+7946eWpOyCWKt8Bl4Dm8Mvly9GoZEU2wcOYqDHONpEXN6ZgVR9AwFY0IEDzmj Csw61TnHwxH1h9U7aizO8zJAOLIUPEzZzwulpjK/qUwBOwoXzaFjPUY/ZlDI++hrg/DT iN3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xfuznK+E; 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 l32si534528pjb.20.2019.05.23.12.47.30; Thu, 23 May 2019 12:47:45 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=xfuznK+E; 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 S2389703AbfEWTou (ORCPT + 99 others); Thu, 23 May 2019 15:44:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:51014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388495AbfEWTQV (ORCPT ); Thu, 23 May 2019 15:16:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C2D822133D; Thu, 23 May 2019 19:16:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638981; bh=JgV2P0eKYsAjG/g+1Hm4nwBYz0UruGhYBV1VLhBpyKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xfuznK+E7pEKekvb34js9GFEhLJRHhoB4zUAven+er6H2J8wrQx6m8vugrEDsqt9Q FPO0nX6m6MEz0tweJsFV8Qh8sKyarBR+zeTZZ+nVTjMQU0qYV70PSgsuZz+/ol7+QZ iT8ChLxIM9+B85choOouq86QBf1sGLWfjROVGLt4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve Longerbeam , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 4.19 035/114] media: imx: csi: Allow unknown nearest upstream entities Date: Thu, 23 May 2019 21:05:34 +0200 Message-Id: <20190523181734.960677562@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181731.372074275@linuxfoundation.org> References: <20190523181731.372074275@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steve Longerbeam commit 904371f90b2c0c749a5ab75478c129a4682ac3d8 upstream. 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/imx/imx-media-csi.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -153,9 +153,10 @@ static inline bool requires_passthrough( /* * 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) @@ -168,7 +169,8 @@ static int csi_get_upstream_endpoint(str 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) { /* @@ -182,6 +184,14 @@ static int csi_get_upstream_endpoint(str 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 && + 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))