Proof of concept, needs to be made compilable and add the unwind path
on error and remove.
Bodged-together-by: Grant Likely <grant.likely(a)secretlab.ca>
---
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
== Thomas Abraham <thomas-ab> ==
=== Highlights ===
* Submitted rebased version of the samsung's sdhci driver device tree patches.
* Started with device tree support for samsung's i2s audio interface driver.
* Started looking into pinmux driver based on the pinctrl subsystem
for samsung platforms.
=== Plans ===
* Submit next version of the sdhci driver dt patches with all comments
addressed.
* Complete the device tree support for i2s driver.
* Complete the intial version of the pinmux driver for samsung
platforms and submit for review.
== Linus Walleij linusw ==
=== Highlights ===
* Torvalds has pulled the pinctrl subssystem for Linux v3.2.
* Several other subsystems have also been pulled for 3.2,
many patches created or signed-off by me have made their
way into mainline due to this, including LP5521 and LM3530
LEDs, Nomadik I2C, DB8500 CPUfreq, MMC core and
the PL180 MMCI driver, AB8500 Core, a bunch of DB8500
PRCMU patches, AB5500 driver, AB8500 GPADC, a few
Integrator patches, PL022 SPI and of course a stack of
Ux500 core patches.
* All GPIO cleanups initially started in the Cambourne sprint
in cooperation with Ben Dooks, have been pulled into Torvalds
tree.
* Fixed bugs in my own patches that have been pulled in by
Torvalds, predominantly <mach/gpio.h> cleanup fallout and
AB8500 MFD core.
* Attended Linaro connect in Orlando. Mainly talking and
planning, not much hands-on work here.
=== Plans ===
* Prepare a second patch for generic pin control.
Shawn Guo and other developers are requesting this to be
able to create complete pinctrl drivers targeted for 3.3.
* Drive generalization of U300 and Nomadik GPIO
by using the pinctrl framework.
drivers/gpio/gpio-[nomadik|u300]
* Test the PL08x patches on the Ericsson Research
PB11MPCore and submit platform data for using
pl08x DMA on that platform.
* Pushed out the AB8500 HWMON driver, will try to address
review comments.
* Mainline some ux500 U-Boot stuff so it can atleast boot
the system.
=== Issues ===
* Some ST-Ericsson internal time-stealing as usual.
Thanks,
Linus Walleij
Proof of concept, needs to be made compilable and add the unwind path
on error and remove.
Bodged-together-by: Grant Likely <grant.likely(a)secretlab.ca>
---
Resend... I messed up Deepak's email addr.
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