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>
This commit is contained in:
Bin Meng
2017-09-07 06:13:17 -07:00
committed by Marek Vasut
parent 7489d22a3c
commit 3e59f59015
2 changed files with 32 additions and 1 deletions

View File

@@ -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;