mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Grzeschik <m.grzeschik@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/5] usb: dwc2: add reset controller dependency for probe via oftree
Date: Wed, 16 Dec 2020 21:45:32 +0100	[thread overview]
Message-ID: <20201216204534.8054-4-m.grzeschik@pengutronix.de> (raw)
In-Reply-To: <20201216204534.8054-1-m.grzeschik@pengutronix.de>

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 <m.grzeschik@pengutronix.de>
---
 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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2020-12-16 20:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 20:45 [PATCH 0/5] dwc2: improve gadget support Michael Grzeschik
2020-12-16 20:45 ` [PATCH 1/5] usb: dwc2: cleanup on error for deferred probing Michael Grzeschik
2020-12-17 11:00   ` Jules Maselbas
2020-12-16 20:45 ` [PATCH 2/5] usb: dwc2: add clk dependency for probe via oftree Michael Grzeschik
2020-12-16 20:45 ` Michael Grzeschik [this message]
2020-12-16 20:45 ` [PATCH 4/5] usb: dwc2: update the dr_mode on set_mode callback Michael Grzeschik
2020-12-16 20:45 ` [PATCH 5/5] usb: dwc2: add support to force gadget mode Michael Grzeschik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201216204534.8054-4-m.grzeschik@pengutronix.de \
    --to=m.grzeschik@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox