Hans de Goede 7f1a07538f dm: usb: Copy over usb_device values from usb_scan_device() to final usb_device
Currently we copy over a number of usb_device values stored in the on stack
struct usb_device probed in usb_scan_device() to the final driver-model managed
struct usb_device in usb_child_pre_probe() through usb_device_platdata, and
then call usb_select_config() to fill in the rest.

There are 3 problems with this approach:

1) It does not fill in enough fields before calling usb_select_config(),
specifically it does not fill in ep0's maxpacketsize causing a div by zero
exception in the ehci driver.

2) It unnecessarily redoes a number of usb requests making usb probing slower

3) Calling usb_select_config() a second time fails on some usb-1 devices
plugged into usb-2 hubs, causing u-boot to not recognize these devices.

This commit fixes these issues by removing (*) the usb_select_config() call
from usb_child_pre_probe(), and instead of copying over things field by field
through usb_device_platdata, store a pointer to the in stack usb_device
(which is still valid when usb_child_pre_probe() gets called) and copy
over the entire struct.

*) Except for devices which are explictly instantiated through device-tree
rather then discovered through usb_scan_device() such as emulated usb devices
in the sandbox.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-05-05 20:58:41 -06:00
..
2014-07-30 08:48:03 -04:00
2015-04-18 16:54:29 -04:00
2015-05-05 20:58:20 -06:00
2015-01-14 11:35:43 -05:00
2014-02-04 16:32:20 +01:00
2014-02-21 08:42:47 -05:00
2015-04-29 21:02:33 -06:00
2014-06-21 10:06:58 -06:00
2015-04-10 14:23:23 +02:00
2014-10-25 15:27:36 -04:00
2015-04-22 12:14:55 -04:00
2014-12-05 08:06:15 -08:00
2015-01-21 10:25:02 +01:00
2015-04-23 16:46:50 -07:00
2015-03-05 08:56:39 -05:00
2014-11-19 08:48:42 +01:00
2015-01-29 17:09:59 -07:00
2014-12-11 13:18:43 -07:00
2013-09-24 09:10:33 -04:00
2014-10-25 15:27:37 -04:00
2014-05-28 10:58:19 +09:00
2014-06-20 11:54:29 -06:00
2014-10-22 16:56:41 -06:00
2015-04-23 09:05:53 -06:00
2013-09-20 10:30:54 -04:00
2015-05-05 12:29:36 +03:00
2014-05-30 14:03:24 -04:00
2013-11-09 17:21:01 +01:00
2015-01-06 10:10:04 +02:00
2015-04-16 19:27:40 -06:00
2015-01-05 12:08:55 -05:00
2015-04-20 17:57:13 -05:00
2014-11-24 12:00:00 +01:00
2015-03-05 20:50:29 -05:00
2013-12-04 08:11:28 -05:00
2015-01-21 10:25:53 +01:00