Re: [PATCH 3/9] usb: dwc3: qcom: Add support for selecting UTMI as reference clock

From: George Moussalem

Date: Thu Aug 27 2026 - 07:50:03 EST


On 8/27/26 15:42, Varadarajan Narayanan wrote:
> [...]
>> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
>> index ac68b4218b56..17292517c594 100644
>> --- a/drivers/usb/dwc3/dwc3-qcom.c
>> +++ b/drivers/usb/dwc3/dwc3-qcom.c
>> @@ -617,6 +617,8 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
>> int ret;
>> bool ignore_pipe_clk;
>> bool wakeup_source;
>> + bool select_utmi_as_ref_clk;
>> + struct clk *ref_clk;
>
> Any reason why glue layer can't send the ref_clk_rate directly?

no, I've tested both. The only reason I passed the clock itself was that
it leaves it open to the core and all glue layers to implement their
requirements (if needed). Happy to switch to ref_clk_rate. I need to
send a revision anyways to change devm_clk_get_optional to devm_clk_get.

>
> -Varada
>
>> qcom = devm_kzalloc(&pdev->dev, sizeof(*qcom), GFP_KERNEL);
>> if (!qcom)
>> @@ -698,6 +700,18 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
>> qcom->current_role = USB_ROLE_DEVICE;
>> }
>>
>> + select_utmi_as_ref_clk = device_property_read_bool(dev,
>> + "qcom,select-utmi-as-ref-clk");
>> + if (select_utmi_as_ref_clk) {
>> + ref_clk = devm_clk_get_optional(dev, "mock_utmi");
>> + if (IS_ERR(ref_clk)) {
>> + ret = PTR_ERR(ref_clk);
>> + dev_warn(dev, "failed to get ref clock: %d\n", ret);
>> + } else {
>> + probe_data.ref_clk = ref_clk;
>> + }
>> + }
>> +
>> qcom->dwc.glue_ops = &dwc3_qcom_glue_ops;
>>
>> qcom->dwc.dev = dev;
>>
>> --
>> 2.53.0
>>
>>