Lines Matching refs:port_dev
459 struct usb_port *port_dev = hub->ports[port1 - 1]; in set_port_led() local
464 dev_dbg(&port_dev->dev, "indicator %s status %d\n", in set_port_led()
693 struct usb_port *port_dev; in usb_wakeup_notification() local
700 port_dev = hub->ports[portnum - 1]; in usb_wakeup_notification()
701 if (port_dev && port_dev->child) in usb_wakeup_notification()
702 pm_wakeup_event(&port_dev->child->dev, 0); in usb_wakeup_notification()
1114 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_activate() local
1115 struct usb_device *udev = port_dev->child; in hub_activate()
1124 dev_dbg(&port_dev->dev, "status %04x change %04x\n", in hub_activate()
1657 struct usb_port *port_dev = hub->ports[i]; in hub_configure() local
1659 pm_runtime_put(&port_dev->dev); in hub_configure()
2189 struct usb_port *port_dev = NULL; in usb_disconnect() local
2223 port_dev = hub->ports[port1 - 1]; in usb_disconnect()
2226 sysfs_remove_link(&port_dev->dev.kobj, "device"); in usb_disconnect()
2233 pm_runtime_get_sync(&port_dev->dev); in usb_disconnect()
2255 if (port_dev && test_and_clear_bit(port1, hub->child_usage_bits)) in usb_disconnect()
2256 pm_runtime_put(&port_dev->dev); in usb_disconnect()
2564 struct usb_port *port_dev = hub->ports[port1 - 1]; in usb_new_device() local
2567 &port_dev->dev.kobj, "port"); in usb_new_device()
2571 err = sysfs_create_link(&port_dev->dev.kobj, in usb_new_device()
2579 pm_runtime_get_sync(&port_dev->dev); in usb_new_device()
2730 struct usb_port *port_dev) in use_new_scheme() argument
2733 (port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME) || in use_new_scheme()
2879 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_reset() local
2912 dev_err(&port_dev->dev, in hub_port_reset()
2958 dev_dbg(&port_dev->dev, in hub_port_reset()
2964 dev_dbg(&port_dev->dev, in hub_port_reset()
2970 dev_err(&port_dev->dev, "Cannot enable. Maybe the USB cable is bad?\n"); in hub_port_reset()
2974 if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM) in hub_port_reset()
3026 static void usb_lock_port(struct usb_port *port_dev) in usb_lock_port() argument
3027 __acquires(&port_dev->status_lock) in usb_lock_port()
3029 mutex_lock(&port_dev->status_lock); in usb_lock_port()
3030 __acquire(&port_dev->status_lock); in usb_lock_port()
3033 static void usb_unlock_port(struct usb_port *port_dev) in usb_unlock_port() argument
3034 __releases(&port_dev->status_lock) in usb_unlock_port()
3036 mutex_unlock(&port_dev->status_lock); in usb_unlock_port()
3037 __release(&port_dev->status_lock); in usb_unlock_port()
3066 struct usb_port *port_dev = hub->ports[port1 - 1]; in check_port_resume_type() local
3101 dev_dbg(&port_dev->dev, "status %04x.%04x after resume, %d\n", in check_port_resume_type()
3281 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_suspend() local
3286 usb_lock_port(port_dev); in usb_port_suspend()
3338 dev_dbg(&port_dev->dev, "can't suspend, status %d\n", status); in usb_port_suspend()
3368 pm_runtime_put_sync(&port_dev->dev); in usb_port_suspend()
3372 usb_unlock_port(port_dev); in usb_port_suspend()
3552 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_resume() local
3558 status = pm_runtime_get_sync(&port_dev->dev); in usb_port_resume()
3566 usb_lock_port(port_dev); in usb_port_resume()
3583 dev_dbg(&port_dev->dev, "can't resume, status %d\n", status); in usb_port_resume()
3633 usb_unlock_port(port_dev); in usb_port_resume()
3658 __must_hold(&port_dev->status_lock) in hub_handle_remote_wakeup()
3660 struct usb_port *port_dev = hub->ports[port - 1]; in hub_handle_remote_wakeup() local
3668 udev = port_dev->child; in hub_handle_remote_wakeup()
3686 usb_unlock_port(port_dev); in hub_handle_remote_wakeup()
3688 usb_lock_port(port_dev); in hub_handle_remote_wakeup()
3695 dev_dbg(&port_dev->dev, "resume, status %d\n", ret); in hub_handle_remote_wakeup()
3726 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_suspend() local
3727 struct usb_device *udev = port_dev->child; in hub_suspend()
3730 dev_warn(&port_dev->dev, "device %s not suspended yet\n", in hub_suspend()
4247 struct usb_port *port_dev; in usb_enable_lpm() local
4271 port_dev = hub->ports[udev->portnum - 1]; in usb_enable_lpm()
4273 if (port_dev->usb3_lpm_u1_permit) in usb_enable_lpm()
4276 if (port_dev->usb3_lpm_u2_permit) in usb_enable_lpm()
4297 struct usb_port *port_dev) in hub_usb3_port_prepare_disable() argument
4299 struct usb_device *udev = port_dev->child; in hub_usb3_port_prepare_disable()
4303 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_usb3_port_prepare_disable()
4323 struct usb_port *port_dev) { } in hub_usb3_port_prepare_disable() argument
4367 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_disable() local
4373 hub_usb3_port_prepare_disable(hub, port_dev); in hub_port_disable()
4374 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_port_disable()
4381 if (port_dev->child && set_state) in hub_port_disable()
4382 usb_set_device_state(port_dev->child, USB_STATE_NOTATTACHED); in hub_port_disable()
4384 dev_err(&port_dev->dev, "cannot disable (err = %d)\n", ret); in hub_port_disable()
4423 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_debounce() local
4452 dev_dbg(&port_dev->dev, "debounce total %dms stable %dms status 0x%x\n", in hub_port_debounce()
4558 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_init() local
4678 do_new_scheme = use_new_scheme(udev, retry_counter, port_dev); in hub_port_init()
4937 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_power_remaining() local
4938 struct usb_device *udev = port_dev->child; in hub_power_remaining()
4960 dev_warn(&port_dev->dev, "%dmA is over %umA budget!\n", in hub_power_remaining()
5065 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect() local
5066 struct usb_device *udev = port_dev->child; in hub_port_connect()
5073 usb_disconnect(&port_dev->child); in hub_port_connect()
5090 dev_err(&port_dev->dev, "connect-debounce failed\n"); in hub_port_connect()
5110 && !port_dev->port_owner) in hub_port_connect()
5130 dev_err(&port_dev->dev, in hub_port_connect()
5153 usb_lock_port(port_dev); in hub_port_connect()
5155 usb_unlock_port(port_dev); in hub_port_connect()
5216 port_dev->child = udev; in hub_port_connect()
5226 port_dev->child = NULL; in hub_port_connect()
5257 dev_info(&port_dev->dev, "attempt power cycle\n"); in hub_port_connect()
5268 dev_err(&port_dev->dev, in hub_port_connect()
5290 __must_hold(&port_dev->status_lock) in hub_port_connect_change()
5292 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect_change() local
5293 struct usb_device *udev = port_dev->child; in hub_port_connect_change()
5298 dev_dbg(&port_dev->dev, "status %04x, change %04x, %s\n", portstatus, in hub_port_connect_change()
5347 usb_unlock_port(port_dev); in hub_port_connect_change()
5349 usb_lock_port(port_dev); in hub_port_connect_change()
5361 usb_unlock_port(port_dev); in hub_port_connect_change()
5363 usb_lock_port(port_dev); in hub_port_connect_change()
5367 static void port_over_current_notify(struct usb_port *port_dev) in port_over_current_notify() argument
5373 sysfs_notify(&port_dev->dev.kobj, NULL, "over_current_count"); in port_over_current_notify()
5375 hub_dev = port_dev->dev.parent; in port_over_current_notify()
5380 port_dev_path = kobject_get_path(&port_dev->dev.kobj, GFP_KERNEL); in port_over_current_notify()
5389 port_dev->over_current_count); in port_over_current_notify()
5404 __must_hold(&port_dev->status_lock) in port_event()
5407 struct usb_port *port_dev = hub->ports[port1 - 1]; in port_event() local
5408 struct usb_device *udev = port_dev->child; in port_event()
5426 dev_dbg(&port_dev->dev, "enable change, status %08x\n", in port_event()
5437 dev_err(&port_dev->dev, "disabled by hub (EMI?), re-enabling...\n"); in port_event()
5444 port_dev->over_current_count++; in port_event()
5445 port_over_current_notify(port_dev); in port_event()
5447 dev_dbg(&port_dev->dev, "over-current change #%u\n", in port_event()
5448 port_dev->over_current_count); in port_event()
5455 dev_err(&port_dev->dev, "over-current condition\n"); in port_event()
5459 dev_dbg(&port_dev->dev, "reset change\n"); in port_event()
5464 dev_dbg(&port_dev->dev, "warm reset change\n"); in port_event()
5469 dev_dbg(&port_dev->dev, "link state change\n"); in port_event()
5474 dev_warn(&port_dev->dev, "config error\n"); in port_event()
5480 if (!pm_runtime_active(&port_dev->dev)) in port_event()
5491 dev_dbg(&port_dev->dev, "do warm reset\n"); in port_event()
5498 usb_unlock_port(port_dev); in port_event()
5502 usb_lock_port(port_dev); in port_event()
5573 struct usb_port *port_dev = hub->ports[i - 1]; in hub_event() local
5587 pm_runtime_get_noresume(&port_dev->dev); in hub_event()
5588 pm_runtime_barrier(&port_dev->dev); in hub_event()
5589 usb_lock_port(port_dev); in hub_event()
5591 usb_unlock_port(port_dev); in hub_event()
5592 pm_runtime_put_sync(&port_dev->dev); in hub_event()
5917 struct usb_port *port_dev; in usb_reset_device() local
5933 port_dev = hub->ports[udev->portnum - 1]; in usb_reset_device()
5968 usb_lock_port(port_dev); in usb_reset_device()
5970 usb_unlock_port(port_dev); in usb_reset_device()
6073 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6075 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6080 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()
6089 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6091 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6096 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()