summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2017-09-07 06:13:17 -0700
committerMarek Vasut <marek.vasut+renesas@gmail.com>2017-09-27 12:12:21 +0200
commit3e59f59015e39ceb870fa8a7a12e0464e775512b (patch)
treef03033b5635b7fa5ee51ced115ec7072fb56c82e /drivers
parent7489d22a3c73b527c21c147f3547e8cc02484e47 (diff)
downloadu-boot-3e59f59015e39ceb870fa8a7a12e0464e775512b.tar.gz
u-boot-3e59f59015e39ceb870fa8a7a12e0464e775512b.tar.xz
u-boot-3e59f59015e39ceb870fa8a7a12e0464e775512b.zip
dm: usb: Add a new USB controller operation 'get_max_xfer_size'
The HCD may have limitation on the maximum bytes to be transferred in a USB transfer. USB class driver needs to be aware of this. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/usb-uclass.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 0b8a501ce8..bc44fc3394 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -150,6 +150,17 @@ int usb_update_hub_device(struct usb_device *udev)
return ops->update_hub_device(bus, udev);
}
+int usb_get_max_xfer_size(struct usb_device *udev, size_t *size)
+{
+ struct udevice *bus = udev->controller_dev;
+ struct dm_usb_ops *ops = usb_get_ops(bus);
+
+ if (!ops->get_max_xfer_size)
+ return -ENOSYS;
+
+ return ops->get_max_xfer_size(bus, size);
+}
+
int usb_stop(void)
{
struct udevice *bus;