mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] usb: ohci: Clear control register at driver startup
@ 2016-05-25 18:13 Alexander Shiyan
  2016-05-25 18:13 ` [PATCH 2/3] usb: Add OHCI platform driver Alexander Shiyan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexander Shiyan @ 2016-05-25 18:13 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/usb/host/ohci-at91.c | 7 -------
 drivers/usb/host/ohci-hcd.c  | 7 ++++---
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 0f5c8f1..0a6e5ca 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -44,8 +44,6 @@ static void at91_stop_clock(void)
 
 static int at91_ohci_probe(struct device_d *dev)
 {
-	struct ohci_regs __iomem *regs = (struct ohci_regs __iomem *)dev->resource[0].start;
-
 	iclk = clk_get(NULL, "ohci_clk");
 	fclk = clk_get(NULL, "uhpck");
 
@@ -54,11 +52,6 @@ static int at91_ohci_probe(struct device_d *dev)
 	 */
 	at91_start_clock();
 
-	/*
-	 * The USB host controller must remain in reset.
-	 */
-	writel(0, &regs->control);
-
 	add_generic_device("ohci", DEVICE_ID_DYNAMIC, NULL, dev->resource[0].start,
 			   resource_size(&dev->resource[0]), IORESOURCE_MEM, NULL);
 
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 612c3a1..a4795bb 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1817,14 +1817,15 @@ static int ohci_probe(struct device_d *dev)
 		return -ENOMEM;
 	memset(ohci->ohci_dev, 0, sizeof(*ohci->ohci_dev));
 
-	usb_register_host(host);
-
 	iores = dev_request_mem_resource(dev, 0);
 	if (IS_ERR(iores))
 		return PTR_ERR(iores);
 	ohci->regs = IOMEM(iores->start);
 
-	return 0;
+	/* Put the USB host controller into reset */
+	writel(0, &ohci->regs->control);
+
+	return usb_register_host(host);
 }
 
 static struct driver_d ohci_driver = {
-- 
2.4.9


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH 1/3] usb: ohci: Clear control register at driver startup
@ 2014-12-14 11:55 Alexander Shiyan
  2014-12-14 11:55 ` [PATCH 3/3] usb: Replace AT91 OHCI driver with platform OHCI driver Alexander Shiyan
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Shiyan @ 2014-12-14 11:55 UTC (permalink / raw)
  To: barebox

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/usb/host/ohci-at91.c | 7 -------
 drivers/usb/host/ohci-hcd.c  | 7 ++++---
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 0f5c8f1..0a6e5ca 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -44,8 +44,6 @@ static void at91_stop_clock(void)
 
 static int at91_ohci_probe(struct device_d *dev)
 {
-	struct ohci_regs __iomem *regs = (struct ohci_regs __iomem *)dev->resource[0].start;
-
 	iclk = clk_get(NULL, "ohci_clk");
 	fclk = clk_get(NULL, "uhpck");
 
@@ -54,11 +52,6 @@ static int at91_ohci_probe(struct device_d *dev)
 	 */
 	at91_start_clock();
 
-	/*
-	 * The USB host controller must remain in reset.
-	 */
-	writel(0, &regs->control);
-
 	add_generic_device("ohci", DEVICE_ID_DYNAMIC, NULL, dev->resource[0].start,
 			   resource_size(&dev->resource[0]), IORESOURCE_MEM, NULL);
 
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 622f5c3..e806c64 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1810,13 +1810,14 @@ static int ohci_probe(struct device_d *dev)
 		return -ENOMEM;
 	memset(ohci->ohci_dev, 0, sizeof(*ohci->ohci_dev));
 
-	usb_register_host(host);
-
 	ohci->regs = dev_request_mem_region(dev, 0);
 	if (IS_ERR(ohci->regs))
 		return PTR_ERR(ohci->regs);
 
-	return 0;
+	/* Put the USB host controller into reset */
+	writel(0, &ohci->regs->control);
+
+	return usb_register_host(host);
 }
 
 static struct driver_d ohci_driver = {
-- 
2.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-26  6:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-25 18:13 [PATCH 1/3] usb: ohci: Clear control register at driver startup Alexander Shiyan
2016-05-25 18:13 ` [PATCH 2/3] usb: Add OHCI platform driver Alexander Shiyan
2016-05-26  6:28   ` Sascha Hauer
2016-05-25 18:13 ` [PATCH 3/3] usb: Replace AT91 OHCI driver with platform OHCI driver Alexander Shiyan
2016-05-26  6:21 ` [PATCH 1/3] usb: ohci: Clear control register at driver startup Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2014-12-14 11:55 Alexander Shiyan
2014-12-14 11:55 ` [PATCH 3/3] usb: Replace AT91 OHCI driver with platform OHCI driver Alexander Shiyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox