Commit aac064f7 authored by Simon Glass's avatar Simon Glass
Browse files

dm: usb: Move all the EHCI weak functions together and declare them



Put these at the top of the file so they are in one place. Also add function
prototypes to the header file to avoid call site mismatches.
Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarMarek Vasut <marex@denx.de>
parent acf277af
...@@ -143,6 +143,17 @@ __weak void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg) ...@@ -143,6 +143,17 @@ __weak void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
mdelay(50); mdelay(50);
} }
__weak uint32_t *ehci_get_portsc_register(struct ehci_hcor *hcor, int port)
{
if (port < 0 || port >= CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) {
/* Printing the message would cause a scan failure! */
debug("The request port(%u) is not configured\n", port);
return NULL;
}
return (uint32_t *)&hcor->or_portsc[port];
}
static int handshake(uint32_t *ptr, uint32_t mask, uint32_t done, int usec) static int handshake(uint32_t *ptr, uint32_t mask, uint32_t done, int usec)
{ {
uint32_t result; uint32_t result;
...@@ -649,17 +660,6 @@ fail: ...@@ -649,17 +660,6 @@ fail:
return -1; return -1;
} }
__weak uint32_t *ehci_get_portsc_register(struct ehci_hcor *hcor, int port)
{
if (port < 0 || port >= CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) {
/* Printing the message would cause a scan failure! */
debug("The request port(%u) is not configured\n", port);
return NULL;
}
return (uint32_t *)&hcor->or_portsc[port];
}
int int
ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
int length, struct devrequest *req) int length, struct devrequest *req)
......
...@@ -250,6 +250,12 @@ struct ehci_ctrl { ...@@ -250,6 +250,12 @@ struct ehci_ctrl {
int ntds; int ntds;
}; };
/* Weak functions that drivers can override */
int ehci_get_port_speed(struct ehci_hcor *hcor, uint32_t reg);
void ehci_set_usbmode(int index);
void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg);
uint32_t *ehci_get_portsc_register(struct ehci_hcor *hcor, int port);
/* Low level init functions */ /* Low level init functions */
int ehci_hcd_init(int index, enum usb_init_type init, int ehci_hcd_init(int index, enum usb_init_type init,
struct ehci_hccr **hccr, struct ehci_hcor **hcor); struct ehci_hccr **hccr, struct ehci_hcor **hcor);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment