The dwc2 controller is connected to one reset controller which needs to be
triggered before it is able to operate. This patch adds the referenced reset
controller in the devicetree to be used.

Signed-off-by: Michael Grzeschik <[email protected]>
---
 drivers/usb/dwc2/dwc2.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/dwc2/dwc2.c b/drivers/usb/dwc2/dwc2.c
index 13455479ef..6f5127fc3b 100644
--- a/drivers/usb/dwc2/dwc2.c
+++ b/drivers/usb/dwc2/dwc2.c
@@ -12,6 +12,7 @@
 #include <errno.h>
 #include <driver.h>
 #include <linux/clk.h>
+#include <linux/reset.h>
 
 #include "dwc2.h"
 
@@ -61,6 +62,10 @@ static int dwc2_probe(struct device_d *dev)
        if (ret)
                goto clk_put;
 
+       ret = device_reset_us(dev, 2);
+       if (ret)
+               goto clk_disable;
+
        dwc2->phy = phy_optional_get(dev, "usb2-phy");
        if (IS_ERR(dwc2->phy)) {
                ret = PTR_ERR(dwc2->phy);
-- 
2.29.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to