Lines Matching refs:port_dev

497 	struct usb_port *port_dev = hub->ports[port1 - 1];  in set_port_led()  local
502 dev_dbg(&port_dev->dev, "indicator %s status %d\n", in set_port_led()
759 struct usb_port *port_dev; in usb_wakeup_notification() local
766 port_dev = hub->ports[portnum - 1]; in usb_wakeup_notification()
767 if (port_dev && port_dev->child) in usb_wakeup_notification()
768 pm_wakeup_event(&port_dev->child->dev, 0); in usb_wakeup_notification()
1184 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_activate() local
1185 struct usb_device *udev = port_dev->child; in hub_activate()
1194 dev_dbg(&port_dev->dev, "status %04x change %04x\n", in hub_activate()
1747 struct usb_port *port_dev = hub->ports[i]; in hub_configure() local
1749 pm_runtime_put(&port_dev->dev); in hub_configure()
2130 struct usb_port *port_dev; in update_port_device_state() local
2143 port_dev = hub->ports[udev->portnum - 1]; in update_port_device_state()
2144 WRITE_ONCE(port_dev->state, udev->state); in update_port_device_state()
2145 sysfs_notify_dirent(port_dev->state_kn); in update_port_device_state()
2316 struct usb_port *port_dev = NULL; in usb_disconnect() local
2350 port_dev = hub->ports[port1 - 1]; in usb_disconnect()
2353 sysfs_remove_link(&port_dev->dev.kobj, "device"); in usb_disconnect()
2360 pm_runtime_get_sync(&port_dev->dev); in usb_disconnect()
2362 typec_deattach(port_dev->connector, &udev->dev); in usb_disconnect()
2387 if (port_dev && test_and_clear_bit(port1, hub->child_usage_bits)) in usb_disconnect()
2388 pm_runtime_put(&port_dev->dev); in usb_disconnect()
2704 struct usb_port *port_dev = hub->ports[port1 - 1]; in usb_new_device() local
2707 &port_dev->dev.kobj, "port"); in usb_new_device()
2711 err = sysfs_create_link(&port_dev->dev.kobj, in usb_new_device()
2719 pm_runtime_get_sync(&port_dev->dev); in usb_new_device()
2721 typec_attach(port_dev->connector, &udev->dev); in usb_new_device()
2907 struct usb_port *port_dev) in use_new_scheme() argument
2910 (port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME) || in use_new_scheme()
3054 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_reset() local
3088 dev_err(&port_dev->dev, in hub_port_reset()
3138 dev_dbg(&port_dev->dev, in hub_port_reset()
3144 dev_dbg(&port_dev->dev, in hub_port_reset()
3150 dev_err(&port_dev->dev, "Cannot enable. Maybe the USB cable is bad?\n"); in hub_port_reset()
3154 if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM) in hub_port_reset()
3210 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_stop_enumerate() local
3212 if (port_dev->early_stop) { in hub_port_stop_enumerate()
3213 if (port_dev->ignore_event) in hub_port_stop_enumerate()
3225 port_dev->ignore_event = 1; in hub_port_stop_enumerate()
3227 port_dev->ignore_event = 0; in hub_port_stop_enumerate()
3229 return port_dev->ignore_event; in hub_port_stop_enumerate()
3248 static void usb_lock_port(struct usb_port *port_dev) in usb_lock_port() argument
3249 __acquires(&port_dev->status_lock) in usb_lock_port()
3251 mutex_lock(&port_dev->status_lock); in usb_lock_port()
3252 __acquire(&port_dev->status_lock); in usb_lock_port()
3255 static void usb_unlock_port(struct usb_port *port_dev) in usb_unlock_port() argument
3256 __releases(&port_dev->status_lock) in usb_unlock_port()
3258 mutex_unlock(&port_dev->status_lock); in usb_unlock_port()
3259 __release(&port_dev->status_lock); in usb_unlock_port()
3288 struct usb_port *port_dev = hub->ports[port1 - 1]; in check_port_resume_type() local
3323 dev_dbg(&port_dev->dev, "status %04x.%04x after resume, %d\n", in check_port_resume_type()
3503 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_suspend() local
3508 usb_lock_port(port_dev); in usb_port_suspend()
3571 dev_dbg(&port_dev->dev, in usb_port_suspend()
3580 dev_dbg(&port_dev->dev, "can't suspend, status %d\n", status); in usb_port_suspend()
3611 pm_runtime_put_sync(&port_dev->dev); in usb_port_suspend()
3615 usb_unlock_port(port_dev); in usb_port_suspend()
3795 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_resume() local
3801 status = pm_runtime_resume_and_get(&port_dev->dev); in usb_port_resume()
3809 usb_lock_port(port_dev); in usb_port_resume()
3826 dev_dbg(&port_dev->dev, "can't resume, status %d\n", status); in usb_port_resume()
3876 usb_unlock_port(port_dev); in usb_port_resume()
3901 __must_hold(&port_dev->status_lock) in hub_handle_remote_wakeup()
3903 struct usb_port *port_dev = hub->ports[port - 1]; in hub_handle_remote_wakeup() local
3911 udev = port_dev->child; in hub_handle_remote_wakeup()
3929 usb_unlock_port(port_dev); in hub_handle_remote_wakeup()
3931 usb_lock_port(port_dev); in hub_handle_remote_wakeup()
3938 dev_dbg(&port_dev->dev, "resume, status %d\n", ret); in hub_handle_remote_wakeup()
3969 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_suspend() local
3970 struct usb_device *udev = port_dev->child; in hub_suspend()
3973 dev_warn(&port_dev->dev, "device %s not suspended yet\n", in hub_suspend()
4506 struct usb_port *port_dev; in usb_enable_lpm() local
4530 port_dev = hub->ports[udev->portnum - 1]; in usb_enable_lpm()
4532 if (port_dev->usb3_lpm_u1_permit) in usb_enable_lpm()
4536 if (port_dev->usb3_lpm_u2_permit) in usb_enable_lpm()
4570 struct usb_port *port_dev) in hub_usb3_port_prepare_disable() argument
4572 struct usb_device *udev = port_dev->child; in hub_usb3_port_prepare_disable()
4576 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_usb3_port_prepare_disable()
4596 struct usb_port *port_dev) { } in hub_usb3_port_prepare_disable() argument
4645 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_disable() local
4651 hub_usb3_port_prepare_disable(hub, port_dev); in hub_port_disable()
4652 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_port_disable()
4659 if (port_dev->child && set_state) in hub_port_disable()
4660 usb_set_device_state(port_dev->child, USB_STATE_NOTATTACHED); in hub_port_disable()
4662 dev_err(&port_dev->dev, "cannot disable (err = %d)\n", ret); in hub_port_disable()
4701 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_debounce() local
4730 dev_dbg(&port_dev->dev, "debounce total %dms stable %dms status 0x%x\n", in hub_port_debounce()
4906 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_init() local
5029 do_new_scheme = use_new_scheme(udev, retry_counter, port_dev); in hub_port_init()
5269 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_power_remaining() local
5270 struct usb_device *udev = port_dev->child; in hub_power_remaining()
5292 dev_warn(&port_dev->dev, "%dmA is over %umA budget!\n", in hub_power_remaining()
5397 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect() local
5398 struct usb_device *udev = port_dev->child; in hub_port_connect()
5406 usb_disconnect(&port_dev->child); in hub_port_connect()
5423 dev_err(&port_dev->dev, "connect-debounce failed\n"); in hub_port_connect()
5443 && !port_dev->port_owner) in hub_port_connect()
5463 usb_lock_port(port_dev); in hub_port_connect()
5471 dev_err(&port_dev->dev, in hub_port_connect()
5474 usb_unlock_port(port_dev); in hub_port_connect()
5500 usb_unlock_port(port_dev); in hub_port_connect()
5560 port_dev->child = udev; in hub_port_connect()
5570 port_dev->child = NULL; in hub_port_connect()
5597 usb_unlock_port(port_dev); in hub_port_connect()
5605 dev_info(&port_dev->dev, "attempt power cycle\n"); in hub_port_connect()
5616 dev_err(&port_dev->dev, in hub_port_connect()
5638 __must_hold(&port_dev->status_lock) in hub_port_connect_change()
5640 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect_change() local
5641 struct usb_device *udev = port_dev->child; in hub_port_connect_change()
5645 dev_dbg(&port_dev->dev, "status %04x, change %04x, %s\n", portstatus, in hub_port_connect_change()
5691 usb_unlock_port(port_dev); in hub_port_connect_change()
5693 usb_lock_port(port_dev); in hub_port_connect_change()
5705 usb_unlock_port(port_dev); in hub_port_connect_change()
5707 usb_lock_port(port_dev); in hub_port_connect_change()
5711 static void port_over_current_notify(struct usb_port *port_dev) in port_over_current_notify() argument
5717 sysfs_notify(&port_dev->dev.kobj, NULL, "over_current_count"); in port_over_current_notify()
5719 hub_dev = port_dev->dev.parent; in port_over_current_notify()
5724 port_dev_path = kobject_get_path(&port_dev->dev.kobj, GFP_KERNEL); in port_over_current_notify()
5733 port_dev->over_current_count); in port_over_current_notify()
5746 __must_hold(&port_dev->status_lock) in port_event()
5749 struct usb_port *port_dev = hub->ports[port1 - 1]; in port_event() local
5750 struct usb_device *udev = port_dev->child; in port_event()
5770 dev_dbg(&port_dev->dev, "enable change, status %08x\n", in port_event()
5781 dev_err(&port_dev->dev, "disabled by hub (EMI?), re-enabling...\n"); in port_event()
5788 port_dev->over_current_count++; in port_event()
5789 port_over_current_notify(port_dev); in port_event()
5791 dev_dbg(&port_dev->dev, "over-current change #%u\n", in port_event()
5792 port_dev->over_current_count); in port_event()
5799 dev_err(&port_dev->dev, "over-current condition\n"); in port_event()
5803 dev_dbg(&port_dev->dev, "reset change\n"); in port_event()
5808 dev_dbg(&port_dev->dev, "warm reset change\n"); in port_event()
5813 dev_dbg(&port_dev->dev, "link state change\n"); in port_event()
5818 dev_warn(&port_dev->dev, "config error\n"); in port_event()
5824 if (!pm_runtime_active(&port_dev->dev)) in port_event()
5828 if (port_dev->ignore_event && port_dev->early_stop) in port_event()
5846 dev_dbg(&port_dev->dev, "Wait for inactive link disconnect detect\n"); in port_event()
5850 dev_dbg(&port_dev->dev, "do warm reset, port only\n"); in port_event()
5858 dev_dbg(&port_dev->dev, "do warm reset, full device\n"); in port_event()
5859 usb_unlock_port(port_dev); in port_event()
5863 usb_lock_port(port_dev); in port_event()
5935 struct usb_port *port_dev = hub->ports[i - 1]; in hub_event() local
5949 pm_runtime_get_noresume(&port_dev->dev); in hub_event()
5950 pm_runtime_barrier(&port_dev->dev); in hub_event()
5951 usb_lock_port(port_dev); in hub_event()
5953 usb_unlock_port(port_dev); in hub_event()
5954 pm_runtime_put_sync(&port_dev->dev); in hub_event()
6353 struct usb_port *port_dev; in usb_reset_device() local
6373 port_dev = hub->ports[udev->portnum - 1]; in usb_reset_device()
6408 usb_lock_port(port_dev); in usb_reset_device()
6410 usb_unlock_port(port_dev); in usb_reset_device()
6514 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6516 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6521 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()
6530 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6532 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6537 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()