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: 13701055 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 A7496C2BA18 for ; Mon, 17 Jun 2024 16:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type: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=ThsTojdQQ8zSHFhNOOxiXRSOPUFKMTWzQLxLd3s8TBU=; b=E6I3DwhXl2SNRlhFNq02wTEOO5 zH0AVmOaBedIQEgnjoO5iG/mTHIGJs4nnP8tNYKtVmvHOsCNWznbpszPT3VpACe3KljjY4Ucuo9py hdl2JYNm5h5oCBWiegDRpd3ir8r6lCc87vo0SimW+NUuj/IpYncSRiRdMcqYMc5FsAxgge6qe+xWb B+S9yxSrQuXYiVpLp8t8k+4cP4+kpadNLiL42MGAy/uN9DBPy2Bo1Hj9V9viPveRI00yB3uwim2HE 7v5JHYmdSJUlYfA3MyOKsH4zZeBQ9htj5BV2vxXzer+coopwyEAUxg2mwS0NadE1i+K/6KRDB2+D3 Le0ieJwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJFU3-0000000BnDn-3c7t; Mon, 17 Jun 2024 16:45:31 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJFTm-0000000Bn0l-1g1w for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 16:45:18 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a6f936d2ba1so28556166b.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=eJlg0MwihPemC6/KENwa024wdwGyNrOpygN2VQYTmdZ8K9JnIxV9Lw7oJzevZYq4is 2Sw8UVyIoiJCwOXiv05AQBDwsqN1Nvd9biOMcwB5fnZSfoJ5BY/LzsqUmd5/UzR6argi YsqEo4Znr5ju88hE6U7gidvN0qUDQ4qcdsIQJIf29pnQNvtn3u0bK+sbRxYF/+hugpIT HAcZW+FK/u5V6BrBbkfQom16KzXUUKwXhcFJHJeF6kEgRI2CpW/U85enQPXaUsEeSeDv vbIv56GRQJlh4p7Kd61yedc1ZABhRjtP2+whGtzrdRJ4/1LxcnZb7FB2NO76oURPyHID onQA== X-Forwarded-Encrypted: i=1; AJvYcCWLMYppX88f65vShZY2YLfUTbnxdifz2pLcSHupnWpGXD3x68Le61/aIr9lJnG81DZ3uMy1UvwwGzTsYolRrGnRuSUDL3BSz8T8GTSeA83z9NXXggM= X-Gm-Message-State: AOJu0YyjahGzB4okZVK7mYM1yPhbv7a/yeo+z2FmqRNlTX3lmgu+afjn LhVfq280xgzYvlVZni5nGC6w6W9vfd+7npqfGr9Ekk3+6TsbUVCku1Q1dlj9Mss= 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_545597_6BE99873 X-CRM114-Status: GOOD ( 13.63 ) 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 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]);