From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] phy: qcom: qmp-pcie: simplify AUX clock registration
Date: Sun, 07 Sep 2025 17:52:12 +0300 [thread overview]
Message-ID: <20250907-qcom-dp-phy-v1-3-46634a6a980b@oss.qualcomm.com> (raw)
In-Reply-To: <20250907-qcom-dp-phy-v1-0-46634a6a980b@oss.qualcomm.com>
Instead of hand-coding it, use devm_clk_hw_register_fixed_rate() to
register the PHY AUX clock.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
index dad44cc0648355fc1533c9afd176b7d37cfa9018..a81facec7e45304f26ca3ce165af90aa5ff56f4e 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
@@ -3173,7 +3173,7 @@ struct qmp_pcie {
int mode;
struct clk_hw *pipe_clk_hw;
- struct clk_fixed_rate aux_clk_fixed;
+ struct clk_hw *aux_clk_hw;
};
static bool qphy_checkbits(const void __iomem *base, u32 offset, u32 val)
@@ -4809,19 +4809,13 @@ static int qmp_pcie_clk_init(struct qmp_pcie *qmp)
*/
static int phy_aux_clk_register(struct qmp_pcie *qmp, struct device_node *np)
{
- struct clk_fixed_rate *fixed = &qmp->aux_clk_fixed;
- struct clk_init_data init = { };
char name[64];
snprintf(name, sizeof(name), "%s::phy_aux_clk", dev_name(qmp->dev));
- init.name = name;
- init.ops = &clk_fixed_rate_ops;
-
- fixed->fixed_rate = qmp->cfg->aux_clock_rate;
- fixed->hw.init = &init;
-
- return devm_clk_hw_register(qmp->dev, &fixed->hw);
+ qmp->aux_clk_hw = devm_clk_hw_register_fixed_rate(qmp->dev, name, NULL, 0,
+ qmp->cfg->aux_clock_rate);
+ return PTR_ERR_OR_ZERO(qmp->aux_clk_hw);
}
static struct clk_hw *qmp_pcie_clk_hw_get(struct of_phandle_args *clkspec, void *data)
@@ -4836,7 +4830,7 @@ static struct clk_hw *qmp_pcie_clk_hw_get(struct of_phandle_args *clkspec, void
case QMP_PCIE_PIPE_CLK:
return qmp->pipe_clk_hw;
case QMP_PCIE_PHY_AUX_CLK:
- return &qmp->aux_clk_fixed.hw;
+ return qmp->aux_clk_hw;
}
return ERR_PTR(-EINVAL);
--
2.47.3
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2025-09-07 14:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-07 14:52 [PATCH 0/4] phy: qcom: extract common clock-handling code Dmitry Baryshkov
2025-09-07 14:52 ` [PATCH 1/4] phy: qcom: qmp-usb-legacy: switch to common helpers Dmitry Baryshkov
2025-09-08 8:17 ` Konrad Dybcio
2025-09-07 14:52 ` [PATCH 2/4] phy: qcom: qmp: extract common PIPE clock helpers Dmitry Baryshkov
2025-09-08 8:30 ` Konrad Dybcio
2025-09-07 14:52 ` Dmitry Baryshkov [this message]
2025-09-08 8:31 ` [PATCH 3/4] phy: qcom: qmp-pcie: simplify AUX clock registration Konrad Dybcio
2025-09-07 14:52 ` [PATCH 4/4] phy: qcom: extract common code for DP clocks Dmitry Baryshkov
2025-09-09 8:47 ` Konrad Dybcio
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=20250907-qcom-dp-phy-v1-3-46634a6a980b@oss.qualcomm.com \
--to=dmitry.baryshkov@oss.qualcomm.com \
--cc=kishon@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).