[U-Boot] [PATCH v2 42/80] dm: usb: Allow USB drivers to be declared and auto-probed

Simon Glass sjg at chromium.org
Tue Apr 7 20:45:07 CEST 2015


On 25 March 2015 at 12:22, Simon Glass <sjg at chromium.org> wrote:
> 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: Simon Glass <sjg at chromium.org>
> ---
>
> Changes in v2: None
>
>  drivers/usb/host/usb-uclass.c | 206 +++++++++++++++++++++++++++++++++++++++++-
>  include/usb.h                 | 107 ++++++++++++++++++++++
>  2 files changed, 311 insertions(+), 2 deletions(-)

Applied to u-boot-dm/next.


More information about the U-Boot mailing list