Lines Matching +full:peer +full:- +full:hub

1 // SPDX-License-Identifier: GPL-2.0-only
33 * onboard_dev_create_pdevs -- create platform devices for onboard USB devices
34 * @parent_hub : parent hub to scan for connected onboard devices
35 * @pdev_list : list of onboard platform devices owned by the parent hub
38 * to the given parent hub. The platform device is in charge of initializing the
44 * by the parent hub.
55 * loop is only executed for the root hub of the primary HCD. Since the function
57 * connected to the root hub of the secondary HCD if needed.
59 * Further there must be only one platform device for onboard hubs with a peer
60 * hub (the hub is a single physical device). To achieve this two measures are
61 * taken: pdevs for onboard hubs with a peer are only created when the function
62 * is called on behalf of the parent hub that is connected to the primary HCD
65 * created if the peer hub doesn't have one already.
70 struct usb_hcd *hcd = bus_to_hcd(parent_hub->bus); in onboard_dev_create_pdevs()
75 if (!parent_hub->dev.of_node) in onboard_dev_create_pdevs()
78 if (!parent_hub->parent && !usb_hcd_is_primary_hcd(hcd)) in onboard_dev_create_pdevs()
81 for (i = 1; i <= parent_hub->maxchild; i++) { in onboard_dev_create_pdevs()
89 npc = of_parse_phandle(np, "peer-hub", 0); in onboard_dev_create_pdevs()
100 put_device(&pdev->dev); in onboard_dev_create_pdevs()
105 pdev = of_platform_device_create(np, NULL, &parent_hub->dev); in onboard_dev_create_pdevs()
107 dev_err(&parent_hub->dev, in onboard_dev_create_pdevs()
114 of_platform_device_destroy(&pdev->dev, NULL); in onboard_dev_create_pdevs()
118 pdle->pdev = pdev; in onboard_dev_create_pdevs()
119 list_add(&pdle->node, pdev_list); in onboard_dev_create_pdevs()
128 * onboard_dev_destroy_pdevs -- free resources of onboard platform devices
139 list_del(&pdle->node); in onboard_dev_destroy_pdevs()
140 of_platform_device_destroy(&pdle->pdev->dev, NULL); in onboard_dev_destroy_pdevs()