Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp130267imp; Wed, 20 Feb 2019 15:56:32 -0800 (PST) X-Google-Smtp-Source: AHgI3IZTXjM14xfoTm3X7wTK4TDWQChQndecom8qYgFCT33X7BOBtWU+TJOmjvFxb2k7nEX6sbr1 X-Received: by 2002:a63:7f46:: with SMTP id p6mr35514437pgn.54.1550706992686; Wed, 20 Feb 2019 15:56:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550706992; cv=none; d=google.com; s=arc-20160816; b=liGwarQAy/pcLsBqQ4yb2qQKEfVIwTQeKiks+LRCZlClbPNBKSBx7s7xnZQV7JEtZN fuQrZ2qADOBySbCYdP+LcxjCyD0rdolhXf0mi8mOYK7QghOL1WqpHFOw3sMOOf8p3OZq X0oL0OR0/bBcPHYLr/PY9F2x/FGV2dkAsGsFloCvqyEA7ppWEg+aByjxs+OMCaINxHUb 5mZ5A2u4bkDplgif+fm9hsQkAa8P+RhpwkkE3FecdBS4RrUtFZekRXwJFXubrxX2V/do OXxNri95ve2qzw42C4ZO8QDEBsQIPs+OSrK/wEamc4dacN87lAazwzQ+pEf75kRJ60fB rvNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=mC7/BJozzMqsSGt/tWTYsBoObNJbPhAY/mCxN2pyMkQ=; b=UZJUzf0KKzxhlRn/UKWglc1ChTxhIrGzsQnroRuvKv1Js5ZuR2OjDryeuAwb8CsmtN H0lxCOcRxQyYMi2+Hn/8upLPiVjQevE7GcgkxtrRWPXqpbz1qMZI9g4YP00KV00/9ndj 0qnvRUD2ZSYzuuI/lA8I1yK35YkgrPvdHiWAyTwd1V4ABNJ2xES5j89GFj60n+KwzIDN TC/RKzBUQys/4XUZXtBGEHbtkkagLL3ZnVL337IQg9n1Nnsd4Dl3O6OrUXcGpe6DXKGf z+EXcSRE5Cii9bjIDJ4mO8tvf97w6pmFIkcH0Jwpg/WTdOI5UH1eBEteEXlJ101dL9f8 bdog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="U/5LJykt"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11si5542366plo.96.2019.02.20.15.56.17; Wed, 20 Feb 2019 15:56:32 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="U/5LJykt"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726275AbfBTXxm (ORCPT + 99 others); Wed, 20 Feb 2019 18:53:42 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40181 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbfBTXxl (ORCPT ); Wed, 20 Feb 2019 18:53:41 -0500 Received: by mail-pl1-f196.google.com with SMTP id bj4so13099302plb.7; Wed, 20 Feb 2019 15:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mC7/BJozzMqsSGt/tWTYsBoObNJbPhAY/mCxN2pyMkQ=; b=U/5LJyktqO84a+XdSt5KX+BwUhp8RGTTghpSNQC4U/gUSzyosHdqGrzJlMt66Idekp 7NOK8GL3aUOPYHutev48pNO12nThHzuqqy5wig+BjnV+dP1ueLEfBdV1KvTctdihkvRo HXFFLtvOAWG6YRqlLO7Y+Dh2vTw+H1aQKsvquZHifr0MTIL4+h8HsH+09oXD+TGWL1Zq hM8FEDq9PNMX8+Qqycw/YXE4TgZIlxkkzo//c9BUanjk8f6iX995wpOypIai6AnYb0c2 GZ65thIg8TRVdtzj9mOjK0jNfkf6op/03ynrWLmdPwPHqjtmHl2/ga72tpB4OaSmHRCd 20Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mC7/BJozzMqsSGt/tWTYsBoObNJbPhAY/mCxN2pyMkQ=; b=i9ZznjY6mz8uGAtYjNdq9Is7PnC0xPP3z9jsk5AVUVzJtNnhQhb5ztw8ui7wSE+1/C aBUKFsMtOdEjNcyg/O2tKkaaSrPZh6pxHD0tM+dkbg/ahO/5asfb9d1pTpAb82YwZaG1 62a0J8Pa9BzDnoNQuuc8Az2FSbi9tJ30LpCL1sD5JwnWH41h2S+qMNryOCZBhy+u3qfd oGW+IAjF3XUN0j4njPoSLdlZXPMruFV+stGrRu9/E1T1pIc3CgQbdnKHG3yMZCIwlvS2 4CwRih5zbpfv7aqSR0SxsYazvDiW+y9JvDXYigeD2VbmN1gScZEEL18FoiXzlRDIUYfj TivA== X-Gm-Message-State: AHQUAuYZlD2Njc6D4UHQ6mSXOaUtoXpN70dEiptPtcCaP8BJVE2xRNcU r+ACEb7zS2YD+ahfxF2rtGy6ETic X-Received: by 2002:a17:902:6b08:: with SMTP id o8mr6005004plk.105.1550706820322; Wed, 20 Feb 2019 15:53:40 -0800 (PST) Received: from majic.sklembedded.com (c-73-202-231-77.hsd1.ca.comcast.net. [73.202.231.77]) by smtp.googlemail.com with ESMTPSA id v15sm25530158pgf.75.2019.02.20.15.53.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 15:53:39 -0800 (PST) From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam , stable@vger.kernel.org, Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 1/4] media: imx: csi: Allow unknown nearest upstream entities Date: Wed, 20 Feb 2019 15:53:29 -0800 Message-Id: <20190220235332.15984-2-slongerbeam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190220235332.15984-1-slongerbeam@gmail.com> References: <20190220235332.15984-1-slongerbeam@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 3b7517348666..41965d8b56c4 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 && + 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)) -- 2.17.1