All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan+linaro@kernel.org>
To: Vinod Koul <vkoul@kernel.org>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Johan Hovold <johan+linaro@kernel.org>
Subject: [PATCH 15/20] phy: qcom-qmp-combo: drop start and pwrdn-ctrl abstraction
Date: Wed, 12 Oct 2022 10:49:57 +0200	[thread overview]
Message-ID: <20221012085002.24099-15-johan+linaro@kernel.org> (raw)
In-Reply-To: <20221012085002.24099-1-johan+linaro@kernel.org>

All USB PHYs need to start and stop the SerDes and PCS so drop the
start-ctrl abstraction which is no longer needed since the QMP driver
split.

Similarly, drop the pwrdn-ctrl abstraction which also is not needed
since the split.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 29 +++++------------------
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index 0071c73ac1c8..2fab8d5ec0f1 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -851,9 +851,6 @@ struct qmp_phy_cfg {
 	/* array of registers with different offsets */
 	const unsigned int *regs;
 
-	unsigned int start_ctrl;
-	unsigned int pwrdn_ctrl;
-
 	/* true, if PHY needs delay after POWER_DOWN */
 	bool has_pwrdn_delay;
 
@@ -1019,9 +1016,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = {
 	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
 	.regs			= qmp_v3_usb3phy_regs_layout,
 
-	.start_ctrl		= SERDES_START | PCS_START,
-	.pwrdn_ctrl		= SW_PWRDN,
-
 	.has_pwrdn_delay	= true,
 };
 
@@ -1087,9 +1081,6 @@ static const struct qmp_phy_cfg sdm845_usb3phy_cfg = {
 	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
 	.regs			= qmp_v3_usb3phy_regs_layout,
 
-	.start_ctrl		= SERDES_START | PCS_START,
-	.pwrdn_ctrl		= SW_PWRDN,
-
 	.has_pwrdn_delay	= true,
 };
 
@@ -1121,9 +1112,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = {
 	.regs			= qmp_v4_usb3phy_regs_layout,
 	.pcs_usb_offset		= 0x300,
 
-	.start_ctrl		= SERDES_START | PCS_START,
-	.pwrdn_ctrl		= SW_PWRDN,
-
 	.has_pwrdn_delay	= true,
 };
 
@@ -1189,9 +1177,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = {
 	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
 	.regs			= qmp_v4_usb3phy_regs_layout,
 	.pcs_usb_offset		= 0x300,
-
-	.start_ctrl		= SERDES_START | PCS_START,
-	.pwrdn_ctrl		= SW_PWRDN,
 };
 
 static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = {
@@ -1259,9 +1244,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = {
 	.regs			= qmp_v4_usb3phy_regs_layout,
 	.pcs_usb_offset		= 0x300,
 
-	.start_ctrl		= SERDES_START | PCS_START,
-	.pwrdn_ctrl		= SW_PWRDN,
-
 	.has_pwrdn_delay	= true,
 };
 
@@ -1944,8 +1926,7 @@ static int qmp_combo_com_init(struct qmp_phy *qphy)
 	qphy_clrbits(dp_com, QPHY_V3_DP_COM_SWI_CTRL, 0x03);
 	qphy_clrbits(dp_com, QPHY_V3_DP_COM_SW_RESET, SW_RESET);
 
-	qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL],
-			cfg->pwrdn_ctrl);
+	qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], SW_PWRDN);
 
 	mutex_unlock(&qmp->phy_mutex);
 
@@ -2049,7 +2030,8 @@ static int qmp_combo_power_on(struct phy *phy)
 		/* Pull PHY out of reset state */
 		qphy_clrbits(pcs, cfg->regs[QPHY_SW_RESET], SW_RESET);
 		/* start SerDes and Phy-Coding-Sublayer */
