From b11633c42a766cb3c824e3583163b9adf67501fe Mon Sep 17 00:00:00 2001 From: Dinh Nguyen Date: Mon, 16 Oct 2017 08:57:18 -0500 Subject: usb: dwc2: disable erroneous overcurrent condition For the case where an external VBUS is used, we should enable the external VBUS comparator in the driver. This would prevent an unnecessary overcurrent error which would then disable the host port. This patch uses the standard 'disable-over-current' binding to allow of the option of disabling the over-current condition. Reviewed-by: Marek Vasut Signed-off-by: Dinh Nguyen Signed-off-by: Felipe Balbi --- drivers/usb/dwc2/params.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/usb/dwc2/params.c') diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index 015d23ebcf5a..fe770a2834d2 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -346,6 +346,9 @@ static void dwc2_get_device_properties(struct dwc2_hsotg *hsotg) num); } } + + if (of_find_property(hsotg->dev->of_node, "disable-over-current", NULL)) + p->oc_disable = true; } static void dwc2_check_param_otg_cap(struct dwc2_hsotg *hsotg) -- cgit v1.2.3