From patchwork Mon Jun 17 16:44:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13701047 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 ACB98C2BA18 for ; Mon, 17 Jun 2024 16:45:21 +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: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:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9XsSex1ytT9ciqjtaEGAG+/p+r1QJgpXaB11KKP/BTc=; b=lyt5i1fem2dwny Lpnwijeu0BcQKB/3RkntUTZb5BSo36rg4ZnYFiZJprTw+MLOn3CNzbXeK9Ti1zNKRJFA1TSDWQVCk ZZ83Ha3p8azdQNkrsCBEQuHLx63FNIPlz6UFgOpMj5snSIr/kcPVUpFT+do5wvboe5VsHIkzlUw+r KWJ1JuzxzObmnyH+xCy7LBzcuyREoXFZ0f1MOp+z2StiNMHIO0Xx7l6kMbTAHFjDMhlkZiDhYhMFv QyExheZYxBL5ckypteoDCP07MX9jZQWrOe2zhNgzGMuaKG1Nc5J1kPrpJ949Gx++4RcEcrTNavdxn UlXP4XcXmeFBClAdgr1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJFTt-0000000Bn89-0d7W; Mon, 17 Jun 2024 16:45:21 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJFTl-0000000Bn0m-2APl for linux-phy@lists.infradead.org; Mon, 17 Jun 2024 16:45:17 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a6f936d2ba1so28556266b.0 for ; Mon, 17 Jun 2024 09:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718642712; x=1719247512; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ThsTojdQQ8zSHFhNOOxiXRSOPUFKMTWzQLxLd3s8TBU=; b=vp5CHSJVxg2nbyr/yBtPeLXjE86OlOmq5IARQZuSesl7GFmE1lub5ZZxI1blDCCeRG 95N124hid+1kIv7Z79L3JTVOtBi0kmDEfV0ANEUKK3kOBWbzp7CDBVkglXQYrCfzDaf5 haDLa3oZqLrlEwUIyUK2JpDiPkw1rg9bFZeBN4qWjyH5XAnIAn8KQBPvhgtjFDm3ypgW uL1xuVrSW91w6vZIGCMHeYGXOI/aZPJg9VrQo6CRg/bt2IuPVzDgeRCbKmVZVhBnl8hM WUq7SdBZee0pIBorfoOpAT8bPuymzei90Sb629bhAEfVhHwaHz6cZtLlzQXbNAI/WdRt 2V+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718642712; x=1719247512; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ThsTojdQQ8zSHFhNOOxiXRSOPUFKMTWzQLxLd3s8TBU=; b=hRFYe5JDShWT8150TU4dSJC05FcPI/R2pin1741uCG143Dv/CP3Ueyqh8+tNv0h62t 0+clcAPS2WwG2nko/ls6pQH9r3rg8IlfEBHjylsAyOZuvsyMvNbBWHVqit3abHcjCW9h YDNJV0o7etoi7N32KJox3tyK/ATYCyAXWRfweRMa+vm3gWwhdb94OuzwdeAxPde7wHbK hb6IVx8aRfx3prsccLn/+1fBzXjwKulJEbn74fdUk0PNZIGRpSFDjvetqQK/ZK79YUZ2 E86WazZp9JI4yCxXf+TuWw9MJqoC9JG18dH2+34hpRdccQ3XIN7dlt5dkBnmT44Usr4H oGcg== X-Forwarded-Encrypted: i=1; AJvYcCX1ImGmL9l7VW+MO55C4oahRnsCCfJDx/I+53lRBIwut8+VPLu1dNZwvHKg4Fv+zqD24VRZnP8cYXJaNsLDbNHmpvXI81AbdP9tgGSQlQ== X-Gm-Message-State: AOJu0YyrxY7YGOsG3W9pjcpfbXFKTpQkPidhl+Zpby7uJmeWFiPf2D+M 8C5z75pfYAh/xutbaq5gvACTAe5L3JT0raF5BkYHwUp/hQuqfqYad2Y+rrDtLmk= X-Google-Smtp-Source: AGHT+IFcJWeLyEHV3yWQ18wnmpR54ia9kKxwzabyy2RmlFFm5mvL5H8jtPPWb261kiLvundn45hNyg== X-Received: by 2002:a17:907:c249:b0:a6f:603a:d9e9 with SMTP id a640c23a62f3a-a6f94e29a83mr13525366b.10.1718642711493; Mon, 17 Jun 2024 09:45:11 -0700 (PDT) Received: from puffmais.c.googlers.com (8.239.204.35.bc.googleusercontent.com. [35.204.239.8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56f4170bsm527139966b.157.2024.06.17.09.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 09:45:11 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Mon, 17 Jun 2024 17:44:43 +0100 Subject: [PATCH v3 2/6] phy: exynos5-usbdrd: support isolating HS and SS ports independently MIME-Version: 1.0 Message-Id: <20240617-usb-phy-gs101-v3-2-b66de9ae7424@linaro.org> References: <20240617-usb-phy-gs101-v3-0-b66de9ae7424@linaro.org> In-Reply-To: <20240617-usb-phy-gs101-v3-0-b66de9ae7424@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Peter Griffin , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar , Sam Protsenko Cc: Krzysztof Kozlowski , Tudor Ambarus , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_094514_003712_304BDAF5 X-CRM114-Status: GOOD ( 12.43 ) 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: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Some versions of this IP have been integrated using separate PMU power control registers for the HS and SS parts. One example is the Google Tensor gs101 SoC. Such SoCs can now set pmu_offset_usbdrd0_phy_ss in their exynos5_usbdrd_phy_drvdata for the SS phy to the appropriate value. The existing 'usbdrdphy' alias can not be used in this case because that is meant for determining the correct PMU offset if multiple distinct PHYs exist in the system (as opposed to one PHY with multiple isolators). Signed-off-by: André Draszik Tested-by: Will McVicker Reviewed-by: Peter Griffin Tested-by: Peter Griffin --- v3: use drv_data instead of phy_drd->drv_data for shorter lines --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index 15be966b50ae..b7e2526f4c06 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -186,6 +186,7 @@ struct exynos5_usbdrd_phy_drvdata { const struct exynos5_usbdrd_phy_config *phy_cfg; const struct phy_ops *phy_ops; u32 pmu_offset_usbdrd0_phy; + u32 pmu_offset_usbdrd0_phy_ss; u32 pmu_offset_usbdrd1_phy; bool has_common_clk_gate; }; @@ -1065,16 +1066,6 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev) if (channel < 0) dev_dbg(dev, "Not a multi-controller usbdrd phy\n"); - switch (channel) { - case 1: - pmu_offset = phy_drd->drv_data->pmu_offset_usbdrd1_phy; - break; - case 0: - default: - pmu_offset = phy_drd->drv_data->pmu_offset_usbdrd0_phy; - break; - } - /* Get Vbus regulators */ phy_drd->vbus = devm_regulator_get(dev, "vbus"); if (IS_ERR(phy_drd->vbus)) { @@ -1109,6 +1100,18 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev) phy_drd->phys[i].phy = phy; phy_drd->phys[i].index = i; phy_drd->phys[i].reg_pmu = reg_pmu; + switch (channel) { + case 1: + pmu_offset = drv_data->pmu_offset_usbdrd1_phy; + break; + case 0: + default: + pmu_offset = drv_data->pmu_offset_usbdrd0_phy; + if (i == EXYNOS5_DRDPHY_PIPE3 && drv_data + ->pmu_offset_usbdrd0_phy_ss) + pmu_offset = drv_data->pmu_offset_usbdrd0_phy_ss; + break; + } phy_drd->phys[i].pmu_offset = pmu_offset; phy_drd->phys[i].phy_cfg = &drv_data->phy_cfg[i]; phy_set_drvdata(phy, &phy_drd->phys[i]);