-		qphy_setbits(pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl);
+		qphy_setbits(pcs, cfg->regs[QPHY_START_CTRL],
+				SERDES_START | PCS_START);
 
 		status = pcs + cfg->regs[QPHY_PCS_STATUS];
 		ret = readl_poll_timeout(status, val, !(val & PHYSTATUS), 200,
@@ -2082,11 +2064,12 @@ static int qmp_combo_power_off(struct phy *phy)
 		qphy_setbits(qphy->pcs, cfg->regs[QPHY_SW_RESET], SW_RESET);
 
 		/* stop SerDes and Phy-Coding-Sublayer */
-		qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl);
+		qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL],
+				SERDES_START | PCS_START);
 
 		/* Put PHY into POWER DOWN state: active low */
 		qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL],
-				cfg->pwrdn_ctrl);
+				SW_PWRDN);
 	}
 
 	return 0;
-- 
2.35.1


WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan+linaro@kernel.org>
To: Vinod Koul <vkoul@kernel.org>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Johan Hovold <johan+linaro@kernel.org>
Subject: [PATCH 15/20] phy: qcom-qmp-combo: drop start and pwrdn-ctrl abstraction
Date: Wed, 12 Oct 2022 10:49:57 +0200	[thread overview]
Message-ID: <20221012085002.24099-15-johan+linaro@kernel.org> (raw)
In-Reply-To: <20221012085002.24099-1-johan+linaro@kernel.org>

All USB PHYs need to start and stop the SerDes and PCS so drop the
start-ctrl abstraction which is no longer needed since the QMP driver
split.

Similarly, drop the pwrdn-ctrl abstraction which also is not needed
since the split.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 29 +++++------------------
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index 0071c73ac1c8..2fab8d5ec0f1 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -851,9 +851,6 @@ struct qmp_phy_cfg {
 	/* array of registers with different offsets */
 	const unsigned int *regs;
 
-	unsigned int start_ctrl;
-	unsigned int pwrdn_ctrl;
-
 	/* true, if PHY needs delay after POWER_DOWN */
 	bool has_pwrdn_delay;
 
@@ -1019,9 +1016,6 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = {
 	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
 	.regs			= qmp_v3_usb3phy_regs_layout,
 
-	.start_ctrl		= SERDES_START | PCS_START,
-	.pwrdn_ctrl		= SW_PWRDN,
-
 	.has_pwrdn_delay	= true,
 };
 
@@ -1087,9 +1081,6 @@ static const struct qmp_phy_cfg sdm845_usb3phy_cfg = {
 	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
 	.regs			= qmp_v3_usb3phy_regs_layout,
 
-	.start_ctrl		= SERDES_START | PCS_START,
-	.pwrdn_ctrl		= SW_PWRDN,
-
 	.has_pwrdn_delay	= true,
 };
 
@@ -1121,9 +1112,6 @@ static const struct qmp_phy_cfg sm8150_usb3phy_cfg = {
 	.regs			= qmp_v4_usb3phy_regs_layout,
 	.pcs_usb_offset		= 0x300,
 
-	.start_ctrl		= SERDES_START | PCS_START,
-	.pwrdn_ctrl		= SW_PWRDN,
-
 	.has_pwrdn_delay	= true,
 };
 
@@ -1189,9 +1177,6 @@ static const struct qmp_phy_cfg sc8280xp_usb43dp_usb_cfg = {
 	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
 	.regs			= qmp_v4_usb3phy_regs_layout,
 	.pcs_usb_offset		= 0x300,
-
-	.start_ctrl		= SERDES_START | PCS_START,
-	.pwrdn_ctrl		= SW_PWRDN,
 };
 
 static const struct qmp_phy_cfg sc8280xp_usb43dp_dp_cfg = {
@@ -1259,9 +1244,6 @@ static const struct qmp_phy_cfg sm8250_usb3phy_cfg = {
 	.regs			= qmp_v4_usb3phy_regs_layout,
 	.pcs_usb_offset		= 0x300,
 
-	.start_ctrl		= SERDES_START | PCS_START,
-	.pwrdn_ctrl		= SW_PWRDN,
-
 	.has_pwrdn_delay	= true,
 };
 
@@ -1944,8 +1926,7 @@ static int qmp_combo_com_init(struct qmp_phy *qphy)
 	qphy_clrbits(dp_com, QPHY_V3_DP_COM_SWI_CTRL, 0x03);
 	qphy_clrbits(dp_com, QPHY_V3_DP_COM_SW_RESET, SW_RESET);
 
-	qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL],
-			cfg->pwrdn_ctrl);
+	qphy_setbits(pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL], SW_PWRDN);
 
 	mutex_unlock(&qmp->phy_mutex);
 
