From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796354363; b=ys4Cz7qQE4uRT8FCOxL7hM7UrCJDpPkUZth0/K3hbS9GZ9SzMhVsRxTJTMnIKAxjpavL 4sn5/XjsWJOkmtGRj55yvzcuull8iW33F1570Zy1Y5ZiKSAX8/UZSU6SeB51RHsjt3ic9 HuJnOP6afpW3W+9aD9x5/Xk1np6wcd5YTEVRSXeW6ldu9J1WY/i+Hm6Da5aLQp4EajKJ4 MR5JT1RRwnYMo8DGLSFA5HY2mBMunh9NxObhAL3ms5/0Yfea0nVfE6ex7MPp4y84F6emz EUH+mNw1IDd0Zfei4OUt5i0rMYYFRw1qOtQfqDdAVuDp6Dggi115TOlk0bi8rf5zb7A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796354363; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key; bh=Px927uPzL0G0bD9p/DBHwmNAaSmtnfAuqfR/vrK6L/E=; b=ugO68Hxxgu8oZ+njzktF+ReCbaBlxA4721vGBkooPg2brsHZDjlM9IrlZfoq/2mLp1CC ZUrYNfu5Kj3jL9eTjHLUcQJmvKm++OJet0UBNM/EPmqLNIpT0OoV8DNxclR1heOUo1Hpx aGZBt6tBW0e4VRiJU/G6yQkxmZqemEvsQgflFhuo8i4K46VyR/6/erIeVsR75KTVDy7s4 n5wPW2NQWy9LEN0u/+kWOlS6QxdRQoUsQyar8b3EXKaKS5b/mRfdQnrtNOr552v4F0+tf WD3nu2m9fIUloHQGx4MtlW9PPoHXYf8bl9cUKPz44L8hzfMWi1aublupb8AbACkWEHg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=V6HIQyfv; arc=none smtp.remote-ip=209.85.216.45 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96FE0606A332 for ; Fri, 4 Dec 2026 03:19:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 96FE0606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=V6HIQyfv Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-3b53c453402so88087a91.3 for ; Thu, 03 Dec 2026 19:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796354363; x=1796959163; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Px927uPzL0G0bD9p/DBHwmNAaSmtnfAuqfR/vrK6L/E=; b=V6HIQyfvv00VHeOJmDUuOZ/eXR7TSGenx/Zssf0y6gOiPYZoVLR3F6YWPrtQTAtEmp Vdo4tNz2Os2QANfHyHHaGq8sP1YUh6DdRE46LIARLPHF5ZffEog++mtry/Qx0TD8RbxO WTrK1n9yV6eavmhriYTyR4TR04gGYt6h1JBP0/UOmq2TSd4zsh58Ocj8SBggl3MhMvXu +6oEajhheg1qjCe4SAUAqlz9BTtq6is+kKN2y8SIQYDxq3b57rel0ktXKpSABK5pgf3q /L+YOS/D8y3c5TM37Vzvhi+X2tD4d7oNuv+0l747C2ASFS31LOGKNpzMMPzKVMGGJRvq 5Hag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796354363; x=1796959163; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Px927uPzL0G0bD9p/DBHwmNAaSmtnfAuqfR/vrK6L/E=; b=iV92c2rmoHQSIH5ZiqAXKCg3NZPqsVjUFN/AnTHbHIlsp7R/N6YZDunznfx89znTOt X7zHtNuniyQ68EdM5pJtg7bvdWJ0p8LrrfrVeisBvXl1kL2OSekkyipg2yzpxRVqNx3g 6/NP9AIH+UfbSvfZ2tNSiaoiaKi4VOvZUpc4H+mJErlK7E/xbawow6tJDeApDI7CYZkr iDpX1+yDtEnb2Znu8iYVsGOMFSeLY/WO9xTWz8ekwRI5+KhYQYHnqoxY6dGI9BelzF+I OqYiW6jk1JK/wYJXyclcb0/EvzOWm2iicXUgXZmbbTC8MVlDErsxeZiGdV1JKDrDbyCk nntA== X-Forwarded-Encrypted: i=1; AL+hErHgTaqYGIIe2RiKJF2xopZLAI7j0/Z1n1X6CECh9ESbKLa6CPj2b9zqxJSlPfiIVt15tonxKXJgYfhUlRM=@vger.kernel.org X-Gm-Message-State: APuU4Z92cQmvDzDw1cWBCaqrX8tLri5cON1z2rNpjp4pMKM6V2REQhWq Bo8lHYvLBTFbv+vftfBk+Xm644vSSNYoyaN19BIqYbLQeKNZX3XZLZY9 X-Gm-Gg: AZFdTZcsMh0ZyWsbeQlkt3nz/eA7jkQDF5RTPWDmepk2G1STIGi1Z0roHpQAqWXUI2J COQf0yIhRDD7mVAAjoZzMLS+8oCW+khUE3wvEqol5aLG8+hEgbIb6MH5SSIEQt4+d49FknvT0ZG aSe1Hj5T5TqloetC0ySgpjlb2oHZ9xR7JRlzf0VXF0DV/2nL6rmL74mCBEVyoWQU/O0NINa1iN1 H771nf//kRUv/MGgm094BVwkWc7+gznSivwhSFr+qWK2utD51CXEbCBgseCdPz7DySMFnjfVPpK Gw1Le9WZn1T81GYz15gd+WsK7deC2mWsay+fEOijGWpIbZeMplx8wh/57jSSuuk579ZIQksGklP AauHYDaYkEOcqJXZwMdXugRy5pAbaz7W+bwpKO3PX5vXzOFYZTJ9efURnlS4LyAcRL23jCnO/jB +Kw/xMTlec2azdX7OtiFOqIem0i67OrmbiBsJiDcCpb0lgfI+DP4BNUnzXBeoyz5CF2jjsqVx/4 Bb/AsGwoVVZjLPkLIBucDsNNzFCByZg73ncqnvcQsGkEHoNi1U6LjlQlkiHes8vmXHCiXmEWZ6q f5boaYi2httehsc2fRY/aEtOgzwW5sD2mnsuwsdBze1R4K+isl3hoNkB9L5AI70Y0dv8GzsM9O1 dHc9vpbv5OraHZsO5nZS3 X-Received: by 2002:a17:902:d510:b0:2e9:5714:607b with SMTP id d9443c01a7336-2f1b9bec47amr10032105ad.0.1796354362296; Thu, 03 Dec 2026 19:19:22 -0800 (PST) Received: from [127.0.1.1] (211-23-39-77.hinet-ip.hinet.net. [211.23.39.77]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f1b791a308sm3316285ad.28.2026.12.03.19.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 19:19:21 -0800 (PST) From: Jason Yang Date: Fri, 04 Dec 2026 11:18:55 +0800 Subject: [PATCH v9 05/10] phy: rockchip-samsung-dcphy: Move block-level setup to runtime resume X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261204-dcphy-rx-v1-v9-5-fad1cfe7f536@gmail.com> References: <20261204-dcphy-rx-v1-v9-0-fad1cfe7f536@gmail.com> In-Reply-To: <20261204-dcphy-rx-v1-v9-0-fad1cfe7f536@gmail.com> To: Vinod Koul , Neil Armstrong , Manivannan Sadhasivam , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Guochun Huang , Philipp Zabel Cc: Michael Riesch , Sebastian Reichel , Bryan O'Donoghue , Quentin Schulz , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jason Yang X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796354337; l=2576; i=jason98166@gmail.com; s=20260721; h=from:subject:message-id; bh=jtUxPRys/dBRdscqaMmdtwL+bhADXEXJWj8FzO882mw=; b=L4AYoSXmhGE5f5uhzoMlEU3FMra14I5JF4eoH4KTc2yLsTz1YXxPtEFzgEawh3QwxfGQh9jaf fa6qbdMOCKwChD9pW6yezknfuMLIoqSvPI1aiB0Dehc7659NYNVsQU9 X-Developer-Key: i=jason98166@gmail.com; a=ed25519; pk=xQmD001Q/ooHl39PxyQtusbUQmgbOsSfpFryRVWZ/k4= The APB reset and the BIAS references have to be treated as block-level [1]: both the transmitter and the receiver need them, and they only have to be programmed once. They are programmed from the transmitter's power-on path today. A later change registers one struct phy for each of them, and a second consumer coming up would then reset the block underneath a PHY that is already running. Program them from runtime resume instead, where whichever of the two comes up first brings the block up and a second one no longer resets it. This puts the BIAS writes ahead of the per-PHY reset assert, where the TRM's worked example has them after [1]. That is safe: neither M_RESETN nor S_RESETN covers the BIAS registers, and the values written are those registers' reset defaults. [1] RK3588 TRM: sections 22.4.1 (address map), 22.4.2 (reset values), 22.6.1.2 (reset) and 22.6.4.1 (D-PHY transmitter start-up) Signed-off-by: Jason Yang Reviewed-by: Michael Riesch Tested-by: Quentin Schulz # RK3588 Tiger CSI1 2-lane IMX219, CSI0 2-lane OV5675+DSI --- drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c b/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c index 7a009d87a665..d6acc3e2d448 100644 --- a/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c +++ b/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c @@ -1346,7 +1346,6 @@ static int samsung_mipi_dphy_power_on(struct samsung_mipi_dcphy *samsung) reset_control_assert(samsung->m_phy_rst); - samsung_mipi_dcphy_bias_block_enable(samsung); samsung_mipi_dcphy_pll_configure(samsung); samsung_mipi_dphy_clk_lane_timing_init(samsung); samsung_mipi_dphy_data_lane_timing_init(samsung); @@ -1373,10 +1372,6 @@ static int samsung_mipi_dcphy_power_on(struct phy *phy) { struct samsung_mipi_dcphy *samsung = phy_get_drvdata(phy); - reset_control_assert(samsung->apb_rst); - udelay(1); - reset_control_deassert(samsung->apb_rst); - switch (samsung->type) { case PHY_TYPE_DPHY: return samsung_mipi_dphy_power_on(samsung); @@ -1667,6 +1662,12 @@ static __maybe_unused int samsung_mipi_dcphy_runtime_resume(struct device *dev) return ret; } + reset_control_assert(samsung->apb_rst); + udelay(1); + reset_control_deassert(samsung->apb_rst); + + samsung_mipi_dcphy_bias_block_enable(samsung); + return 0; } -- 2.43.0