Lines Matching refs:port_dev
27 struct usb_port *port_dev = to_usb_port(dev); in early_stop_show() local
29 return sysfs_emit(buf, "%s\n", str_yes_no(port_dev->early_stop)); in early_stop_show()
35 struct usb_port *port_dev = to_usb_port(dev); in early_stop_store() local
42 port_dev->early_stop = 1; in early_stop_store()
44 port_dev->early_stop = 0; in early_stop_store()
53 struct usb_port *port_dev = to_usb_port(dev); in disable_show() local
57 int port1 = port_dev->portnum; in disable_show()
105 struct usb_port *port_dev = to_usb_port(dev); in disable_store() local
109 int port1 = port_dev->portnum; in disable_store()
140 if (disabled && port_dev->child) in disable_store()
141 usb_disconnect(&port_dev->child); in disable_store()
147 if (!port_dev->is_superspeed) in disable_store()
169 struct usb_port *port_dev = to_usb_port(dev); in location_show() local
171 return sysfs_emit(buf, "0x%08x\n", port_dev->location); in location_show()
178 struct usb_port *port_dev = to_usb_port(dev); in connect_type_show() local
181 switch (port_dev->connect_type) { in connect_type_show()
203 struct usb_port *port_dev = to_usb_port(dev); in state_show() local
204 enum usb_device_state state = READ_ONCE(port_dev->state); in state_show()
213 struct usb_port *port_dev = to_usb_port(dev); in over_current_count_show() local
215 return sysfs_emit(buf, "%u\n", port_dev->over_current_count); in over_current_count_show()
222 struct usb_port *port_dev = to_usb_port(dev); in quirks_show() local
224 return sysfs_emit(buf, "%08x\n", port_dev->quirks); in quirks_show()
230 struct usb_port *port_dev = to_usb_port(dev); in quirks_store() local
236 port_dev->quirks = value; in quirks_store()
244 struct usb_port *port_dev = to_usb_port(dev); in usb3_lpm_permit_show() local
247 if (port_dev->usb3_lpm_u1_permit) { in usb3_lpm_permit_show()
248 if (port_dev->usb3_lpm_u2_permit) in usb3_lpm_permit_show()
253 if (port_dev->usb3_lpm_u2_permit) in usb3_lpm_permit_show()
266 struct usb_port *port_dev = to_usb_port(dev); in usb3_lpm_permit_store() local
267 struct usb_device *udev = port_dev->child; in usb3_lpm_permit_store()
271 port_dev->usb3_lpm_u1_permit = 1; in usb3_lpm_permit_store()
272 port_dev->usb3_lpm_u2_permit = 1; in usb3_lpm_permit_store()
275 port_dev->usb3_lpm_u1_permit = 1; in usb3_lpm_permit_store()
276 port_dev->usb3_lpm_u2_permit = 0; in usb3_lpm_permit_store()
279 port_dev->usb3_lpm_u1_permit = 0; in usb3_lpm_permit_store()
280 port_dev->usb3_lpm_u2_permit = 1; in usb3_lpm_permit_store()
283 port_dev->usb3_lpm_u1_permit = 0; in usb3_lpm_permit_store()
284 port_dev->usb3_lpm_u2_permit = 0; in usb3_lpm_permit_store()
344 struct usb_port *port_dev = to_usb_port(dev); in usb_port_device_release() local
346 kfree(port_dev->req); in usb_port_device_release()
347 kfree(port_dev); in usb_port_device_release()
353 struct usb_port *port_dev = to_usb_port(dev); in usb_port_runtime_resume() local
357 struct usb_device *udev = port_dev->child; in usb_port_runtime_resume()
358 struct usb_port *peer = port_dev->peer; in usb_port_runtime_resume()
359 int port1 = port_dev->portnum; in usb_port_runtime_resume()
373 if (!port_dev->is_superspeed && peer) in usb_port_runtime_resume()
393 dev_dbg(&port_dev->dev, "reconnect timeout\n"); in usb_port_runtime_resume()
400 pm_runtime_get_noresume(&port_dev->dev); in usb_port_runtime_resume()
412 struct usb_port *port_dev = to_usb_port(dev); in usb_port_runtime_suspend() local
416 struct usb_port *peer = port_dev->peer; in usb_port_runtime_suspend()
417 int port1 = port_dev->portnum; in usb_port_runtime_suspend()
425 if (dev_pm_qos_flags(&port_dev->dev, PM_QOS_FLAG_NO_POWER_OFF) in usb_port_runtime_suspend()
438 if (!port_dev->is_superspeed) in usb_port_runtime_suspend()
447 if (!port_dev->is_superspeed && peer) in usb_port_runtime_suspend()
456 struct usb_port *port_dev = to_usb_port(dev); in usb_port_shutdown() local
457 struct usb_device *udev = port_dev->child; in usb_port_shutdown()
612 struct usb_port *port_dev = p, *peer; in match_location() local
614 struct usb_device *hdev = to_usb_device(port_dev->dev.parent->parent); in match_location()
616 if (!peer_hub || port_dev->connect_type == USB_PORT_NOT_USED) in match_location()
628 peer->location == port_dev->location) { in match_location()
629 link_peers_report(port_dev, peer); in match_location()
644 struct usb_port *port_dev = hub->ports[port1 - 1], *peer; in find_and_link_peer() local
655 if (port_dev->location) { in find_and_link_peer()
657 usb_for_each_dev(port_dev, match_location); in find_and_link_peer()
692 link_peers_report(port_dev, peer); in find_and_link_peer()
697 struct usb_port *port_dev = to_usb_port(dev); in connector_bind() local
710 port_dev->connector = data; in connector_bind()
716 if (port_dev->child) in connector_bind()
717 typec_attach(port_dev->connector, &port_dev->child->dev); in connector_bind()
724 struct usb_port *port_dev = to_usb_port(dev); in connector_unbind() local
728 port_dev->connector = NULL; in connector_unbind()
738 struct usb_port *port_dev; in usb_hub_create_port_device() local
742 port_dev = kzalloc(sizeof(*port_dev), GFP_KERNEL); in usb_hub_create_port_device()
743 if (!port_dev) in usb_hub_create_port_device()
746 port_dev->req = kzalloc(sizeof(*(port_dev->req)), GFP_KERNEL); in usb_hub_create_port_device()
747 if (!port_dev->req) { in usb_hub_create_port_device()
748 kfree(port_dev); in usb_hub_create_port_device()
752 port_dev->connect_type = usb_of_get_connect_type(hdev, port1); in usb_hub_create_port_device()
753 hub->ports[port1 - 1] = port_dev; in usb_hub_create_port_device()
754 port_dev->portnum = port1; in usb_hub_create_port_device()
756 port_dev->dev.parent = hub->intfdev; in usb_hub_create_port_device()
758 port_dev->is_superspeed = 1; in usb_hub_create_port_device()
759 port_dev->usb3_lpm_u1_permit = 1; in usb_hub_create_port_device()
760 port_dev->usb3_lpm_u2_permit = 1; in usb_hub_create_port_device()
761 port_dev->dev.groups = port_dev_usb3_group; in usb_hub_create_port_device()
763 port_dev->dev.groups = port_dev_group; in usb_hub_create_port_device()
764 port_dev->dev.type = &usb_port_device_type; in usb_hub_create_port_device()
765 port_dev->dev.driver = &usb_port_driver; in usb_hub_create_port_device()
766 dev_set_name(&port_dev->dev, "%s-port%d", dev_name(&hub->hdev->dev), in usb_hub_create_port_device()
768 mutex_init(&port_dev->status_lock); in usb_hub_create_port_device()
769 retval = device_register(&port_dev->dev); in usb_hub_create_port_device()
771 put_device(&port_dev->dev); in usb_hub_create_port_device()
775 port_dev->state_kn = sysfs_get_dirent(port_dev->dev.kobj.sd, "state"); in usb_hub_create_port_device()
776 if (!port_dev->state_kn) { in usb_hub_create_port_device()
777 dev_err(&port_dev->dev, "failed to sysfs_get_dirent 'state'\n"); in usb_hub_create_port_device()
783 retval = dev_pm_qos_add_request(&port_dev->dev, port_dev->req, in usb_hub_create_port_device()
789 retval = component_add(&port_dev->dev, &connector_ops); in usb_hub_create_port_device()
791 dev_warn(&port_dev->dev, "failed to add component\n"); in usb_hub_create_port_device()
802 pm_runtime_set_active(&port_dev->dev); in usb_hub_create_port_device()
803 pm_runtime_get_noresume(&port_dev->dev); in usb_hub_create_port_device()
804 pm_runtime_enable(&port_dev->dev); in usb_hub_create_port_device()
805 device_enable_async_suspend(&port_dev->dev); in usb_hub_create_port_device()
815 retval = dev_pm_qos_expose_flags(&port_dev->dev, in usb_hub_create_port_device()
818 dev_warn(&port_dev->dev, "failed to expose pm_qos_no_poweroff\n"); in usb_hub_create_port_device()
823 retval = dev_pm_qos_remove_request(port_dev->req); in usb_hub_create_port_device()
825 kfree(port_dev->req); in usb_hub_create_port_device()
826 port_dev->req = NULL; in usb_hub_create_port_device()
831 sysfs_put(port_dev->state_kn); in usb_hub_create_port_device()
833 device_unregister(&port_dev->dev); in usb_hub_create_port_device()
840 struct usb_port *port_dev = hub->ports[port1 - 1]; in usb_hub_remove_port_device() local
843 peer = port_dev->peer; in usb_hub_remove_port_device()
845 unlink_peers(port_dev, peer); in usb_hub_remove_port_device()
846 component_del(&port_dev->dev, &connector_ops); in usb_hub_remove_port_device()
847 sysfs_put(port_dev->state_kn); in usb_hub_remove_port_device()
848 device_unregister(&port_dev->dev); in usb_hub_remove_port_device()