@@ -2049,7 +2030,8 @@ static int qmp_combo_power_on(struct phy *phy)
 		/* Pull PHY out of reset state */
 		qphy_clrbits(pcs, cfg->regs[QPHY_SW_RESET], SW_RESET);
 		/* start SerDes and Phy-Coding-Sublayer */
-		qphy_setbits(pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl);
+		qphy_setbits(pcs, cfg->regs[QPHY_START_CTRL],
+				SERDES_START | PCS_START);
 
 		status = pcs + cfg->regs[QPHY_PCS_STATUS];
 		ret = readl_poll_timeout(status, val, !(val & PHYSTATUS), 200,
@@ -2082,11 +2064,12 @@ static int qmp_combo_power_off(struct phy *phy)
 		qphy_setbits(qphy->pcs, cfg->regs[QPHY_SW_RESET], SW_RESET);
 
 		/* stop SerDes and Phy-Coding-Sublayer */
-		qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL], cfg->start_ctrl);
+		qphy_clrbits(qphy->pcs, cfg->regs[QPHY_START_CTRL],
+				SERDES_START | PCS_START);
 
 		/* Put PHY into POWER DOWN state: active low */
 		qphy_clrbits(qphy->pcs, cfg->regs[QPHY_PCS_POWER_DOWN_CONTROL],
-				cfg->pwrdn_ctrl);
+				SW_PWRDN);
 	}
 
 	return 0;
