[U-Boot] [PATCH v2 33/80] dm: usb: Pass EHCI controller pointer to ehci_powerup_fixup()

Simon Glass sjg at chromium.org
Wed Mar 25 19:22:21 CET 2015


Adjust this function so that it is passed an EHCI controller pointer so that
implementations can look up their controller.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v2: None

 board/genesi/mx51_efikamx/efikamx-usb.c | 3 ++-
 drivers/usb/host/ehci-hcd.c             | 5 +++--
 drivers/usb/host/ehci-tegra.c           | 3 ++-
 drivers/usb/host/ehci.h                 | 3 ++-
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/board/genesi/mx51_efikamx/efikamx-usb.c b/board/genesi/mx51_efikamx/efikamx-usb.c
index 0b43101..0c0b8d3 100644
--- a/board/genesi/mx51_efikamx/efikamx-usb.c
+++ b/board/genesi/mx51_efikamx/efikamx-usb.c
@@ -173,7 +173,8 @@ int board_ehci_hcd_init(int port)
 	return 0;
 }
 
-void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
+void ehci_powerup_fixup(struct ehci_ctrl *ctrl, uint32_t *status_reg,
+			uint32_t *reg)
 {
 	uint32_t port = OTG_BASE_ADDR + (0x200 * CONFIG_MXC_USB_PORT);
 	struct usb_ehci *ehci = (struct usb_ehci *)port;
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index d85308f..e9f58e3 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -138,7 +138,8 @@ __weak void ehci_set_usbmode(int index)
 	ehci_writel(reg_ptr, tmp);
 }
 
-__weak void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
+__weak void ehci_powerup_fixup(struct ehci_ctrl *ctrl, uint32_t *status_reg,
+			       uint32_t *reg)
 {
 	mdelay(50);
 }
@@ -843,7 +844,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 				 * usb 2.0 specification say 50 ms resets on
 				 * root
 				 */
-				ehci_powerup_fixup(status_reg, &reg);
+				ehci_powerup_fixup(ctrl, status_reg, &reg);
 
 				ehci_writel(status_reg, reg & ~EHCI_PS_PR);
 				/*
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 9a73e60..5d746f2 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -198,7 +198,8 @@ static struct fdt_usb_controller *controller;
  * This ehci_powerup_fixup overrides the weak function ehci_powerup_fixup
  * in "ehci-hcd.c".
  */
-void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
+void ehci_powerup_fixup(struct ehci_ctrl *ctrl, uint32_t *status_reg,
+			uint32_t *reg)
 {
 	mdelay(50);
 	/* This is to avoid PORT_ENABLE bit to be cleared in "ehci-hcd.c". */
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index d538bb6..a00c7e7 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -254,7 +254,8 @@ struct ehci_ctrl {
 /* Weak functions that drivers can override */
 int ehci_get_port_speed(struct ehci_ctrl *ctrl, uint32_t reg);
 void ehci_set_usbmode(int index);
-void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg);
+void ehci_powerup_fixup(struct ehci_ctrl *ctrl, uint32_t *status_reg,
+			uint32_t *reg);
 uint32_t *ehci_get_portsc_register(struct ehci_hcor *hcor, int port);
 
 /**
-- 
2.2.0.rc0.207.ga3a616c



More information about the U-Boot mailing list