diff options
author | Simon Glass <sjg@chromium.org> | 2015-03-25 21:22:24 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 20:11:24 +0300 |
commit | 6a1a8162c62fcb5435495c1ddf3390a1d1967474 (patch) | |
tree | cdb92b0943b31f8ef016c0823a5146624a96af24 /drivers/usb | |
parent | 11d18a1946bd290b83d584ab521e6940e1a11d69 (diff) | |
download | u-boot-6a1a8162c62fcb5435495c1ddf3390a1d1967474.tar.xz |
dm: usb: Pass EHCI controller pointer to ehci_get_portsc_register()
Adjust this function so that it is passed an EHCI controller pointer so that
implementations can look up their controller. This makes the weak functions
use a consistent API.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ehci-faraday.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/host/ehci-faraday.c b/drivers/usb/host/ehci-faraday.c index c64672bf45..b865fea3eb 100644 --- a/drivers/usb/host/ehci-faraday.c +++ b/drivers/usb/host/ehci-faraday.c @@ -134,7 +134,7 @@ int ehci_get_port_speed(struct ehci_ctrl *ctrl, uint32_t reg) * This ehci_get_portsc_register() overrides the weak function * in "ehci-hcd.c". */ -uint32_t *ehci_get_portsc_register(struct ehci_hcor *hcor, int port) +uint32_t *ehci_get_portsc_register(struct ehci_ctrl *ctrl, int port) { /* Faraday EHCI has one and only one portsc register */ if (port) { @@ -144,5 +144,5 @@ uint32_t *ehci_get_portsc_register(struct ehci_hcor *hcor, int port) } /* Faraday EHCI PORTSC register offset is 0x20 from hcor */ - return (uint32_t *)((uint8_t *)hcor + 0x20); + return (uint32_t *)((uint8_t *)ctrl->hcor + 0x20); } diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 4de7c81c95..8238e9d388 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -144,7 +144,7 @@ __weak void ehci_powerup_fixup(struct ehci_ctrl *ctrl, uint32_t *status_reg, mdelay(50); } -__weak uint32_t *ehci_get_portsc_register(struct ehci_hcor *hcor, int port) +__weak uint32_t *ehci_get_portsc_register(struct ehci_ctrl *ctrl, int port) { if (port < 0 || port >= CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) { /* Printing the message would cause a scan failure! */ @@ -152,7 +152,7 @@ __weak uint32_t *ehci_get_portsc_register(struct ehci_hcor *hcor, int port) return NULL; } - return (uint32_t *)&hcor->or_portsc[port]; + return (uint32_t *)&ctrl->hcor->or_portsc[port]; } static int handshake(uint32_t *ptr, uint32_t mask, uint32_t done, int usec) @@ -687,7 +687,7 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, case USB_REQ_GET_STATUS | ((USB_RT_PORT | USB_DIR_IN) << 8): case USB_REQ_SET_FEATURE | ((USB_DIR_OUT | USB_RT_PORT) << 8): case USB_REQ_CLEAR_FEATURE | ((USB_DIR_OUT | USB_RT_PORT) << 8): - status_reg = ehci_get_portsc_register(ctrl->hcor, port - 1); + status_reg = ehci_get_portsc_register(ctrl, port - 1); if (!status_reg) return -1; break; diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 164b3cb4c7..0fd59bc107 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -256,7 +256,7 @@ int ehci_get_port_speed(struct ehci_ctrl *ctrl, uint32_t reg); void ehci_set_usbmode(struct ehci_ctrl *ctrl); 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); +uint32_t *ehci_get_portsc_register(struct ehci_ctrl *ctrl, int port); /** * ehci_set_controller_priv() - Set up private data for the controller |