usb: host: xhci-plat: Create platform device for onboard hubs in probe()
[linux-2.6-microblaze.git] / drivers / usb / host / xhci-plat.c
index c1edcc9..ee98a36 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/usb/onboard_hub.h>
 #include <linux/usb/phy.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
@@ -374,6 +375,9 @@ static int xhci_plat_probe(struct platform_device *pdev)
         */
        pm_runtime_forbid(&pdev->dev);
 
+       INIT_LIST_HEAD(&xhci->onboard_hub_devs);
+       onboard_hub_create_pdevs(hcd->self.root_hub, &xhci->onboard_hub_devs);
+
        return 0;
 
 
@@ -420,6 +424,8 @@ static int xhci_plat_remove(struct platform_device *dev)
        usb_remove_hcd(hcd);
        usb_put_hcd(shared_hcd);
 
+       onboard_hub_destroy_pdevs(&xhci->onboard_hub_devs);
+
        clk_disable_unprepare(clk);
        clk_disable_unprepare(reg_clk);
        usb_put_hcd(hcd);