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: 13640405 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 7F256C4345F for ; Tue, 23 Apr 2024 17:06:52 +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=9P4MhuT8TZXgzyVAUWDQtMH4/eIIoogkk6uOmfE6VbY=; b=FC3wwJhhX1KS4H yeX/87zhzSef+bjTJ77kglT2/FjSZjS/TFXOc4jZOU38s7VAqKIhQ85/nTr28nA1HRVHmntpwJxZ9 xqd+tyDtUhWQ/HRkjUTqreC7KCDkrASYJsxgJ44r41B+aSbIaIsPnfVltbddK9y/EsW73QkVKdh4A CkRQyPevdWXR+NLcJyd4HlfQU53/4bqGx//8HhMUC08R+HWBXy01ZqORlz4r5sx8aMhfJPOinxh39 vPII51EjJBecLjgrNQnBQU68Kwv4OFtFVu1I/KfTxxeee+4FVyoEaqFakE1M8PwoAgFDkxseE+Fgj A1fGjdiRpKAXj+WfHvuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzJbY-00000000sPf-0WSV; Tue, 23 Apr 2024 17:06:52 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzJbA-00000000s9q-0iDT for linux-phy@lists.infradead.org; Tue, 23 Apr 2024 17:06:32 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a556d22fa93so663393166b.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=pU8EYdDDdHQCsDyOV9oYc0+RO9YreVY8VHGq+eGZLCtdFfnnO08X+ewY6HJbcei551 kDXgjxCd0QKuXr3V4BIcR9clw3TYWrf4HZa06Va0fKRAcGfCdhTWEsqlFaFpbS6Mqx86 z49OuPrU2p8024U4TC9HbkRzhqWi6dQ/8i5zTGOixAetmCN4LsXVkVDxvsOfrgrfPlD6 Dpz8IQf5fT1hP7YZi9R9V6IkOtTJNWOEGymIvWAUkWcSGYYYsXUVbGMmfwxWp2wyPhJ5 LJcNoPpJksnPJRd1edjyImBnJAu4J2+VsBFa1m0b+No/darAcX3ck5FK7XOU5sLG2rhd 1rzw== X-Forwarded-Encrypted: i=1; AJvYcCXAHZl4aHYoPnGD9t04kxKOKHBknIQlnsBBa6PiE52nbgoouCy8Jf2UqEdFpSOZqhqy9JK0cp8mhYRsjkvAFpByntTG3D9PUeVk4KFVLA== X-Gm-Message-State: AOJu0YxcDHfDE8q1rF/0sIIbgcQkRqTZMiCrZbiFJ+ZyWl+v5xhl1Li5 RRXR9D1zy+pcWWGPmJibax9yFusegRA5ySiYJIviIP1UokyyntLWFkXz+GbQ4rc= 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_330927_14E047C7 X-CRM114-Status: GOOD ( 12.12 ) 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 --- 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]);