Message ID | 20240222-multistream-v1-2-1837ed916eeb@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-76417-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:aa16:b0:108:e6aa:91d0 with SMTP id by22csp189535dyb; Thu, 22 Feb 2024 03:35:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVf006MnKnS6tgBo95q0S7Z7hWf5uhlT8nSaoarYZRkHF89vNU+34NTXQF9fR1rvG2tAbkStHIidJ3LPK+MvTV22ZyKxQ== X-Google-Smtp-Source: AGHT+IGqGQlCMEUANBghJDZQ7rTqjD2AGzeJbk2sL+DJ4OALQkIdw1jhlfVdfDhsC54Y+HzRHRL0 X-Received: by 2002:a17:90a:43c6:b0:299:1446:7ab6 with SMTP id r64-20020a17090a43c600b0029914467ab6mr15043789pjg.19.1708601721255; Thu, 22 Feb 2024 03:35:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708601721; cv=pass; d=google.com; s=arc-20160816; b=ScPbpjvcNWsL3mEr+JFIc8X02CyUv0VS77XLW+4twgQYzC5lZypcxmOAyF8y9yppZX 4ClESu3QZrRtGVu6OsdN9sobddwkDXolnVEraLyeIOfPmJX8A8h7qP8hrPgTe3xmaW88 AYHije0xo8APZ6IkwzegF26ceh8khg6ykJ1raL9CAwV0HFGmRhfa8EAaDncnXqvQfGps XeGGYvawZ2MK11vF5yE3zAQwZKBtUsJlGcm07ICVWbx+0bLFbNPgP2u43ONMDmZEuSCG q+dJRQcUYCUMkLFW9T69EqoTl90VD9OsumuBh0WyZvxO0np5LaTmEHTjANUwrC9lyrrL E0Bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=2cNr2W9c0uUvSVuROSL/j2Uzf+2G2fP0MYHF6MQhS7M=; fh=7Ze5xPQXuwRxFNHD2ILqwMPZ5wjg3PcSuREjIh8VhDo=; b=CCdHCc+CQZQGG6p+TY/kWqCAmNpD3CUseggkcLe8qgbrCHVW6yU70udOHlGwa+uyRL +vDZ6aE1cVk2rxBPvdnRm609URBf4m/Aojc6hwEVpC8uvV3wgswFYd14AW06OcY3mvhq TMsr6CEUyQZPznh9xYGs5XxKtBBDf+0Is3YSP7uyWX+FNMI9nIZiCdUKoqPkp4XxrZzb 6GFZctXczQl2T0I8DS1h8fiIe38WueeyXIt4r2K3DeHZZUN16O+Nt6QnV4kQhHtktfnL yXkicMvV1Rwu+eJckZgCNQJrcGQCGpjxJ1JxewLiiAhRxihCrCUjtgh7IW0LIouahydV Zh8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lvGKYUpE; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-76417-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76417-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a73-20020a63904c000000b005dc952f426asi10016747pge.850.2024.02.22.03.35.21 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 03:35:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76417-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lvGKYUpE; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-76417-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76417-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 50D062816EE for <ouuuleilei@gmail.com>; Thu, 22 Feb 2024 11:35:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AE8F4D58A; Thu, 22 Feb 2024 11:33:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="lvGKYUpE" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28627482CA; Thu, 22 Feb 2024 11:33:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708601616; cv=none; b=lIMjL3hXVYmAQCSzjlF/0ufgyIDHPqxdI7Kwhz5lPoKzdWCJjhbm1Txkg9mUKNPsIGevdb5I2IcCopFKp3E4fXy9E29AeCl9mvorRZ/qZXN6Lm3ENIvqUyIc9I2xLMa5QOKC2kX/n+qIVecOiT2RdDUTMlX+5nl9A5IPiBc1Ax0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708601616; c=relaxed/simple; bh=im2b3XkRWHVDjENKTL39XO+OkPYZPgPa/EbqRfvqcr0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=PpwVN5MzlCXdiWnwADMWD/m42kCOKTD0nt355blESfANp+GAJTATsDv2/ex+0NiEx9L2i+ZDaHLOyLyCNfwYMkVCJAA4YRp65VdEMEZ+R4q/UcX3hvpgrCd/VjIeNeq7rvDZFxWZWXsWeLqQVEISLSA0EiAOJpT0qpCX82Gl2eQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=lvGKYUpE; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41MBX9F7027774; Thu, 22 Feb 2024 05:33:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1708601589; bh=2cNr2W9c0uUvSVuROSL/j2Uzf+2G2fP0MYHF6MQhS7M=; h=From:Date:Subject:References:In-Reply-To:To:CC; b=lvGKYUpEXvpx56rZAYJarKRBpUBbwsk1qJxq1DIN8Ff3429hAGiH/yLakW7P42Qyz lmmilnJFYmGLsGxME6UtDoim/rt5023qnMToheBTu2ur8Ugt30fSQX53jBGVsK/X3G JDZkKp+ZE+NxU1rpSDMVCdRqNx9V7ZaIo7IfWnNc= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41MBX9he056994 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Feb 2024 05:33:09 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 22 Feb 2024 05:33:08 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 22 Feb 2024 05:33:08 -0600 Received: from localhost (jluthra.dhcp.ti.com [172.24.227.217]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 41MBX7Zi090935; Thu, 22 Feb 2024 05:33:07 -0600 From: Jai Luthra <j-luthra@ti.com> Date: Thu, 22 Feb 2024 17:01:18 +0530 Subject: [PATCH RFC 02/21] media: cadence: csi2rx: configure DPHY before starting source stream Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20240222-multistream-v1-2-1837ed916eeb@ti.com> References: <20240222-multistream-v1-0-1837ed916eeb@ti.com> In-Reply-To: <20240222-multistream-v1-0-1837ed916eeb@ti.com> To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Sakari Ailus <sakari.ailus@linux.intel.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, Vaishnav Achath <vaishnav.a@ti.com>, Maxime Ripard <mripard@kernel.org>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> CC: <linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>, Vignesh Raghavendra <vigneshr@ti.com>, Aradhya Bhatia <a-bhatia1@ti.com>, Devarsh Thakkar <devarsht@ti.com>, Changhuang Liang <changhuang.liang@starfivetech.com>, Jack Zhu <jack.zhu@starfivetech.com>, Julien Massot <julien.massot@collabora.com>, Jayshri Pawar <jpawar@cadence.com>, Jai Luthra <j-luthra@ti.com> X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2426; i=j-luthra@ti.com; h=from:subject:message-id; bh=PdPEqazmXTfXDrKucBNAcGZRh84r972NesVdYj6Urnc=; b=owEBbQKS/ZANAwAIAUPekfkkmnFFAcsmYgBl1zDb6Btyd3l4s3XpQ/yhAgO7WB8o/94UBxhg+ XZYNViZIxWJAjMEAAEIAB0WIQRN4NgY5dV16NRar8VD3pH5JJpxRQUCZdcw2wAKCRBD3pH5JJpx RVpsD/wIaFvgYeOJgz5+wO05LNXrzihOfqTYOxNbgEkhoLL6v3JEki/UwYlZeSMoOf69WgModFv hcb5p3UWzSb7LAMOpYW2Bu2xl3i6xYuDW8SKgMuIqHNoI2J3whJcCbLyjkiVGTZFh/ZcgZkio8M jCuNGH+FkFvBRwKhFYx70Hzbdj6rP8B8o5cOR3C3PtLAGUBNoNnB6mKF6cAhnYdQJJGRCYQPeLm 8x6RfzUwiTyD1spj7gD89t6Omp4MtX5hnoEubWqzyBFpM5Sc88CjtoOF+mSyxL9wlXZ+KkKlesj g/Nq50PR9i9GKE1Pr/LVBcsFrYdrS+pjQzK1HL1MNmu/WDFHYSNembITaVxlS57amJXjzAoBF5G h8p2swwvmerLrnfoETDGP5huLmknB8KuA1ZbXyrd09NTgEcsWG9MQ6DOTWh1Sfxj4Fe40x3zezf Pqslw41+wN7dcd98yCOzlE309H3eZXPTwPlBDotOnDsHZGTV/F4w3vjtW9smURa/krS9p8UVKof frq1G4NfQlmFaPCCFcHrHb3kZQnwMUeIlQJ9ExL/ejJi02kqmHbFTLIVdKf3IxT0aaDTOocsg7N 61To7EuKBHPpaI3JPySWycPeejbzLZ7SnOxvx7wKj8QBdb4SYzd9wl0E3jxqJdXT0pfoXDFFIh1 YKIMsDs2rR+HTVA== X-Developer-Key: i=j-luthra@ti.com; a=openpgp; fpr=4DE0D818E5D575E8D45AAFC543DE91F9249A7145 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791598758323574908 X-GMAIL-MSGID: 1791598758323574908 |
Series |
media: cadence,ti: CSI2RX Multistream Support
|
|
Commit Message
Jai Luthra
Feb. 22, 2024, 11:31 a.m. UTC
From: Pratyush Yadav <p.yadav@ti.com> When the source device is operating above 1.5 Gbps per lane, it needs to send the Skew Calibration Sequence before sending any HS data. If the DPHY is initialized after the source stream is started, then it might miss the sequence and not be able to receive data properly. Move the start of source subdev to the end of the sequence to make sure everything is ready to receive data before the source starts streaming. Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Jai Luthra <j-luthra@ti.com> --- drivers/media/platform/cadence/cdns-csi2rx.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
Comments
Hi Jai, On 2/22/24 12:31, Jai Luthra wrote: > From: Pratyush Yadav <p.yadav@ti.com> > > When the source device is operating above 1.5 Gbps per lane, it needs to > send the Skew Calibration Sequence before sending any HS data. If the > DPHY is initialized after the source stream is started, then it might > miss the sequence and not be able to receive data properly. Move the > start of source subdev to the end of the sequence to make sure > everything is ready to receive data before the source starts streaming. > > Signed-off-by: Pratyush Yadav <p.yadav@ti.com> > Signed-off-by: Jai Luthra <j-luthra@ti.com> Thanks for your patch! This patch is useful even at lower data rate than 1.5 Gbps. I'm having the issue at 800Mbps with max96714F deserializer. Should this patch deserve a Fixes tag? Fixes: 3295cf1241d3 ("media: cadence: Add support for external dphy") Reviewed-by: Julien Massot <julien.massot@collabora.com> Tested-by: Julien Massot <julien.massot@collabora.com> > --- > drivers/media/platform/cadence/cdns-csi2rx.c | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) > > diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c > index 70b7f8a9e4f2..75e602c1d762 100644 > --- a/drivers/media/platform/cadence/cdns-csi2rx.c > +++ b/drivers/media/platform/cadence/cdns-csi2rx.c > @@ -243,10 +243,6 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > > writel(reg, csi2rx->base + CSI2RX_STATIC_CFG_REG); > > - ret = v4l2_subdev_call(csi2rx->source_subdev, video, s_stream, true); > - if (ret) > - goto err_disable_pclk; > - > /* Enable DPHY clk and data lanes. */ > if (csi2rx->dphy) { > reg = CSI2RX_DPHY_CL_EN | CSI2RX_DPHY_CL_RST; > @@ -256,6 +252,13 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > } > > writel(reg, csi2rx->base + CSI2RX_DPHY_LANE_CTRL_REG); > + > + ret = csi2rx_configure_ext_dphy(csi2rx); > + if (ret) { > + dev_err(csi2rx->dev, > + "Failed to configure external DPHY: %d\n", ret); > + goto err_disable_pclk; > + } > } > > /* > @@ -295,14 +298,9 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > > reset_control_deassert(csi2rx->sys_rst); > > - if (csi2rx->dphy) { > - ret = csi2rx_configure_ext_dphy(csi2rx); > - if (ret) { > - dev_err(csi2rx->dev, > - "Failed to configure external DPHY: %d\n", ret); > - goto err_disable_sysclk; > - } > - } > + ret = v4l2_subdev_call(csi2rx->source_subdev, video, s_stream, true); > + if (ret) > + goto err_disable_sysclk; > > clk_disable_unprepare(csi2rx->p_clk); > > @@ -316,6 +314,10 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > clk_disable_unprepare(csi2rx->pixel_clk[i - 1]); > } > > + if (csi2rx->dphy) { > + writel(0, csi2rx->base + CSI2RX_DPHY_LANE_CTRL_REG); > + phy_power_off(csi2rx->dphy); > + } > err_disable_pclk: > clk_disable_unprepare(csi2rx->p_clk); > >
Hi, Jai > [PATCH RFC 02/21] media: cadence: csi2rx: configure DPHY before > starting source stream > > From: Pratyush Yadav <p.yadav@ti.com> > > When the source device is operating above 1.5 Gbps per lane, it needs to send > the Skew Calibration Sequence before sending any HS data. If the DPHY is > initialized after the source stream is started, then it might miss the sequence > and not be able to receive data properly. Move the start of source subdev to > the end of the sequence to make sure everything is ready to receive data > before the source starts streaming. > > Signed-off-by: Pratyush Yadav <p.yadav@ti.com> > Signed-off-by: Jai Luthra <j-luthra@ti.com> > --- I also tested this patch on StarFive JH7100 CAMSS and it worked fine. Reviewed-by: Changhuang Liang <Changhuang.liang@starfivetech.com> Tested-by: Changhuang Liang <Changhuang.liang@starfivetech.com> regards Changhuang
Hi Julien, On Feb 22, 2024 at 15:29:54 +0100, Julien Massot wrote: > Hi Jai, > > On 2/22/24 12:31, Jai Luthra wrote: > > From: Pratyush Yadav <p.yadav@ti.com> > > > > When the source device is operating above 1.5 Gbps per lane, it needs to > > send the Skew Calibration Sequence before sending any HS data. If the > > DPHY is initialized after the source stream is started, then it might > > miss the sequence and not be able to receive data properly. Move the > > start of source subdev to the end of the sequence to make sure > > everything is ready to receive data before the source starts streaming. > > > > Signed-off-by: Pratyush Yadav <p.yadav@ti.com> > > Signed-off-by: Jai Luthra <j-luthra@ti.com> > > Thanks for your patch! > This patch is useful even at lower data rate than 1.5 Gbps. > I'm having the issue at 800Mbps with max96714F deserializer. > > Should this patch deserve a Fixes tag? Thanks, yes in that case I will add the fixes tag and repost this fix separately so it can be picked sooner. > Fixes: 3295cf1241d3 ("media: cadence: Add support for external dphy") > > Reviewed-by: Julien Massot <julien.massot@collabora.com> > Tested-by: Julien Massot <julien.massot@collabora.com> > > > --- > > drivers/media/platform/cadence/cdns-csi2rx.c | 26 ++++++++++++++------------ > > 1 file changed, 14 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c > > index 70b7f8a9e4f2..75e602c1d762 100644 > > --- a/drivers/media/platform/cadence/cdns-csi2rx.c > > +++ b/drivers/media/platform/cadence/cdns-csi2rx.c > > @@ -243,10 +243,6 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > > writel(reg, csi2rx->base + CSI2RX_STATIC_CFG_REG); > > - ret = v4l2_subdev_call(csi2rx->source_subdev, video, s_stream, true); > > - if (ret) > > - goto err_disable_pclk; > > - > > /* Enable DPHY clk and data lanes. */ > > if (csi2rx->dphy) { > > reg = CSI2RX_DPHY_CL_EN | CSI2RX_DPHY_CL_RST; > > @@ -256,6 +252,13 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > > } > > writel(reg, csi2rx->base + CSI2RX_DPHY_LANE_CTRL_REG); > > + > > + ret = csi2rx_configure_ext_dphy(csi2rx); > > + if (ret) { > > + dev_err(csi2rx->dev, > > + "Failed to configure external DPHY: %d\n", ret); > > + goto err_disable_pclk; > > + } > > } > > /* > > @@ -295,14 +298,9 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > > reset_control_deassert(csi2rx->sys_rst); > > - if (csi2rx->dphy) { > > - ret = csi2rx_configure_ext_dphy(csi2rx); > > - if (ret) { > > - dev_err(csi2rx->dev, > > - "Failed to configure external DPHY: %d\n", ret); > > - goto err_disable_sysclk; > > - } > > - } > > + ret = v4l2_subdev_call(csi2rx->source_subdev, video, s_stream, true); > > + if (ret) > > + goto err_disable_sysclk; > > clk_disable_unprepare(csi2rx->p_clk); > > @@ -316,6 +314,10 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) > > clk_disable_unprepare(csi2rx->pixel_clk[i - 1]); > > } > > + if (csi2rx->dphy) { > > + writel(0, csi2rx->base + CSI2RX_DPHY_LANE_CTRL_REG); > > + phy_power_off(csi2rx->dphy); > > + } > > err_disable_pclk: > > clk_disable_unprepare(csi2rx->p_clk); > > > > -- > Julien Massot > Senior Software Engineer > Collabora Ltd. > Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK > Registered in England & Wales, no. 5513718
diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c index 70b7f8a9e4f2..75e602c1d762 100644 --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -243,10 +243,6 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) writel(reg, csi2rx->base + CSI2RX_STATIC_CFG_REG); - ret = v4l2_subdev_call(csi2rx->source_subdev, video, s_stream, true); - if (ret) - goto err_disable_pclk; - /* Enable DPHY clk and data lanes. */ if (csi2rx->dphy) { reg = CSI2RX_DPHY_CL_EN | CSI2RX_DPHY_CL_RST; @@ -256,6 +252,13 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) } writel(reg, csi2rx->base + CSI2RX_DPHY_LANE_CTRL_REG); + + ret = csi2rx_configure_ext_dphy(csi2rx); + if (ret) { + dev_err(csi2rx->dev, + "Failed to configure external DPHY: %d\n", ret); + goto err_disable_pclk; + } } /* @@ -295,14 +298,9 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) reset_control_deassert(csi2rx->sys_rst); - if (csi2rx->dphy) { - ret = csi2rx_configure_ext_dphy(csi2rx); - if (ret) { - dev_err(csi2rx->dev, - "Failed to configure external DPHY: %d\n", ret); - goto err_disable_sysclk; - } - } + ret = v4l2_subdev_call(csi2rx->source_subdev, video, s_stream, true); + if (ret) + goto err_disable_sysclk; clk_disable_unprepare(csi2rx->p_clk); @@ -316,6 +314,10 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) clk_disable_unprepare(csi2rx->pixel_clk[i - 1]); } + if (csi2rx->dphy) { + writel(0, csi2rx->base + CSI2RX_DPHY_LANE_CTRL_REG); + phy_power_off(csi2rx->dphy); + } err_disable_pclk: clk_disable_unprepare(csi2rx->p_clk);