Lines Matching full:port_dev
493 struct usb_port *port_dev = hub->ports[port1 - 1]; in set_port_led() local
498 dev_dbg(&port_dev->dev, "indicator %s status %d\n", in set_port_led()
755 struct usb_port *port_dev; in usb_wakeup_notification() local
762 port_dev = hub->ports[portnum - 1]; in usb_wakeup_notification()
763 if (port_dev && port_dev->child) in usb_wakeup_notification()
764 pm_wakeup_event(&port_dev->child->dev, 0); in usb_wakeup_notification()
1180 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_activate() local
1181 struct usb_device *udev = port_dev->child; in hub_activate()
1190 dev_dbg(&port_dev->dev, "status %04x change %04x\n", in hub_activate()
1743 struct usb_port *port_dev = hub->ports[i]; in hub_configure() local
1745 pm_runtime_put(&port_dev->dev); in hub_configure()
2126 struct usb_port *port_dev; in update_port_device_state() local
2139 port_dev = hub->ports[udev->portnum - 1]; in update_port_device_state()
2140 WRITE_ONCE(port_dev->state, udev->state); in update_port_device_state()
2141 sysfs_notify_dirent(port_dev->state_kn); in update_port_device_state()
2317 struct usb_port *port_dev = NULL; in usb_disconnect() local
2351 port_dev = hub->ports[port1 - 1]; in usb_disconnect()
2354 sysfs_remove_link(&port_dev->dev.kobj, "device"); in usb_disconnect()
2361 pm_runtime_get_sync(&port_dev->dev); in usb_disconnect()
2363 typec_deattach(port_dev->connector, &udev->dev); in usb_disconnect()
2388 if (port_dev && test_and_clear_bit(port1, hub->child_usage_bits)) in usb_disconnect()
2389 pm_runtime_put(&port_dev->dev); in usb_disconnect()
2705 struct usb_port *port_dev = hub->ports[port1 - 1]; in usb_new_device() local
2708 &port_dev->dev.kobj, "port"); in usb_new_device()
2712 err = sysfs_create_link(&port_dev->dev.kobj, in usb_new_device()
2720 pm_runtime_get_sync(&port_dev->dev); in usb_new_device()
2722 typec_attach(port_dev->connector, &udev->dev); in usb_new_device()
2908 struct usb_port *port_dev) in use_new_scheme() argument
2911 (port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME) || in use_new_scheme()
3055 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_reset() local
3089 dev_err(&port_dev->dev, in hub_port_reset()
3139 dev_dbg(&port_dev->dev, in hub_port_reset()
3145 dev_dbg(&port_dev->dev, in hub_port_reset()
3151 dev_err(&port_dev->dev, "Cannot enable. Maybe the USB cable is bad?\n"); in hub_port_reset()
3155 if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM) in hub_port_reset()
3211 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_stop_enumerate() local
3213 if (port_dev->early_stop) { in hub_port_stop_enumerate()
3214 if (port_dev->ignore_event) in hub_port_stop_enumerate()
3226 port_dev->ignore_event = 1; in hub_port_stop_enumerate()
3228 port_dev->ignore_event = 0; in hub_port_stop_enumerate()
3230 return port_dev->ignore_event; in hub_port_stop_enumerate()
3249 static void usb_lock_port(struct usb_port *port_dev) in usb_lock_port() argument
3250 __acquires(&port_dev->status_lock) in usb_lock_port()
3252 mutex_lock(&port_dev->status_lock); in usb_lock_port()
3253 __acquire(&port_dev->status_lock); in usb_lock_port()
3256 static void usb_unlock_port(struct usb_port *port_dev) in usb_unlock_port() argument
3257 __releases(&port_dev->status_lock) in usb_unlock_port()
3259 mutex_unlock(&port_dev->status_lock); in usb_unlock_port()
3260 __release(&port_dev->status_lock); in usb_unlock_port()
3289 struct usb_port *port_dev = hub->ports[port1 - 1]; in check_port_resume_type() local
3324 dev_dbg(&port_dev->dev, "status %04x.%04x after resume, %d\n", in check_port_resume_type()
3504 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_suspend() local
3509 usb_lock_port(port_dev); in usb_port_suspend()
3572 dev_dbg(&port_dev->dev, in usb_port_suspend()
3581 dev_dbg(&port_dev->dev, "can't suspend, status %d\n", status); in usb_port_suspend()
3612 pm_runtime_put_sync(&port_dev->dev); in usb_port_suspend()
3616 usb_unlock_port(port_dev); in usb_port_suspend()
3796 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_resume() local
3802 status = pm_runtime_resume_and_get(&port_dev->dev); in usb_port_resume()
3810 usb_lock_port(port_dev); in usb_port_resume()
3827 dev_dbg(&port_dev->dev, "can't resume, status %d\n", status); in usb_port_resume()
3877 usb_unlock_port(port_dev); in usb_port_resume()
3902 __must_hold(&port_dev->status_lock) in hub_handle_remote_wakeup()
3904 struct usb_port *port_dev = hub->ports[port - 1]; in hub_handle_remote_wakeup() local
3912 udev = port_dev->child; in hub_handle_remote_wakeup()
3930 usb_unlock_port(port_dev); in hub_handle_remote_wakeup()
3932 usb_lock_port(port_dev); in hub_handle_remote_wakeup()
3939 dev_dbg(&port_dev->dev, "resume, status %d\n", ret); in hub_handle_remote_wakeup()
3970 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_suspend() local
3971 struct usb_device *udev = port_dev->child; in hub_suspend()
3974 dev_warn(&port_dev->dev, "device %s not suspended yet\n", in hub_suspend()
4507 struct usb_port *port_dev; in usb_enable_lpm() local
4531 port_dev = hub->ports[udev->portnum - 1]; in usb_enable_lpm()
4533 if (port_dev->usb3_lpm_u1_permit) in usb_enable_lpm()
4537 if (port_dev->usb3_lpm_u2_permit) in usb_enable_lpm()
4571 struct usb_port *port_dev) in hub_usb3_port_prepare_disable() argument
4573 struct usb_device *udev = port_dev->child; in hub_usb3_port_prepare_disable()
4577 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_usb3_port_prepare_disable()
4597 struct usb_port *port_dev) { } in hub_usb3_port_prepare_disable() argument
4646 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_disable() local
4652 hub_usb3_port_prepare_disable(hub, port_dev); in hub_port_disable()
4653 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_port_disable()
4660 if (port_dev->child && set_state) in hub_port_disable()
4661 usb_set_device_state(port_dev->child, USB_STATE_NOTATTACHED); in hub_port_disable()
4663 dev_err(&port_dev->dev, "cannot disable (err = %d)\n", ret); in hub_port_disable()
4702 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_debounce() local
4731 dev_dbg(&port_dev->dev, "debounce total %dms stable %dms status 0x%x\n", in hub_port_debounce()
4907 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_init() local
5030 do_new_scheme = use_new_scheme(udev, retry_counter, port_dev); in hub_port_init()
5270 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_power_remaining() local
5271 struct usb_device *udev = port_dev->child; in hub_power_remaining()
5293 dev_warn(&port_dev->dev, "%dmA is over %umA budget!\n", in hub_power_remaining()
5398 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect() local
5399 struct usb_device *udev = port_dev->child; in hub_port_connect()
5407 usb_disconnect(&port_dev->child); in hub_port_connect()
5424 dev_err(&port_dev->dev, "connect-debounce failed\n"); in hub_port_connect()
5444 && !port_dev->port_owner) in hub_port_connect()
5464 usb_lock_port(port_dev); in hub_port_connect()
5472 dev_err(&port_dev->dev, in hub_port_connect()
5475 usb_unlock_port(port_dev); in hub_port_connect()
5501 usb_unlock_port(port_dev); in hub_port_connect()
5561 port_dev->child = udev; in hub_port_connect()
5571 port_dev->child = NULL; in hub_port_connect()
5598 usb_unlock_port(port_dev); in hub_port_connect()
5606 dev_info(&port_dev->dev, "attempt power cycle\n"); in hub_port_connect()
5617 dev_err(&port_dev->dev, in hub_port_connect()
5639 __must_hold(&port_dev->status_lock) in hub_port_connect_change()
5641 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect_change() local
5642 struct usb_device *udev = port_dev->child; in hub_port_connect_change()
5646 dev_dbg(&port_dev->dev, "status %04x, change %04x, %s\n", portstatus, in hub_port_connect_change()
5692 usb_unlock_port(port_dev); in hub_port_connect_change()
5694 usb_lock_port(port_dev); in hub_port_connect_change()
5706 usb_unlock_port(port_dev); in hub_port_connect_change()
5708 usb_lock_port(port_dev); in hub_port_connect_change()
5712 static void port_over_current_notify(struct usb_port *port_dev) in port_over_current_notify() argument
5718 sysfs_notify(&port_dev->dev.kobj, NULL, "over_current_count"); in port_over_current_notify()
5720 hub_dev = port_dev->dev.parent; in port_over_current_notify()
5725 port_dev_path = kobject_get_path(&port_dev->dev.kobj, GFP_KERNEL); in port_over_current_notify()
5734 port_dev->over_current_count); in port_over_current_notify()
5747 __must_hold(&port_dev->status_lock) in port_event()
5750 struct usb_port *port_dev = hub->ports[port1 - 1]; in port_event() local
5751 struct usb_device *udev = port_dev->child; in port_event()
5771 dev_dbg(&port_dev->dev, "enable change, status %08x\n", in port_event()
5782 dev_err(&port_dev->dev, "disabled by hub (EMI?), re-enabling...\n"); in port_event()
5789 port_dev->over_current_count++; in port_event()
5790 port_over_current_notify(port_dev); in port_event()
5792 dev_dbg(&port_dev->dev, "over-current change #%u\n", in port_event()
5793 port_dev->over_current_count); in port_event()
5800 dev_err(&port_dev->dev, "over-current condition\n"); in port_event()
5804 dev_dbg(&port_dev->dev, "reset change\n"); in port_event()
5809 dev_dbg(&port_dev->dev, "warm reset change\n"); in port_event()
5814 dev_dbg(&port_dev->dev, "link state change\n"); in port_event()
5819 dev_warn(&port_dev->dev, "config error\n"); in port_event()
5825 if (!pm_runtime_active(&port_dev->dev)) in port_event()
5829 if (port_dev->ignore_event && port_dev->early_stop) in port_event()
5847 dev_dbg(&port_dev->dev, "Wait for inactive link disconnect detect\n"); in port_event()
5851 dev_dbg(&port_dev->dev, "do warm reset, port only\n"); in port_event()
5859 dev_dbg(&port_dev->dev, "do warm reset, full device\n"); in port_event()
5860 usb_unlock_port(port_dev); in port_event()
5864 usb_lock_port(port_dev); in port_event()
5936 struct usb_port *port_dev = hub->ports[i - 1]; in hub_event() local
5950 pm_runtime_get_noresume(&port_dev->dev); in hub_event()
5951 pm_runtime_barrier(&port_dev->dev); in hub_event()
5952 usb_lock_port(port_dev); in hub_event()
5954 usb_unlock_port(port_dev); in hub_event()
5955 pm_runtime_put_sync(&port_dev->dev); in hub_event()
6354 struct usb_port *port_dev; in usb_reset_device() local
6374 port_dev = hub->ports[udev->portnum - 1]; in usb_reset_device()
6409 usb_lock_port(port_dev); in usb_reset_device()
6411 usb_unlock_port(port_dev); in usb_reset_device()
6515 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6517 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6522 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()
6531 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6533 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6538 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()