From patchwork Thu Jan 7 10:47:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 358159 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp379378jai; Thu, 7 Jan 2021 02:48:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEFTt3aWfomLnK9glTDIhLVQQ7qag+123vP4X8XB8N8LP1arQnGdH02Jqj9UM4zrnQhGXd X-Received: by 2002:a17:907:a96:: with SMTP id by22mr5580067ejc.171.1610016520598; Thu, 07 Jan 2021 02:48:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610016520; cv=none; d=google.com; s=arc-20160816; b=uteYaEGkupFode/re3XtlTpzCYpGwrjl5XMiI/ji8/5Hmt/gnzX4R9+1cXbSrSZ70e el5P1VZae90ah2UMkrItg20txzk5V9shSG+wdmKUr9TPSYcKsVAL1ePdrwy9Wm43JHNF gp8ixfQ/U/Q2KgvAklgYQ4Go2Kjk/RpCwJtgdNYpAcVJ5+qzq7bGjFbJ9ZldGItbNyYG 03FjvhCyLxbUIjWBdmpnvQLzGYBz+vOpd+YKvZHLEV5ix9awAs77x2VVApfnWmIqF4RU 4Ou2XIzH4TLZNApCa3hp+4xRs82U9abHdv5BvNeuAI/N38BedBsSx/wERoEjACpeuTjx qaHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=67aHJ6nmJ5xT+4FkpaqqiF0RNZx/OpHs6USNxyglm+k=; b=TKDOEvPteTZaWXISDAU3SFyGxZbG/jr4BMi4Re1diiObeF2KABoTI24G4Q5aHT2Rs8 H4iq8mtAtRBgMAPREuXHuGwKZMwz5CURpcs749hTrwjENU7/eNZ2MmyK0onuk9cXil1t Fg1qyQgwx2hTs6NPH3d9l/RVhJ5OjnkNuPM4UGsjKmICThcv7ETnVeY40zBEBBgRx9ip 2U0rhIuFzEphA8CCaqWJwp5pdIs8CUFV3yaCSWVVFuFlpNQT/XXBqZ0Y416ecvpVFfbq qt8Zhjj6hWAJjj3HNuQeiLK8v9V6Z41+lptiEiQw6JW2PQSc2k/b4nkLTOnJNGFkgD/N wOaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="d9O0z/YZ"; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu15si1985373ejb.667.2021.01.07.02.48.40; Thu, 07 Jan 2021 02:48:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="d9O0z/YZ"; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727742AbhAGKsZ (ORCPT + 3 others); Thu, 7 Jan 2021 05:48:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbhAGKsX (ORCPT ); Thu, 7 Jan 2021 05:48:23 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0DBCC0612F5 for ; Thu, 7 Jan 2021 02:47:36 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id q75so5130794wme.2 for ; Thu, 07 Jan 2021 02:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=67aHJ6nmJ5xT+4FkpaqqiF0RNZx/OpHs6USNxyglm+k=; b=d9O0z/YZ3nMDTzMSYWwJTt/i/hdMf7zp3N0Q+VypsJPV67Ut5VSGwzLvzvRjyroHsv YMdLUT8HcO4DGZM4daocgGGNsJB3sK9xzyx1GSEwLHyihkYeCPZhhNBaNrUV1qyoxQXk 83WMwYwomHAaI6xt87YmxAkKyjKlCQe/dk3ZD7OfBUhT/tc+KRdoxBtT/T9Oft38834p QlJO1Y/QoAT4ao9eJ0uJUYatR84t1nJdlclMKyaq5bAHZqdOZ4x8IT3NprDI3tI6Akqu BbcFCy2vF7CCfTM+PAsgFkRkyccl6dLg/fWw2nO4f9vdFGrK8Ttr0+tXJivv2UZKfhhW ducw== 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:mime-version:content-transfer-encoding; bh=67aHJ6nmJ5xT+4FkpaqqiF0RNZx/OpHs6USNxyglm+k=; b=cwPGOEA1P+JfovtaOAQ8bVQN9l1SyOQU9Rk/X6/MVGjTW2liKPcNzm6egSfaEs7+Vf slqbi+iN2xCGBGqupROVvfwdtYsiWwHD3ZDL9qcspHIyp4aza5CAaLp2OGqjqPey05zu MidL0lLRZlL05YJwF0CZ0U2K97GUYPbinSuWdmiYd4S/4iU2UX0k9aL/cXxC/yJ94B7l Qjj5f6qJD6ahzK25BYArUggcXr9wqK5E9ygfKRddFAZ+jyBvW2lhJM8Is2vWSSiqgNUN BbaoojvloeWchgFjsOR81XFYIpmpgYPfz3uUC5oOrXHy7da+qMGeVruGfCpUEFWUMxnp rMnA== X-Gm-Message-State: AOAM5307LA+A08X4S8LVadLh5aQcEBO2iuSnkelLhzvH+SyhDOAxufh+ 2ULxiAsALim1Ht1OyLvVgtbXNQ== X-Received: by 2002:a1c:6654:: with SMTP id a81mr7254936wmc.113.1610016455574; Thu, 07 Jan 2021 02:47:35 -0800 (PST) Received: from arch-thunder.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id o74sm7841449wme.36.2021.01.07.02.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 02:47:34 -0800 (PST) From: Rui Miguel Silva X-Google-Original-From: Rui Miguel Silva To: sakari.ailus@linux.intel.com, Hans Verkuil Cc: linux-media@vger.kernel.org, Fabio Estevam , =?utf-8?q?S=C3=A9bastien_Szymanski?= , Rui Miguel Silva Subject: [PATCH 1/2] media: imx7: csi: Fix regression for parallel cameras on i.MX6UL Date: Thu, 7 Jan 2021 10:47:25 +0000 Message-Id: <20210107104726.1294538-2-rmfrfs@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107104726.1294538-1-rmfrfs@gmail.com> References: <20210107104726.1294538-1-rmfrfs@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Fabio Estevam Commit 86e02d07871c ("media: imx5/6/7: csi: Mark a bound video mux as a CSI mux") made an incorrect assumption that for imx7-media-csi, the bound subdev must always be a CSI mux. On i.MX6UL/i.MX6ULL there is no CSI mux at all, so do not return an error when the entity is not a video mux and assign the IMX_MEDIA_GRP_ID_CSI_MUX group id only when appropriate. This is the same approach as done in imx-media-csi.c and it fixes the csi probe regression on i.MX6UL. Tested on a imx6ull-evk board. Fixes: 86e02d07871c ("media: imx5/6/7: csi: Mark a bound video mux as a CSI mux") Signed-off-by: Fabio Estevam Signed-off-by: Rui Miguel Silva --- drivers/staging/media/imx/imx7-media-csi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.30.0 diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index a3f3df901704..31e36168f9d0 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1164,12 +1164,12 @@ 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; + /* + * If the subdev is a video mux, it must be one of the CSI + * muxes. Mark it as such via its group id. + */ + if (sd->entity.function == MEDIA_ENT_F_VID_MUX) + sd->grp_id = IMX_MEDIA_GRP_ID_CSI_MUX; return v4l2_create_fwnode_links_to_pad(sd, sink); } From patchwork Thu Jan 7 10:47:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 358158 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp379370jai; Thu, 7 Jan 2021 02:48:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJYsWoaxD5Zwr+AOdKjzszf82TYclE2ZVp+sXU8We0JzGfos3ubUWL+ukaVtLkwkSApRuV X-Received: by 2002:a05:6402:1d18:: with SMTP id dg24mr1195345edb.221.1610016520203; Thu, 07 Jan 2021 02:48:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610016520; cv=none; d=google.com; s=arc-20160816; b=xZeomo5b6TqJmRJwxZlxFN1s8K++BEunhkwnensWCZf1fFn+9DXX4z30NNokkrDkd1 fY3AWd0rWo8D5Z73zjJJwPKZx/MhDZARZIqUyIGxT2r8ukGl0MHjzm1hUnLZoo+Tm99k +XqMA99liC6qlLmShfuQSR0jWeJtt+idC2rPnIOF0oQu2iPHAI0+fCSbfHoQDTVZRo+r k0yBXM6PXaJMUsQF+N4ZWMqAe+npYM7KYQStzLbM0AM708qaaWapZOCkgu5o5dycfsmy +H9KpTWwrgEDXJATHP+sgx7kTddmImlp0yjnMEb67WGWyg+MeMA9oJT/spWZ/EfvBoIF qmuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HEF8U1LOFMDOS1nZx7wQJSKi4/nl2du1Hlm0oy+YxHI=; b=yXsA0Le5pFZJvuwNeL6Tr36F9ysV2Yi1O4g9CJP+cs9cfjFLi3t4rN3AmbTSW0UpMQ z0+rcdJGxZvFIWc/Kr7eMb38sDm4nz9+aRSuwpU8K40Xl4Nj6ydPyiEkkZPbO99sJiai yw3qwB20tzfPfIZHhOH9c9TdcuBsoKZsunMvcbikEPvXyg7gDBCjzy0+OvEIVnQKjdBz cBSUTzOXCHBxizxX7VlyaajHX8E7BqBF8mJzSl4DZoTNac4gXIVrBtMnl2tX1Sv953vO p5XM28jGb6MqYM+nbT/pOZKJ08RBhBxscbypXH73HYmInOn91Qf6R1WnkXtMPOekrktx 1J1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xgm4666I; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu15si1985373ejb.667.2021.01.07.02.48.40; Thu, 07 Jan 2021 02:48:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xgm4666I; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727739AbhAGKsT (ORCPT + 3 others); Thu, 7 Jan 2021 05:48:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727733AbhAGKsT (ORCPT ); Thu, 7 Jan 2021 05:48:19 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D7C3C0612F6 for ; Thu, 7 Jan 2021 02:47:39 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id m5so5146772wrx.9 for ; Thu, 07 Jan 2021 02:47:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HEF8U1LOFMDOS1nZx7wQJSKi4/nl2du1Hlm0oy+YxHI=; b=xgm4666IVk3QgwOVfJ1Oks+VCUpbhpOFW3kY5vTqQ47Rrmtcir5GAJO8EtRwPSY+p3 W0YLCe+7b8PNaQIQuPvlKA5oWBg/eVUgPBsVkOlyJmiVcSQpQ0JsjHaZyJhflpunnSph VjRJMoTnECOkltxG7WMOvHg9BeMZuOJ4wkeM0kedrRT6OOaJ6cx36DuJuV+La4Ly858O xSauSEm/apLKUnwDGTPipWwNi1/Ov/YQf4MH9E31bdE3oNG/PZ4OwBFsOw+C6eau9Eif bd/NlcoHgZ4qDfesckZAhYchWoX3psu5kuz0trro6zkXiKBNr+QtHzuLH1/PBCAKgcXj UJLA== 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:mime-version:content-transfer-encoding; bh=HEF8U1LOFMDOS1nZx7wQJSKi4/nl2du1Hlm0oy+YxHI=; b=ov3bwH6cfD0OJJe9DUvwl0MuySNbNnEmrXBIu6TWgfx11x4rhNck7dpxccRgNRBb/u Ino65uTV4yXM5Hhz7BZD53EX7gW84diGXw/9AiNxyyY6iVmmpu89DSLgH8OkW3wyewgV 8LJTRW+MwLOb3i6SdvLK2oo5poUVKyHTcN/RXDNnSU5Uv2rR2BlH1n4gE5E+ibSPo1UQ r4Pgy2q6qh0pH5HlV04jkrGex5uLVWu+eequ7SK5Bw+R4bWuAv6mxCJj+y6qSIxV33WI umh6DhEKiq7sDgpM+HFhTg1zJpwi88eWJ2dXEbZHlvfLh9f3BTSGAfx4pP6ArdsFjZ4h ejyA== X-Gm-Message-State: AOAM531OoB97BGyhS4xA3RksX74CAp86ZHePYdfYRQgfrhw7dCdE3ndZ qnxR4i4whCwIEmE/561h3B6bYA== X-Received: by 2002:adf:9d48:: with SMTP id o8mr8437704wre.408.1610016457896; Thu, 07 Jan 2021 02:47:37 -0800 (PST) Received: from arch-thunder.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id o74sm7841449wme.36.2021.01.07.02.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 02:47:37 -0800 (PST) From: Rui Miguel Silva X-Google-Original-From: Rui Miguel Silva To: sakari.ailus@linux.intel.com, Hans Verkuil Cc: linux-media@vger.kernel.org, Fabio Estevam , =?utf-8?q?S=C3=A9bastien_Szymanski?= , Rui Miguel Silva Subject: [PATCH 2/2] media: imx7: csi: Fix pad link validation Date: Thu, 7 Jan 2021 10:47:26 +0000 Message-Id: <20210107104726.1294538-3-rmfrfs@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107104726.1294538-1-rmfrfs@gmail.com> References: <20210107104726.1294538-1-rmfrfs@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org We can not make the assumption that the bound subdev is always a CSI mux, in i.MX6UL/i.MX6ULL that is not the case. So, just get the entity selected by source directly upstream from the CSI. Fixes: 86e02d07871c ("media: imx5/6/7: csi: Mark a bound video mux as a CSI mux") Reported-by: Fabio Estevam Signed-off-by: Rui Miguel Silva Tested-by: Fabio Estevam Tested-by: Sébastien Szymanski --- drivers/staging/media/imx/imx7-media-csi.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) -- 2.30.0 diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 31e36168f9d0..ac52b1daf991 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -499,6 +499,7 @@ static int imx7_csi_pad_link_validate(struct v4l2_subdev *sd, struct v4l2_subdev_format *sink_fmt) { struct imx7_csi *csi = v4l2_get_subdevdata(sd); + struct media_entity *src; struct media_pad *pad; int ret; @@ -509,11 +510,21 @@ static int imx7_csi_pad_link_validate(struct v4l2_subdev *sd, if (!csi->src_sd) return -EPIPE; + src = &csi->src_sd->entity; + + /* + * if the source is neither a CSI MUX or CSI-2 get the one directly + * upstream from this CSI + */ + if (src->function != MEDIA_ENT_F_VID_IF_BRIDGE && + src->function != MEDIA_ENT_F_VID_MUX) + src = &csi->sd.entity; + /* - * find the entity that is selected by the CSI mux. This is needed + * find the entity that is selected by the source. This is needed * to distinguish between a parallel or CSI-2 pipeline. */ - pad = imx_media_pipeline_pad(&csi->src_sd->entity, 0, 0, true); + pad = imx_media_pipeline_pad(src, 0, 0, true); if (!pad) return -ENODEV;