From patchwork Tue Apr 23 17:06:05 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: 13640412 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 A86DEC4345F for ; Tue, 23 Apr 2024 17:07:03 +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=9vtDNTSnSeU8xgVqy8b7IRu4m4INg8nJm1WKiqSwVCo=; b=zCJ48CU6m/VO4I 1i/bT1B5JEt7pdH8UaI51gAdV96sCIxqIBv8sXnoU+691FVuZx4J8Pju/FszWML35HojBp0H6Bt/t It7qbr2c9678prkAP/hAcO1+YznNa45tgjNHOObzGyJHEOEohg6B8xa9w1FzpN60ue42ocodAfeDn pp7p03vC3Gzr7XIxVNkZq6NvIbLB6ekIizOqg0upgPhZWTsentApG2WyKlMyb6MQzEd6XZUJZ7evI dFkIf3bGt1HZDt87q9wcPQxmDlXHqKM+DXZhEiFkHPaLYvPTav2HoQeb7yusoPr8uWs3GaHOFfn7b mTtZsbqJksRpidDcz92A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzJbW-00000000sOK-3aI6; Tue, 23 Apr 2024 17:06:50 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzJbA-00000000s9p-0hwr for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2024 17:06:31 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a556d22fa93so663393066b.3 for ; Tue, 23 Apr 2024 10:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713891986; x=1714496786; 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=vTeJ++F/mnm19eqXVShab+zLQp1WnhObbyrG4T/vDvk=; b=F4CwJgvoZ49aTnJNSuOxSUjy9K5geKHs/rm0YRxlbY7s2O+1daQowhBDDdKtfCBkg1 GBnnmBvJ0CEp59uf1ng0rxmtEtXixV5HFUr+OU1rouhNPxlAABBs/9/R8PiYRAb+a5YD M+ix/yGYfVXbkP1WlWpyWo96k2WhB0+RsyQthsiV66qqHg1IIuHPOt8OxJgnuQezeQmW HJz3N2+IxBWAyZKFv23iY3s4EyFzvc32/9kFx24Tmd8T6KDW+Gd5BJmfoKsWghOHpdLo dudlxHI5tO8ZogkDDqCiPM7OXQUQRMfrMxW5mpKnrZDiaKyF4fQ7xKRHEJ07IUr8HVsO U5Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713891986; x=1714496786; 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=vTeJ++F/mnm19eqXVShab+zLQp1WnhObbyrG4T/vDvk=; b=jvKj9UNuPvSBardq41F+kBszAz99zIdri+QIWqmDXySXX1NqQKCZLyizmDMmEtFU0r Pif0990zcDgJqwkJAPpF8j/FNIcQWUs2t3CvIkhekU2YEFhVtvGOIADe4n2hgPZxqkjB P63+PWawCASWzUdbOpRID1Db3GAhXw4yD/ukzJ5xg0mSRp1WwbVCMHxUSE4fN/Tc3uYa vxJ156KYU40a5vDGPv/7CSBX9pjDJ8ZqpThkmB6K97cD8kIEQqUFJ7cH3XscVRiMddYH nuB7m0ogbUdEDzIceYIBOTgWyoBaHby2Qa1IzfD1U21DD5KXPA/rsD938rW9lBc+itRh PwdA== X-Forwarded-Encrypted: i=1; AJvYcCU8SCFTyRcrK00pfmxLc00Q6mvg/JqQpnhbTKYZcsugbMCBkv8iqag2OfcnXjkFTrNyi1iz6Ju/VVcx9G4Br1y2fmBazitsqa6duMOJwuM2QZ/Nh/U= X-Gm-Message-State: AOJu0YzlFGO7O4oJa+hJIL+2wUNRRPzXjyW2BT9nXiUJTqhIJV7EjWpn zojjJ1tZx1tD/WrXdBJt6m4tYF4Y6wV9ONEIznnPPh/mL4a4RyFRzTgbhKZuN1Q= X-Google-Smtp-Source: AGHT+IGmX8/L0/I9Xfi/12RjpvA/XDSBEjDv0Ba0q/FGDoMM5t1bQJxoQFANCyEahhfvXPMRwfCN7A== X-Received: by 2002:a17:907:bb92:b0:a58:7505:1968 with SMTP id xo18-20020a170907bb9200b00a5875051968mr2076701ejc.43.1713891986224; Tue, 23 Apr 2024 10:06:26 -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 t22-20020a1709063e5600b00a5209dc79c1sm7351624eji.146.2024.04.23.10.06.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 10:06:25 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Tue, 23 Apr 2024 18:06:05 +0100 Subject: [PATCH 3/7] phy: exynos5-usbdrd: support isolating HS and SS ports independently MIME-Version: 1.0 Message-Id: <20240423-usb-phy-gs101-v1-3-ebdcb3ac174d@linaro.org> References: <20240423-usb-phy-gs101-v1-0-ebdcb3ac174d@linaro.org> In-Reply-To: <20240423-usb-phy-gs101-v1-0-ebdcb3ac174d@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, Krzysztof Kozlowski , =?utf-8?q?Andr=C3=A9?= =?utf-8?q?_Draszik?= X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240423_100628_325708_5A08D7AB X-CRM114-Status: GOOD ( 13.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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 --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index ac208b89f5a6..d69187c22613 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -196,6 +196,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; }; @@ -1050,16 +1051,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)) { @@ -1094,6 +1085,19 @@ 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 = phy_drd->drv_data->pmu_offset_usbdrd1_phy; + break; + case 0: + default: + pmu_offset = phy_drd->drv_data->pmu_offset_usbdrd0_phy; + if (i == EXYNOS5_DRDPHY_PIPE3 + && phy_drd->drv_data->pmu_offset_usbdrd0_phy_ss) + pmu_offset = phy_drd->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]);