[PATCH 2/2] usb: dwc3: qcom: Allow the glue layer to pass ref_clk to the core
From: Varadarajan Narayanan
Date: Tue Aug 25 2026 - 01:10:17 EST
The dwc3-qcom glue layer sets probe_data.ignore_clocks_and_resets before
calling dwc3_core_probe(), so the DWC3 core does not acquire ref_clk on its
own. This prevents dwc3_ref_clk_period() from programming GUCTL and GFLADJ
from the reference clock rate.
The deprecated snps,ref-clock-period-ns property is not a suitable
replacement on IPQ9650. Its 24 MHz reference clock has a period of about
41.66 ns, while using 41 ns makes the calculated FLADJ value become 0 and
leaves the reference clock configuration incorrect.
Allow the Qualcomm glue driver to provide ref_clk to the DWC3 core for
platforms that may need it.
Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@xxxxxxxxxxxxxxxx>
---
drivers/usb/dwc3/dwc3-qcom.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index ac68b4218b56..2d6de6469c1e 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -705,6 +705,13 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
probe_data.res = &res;
probe_data.ignore_clocks_and_resets = true;
probe_data.properties = DWC3_DEFAULT_PROPERTIES;
+
+ qcom->dwc.ref_clk = devm_clk_get_optional(dev, "ref_clk");
+ if (IS_ERR_OR_NULL(qcom->dwc.ref_clk)) {
+ qcom->dwc.ref_clk = NULL;
+ dev_info(dev, "NOT setting dwc.ref_clk\n");
+ }
+
ret = dwc3_core_probe(&probe_data);
if (ret) {
ret = dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
--
2.34.1