Hi Grant,
On 5 November 2011 00:50, Grant Likely grant.likely@secretlab.ca wrote:
Proof of concept, needs to be made compilable and add the unwind path on error and remove.
Bodged-together-by: Grant Likely grant.likely@secretlab.ca
Is there is reason to include device nodes in dts file for usb devices that are attached to a usb host? What additional information would such nodes include apart from the device information obtained during enumeration?
Thanks, Thomas.
Hi Deepak,
Here's the code I hacked together on Friday. It would be useful to have someone take on this work and finish it so that device nodes can be attached to usb devices.
g.
drivers/usb/core/hub.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 96f05b2..bafd31d 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1856,6 +1856,8 @@ fail: */ int usb_new_device(struct usb_device *udev) {
- struct device_node *np = udev->bus->dev.of_node;
- struct device_node *child;
int err;
if (udev->parent) { @@ -1864,6 +1866,17 @@ int usb_new_device(struct usb_device *udev) * sysfs power/wakeup controls wakeup enabled/disabled */ device_init_wakeup(&udev->dev, 0);
- /* Grab the device node for the hub */
- np = udev->parent->dev.of_node;
- }
- /* Do we have a device tree node for this USB device? */
- if (np) {
- for_each_child_of_node(child, np) {
- if (value_of_reg_property(child) == udev->portnum)
- udev->dev.of_node = of_node_get(child);
- }
}
/* Tell the runtime-PM framework the device is active */
1.7.5.4
linaro-kernel mailing list linaro-kernel@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-kernel