Re: [PATCH 2/2] USB: dwc2: Add OTG support for Ingenic SoCs.

From: Zhou Yanjie
Date: Tue Apr 12 2022 - 12:45:46 EST


Hi Felipe,

On 2021/7/24 下午9:24, Felipe Balbi wrote:
Hi Zhou,

Zhou Yanjie writes:
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 67c5eb1..a7a1b50 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -71,6 +71,47 @@ static void dwc2_set_his_params(struct
dwc2_hsotg *hsotg)
p->power_down = DWC2_POWER_DOWN_PARAM_NONE;
}

+static void dwc2_set_jz4775_params(struct dwc2_hsotg *hsotg)
+{
+ struct dwc2_core_params *p = &hsotg->params;
+
+ p->otg_cap = DWC2_CAP_PARAM_NO_HNP_SRP_CAPABLE;
+ p->speed = DWC2_SPEED_PARAM_HIGH;
+ p->phy_type = DWC2_PHY_TYPE_PARAM_UTMI;
+ p->phy_utmi_width = 16;
+ p->deactivate_ingenic_overcurrent_detection =
+ device_property_read_bool(hsotg->dev, "disable-over-current");
That device property was not documented in the previous patch. Also
this probably should be "ingenic,disable-over-current".

This device property already exists (it has been used in the
"dwc2_get_device_properties()" function below).

Under normal circumstances, after using this device attribute, it
should be possible to turn off the overcurrent

detection, but on the Ingenic processors, somehow it did not take
effect normally, and we must operate the

"VBVALOEN" bit and "VBVALOVAL" bit of "GOTGCTL" register to make it normal.
I believe what Paul is suggesting is that this property lacks
documentation under Documentation/devicetree/bindings/. If that's the
case, you could take the opportunity to document the property and,
perhaps, add the missing prefix.


Sorry for the long time delay.

Looks like Krzysztof has done the job, I will send v2 soon.


Thanks and best regards!