1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

dm: usb: Refactor port resets

Move the port reset code into its own function. Rename usb_hub_reset() to
indicate that is is now a legacy function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
This commit is contained in:
Simon Glass
2015-03-25 12:22:04 -06:00
parent 53d8aa0f61
commit 862e75c0db
3 changed files with 45 additions and 17 deletions

View File

@@ -700,9 +700,25 @@ bool usb_device_has_child_on_port(struct usb_device *parent, int port);
int usb_hub_probe(struct usb_device *dev, int ifnum);
void usb_hub_reset(void);
int hub_port_reset(struct usb_device *dev, int port,
/**
* legacy_hub_port_reset() - reset a port given its usb_device pointer
*
* Reset a hub port and see if a device is present on that port, providing
* sufficient time for it to show itself. The port status is returned.
*
* With driver model this moves to hub_port_reset() and is passed a struct
* udevice.
*
* @dev: USB device to reset
* @port: Port number to reset (note ports are numbered from 0 here)
* @portstat: Returns port status
*/
int legacy_hub_port_reset(struct usb_device *dev, int port,
unsigned short *portstat);
int hub_port_reset(struct udevice *dev, int port, unsigned short *portstat);
/**
* usb_alloc_new_device() - Allocate a new device
*