Lines Matching refs:port_dev
478 struct usb_port *port_dev = hub->ports[port1 - 1]; in set_port_led() local
483 dev_dbg(&port_dev->dev, "indicator %s status %d\n", in set_port_led()
735 struct usb_port *port_dev; in usb_wakeup_notification() local
742 port_dev = hub->ports[portnum - 1]; in usb_wakeup_notification()
743 if (port_dev && port_dev->child) in usb_wakeup_notification()
744 pm_wakeup_event(&port_dev->child->dev, 0); in usb_wakeup_notification()
1159 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_activate() local
1160 struct usb_device *udev = port_dev->child; in hub_activate()
1169 dev_dbg(&port_dev->dev, "status %04x change %04x\n", in hub_activate()
1702 struct usb_port *port_dev = hub->ports[i]; in hub_configure() local
1704 pm_runtime_put(&port_dev->dev); in hub_configure()
2055 struct usb_port *port_dev; in update_port_device_state() local
2059 port_dev = hub->ports[udev->portnum - 1]; in update_port_device_state()
2060 WRITE_ONCE(port_dev->state, udev->state); in update_port_device_state()
2061 sysfs_notify_dirent(port_dev->state_kn); in update_port_device_state()
2232 struct usb_port *port_dev = NULL; in usb_disconnect() local
2266 port_dev = hub->ports[port1 - 1]; in usb_disconnect()
2269 sysfs_remove_link(&port_dev->dev.kobj, "device"); in usb_disconnect()
2276 pm_runtime_get_sync(&port_dev->dev); in usb_disconnect()
2298 if (port_dev && test_and_clear_bit(port1, hub->child_usage_bits)) in usb_disconnect()
2299 pm_runtime_put(&port_dev->dev); in usb_disconnect()
2607 struct usb_port *port_dev = hub->ports[port1 - 1]; in usb_new_device() local
2610 &port_dev->dev.kobj, "port"); in usb_new_device()
2614 err = sysfs_create_link(&port_dev->dev.kobj, in usb_new_device()
2622 pm_runtime_get_sync(&port_dev->dev); in usb_new_device()
2806 struct usb_port *port_dev) in use_new_scheme() argument
2809 (port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME) || in use_new_scheme()
2953 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_reset() local
2987 dev_err(&port_dev->dev, in hub_port_reset()
3037 dev_dbg(&port_dev->dev, in hub_port_reset()
3043 dev_dbg(&port_dev->dev, in hub_port_reset()
3049 dev_err(&port_dev->dev, "Cannot enable. Maybe the USB cable is bad?\n"); in hub_port_reset()
3053 if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM) in hub_port_reset()
3109 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_stop_enumerate() local
3111 if (port_dev->early_stop) { in hub_port_stop_enumerate()
3112 if (port_dev->ignore_event) in hub_port_stop_enumerate()
3124 port_dev->ignore_event = 1; in hub_port_stop_enumerate()
3126 port_dev->ignore_event = 0; in hub_port_stop_enumerate()
3128 return port_dev->ignore_event; in hub_port_stop_enumerate()
3147 static void usb_lock_port(struct usb_port *port_dev) in usb_lock_port() argument
3148 __acquires(&port_dev->status_lock) in usb_lock_port()
3150 mutex_lock(&port_dev->status_lock); in usb_lock_port()
3151 __acquire(&port_dev->status_lock); in usb_lock_port()
3154 static void usb_unlock_port(struct usb_port *port_dev) in usb_unlock_port() argument
3155 __releases(&port_dev->status_lock) in usb_unlock_port()
3157 mutex_unlock(&port_dev->status_lock); in usb_unlock_port()
3158 __release(&port_dev->status_lock); in usb_unlock_port()
3187 struct usb_port *port_dev = hub->ports[port1 - 1]; in check_port_resume_type() local
3222 dev_dbg(&port_dev->dev, "status %04x.%04x after resume, %d\n", in check_port_resume_type()
3402 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_suspend() local
3407 usb_lock_port(port_dev); in usb_port_suspend()
3470 dev_dbg(&port_dev->dev, in usb_port_suspend()
3479 dev_dbg(&port_dev->dev, "can't suspend, status %d\n", status); in usb_port_suspend()
3510 pm_runtime_put_sync(&port_dev->dev); in usb_port_suspend()
3514 usb_unlock_port(port_dev); in usb_port_suspend()
3694 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_resume() local
3700 status = pm_runtime_resume_and_get(&port_dev->dev); in usb_port_resume()
3708 usb_lock_port(port_dev); in usb_port_resume()
3725 dev_dbg(&port_dev->dev, "can't resume, status %d\n", status); in usb_port_resume()
3775 usb_unlock_port(port_dev); in usb_port_resume()
3800 __must_hold(&port_dev->status_lock) in hub_handle_remote_wakeup()
3802 struct usb_port *port_dev = hub->ports[port - 1]; in hub_handle_remote_wakeup() local
3810 udev = port_dev->child; in hub_handle_remote_wakeup()
3828 usb_unlock_port(port_dev); in hub_handle_remote_wakeup()
3830 usb_lock_port(port_dev); in hub_handle_remote_wakeup()
3837 dev_dbg(&port_dev->dev, "resume, status %d\n", ret); in hub_handle_remote_wakeup()
3868 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_suspend() local
3869 struct usb_device *udev = port_dev->child; in hub_suspend()
3872 dev_warn(&port_dev->dev, "device %s not suspended yet\n", in hub_suspend()
4416 struct usb_port *port_dev; in usb_enable_lpm() local
4440 port_dev = hub->ports[udev->portnum - 1]; in usb_enable_lpm()
4442 if (port_dev->usb3_lpm_u1_permit) in usb_enable_lpm()
4445 if (port_dev->usb3_lpm_u2_permit) in usb_enable_lpm()
4466 struct usb_port *port_dev) in hub_usb3_port_prepare_disable() argument
4468 struct usb_device *udev = port_dev->child; in hub_usb3_port_prepare_disable()
4472 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_usb3_port_prepare_disable()
4492 struct usb_port *port_dev) { } in hub_usb3_port_prepare_disable() argument
4541 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_disable() local
4547 hub_usb3_port_prepare_disable(hub, port_dev); in hub_port_disable()
4548 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_port_disable()
4555 if (port_dev->child && set_state) in hub_port_disable()
4556 usb_set_device_state(port_dev->child, USB_STATE_NOTATTACHED); in hub_port_disable()
4558 dev_err(&port_dev->dev, "cannot disable (err = %d)\n", ret); in hub_port_disable()
4597 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_debounce() local
4626 dev_dbg(&port_dev->dev, "debounce total %dms stable %dms status 0x%x\n", in hub_port_debounce()
4800 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_init() local
4923 do_new_scheme = use_new_scheme(udev, retry_counter, port_dev); in hub_port_init()
5162 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_power_remaining() local
5163 struct usb_device *udev = port_dev->child; in hub_power_remaining()
5185 dev_warn(&port_dev->dev, "%dmA is over %umA budget!\n", in hub_power_remaining()
5290 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect() local
5291 struct usb_device *udev = port_dev->child; in hub_port_connect()
5299 usb_disconnect(&port_dev->child); in hub_port_connect()
5316 dev_err(&port_dev->dev, "connect-debounce failed\n"); in hub_port_connect()
5336 && !port_dev->port_owner) in hub_port_connect()
5356 usb_lock_port(port_dev); in hub_port_connect()
5364 dev_err(&port_dev->dev, in hub_port_connect()
5367 usb_unlock_port(port_dev); in hub_port_connect()
5393 usb_unlock_port(port_dev); in hub_port_connect()
5453 port_dev->child = udev; in hub_port_connect()
5463 port_dev->child = NULL; in hub_port_connect()
5490 usb_unlock_port(port_dev); in hub_port_connect()
5498 dev_info(&port_dev->dev, "attempt power cycle\n"); in hub_port_connect()
5509 dev_err(&port_dev->dev, in hub_port_connect()
5531 __must_hold(&port_dev->status_lock) in hub_port_connect_change()
5533 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect_change() local
5534 struct usb_device *udev = port_dev->child; in hub_port_connect_change()
5538 dev_dbg(&port_dev->dev, "status %04x, change %04x, %s\n", portstatus, in hub_port_connect_change()
5584 usb_unlock_port(port_dev); in hub_port_connect_change()
5586 usb_lock_port(port_dev); in hub_port_connect_change()
5598 usb_unlock_port(port_dev); in hub_port_connect_change()
5600 usb_lock_port(port_dev); in hub_port_connect_change()
5604 static void port_over_current_notify(struct usb_port *port_dev) in port_over_current_notify() argument
5610 sysfs_notify(&port_dev->dev.kobj, NULL, "over_current_count"); in port_over_current_notify()
5612 hub_dev = port_dev->dev.parent; in port_over_current_notify()
5617 port_dev_path = kobject_get_path(&port_dev->dev.kobj, GFP_KERNEL); in port_over_current_notify()
5626 port_dev->over_current_count); in port_over_current_notify()
5639 __must_hold(&port_dev->status_lock) in port_event()
5642 struct usb_port *port_dev = hub->ports[port1 - 1]; in port_event() local
5643 struct usb_device *udev = port_dev->child; in port_event()
5662 dev_dbg(&port_dev->dev, "enable change, status %08x\n", in port_event()
5673 dev_err(&port_dev->dev, "disabled by hub (EMI?), re-enabling...\n"); in port_event()
5680 port_dev->over_current_count++; in port_event()
5681 port_over_current_notify(port_dev); in port_event()
5683 dev_dbg(&port_dev->dev, "over-current change #%u\n", in port_event()
5684 port_dev->over_current_count); in port_event()
5691 dev_err(&port_dev->dev, "over-current condition\n"); in port_event()
5695 dev_dbg(&port_dev->dev, "reset change\n"); in port_event()
5700 dev_dbg(&port_dev->dev, "warm reset change\n"); in port_event()
5705 dev_dbg(&port_dev->dev, "link state change\n"); in port_event()
5710 dev_warn(&port_dev->dev, "config error\n"); in port_event()
5716 if (!pm_runtime_active(&port_dev->dev)) in port_event()
5720 if (port_dev->ignore_event && port_dev->early_stop) in port_event()
5738 dev_dbg(&port_dev->dev, "Wait for inactive link disconnect detect\n"); in port_event()
5742 dev_dbg(&port_dev->dev, "do warm reset, port only\n"); in port_event()
5747 dev_dbg(&port_dev->dev, "do warm reset, full device\n"); in port_event()
5748 usb_unlock_port(port_dev); in port_event()
5752 usb_lock_port(port_dev); in port_event()
5824 struct usb_port *port_dev = hub->ports[i - 1]; in hub_event() local
5838 pm_runtime_get_noresume(&port_dev->dev); in hub_event()
5839 pm_runtime_barrier(&port_dev->dev); in hub_event()
5840 usb_lock_port(port_dev); in hub_event()
5842 usb_unlock_port(port_dev); in hub_event()
5843 pm_runtime_put_sync(&port_dev->dev); in hub_event()
6182 struct usb_port *port_dev; in usb_reset_device() local
6202 port_dev = hub->ports[udev->portnum - 1]; in usb_reset_device()
6237 usb_lock_port(port_dev); in usb_reset_device()
6239 usb_unlock_port(port_dev); in usb_reset_device()
6343 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6345 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6350 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()
6359 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6361 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6366 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()