From: Elson Serrao <elson.serrao@oss.qualcomm.com>
To: vkoul@kernel.org, neil.armstrong@linaro.org, mani@kernel.org,
abelvesa@kernel.org, konrad.dybcio@oss.qualcomm.com,
dmitry.baryshkov@oss.qualcomm.com
Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH] phy: qcom: qmp-combo: Fix AON toggle register presence check
Date: Tue, 1 Dec 2026 20:48:31 -0800 [thread overview]
Message-ID: <20261202044831.3528405-1-elson.serrao@oss.qualcomm.com> (raw)
The driver decides whether to clear the AON toggle enable bits by using
the USB AON toggle enable register offset as a presence indicator. On V10
PHYs, that register resides at offset 0x00 in the COM AON register space,
causing the check to evaluate false. As a result, the AON toggle bits are
never cleared.
Add a dedicated flag to indicate the presence of AON toggle registers and
use it to guard the corresponding register accesses. Also rename the
aon_toggle mapping and offsets to com_aon, as they represent the COM AON
register space rather than a single toggle register.
Fixes: eca0e717aab1 ("phy: qualcomm: qmp-combo: Add support for Hawi SoC")
Cc: stable@vger.kernel.org
Signed-off-by: Elson Serrao <elson.serrao@oss.qualcomm.com>
---
drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 27 +++++++++++++----------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index 3acf28c7d7b2..35fcf8681c62 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -2513,7 +2513,7 @@ struct qmp_combo_offsets {
u16 dp_txa;
u16 dp_txb;
u16 dp_dp_phy;
- u16 aon_toggle;
+ u16 com_aon;
u16 usb4_serdes;
u16 usb4_pcs;
};
@@ -2592,6 +2592,7 @@ struct qmp_phy_cfg {
unsigned int pcs_usb_offset;
bool invert_cc_polarity;
+ bool has_aon_toggle;
};
struct qmp_combo {
@@ -2600,7 +2601,7 @@ struct qmp_combo {
const struct qmp_phy_cfg *cfg;
void __iomem *com;
- void __iomem *aon_toggle;
+ void __iomem *com_aon;
void __iomem *serdes;
void __iomem *tx;
@@ -2749,7 +2750,7 @@ static const struct qmp_combo_offsets qmp_combo_offsets_v8 = {
static const struct qmp_combo_offsets qmp_combo_offsets_v10 = {
.com = 0x0000,
- .aon_toggle = 0x0400,
+ .com_aon = 0x0400,
.txa = 0x1400,
.rxa = 0x1600,
.txb = 0x1800,
@@ -3065,6 +3066,7 @@ static const struct qmp_phy_cfg hawi_usb3dpphy_cfg = {
.pcs_usb_tbl_num = ARRAY_SIZE(hawi_usb3_pcs_usb_tbl),
.regs = qmp_v10_usb3phy_regs_layout,
+ .has_aon_toggle = true,
.reset_list = msm8996_usb3phy_reset_l,
.num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l),
.vreg_list = qmp_phy_vreg_l,
@@ -3428,6 +3430,7 @@ static const struct qmp_phy_cfg glymur_usb3dpphy_cfg = {
.configure_dp_phy = qmp_v8_configure_dp_phy,
.regs = qmp_v8_n3_usb43dpphy_regs_layout,
+ .has_aon_toggle = true,
.reset_list = msm8996_usb3phy_reset_l,
.num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l),
.vreg_list = qmp_phy_vreg_refgen,
@@ -4095,17 +4098,17 @@ static int qmp_combo_com_init(struct qmp_combo *qmp, bool force)
void __iomem *pcs_aon = qmp->pcs_aon;
void __iomem *pcs = qmp->pcs;
void __iomem *com = qmp->com;
- void __iomem *aon_toggle;
+ void __iomem *aon_base;
int ret;
u32 val;
if (!force && qmp->init_count++)
return 0;
- if (qmp->aon_toggle)
- aon_toggle = qmp->aon_toggle;
+ if (qmp->com_aon)
+ aon_base = qmp->com_aon;
else
- aon_toggle = qmp->pcs_aon;
+ aon_base = qmp->pcs_aon;
if (qmp->qmpphy_mode == QMPPHY_MODE_USB4) {
pcs = qmp->usb4_pcs;
@@ -4155,9 +4158,9 @@ static int qmp_combo_com_init(struct qmp_combo *qmp, bool force)
SW_USB4PHY_RESET_MUX | SW_USB4PHY_RESET);
/* override hardware control for reset of qmp phy */
- if (aon_toggle && cfg->regs[QPHY_AON_TOGGLE_ENABLE]) {
- qphy_clrbits(aon_toggle, cfg->regs[QPHY_AON_TOGGLE_ENABLE], 0x1);
- qphy_clrbits(aon_toggle, cfg->regs[QPHY_DP_AON_TOGGLE_ENABLE], 0x1);
+ if (aon_base && cfg->has_aon_toggle) {
+ qphy_clrbits(aon_base, cfg->regs[QPHY_AON_TOGGLE_ENABLE], 0x1);
+ qphy_clrbits(aon_base, cfg->regs[QPHY_DP_AON_TOGGLE_ENABLE], 0x1);
}
/* Use software based port select and switch on typec orientation */
@@ -5386,8 +5389,8 @@ static int qmp_combo_parse_dt(struct qmp_combo *qmp)
}
qmp->dp_dp_phy = base + offs->dp_dp_phy;
- if (offs->aon_toggle)
- qmp->aon_toggle = base + offs->aon_toggle;
+ if (offs->com_aon)
+ qmp->com_aon = base + offs->com_aon;
qmp->usb4_serdes = base + offs->usb4_serdes;
qmp->usb4_pcs = base + offs->usb4_pcs;
--
2.34.1
reply other threads:[~2026-12-02 4:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261202044831.3528405-1-elson.serrao@oss.qualcomm.com \
--to=elson.serrao@oss.qualcomm.com \
--cc=abelvesa@kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=mani@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®