Skip to content
  • Simon Glass's avatar
    dm: usb: Allow USB drivers to be declared and auto-probed · 0566e240
    Simon Glass authored
    
    
    USB devices in U-Boot are currently probed only after all devices have
    been enumerated. Each type of device is probed by custom code, e.g.:
    
    - USB storage
    - Keyboard
    - Ethernet
    
    With driver model this approach doesn't work very well. We could build
    a picture of the bus and then go back and add the devices later, but
    this means that the data structures are incomplete for quite a while.
    It also does not follow the model of being able to bind a device when we
    discover it.
    
    We would prefer to have devices automatically be bound as the device is
    enumerated. This allows us to attach drivers to particular USB classes
    or product/vendor IDs. This is the method used by Linux.
    
    Add the required #defines from Linux, a way of declaring a USB driver and
    the logic to locate the correct driver given the USB device's descriptors.
    
    Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
    Reviewed-by: default avatarMarek Vasut <marex@denx.de>
    0566e240