-- 
2.35.1


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  parent reply	other threads:[~2022-10-12  8:50 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12  8:48 [PATCH 00/20] phy: qcom-qmp: further prep fixes and cleanups (set 3) Johan Hovold
2022-10-12  8:48 ` Johan Hovold
2022-10-12  8:49 ` [PATCH 01/20] phy: qcom-qmp-pcie: fix sc8180x initialisation Johan Hovold
2022-10-12  8:49   ` Johan Hovold
2022-10-12  8:49   ` [PATCH 02/20] phy: qcom-qmp-pcie: fix ipq8074-gen3 initialisation Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12 20:44     ` Dmitry Baryshkov
2022-10-12 20:44       ` Dmitry Baryshkov
2022-10-12  8:49   ` [PATCH 03/20] phy: qcom-qmp-pcie: fix ipq6018 initialisation Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12 20:44     ` Dmitry Baryshkov
2022-10-12 20:44       ` Dmitry Baryshkov
2022-10-12  8:49   ` [PATCH 04/20] phy: qcom-qmp-pcie: clean up status polling Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12 20:45     ` Dmitry Baryshkov
2022-10-12 20:45       ` Dmitry Baryshkov
2022-10-12  8:49   ` [PATCH 05/20] phy: qcom-qmp-pcie: increase status polling period Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12  8:49   ` [PATCH 06/20] phy: qcom-qmp-pcie-msm8996: clean up ready and status polling Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12 20:47     ` Dmitry Baryshkov
2022-10-12 20:47       ` Dmitry Baryshkov
2022-10-12  8:49   ` [PATCH 07/20] phy: qcom-qmp-pcie-msm8996: increase status polling period Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12  8:49   ` [PATCH 08/20] phy: qcom-qmp-combo: clean up status polling Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12 21:14     ` Dmitry Baryshkov
2022-10-12 21:14       ` Dmitry Baryshkov
2022-10-17  6:55       ` Johan Hovold
2022-10-17  6:55         ` Johan Hovold
2022-10-12  8:49   ` [PATCH 09/20] phy: qcom-qmp-combo: increase status polling period Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12  8:49   ` [PATCH 10/20] phy: qcom-qmp-ufs: drop unused phy-status config Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12 21:14     ` Dmitry Baryshkov
2022-10-12 21:14       ` Dmitry Baryshkov
2022-10-12  8:49   ` [PATCH 11/20] phy: qcom-qmp-ufs: clean up ready polling Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12 21:14     ` Dmitry Baryshkov
2022-10-12 21:14       ` Dmitry Baryshkov
2022-10-12  8:49   ` [PATCH 12/20] phy: qcom-qmp-ufs: increase ready polling period Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12  8:49   ` [PATCH 13/20] phy: qcom-qmp-usb: clean up status polling Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12 21:15     ` Dmitry Baryshkov
2022-10-12 21:15       ` Dmitry Baryshkov
2022-10-12  8:49   ` [PATCH 14/20] phy: qcom-qmp-usb: increase status polling period Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12  8:49   ` Johan Hovold [this message]
2022-10-12  8:49     ` [PATCH 15/20] phy: qcom-qmp-combo: drop start and pwrdn-ctrl abstraction Johan Hovold
2022-10-12 21:16     ` Dmitry Baryshkov
2022-10-12 21:16       ` Dmitry Baryshkov
2022-10-12  8:49   ` [PATCH 16/20] phy: qcom-qmp-pcie: drop start-ctrl abstraction Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12 21:20     ` Dmitry Baryshkov
2022-10-12 21:20       ` Dmitry Baryshkov
2022-10-28 12:23       ` Vinod Koul
2022-10-28 12:23         ` Vinod Koul
2022-10-12  8:49   ` [PATCH 17/20] phy: qcom-qmp-pcie: add config sanity checks Johan Hovold
2022-10-12  8:49     ` Johan Hovold
2022-10-12 21:20     ` Dmitry Baryshkov
2022-10-12 21:20       ` Dmitry Baryshkov
2022-10-12  8:50   ` [PATCH 18/20] phy: qcom-qmp-pcie-msm8996: drop start and pwrdn-ctrl abstraction Johan Hovold
2022-10-12  8:50     ` Johan Hovold
2022-10-12 21:20     ` Dmitry Baryshkov
2022-10-12 21:20       ` Dmitry Baryshkov
2022-10-12  8:50   ` [PATCH 19/20] phy: qcom-qmp-ufs: " Johan Hovold
2022-10-12  8:50     ` Johan Hovold
2022-10-12 21:20     ` Dmitry Baryshkov
2022-10-12 21:20       ` Dmitry Baryshkov
2022-10-12  8:50   ` [PATCH 20/20] phy: qcom-qmp-usb: " Johan Hovold
2022-10-12  8:50     ` Johan Hovold
2022-10-12 21:21     ` Dmitry Baryshkov
2022-10-12 21:21       ` Dmitry Baryshkov
2022-10-12 20:44   ` [PATCH 01/20] phy: qcom-qmp-pcie: fix sc8180x initialisation Dmitry Baryshkov
2022-10-12 20:44     ` Dmitry Baryshkov
2022-10-12 12:36 ` [PATCH 00/20] phy: qcom-qmp: further prep fixes and cleanups (set 3) Johan Hovold
2022-10-12 12:36   ` Johan Hovold
2022-10-28 12:25 ` Vinod Koul
2022-10-28 12:25   ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221012085002.24099-15-johan+linaro@kernel.org \
    --to=johan+linaro@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=kishon@ti.com \
    --cc=konrad.dybcio@somainline.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.