diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-06-17 19:33:52 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-07-21 23:39:36 (GMT) |
commit | b2f219b081de964583a5621bc59d43eb75521598 (patch) | |
tree | 5506064bbdadabdc4d785c64e7ff79f7a2203727 /drivers/usb/host | |
parent | 9b510df703d282effba4f56ac567aa8011d56e6b (diff) | |
download | u-boot-b2f219b081de964583a5621bc59d43eb75521598.tar.xz |
dm: usb: Allow usb host drivers to implement usb_reset_root_port
Allow usb uclass host drivers to implement usb_reset_root_port, this is
used by single port usb hosts which do not emulate a hub, such as otg
controllers.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/usb-uclass.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c index fd11cc6..b0e6e71 100644 --- a/drivers/usb/host/usb-uclass.c +++ b/drivers/usb/host/usb-uclass.c @@ -128,6 +128,17 @@ int usb_alloc_device(struct usb_device *udev) return ops->alloc_device(bus, udev); } +int usb_reset_root_port(struct usb_device *udev) +{ + struct udevice *bus = udev->controller_dev; + struct dm_usb_ops *ops = usb_get_ops(bus); + + if (!ops->reset_root_port) + return -ENOSYS; + + return ops->reset_root_port(bus, udev); +} + int usb_stop(void) { struct udevice *bus; @@ -268,11 +279,6 @@ int usb_init(void) return usb_started ? 0 : -1; } -int usb_reset_root_port(struct usb_device *udev) -{ - return -ENOSYS; -} - static struct usb_device *find_child_devnum(struct udevice *parent, int devnum) { struct usb_device *udev; |