From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6FFEC5DF87 for ; Fri, 21 Aug 2026 12:02:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References: Message-Id:MIME-Version:Subject:Date:From:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ltF47tc43gtGTBW3i2Kr0nyANZ5hUsYCI+i44hDgc/A=; b=HDxHrluAb+SyVT qg10+maN2rGkOU5hgp3KtPeoqLPl3vWUdhrBmwpZ3qntSC+bx7b32djOD8sG24UhZP0tFr21Q9Do0 +qyHcoELWfn3YyRquuRJQ0fOQC06oj9xVv3M7tpDZR11fvV1RTT82YBBlla8bdh4yijPELmYyIRpk pW1cYRgkStTSr+N/3+w3Yk1kdos9n5JQg1cbjVQjEtQBQGYUC0722PFP+pnBr2iISCEEfi2LWLtRi FGc6i8PF66c5koTvj/dRZ5Yi4UMuFOWDWUvecY6yJ38NPtNtGw3p+jJuNzK+QdmgP4qkjN5Hrhx1I HIuIel/AK+DVT8j5BDQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wxNxa-0000000DGFN-274w; Fri, 21 Aug 2026 12:02:58 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wxNxE-0000000DFwF-1onG; Fri, 21 Aug 2026 12:02:36 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id D24E444084; Fri, 21 Aug 2026 12:02:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id B5A0AC2BCFF; Fri, 21 Aug 2026 12:02:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1787313755; bh=TnI1p+P/50A7HWM9Y8HyRkngg4ldec9pgu0d66QJY5Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=TroQY1etFEyAwtSBl2bnHKcPIyWCaSr94DsOSVADzv9hdB1dFykOsP7dpp1oSgljr /41jAxzMxhQav2Pp7GF93hS+bK8Ys59TOPfnVQb/s8cjQV33X3YtrE808HV3QaA8ZV 6i6rgrQCg/4A6RpOLBix2Hhq60uGjDloZvPvpvBzTpczayO6MGN8oCUKN3Q23EAh1a kvkF+JryigXrpFKxQz9PKlcIsCRLZ10nSinBNv59hQ4iMKRRIwtwbTpfKZdP0pfENr zGOuP1MyCXkBoYMGwDBgvSabq5A5EfUlMM09ofX/WwjRHE0/sbxvf22Ef/hdUj90qw LGoGUbQRUgZBQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1AA8C5DF87; Fri, 21 Aug 2026 12:02:35 +0000 (UTC) From: Jason Yang via B4 Relay Date: Fri, 21 Aug 2026 20:02:33 +0800 Subject: [PATCH v4 5/7] phy: rockchip-samsung-dcphy: Factor the transmitter teardown into a helper MIME-Version: 1.0 Message-Id: <20260821-dcphy-rx-v1-v4-5-f1797634233d@gmail.com> References: <20260821-dcphy-rx-v1-v4-0-f1797634233d@gmail.com> In-Reply-To: <20260821-dcphy-rx-v1-v4-0-f1797634233d@gmail.com> To: Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Guochun Huang , Philipp Zabel Cc: Michael Riesch , Sebastian Reichel , Bryan O'Donoghue , 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.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1787313753; l=2267; i=jason98166@gmail.com; s=20260721; h=from:subject:message-id; bh=H9C3dBUKHCEqAqQXc3SD6EcAQzNiujpzdtKGk2VKgQE=; b=8OIV6ztcFUOG7ZAoX7MY1eISvfkc4VkrqMa6/7vGpV8pyY1fPXRP+0w9sUvq3clP/0n8GrXdG gtvDeMyM04IBjhrl25Y471zayq7Zy61zpJBQZYAB+Si2HHJHvA6nygk X-Developer-Key: i=jason98166@gmail.com; a=ed25519; pk=xQmD001Q/ooHl39PxyQtusbUQmgbOsSfpFryRVWZ/k4= X-Endpoint-Received: by B4 Relay for jason98166@gmail.com/20260721 with auth_id=887 X-Original-From: Jason Yang X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jason98166@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Jason Yang The transmitter's power-on path is in samsung_mipi_dphy_tx_power_on(), but the power_off callback still does the teardown itself. Move the teardown into samsung_mipi_dphy_tx_power_off(), so that power-on and power-off are a matching pair. Both callbacks then have a type switch whose arms are plain returns. Turn each into an early guard for the not yet supported C-PHY and drop the unreachable trailing return. No functional change intended. Signed-off-by: Jason Yang --- drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c | 31 ++++++++++------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c b/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c index f58907dec733..5d9d44a1d6a2 100644 --- a/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c +++ b/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c @@ -1361,37 +1361,34 @@ static int samsung_mipi_dphy_tx_power_on(struct samsung_mipi_dcphy *samsung) return 0; } +static int samsung_mipi_dphy_tx_power_off(struct samsung_mipi_dcphy *samsung) +{ + samsung_mipi_dphy_tx_lane_disable(samsung); + samsung_mipi_dcphy_pll_disable(samsung); + + return 0; +} + static int samsung_mipi_dcphy_tx_power_on(struct phy *phy) { struct samsung_mipi_dcphy *samsung = phy_get_drvdata(phy); - switch (samsung->type) { - case PHY_TYPE_DPHY: - return samsung_mipi_dphy_tx_power_on(samsung); - default: - /* CPHY part to be implemented later */ + /* CPHY part to be implemented later */ + if (samsung->type != PHY_TYPE_DPHY) return -EOPNOTSUPP; - } - return 0; + return samsung_mipi_dphy_tx_power_on(samsung); } static int samsung_mipi_dcphy_tx_power_off(struct phy *phy) { struct samsung_mipi_dcphy *samsung = phy_get_drvdata(phy); - switch (samsung->type) { - case PHY_TYPE_DPHY: - samsung_mipi_dphy_tx_lane_disable(samsung); - break; - default: - /* CPHY part to be implemented later */ + /* CPHY part to be implemented later */ + if (samsung->type != PHY_TYPE_DPHY) return -EOPNOTSUPP; - } - samsung_mipi_dcphy_pll_disable(samsung); - - return 0; + return samsung_mipi_dphy_tx_power_off(samsung); } static int -- 2.43.0 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy