Lines Matching refs:port_dev
470 struct usb_port *port_dev = hub->ports[port1 - 1]; in set_port_led() local
475 dev_dbg(&port_dev->dev, "indicator %s status %d\n", in set_port_led()
704 struct usb_port *port_dev; in usb_wakeup_notification() local
711 port_dev = hub->ports[portnum - 1]; in usb_wakeup_notification()
712 if (port_dev && port_dev->child) in usb_wakeup_notification()
713 pm_wakeup_event(&port_dev->child->dev, 0); in usb_wakeup_notification()
1128 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_activate() local
1129 struct usb_device *udev = port_dev->child; in hub_activate()
1138 dev_dbg(&port_dev->dev, "status %04x change %04x\n", in hub_activate()
1671 struct usb_port *port_dev = hub->ports[i]; in hub_configure() local
1673 pm_runtime_put(&port_dev->dev); in hub_configure()
2210 struct usb_port *port_dev = NULL; in usb_disconnect() local
2244 port_dev = hub->ports[port1 - 1]; in usb_disconnect()
2247 sysfs_remove_link(&port_dev->dev.kobj, "device"); in usb_disconnect()
2254 pm_runtime_get_sync(&port_dev->dev); in usb_disconnect()
2276 if (port_dev && test_and_clear_bit(port1, hub->child_usage_bits)) in usb_disconnect()
2277 pm_runtime_put(&port_dev->dev); in usb_disconnect()
2586 struct usb_port *port_dev = hub->ports[port1 - 1]; in usb_new_device() local
2589 &port_dev->dev.kobj, "port"); in usb_new_device()
2593 err = sysfs_create_link(&port_dev->dev.kobj, in usb_new_device()
2601 pm_runtime_get_sync(&port_dev->dev); in usb_new_device()
2802 struct usb_port *port_dev) in use_new_scheme() argument
2805 (port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME) || in use_new_scheme()
2951 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_reset() local
2985 dev_err(&port_dev->dev, in hub_port_reset()
3035 dev_dbg(&port_dev->dev, in hub_port_reset()
3041 dev_dbg(&port_dev->dev, in hub_port_reset()
3047 dev_err(&port_dev->dev, "Cannot enable. Maybe the USB cable is bad?\n"); in hub_port_reset()
3051 if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM) in hub_port_reset()
3103 static void usb_lock_port(struct usb_port *port_dev) in usb_lock_port() argument
3104 __acquires(&port_dev->status_lock) in usb_lock_port()
3106 mutex_lock(&port_dev->status_lock); in usb_lock_port()
3107 __acquire(&port_dev->status_lock); in usb_lock_port()
3110 static void usb_unlock_port(struct usb_port *port_dev) in usb_unlock_port() argument
3111 __releases(&port_dev->status_lock) in usb_unlock_port()
3113 mutex_unlock(&port_dev->status_lock); in usb_unlock_port()
3114 __release(&port_dev->status_lock); in usb_unlock_port()
3143 struct usb_port *port_dev = hub->ports[port1 - 1]; in check_port_resume_type() local
3178 dev_dbg(&port_dev->dev, "status %04x.%04x after resume, %d\n", in check_port_resume_type()
3358 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_suspend() local
3363 usb_lock_port(port_dev); in usb_port_suspend()
3426 dev_dbg(&port_dev->dev, in usb_port_suspend()
3435 dev_dbg(&port_dev->dev, "can't suspend, status %d\n", status); in usb_port_suspend()
3466 pm_runtime_put_sync(&port_dev->dev); in usb_port_suspend()
3470 usb_unlock_port(port_dev); in usb_port_suspend()
3650 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_resume() local
3656 status = pm_runtime_resume_and_get(&port_dev->dev); in usb_port_resume()
3664 usb_lock_port(port_dev); in usb_port_resume()
3681 dev_dbg(&port_dev->dev, "can't resume, status %d\n", status); in usb_port_resume()
3731 usb_unlock_port(port_dev); in usb_port_resume()
3756 __must_hold(&port_dev->status_lock) in hub_handle_remote_wakeup()
3758 struct usb_port *port_dev = hub->ports[port - 1]; in hub_handle_remote_wakeup() local
3766 udev = port_dev->child; in hub_handle_remote_wakeup()
3784 usb_unlock_port(port_dev); in hub_handle_remote_wakeup()
3786 usb_lock_port(port_dev); in hub_handle_remote_wakeup()
3793 dev_dbg(&port_dev->dev, "resume, status %d\n", ret); in hub_handle_remote_wakeup()
3824 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_suspend() local
3825 struct usb_device *udev = port_dev->child; in hub_suspend()
3828 dev_warn(&port_dev->dev, "device %s not suspended yet\n", in hub_suspend()
4365 struct usb_port *port_dev; in usb_enable_lpm() local
4389 port_dev = hub->ports[udev->portnum - 1]; in usb_enable_lpm()
4391 if (port_dev->usb3_lpm_u1_permit) in usb_enable_lpm()
4394 if (port_dev->usb3_lpm_u2_permit) in usb_enable_lpm()
4415 struct usb_port *port_dev) in hub_usb3_port_prepare_disable() argument
4417 struct usb_device *udev = port_dev->child; in hub_usb3_port_prepare_disable()
4421 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_usb3_port_prepare_disable()
4441 struct usb_port *port_dev) { } in hub_usb3_port_prepare_disable() argument
4490 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_disable() local
4496 hub_usb3_port_prepare_disable(hub, port_dev); in hub_port_disable()
4497 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_port_disable()
4504 if (port_dev->child && set_state) in hub_port_disable()
4505 usb_set_device_state(port_dev->child, USB_STATE_NOTATTACHED); in hub_port_disable()
4507 dev_err(&port_dev->dev, "cannot disable (err = %d)\n", ret); in hub_port_disable()
4546 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_debounce() local
4575 dev_dbg(&port_dev->dev, "debounce total %dms stable %dms status 0x%x\n", in hub_port_debounce()
4681 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_init() local
4799 do_new_scheme = use_new_scheme(udev, retry_counter, port_dev); in hub_port_init()
5063 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_power_remaining() local
5064 struct usb_device *udev = port_dev->child; in hub_power_remaining()
5086 dev_warn(&port_dev->dev, "%dmA is over %umA budget!\n", in hub_power_remaining()
5191 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect() local
5192 struct usb_device *udev = port_dev->child; in hub_port_connect()
5200 usb_disconnect(&port_dev->child); in hub_port_connect()
5217 dev_err(&port_dev->dev, "connect-debounce failed\n"); in hub_port_connect()
5237 && !port_dev->port_owner) in hub_port_connect()
5252 usb_lock_port(port_dev); in hub_port_connect()
5260 dev_err(&port_dev->dev, in hub_port_connect()
5263 usb_unlock_port(port_dev); in hub_port_connect()
5290 usb_unlock_port(port_dev); in hub_port_connect()
5350 port_dev->child = udev; in hub_port_connect()
5360 port_dev->child = NULL; in hub_port_connect()
5387 usb_unlock_port(port_dev); in hub_port_connect()
5395 dev_info(&port_dev->dev, "attempt power cycle\n"); in hub_port_connect()
5406 dev_err(&port_dev->dev, in hub_port_connect()
5428 __must_hold(&port_dev->status_lock) in hub_port_connect_change()
5430 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect_change() local
5431 struct usb_device *udev = port_dev->child; in hub_port_connect_change()
5436 dev_dbg(&port_dev->dev, "status %04x, change %04x, %s\n", portstatus, in hub_port_connect_change()
5485 usb_unlock_port(port_dev); in hub_port_connect_change()
5487 usb_lock_port(port_dev); in hub_port_connect_change()
5499 usb_unlock_port(port_dev); in hub_port_connect_change()
5501 usb_lock_port(port_dev); in hub_port_connect_change()
5505 static void port_over_current_notify(struct usb_port *port_dev) in port_over_current_notify() argument
5511 sysfs_notify(&port_dev->dev.kobj, NULL, "over_current_count"); in port_over_current_notify()
5513 hub_dev = port_dev->dev.parent; in port_over_current_notify()
5518 port_dev_path = kobject_get_path(&port_dev->dev.kobj, GFP_KERNEL); in port_over_current_notify()
5527 port_dev->over_current_count); in port_over_current_notify()
5540 __must_hold(&port_dev->status_lock) in port_event()
5543 struct usb_port *port_dev = hub->ports[port1 - 1]; in port_event() local
5544 struct usb_device *udev = port_dev->child; in port_event()
5563 dev_dbg(&port_dev->dev, "enable change, status %08x\n", in port_event()
5574 dev_err(&port_dev->dev, "disabled by hub (EMI?), re-enabling...\n"); in port_event()
5581 port_dev->over_current_count++; in port_event()
5582 port_over_current_notify(port_dev); in port_event()
5584 dev_dbg(&port_dev->dev, "over-current change #%u\n", in port_event()
5585 port_dev->over_current_count); in port_event()
5592 dev_err(&port_dev->dev, "over-current condition\n"); in port_event()
5596 dev_dbg(&port_dev->dev, "reset change\n"); in port_event()
5601 dev_dbg(&port_dev->dev, "warm reset change\n"); in port_event()
5606 dev_dbg(&port_dev->dev, "link state change\n"); in port_event()
5611 dev_warn(&port_dev->dev, "config error\n"); in port_event()
5617 if (!pm_runtime_active(&port_dev->dev)) in port_event()
5635 dev_dbg(&port_dev->dev, "Wait for inactive link disconnect detect\n"); in port_event()
5639 dev_dbg(&port_dev->dev, "do warm reset, port only\n"); in port_event()
5644 dev_dbg(&port_dev->dev, "do warm reset, full device\n"); in port_event()
5645 usb_unlock_port(port_dev); in port_event()
5649 usb_lock_port(port_dev); in port_event()
5721 struct usb_port *port_dev = hub->ports[i - 1]; in hub_event() local
5735 pm_runtime_get_noresume(&port_dev->dev); in hub_event()
5736 pm_runtime_barrier(&port_dev->dev); in hub_event()
5737 usb_lock_port(port_dev); in hub_event()
5739 usb_unlock_port(port_dev); in hub_event()
5740 pm_runtime_put_sync(&port_dev->dev); in hub_event()
6076 struct usb_port *port_dev; in usb_reset_device() local
6096 port_dev = hub->ports[udev->portnum - 1]; in usb_reset_device()
6131 usb_lock_port(port_dev); in usb_reset_device()
6133 usb_unlock_port(port_dev); in usb_reset_device()
6237 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6239 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6244 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()
6253 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6255 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6260 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()