Lines Matching refs:port_dev
23 struct usb_port *port_dev = to_usb_port(dev); in disable_show() local
27 int port1 = port_dev->portnum; in disable_show()
58 struct usb_port *port_dev = to_usb_port(dev); in disable_store() local
62 int port1 = port_dev->portnum; in disable_store()
80 if (disabled && port_dev->child) in disable_store()
81 usb_disconnect(&port_dev->child); in disable_store()
87 if (!port_dev->is_superspeed) in disable_store()
105 struct usb_port *port_dev = to_usb_port(dev); in location_show() local
107 return sprintf(buf, "0x%08x\n", port_dev->location); in location_show()
114 struct usb_port *port_dev = to_usb_port(dev); in connect_type_show() local
117 switch (port_dev->connect_type) { in connect_type_show()
139 struct usb_port *port_dev = to_usb_port(dev); in over_current_count_show() local
141 return sprintf(buf, "%u\n", port_dev->over_current_count); in over_current_count_show()
148 struct usb_port *port_dev = to_usb_port(dev); in quirks_show() local
150 return sprintf(buf, "%08x\n", port_dev->quirks); in quirks_show()
156 struct usb_port *port_dev = to_usb_port(dev); in quirks_store() local
162 port_dev->quirks = value; in quirks_store()
170 struct usb_port *port_dev = to_usb_port(dev); in usb3_lpm_permit_show() local
173 if (port_dev->usb3_lpm_u1_permit) { in usb3_lpm_permit_show()
174 if (port_dev->usb3_lpm_u2_permit) in usb3_lpm_permit_show()
179 if (port_dev->usb3_lpm_u2_permit) in usb3_lpm_permit_show()
192 struct usb_port *port_dev = to_usb_port(dev); in usb3_lpm_permit_store() local
193 struct usb_device *udev = port_dev->child; in usb3_lpm_permit_store()
197 port_dev->usb3_lpm_u1_permit = 1; in usb3_lpm_permit_store()
198 port_dev->usb3_lpm_u2_permit = 1; in usb3_lpm_permit_store()
201 port_dev->usb3_lpm_u1_permit = 1; in usb3_lpm_permit_store()
202 port_dev->usb3_lpm_u2_permit = 0; in usb3_lpm_permit_store()
205 port_dev->usb3_lpm_u1_permit = 0; in usb3_lpm_permit_store()
206 port_dev->usb3_lpm_u2_permit = 1; in usb3_lpm_permit_store()
209 port_dev->usb3_lpm_u1_permit = 0; in usb3_lpm_permit_store()
210 port_dev->usb3_lpm_u2_permit = 0; in usb3_lpm_permit_store()
268 struct usb_port *port_dev = to_usb_port(dev); in usb_port_device_release() local
270 kfree(port_dev->req); in usb_port_device_release()
271 kfree(port_dev); in usb_port_device_release()
277 struct usb_port *port_dev = to_usb_port(dev); in usb_port_runtime_resume() local
281 struct usb_device *udev = port_dev->child; in usb_port_runtime_resume()
282 struct usb_port *peer = port_dev->peer; in usb_port_runtime_resume()
283 int port1 = port_dev->portnum; in usb_port_runtime_resume()
297 if (!port_dev->is_superspeed && peer) in usb_port_runtime_resume()
317 dev_dbg(&port_dev->dev, "reconnect timeout\n"); in usb_port_runtime_resume()
324 pm_runtime_get_noresume(&port_dev->dev); in usb_port_runtime_resume()
336 struct usb_port *port_dev = to_usb_port(dev); in usb_port_runtime_suspend() local
340 struct usb_port *peer = port_dev->peer; in usb_port_runtime_suspend()
341 int port1 = port_dev->portnum; in usb_port_runtime_suspend()
349 if (dev_pm_qos_flags(&port_dev->dev, PM_QOS_FLAG_NO_POWER_OFF) in usb_port_runtime_suspend()
362 if (!port_dev->is_superspeed) in usb_port_runtime_suspend()
371 if (!port_dev->is_superspeed && peer) in usb_port_runtime_suspend()
380 struct usb_port *port_dev = to_usb_port(dev); in usb_port_shutdown() local
382 if (port_dev->child) in usb_port_shutdown()
383 usb_disable_usb2_hardware_lpm(port_dev->child); in usb_port_shutdown()
533 struct usb_port *port_dev = p, *peer; in match_location() local
535 struct usb_device *hdev = to_usb_device(port_dev->dev.parent->parent); in match_location()
548 if (peer && peer->location == port_dev->location) { in match_location()
549 link_peers_report(port_dev, peer); in match_location()
564 struct usb_port *port_dev = hub->ports[port1 - 1], *peer; in find_and_link_peer() local
575 if (port_dev->location) { in find_and_link_peer()
577 usb_for_each_dev(port_dev, match_location); in find_and_link_peer()
612 link_peers_report(port_dev, peer); in find_and_link_peer()
643 struct usb_port *port_dev; in usb_hub_create_port_device() local
647 port_dev = kzalloc(sizeof(*port_dev), GFP_KERNEL); in usb_hub_create_port_device()
648 if (!port_dev) in usb_hub_create_port_device()
651 port_dev->req = kzalloc(sizeof(*(port_dev->req)), GFP_KERNEL); in usb_hub_create_port_device()
652 if (!port_dev->req) { in usb_hub_create_port_device()
653 kfree(port_dev); in usb_hub_create_port_device()
657 hub->ports[port1 - 1] = port_dev; in usb_hub_create_port_device()
658 port_dev->portnum = port1; in usb_hub_create_port_device()
660 port_dev->dev.parent = hub->intfdev; in usb_hub_create_port_device()
662 port_dev->usb3_lpm_u1_permit = 1; in usb_hub_create_port_device()
663 port_dev->usb3_lpm_u2_permit = 1; in usb_hub_create_port_device()
664 port_dev->dev.groups = port_dev_usb3_group; in usb_hub_create_port_device()
666 port_dev->dev.groups = port_dev_group; in usb_hub_create_port_device()
667 port_dev->dev.type = &usb_port_device_type; in usb_hub_create_port_device()
668 port_dev->dev.driver = &usb_port_driver; in usb_hub_create_port_device()
670 port_dev->is_superspeed = 1; in usb_hub_create_port_device()
671 dev_set_name(&port_dev->dev, "%s-port%d", dev_name(&hub->hdev->dev), in usb_hub_create_port_device()
673 mutex_init(&port_dev->status_lock); in usb_hub_create_port_device()
674 retval = device_register(&port_dev->dev); in usb_hub_create_port_device()
676 put_device(&port_dev->dev); in usb_hub_create_port_device()
681 retval = dev_pm_qos_add_request(&port_dev->dev, port_dev->req, in usb_hub_create_port_device()
684 device_unregister(&port_dev->dev); in usb_hub_create_port_device()
688 retval = component_add(&port_dev->dev, &connector_ops); in usb_hub_create_port_device()
690 dev_warn(&port_dev->dev, "failed to add component\n"); in usb_hub_create_port_device()
691 device_unregister(&port_dev->dev); in usb_hub_create_port_device()
702 pm_runtime_set_active(&port_dev->dev); in usb_hub_create_port_device()
703 pm_runtime_get_noresume(&port_dev->dev); in usb_hub_create_port_device()
704 pm_runtime_enable(&port_dev->dev); in usb_hub_create_port_device()
705 device_enable_async_suspend(&port_dev->dev); in usb_hub_create_port_device()
715 retval = dev_pm_qos_expose_flags(&port_dev->dev, in usb_hub_create_port_device()
718 dev_warn(&port_dev->dev, "failed to expose pm_qos_no_poweroff\n"); in usb_hub_create_port_device()
723 retval = dev_pm_qos_remove_request(port_dev->req); in usb_hub_create_port_device()
725 kfree(port_dev->req); in usb_hub_create_port_device()
726 port_dev->req = NULL; in usb_hub_create_port_device()
733 struct usb_port *port_dev = hub->ports[port1 - 1]; in usb_hub_remove_port_device() local
736 peer = port_dev->peer; in usb_hub_remove_port_device()
738 unlink_peers(port_dev, peer); in usb_hub_remove_port_device()
739 component_del(&port_dev->dev, &connector_ops); in usb_hub_remove_port_device()
740 device_unregister(&port_dev->dev); in usb_hub_remove_port_device()