Lines Matching refs:port_dev
466 struct usb_port *port_dev = hub->ports[port1 - 1]; in set_port_led() local
471 dev_dbg(&port_dev->dev, "indicator %s status %d\n", in set_port_led()
700 struct usb_port *port_dev; in usb_wakeup_notification() local
707 port_dev = hub->ports[portnum - 1]; in usb_wakeup_notification()
708 if (port_dev && port_dev->child) in usb_wakeup_notification()
709 pm_wakeup_event(&port_dev->child->dev, 0); in usb_wakeup_notification()
1121 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_activate() local
1122 struct usb_device *udev = port_dev->child; in hub_activate()
1131 dev_dbg(&port_dev->dev, "status %04x change %04x\n", in hub_activate()
1664 struct usb_port *port_dev = hub->ports[i]; in hub_configure() local
1666 pm_runtime_put(&port_dev->dev); in hub_configure()
2197 struct usb_port *port_dev = NULL; in usb_disconnect() local
2231 port_dev = hub->ports[port1 - 1]; in usb_disconnect()
2234 sysfs_remove_link(&port_dev->dev.kobj, "device"); in usb_disconnect()
2241 pm_runtime_get_sync(&port_dev->dev); in usb_disconnect()
2263 if (port_dev && test_and_clear_bit(port1, hub->child_usage_bits)) in usb_disconnect()
2264 pm_runtime_put(&port_dev->dev); in usb_disconnect()
2573 struct usb_port *port_dev = hub->ports[port1 - 1]; in usb_new_device() local
2576 &port_dev->dev.kobj, "port"); in usb_new_device()
2580 err = sysfs_create_link(&port_dev->dev.kobj, in usb_new_device()
2588 pm_runtime_get_sync(&port_dev->dev); in usb_new_device()
2787 struct usb_port *port_dev) in use_new_scheme() argument
2790 (port_dev->quirks & USB_PORT_QUIRK_OLD_SCHEME) || in use_new_scheme()
2936 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_reset() local
2969 dev_err(&port_dev->dev, in hub_port_reset()
3015 dev_dbg(&port_dev->dev, in hub_port_reset()
3021 dev_dbg(&port_dev->dev, in hub_port_reset()
3027 dev_err(&port_dev->dev, "Cannot enable. Maybe the USB cable is bad?\n"); in hub_port_reset()
3031 if (port_dev->quirks & USB_PORT_QUIRK_FAST_ENUM) in hub_port_reset()
3083 static void usb_lock_port(struct usb_port *port_dev) in usb_lock_port() argument
3084 __acquires(&port_dev->status_lock) in usb_lock_port()
3086 mutex_lock(&port_dev->status_lock); in usb_lock_port()
3087 __acquire(&port_dev->status_lock); in usb_lock_port()
3090 static void usb_unlock_port(struct usb_port *port_dev) in usb_unlock_port() argument
3091 __releases(&port_dev->status_lock) in usb_unlock_port()
3093 mutex_unlock(&port_dev->status_lock); in usb_unlock_port()
3094 __release(&port_dev->status_lock); in usb_unlock_port()
3123 struct usb_port *port_dev = hub->ports[port1 - 1]; in check_port_resume_type() local
3158 dev_dbg(&port_dev->dev, "status %04x.%04x after resume, %d\n", in check_port_resume_type()
3338 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_suspend() local
3343 usb_lock_port(port_dev); in usb_port_suspend()
3406 dev_dbg(&port_dev->dev, in usb_port_suspend()
3415 dev_dbg(&port_dev->dev, "can't suspend, status %d\n", status); in usb_port_suspend()
3446 pm_runtime_put_sync(&port_dev->dev); in usb_port_suspend()
3450 usb_unlock_port(port_dev); in usb_port_suspend()
3630 struct usb_port *port_dev = hub->ports[udev->portnum - 1]; in usb_port_resume() local
3636 status = pm_runtime_resume_and_get(&port_dev->dev); in usb_port_resume()
3644 usb_lock_port(port_dev); in usb_port_resume()
3661 dev_dbg(&port_dev->dev, "can't resume, status %d\n", status); in usb_port_resume()
3711 usb_unlock_port(port_dev); in usb_port_resume()
3736 __must_hold(&port_dev->status_lock) in hub_handle_remote_wakeup()
3738 struct usb_port *port_dev = hub->ports[port - 1]; in hub_handle_remote_wakeup() local
3746 udev = port_dev->child; in hub_handle_remote_wakeup()
3764 usb_unlock_port(port_dev); in hub_handle_remote_wakeup()
3766 usb_lock_port(port_dev); in hub_handle_remote_wakeup()
3773 dev_dbg(&port_dev->dev, "resume, status %d\n", ret); in hub_handle_remote_wakeup()
3804 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_suspend() local
3805 struct usb_device *udev = port_dev->child; in hub_suspend()
3808 dev_warn(&port_dev->dev, "device %s not suspended yet\n", in hub_suspend()
4369 struct usb_port *port_dev; in usb_enable_lpm() local
4393 port_dev = hub->ports[udev->portnum - 1]; in usb_enable_lpm()
4395 if (port_dev->usb3_lpm_u1_permit) in usb_enable_lpm()
4398 if (port_dev->usb3_lpm_u2_permit) in usb_enable_lpm()
4419 struct usb_port *port_dev) in hub_usb3_port_prepare_disable() argument
4421 struct usb_device *udev = port_dev->child; in hub_usb3_port_prepare_disable()
4425 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_usb3_port_prepare_disable()
4445 struct usb_port *port_dev) { } in hub_usb3_port_prepare_disable() argument
4489 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_disable() local
4495 hub_usb3_port_prepare_disable(hub, port_dev); in hub_port_disable()
4496 ret = hub_set_port_link_state(hub, port_dev->portnum, in hub_port_disable()
4503 if (port_dev->child && set_state) in hub_port_disable()
4504 usb_set_device_state(port_dev->child, USB_STATE_NOTATTACHED); in hub_port_disable()
4506 dev_err(&port_dev->dev, "cannot disable (err = %d)\n", ret); in hub_port_disable()
4545 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_debounce() local
4574 dev_dbg(&port_dev->dev, "debounce total %dms stable %dms status 0x%x\n", in hub_port_debounce()
4680 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_init() local
4800 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()
5199 usb_disconnect(&port_dev->child); in hub_port_connect()
5216 dev_err(&port_dev->dev, "connect-debounce failed\n"); in hub_port_connect()
5236 && !port_dev->port_owner) in hub_port_connect()
5256 dev_err(&port_dev->dev, in hub_port_connect()
5279 usb_lock_port(port_dev); in hub_port_connect()
5281 usb_unlock_port(port_dev); in hub_port_connect()
5342 port_dev->child = udev; in hub_port_connect()
5352 port_dev->child = NULL; in hub_port_connect()
5383 dev_info(&port_dev->dev, "attempt power cycle\n"); in hub_port_connect()
5394 dev_err(&port_dev->dev, in hub_port_connect()
5416 __must_hold(&port_dev->status_lock) in hub_port_connect_change()
5418 struct usb_port *port_dev = hub->ports[port1 - 1]; in hub_port_connect_change() local
5419 struct usb_device *udev = port_dev->child; in hub_port_connect_change()
5424 dev_dbg(&port_dev->dev, "status %04x, change %04x, %s\n", portstatus, in hub_port_connect_change()
5473 usb_unlock_port(port_dev); in hub_port_connect_change()
5475 usb_lock_port(port_dev); in hub_port_connect_change()
5487 usb_unlock_port(port_dev); in hub_port_connect_change()
5489 usb_lock_port(port_dev); in hub_port_connect_change()
5493 static void port_over_current_notify(struct usb_port *port_dev) in port_over_current_notify() argument
5499 sysfs_notify(&port_dev->dev.kobj, NULL, "over_current_count"); in port_over_current_notify()
5501 hub_dev = port_dev->dev.parent; in port_over_current_notify()
5506 port_dev_path = kobject_get_path(&port_dev->dev.kobj, GFP_KERNEL); in port_over_current_notify()
5515 port_dev->over_current_count); in port_over_current_notify()
5530 __must_hold(&port_dev->status_lock) in port_event()
5533 struct usb_port *port_dev = hub->ports[port1 - 1]; in port_event() local
5534 struct usb_device *udev = port_dev->child; in port_event()
5552 dev_dbg(&port_dev->dev, "enable change, status %08x\n", in port_event()
5563 dev_err(&port_dev->dev, "disabled by hub (EMI?), re-enabling...\n"); in port_event()
5570 port_dev->over_current_count++; in port_event()
5571 port_over_current_notify(port_dev); in port_event()
5573 dev_dbg(&port_dev->dev, "over-current change #%u\n", in port_event()
5574 port_dev->over_current_count); in port_event()
5581 dev_err(&port_dev->dev, "over-current condition\n"); in port_event()
5585 dev_dbg(&port_dev->dev, "reset change\n"); in port_event()
5590 dev_dbg(&port_dev->dev, "warm reset change\n"); in port_event()
5595 dev_dbg(&port_dev->dev, "link state change\n"); in port_event()
5600 dev_warn(&port_dev->dev, "config error\n"); in port_event()
5606 if (!pm_runtime_active(&port_dev->dev)) in port_event()
5617 dev_dbg(&port_dev->dev, "do warm reset\n"); in port_event()
5624 usb_unlock_port(port_dev); in port_event()
5628 usb_lock_port(port_dev); in port_event()
5699 struct usb_port *port_dev = hub->ports[i - 1]; in hub_event() local
5713 pm_runtime_get_noresume(&port_dev->dev); in hub_event()
5714 pm_runtime_barrier(&port_dev->dev); in hub_event()
5715 usb_lock_port(port_dev); in hub_event()
5717 usb_unlock_port(port_dev); in hub_event()
5718 pm_runtime_put_sync(&port_dev->dev); in hub_event()
6048 struct usb_port *port_dev; in usb_reset_device() local
6064 port_dev = hub->ports[udev->portnum - 1]; in usb_reset_device()
6099 usb_lock_port(port_dev); in usb_reset_device()
6101 usb_unlock_port(port_dev); in usb_reset_device()
6204 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6206 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6211 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()
6220 struct usb_port *port_dev = hub->ports[i - 1]; in usb_hub_adjust_deviceremovable() local
6222 connect_type = port_dev->connect_type; in usb_hub_adjust_deviceremovable()
6227 … dev_dbg(&port_dev->dev, "DeviceRemovable is changed to 1 according to platform information.\n"); in usb_hub_adjust_deviceremovable()