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@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Johan Hovold <johan+linaro@kernel.org>
Subject: [PATCH v2 09/15] phy: qcom-qmp-combo: separate clock and provider registration
Date: Tue, 15 Nov 2022 15:39:59 +0100 [thread overview]
Message-ID: <20221115144005.2478-10-johan+linaro@kernel.org> (raw)
In-Reply-To: <20221115144005.2478-1-johan+linaro@kernel.org>
In preparation for supporting devicetree bindings which do not use child
nodes, separate clock registration from clock-provider registration.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 44 +++++++++++------------
1 file changed, 20 insertions(+), 24 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index 1079a16b45f6..89a5b51c770d 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -2243,7 +2243,6 @@ static int phy_pipe_clk_register(struct qmp_combo *qmp, struct device_node *np)
struct clk_fixed_rate *fixed = &qmp->pipe_clk_fixed;
struct clk_init_data init = { };
char name[64];
- int ret;
snprintf(name, sizeof(name), "%s::pipe_clk", dev_name(qmp->dev));
init.name = name;
@@ -2253,19 +2252,7 @@ static int phy_pipe_clk_register(struct qmp_combo *qmp, struct device_node *np)
fixed->fixed_rate = 125000000;
fixed->hw.init = &init;
- ret = devm_clk_hw_register(qmp->dev, &fixed->hw);
- if (ret)
- return ret;
-
- ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &fixed->hw);
- if (ret)
- return ret;
-
- /*
- * Roll a devm action because the clock provider is the child node, but
- * the child node is not actually a device.
- */
- return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np);
+ return devm_clk_hw_register(qmp->dev, &fixed->hw);
}
/*
@@ -2436,15 +2423,7 @@ static int phy_dp_clks_register(struct qmp_combo *qmp, struct device_node *np)
if (ret)
return ret;
- ret = of_clk_add_hw_provider(np, qcom_qmp_dp_clks_hw_get, qmp);
- if (ret)
- return ret;
-
- /*
- * Roll a devm action because the clock provider is the child node, but
- * the child node is not actually a device.
- */
- return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np);
+ return 0;
}
static int qmp_combo_register_clocks(struct qmp_combo *qmp, struct device_node *usb_np,
@@ -2460,7 +2439,24 @@ static int qmp_combo_register_clocks(struct qmp_combo *qmp, struct device_node *
if (ret)
return ret;
- return 0;
+ ret = of_clk_add_hw_provider(usb_np, of_clk_hw_simple_get,
+ &qmp->pipe_clk_fixed.hw);
+ if (ret)
+ return ret;
+
+ /*
+ * Roll a devm action because the clock provider is the child node, but
+ * the child node is not actually a device.
+ */
+ ret = devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, usb_np);
+ if (ret)
+ return ret;
+
+ ret = of_clk_add_hw_provider(dp_np, qcom_qmp_dp_clks_hw_get, qmp);
+ if (ret)
+ return ret;
+
+ return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, dp_np);
}
static int qmp_combo_parse_dt_lecacy_dp(struct qmp_combo *qmp, struct device_node *np)
--
2.37.4
next prev parent reply other threads:[~2022-11-15 14:41 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 14:39 [PATCH v2 00/15] phy: qcom-qmp-combo: fix sc8280xp binding (set 3/3) Johan Hovold
2022-11-15 14:39 ` [PATCH v2 01/15] dt-bindings: phy: qcom,qmp-usb3-dp: rename current bindings Johan Hovold
2022-11-15 14:39 ` [PATCH v2 02/15] dt-bindings: phy: qcom,qmp-usb3-dp: fix sc8280xp binding Johan Hovold
2022-11-16 21:59 ` Rob Herring
2022-11-15 14:39 ` [PATCH v2 03/15] phy: qcom-qmp-combo: drop v4 reference-clock source Johan Hovold
2022-11-16 13:48 ` Dmitry Baryshkov
2022-11-15 14:39 ` [PATCH v2 04/15] phy: qcom-qmp-combo: restructure PHY creation Johan Hovold
2022-11-16 13:50 ` Dmitry Baryshkov
2022-11-15 14:39 ` [PATCH v2 05/15] phy: qcom-qmp-combo: generate pipe clock name Johan Hovold
2022-11-15 14:39 ` [PATCH v2 06/15] phy: qcom-qmp-combo: drop redundant clock structure Johan Hovold
2022-11-15 14:39 ` [PATCH v2 07/15] phy: qcom-qmp-combo: drop redundant clock allocation Johan Hovold
2022-11-15 14:39 ` [PATCH v2 08/15] phy: qcom-qmp-combo: add clock registration helper Johan Hovold
2022-11-15 14:39 ` Johan Hovold [this message]
2022-11-15 14:40 ` [PATCH v2 10/15] phy: qcom-qmp-combo: clean up DP clock callbacks Johan Hovold
2022-11-15 14:40 ` [PATCH v2 11/15] phy: qcom-qmp-combo: rename common-register pointers Johan Hovold
2022-11-15 14:40 ` [PATCH v2 12/15] phy: qcom-qmp-combo: rename DP_PHY register pointer Johan Hovold
2022-11-15 14:40 ` [PATCH v2 13/15] phy: qcom-qmp-combo: add support for updated sc8280xp binding Johan Hovold
2022-11-16 13:51 ` Dmitry Baryshkov
2022-11-15 14:40 ` [PATCH v2 14/15] arm64: dts: qcom: sc8280xp: fix primary USB-DP PHY reset Johan Hovold
2022-11-15 14:40 ` [PATCH v2 15/15] arm64: dts: qcom: sc8280xp: fix USB-DP PHY nodes Johan Hovold
2022-11-16 13:52 ` Dmitry Baryshkov
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=20221115144005.2478-10-johan+linaro@kernel.org \
--to=johan+linaro@kernel.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@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 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.