Lines Matching refs:udev
56 int usb_choose_configuration(struct usb_device *udev) in usb_choose_configuration() argument
63 if (usb_device_is_owned(udev)) in usb_choose_configuration()
67 c = udev->config; in usb_choose_configuration()
68 num_configs = udev->descriptor.bNumConfigurations; in usb_choose_configuration()
116 if (usb_get_max_power(udev, c) > udev->bus_mA) { in usb_choose_configuration()
164 else if (udev->descriptor.bDeviceClass != in usb_choose_configuration()
179 dev_info(&udev->dev, "rejected %d configuration%s " in usb_choose_configuration()
185 dev_dbg(&udev->dev, in usb_choose_configuration()
190 dev_warn(&udev->dev, in usb_choose_configuration()
200 struct usb_device *udev = data; in __check_for_non_generic_match() local
208 return usb_driver_applicable(udev, udrv); in __check_for_non_generic_match()
211 static bool usb_generic_driver_match(struct usb_device *udev) in usb_generic_driver_match() argument
213 if (udev->use_generic_driver) in usb_generic_driver_match()
220 if (bus_for_each_drv(&usb_bus_type, NULL, udev, __check_for_non_generic_match)) in usb_generic_driver_match()
226 int usb_generic_driver_probe(struct usb_device *udev) in usb_generic_driver_probe() argument
233 if (udev->authorized == 0) in usb_generic_driver_probe()
234 dev_err(&udev->dev, "Device is not authorized for usage\n"); in usb_generic_driver_probe()
236 c = usb_choose_configuration(udev); in usb_generic_driver_probe()
238 err = usb_set_configuration(udev, c); in usb_generic_driver_probe()
240 dev_err(&udev->dev, "can't set config #%d, error %d\n", in usb_generic_driver_probe()
248 usb_notify_add_device(udev); in usb_generic_driver_probe()
253 void usb_generic_driver_disconnect(struct usb_device *udev) in usb_generic_driver_disconnect() argument
255 usb_notify_remove_device(udev); in usb_generic_driver_disconnect()
259 if (udev->actconfig) in usb_generic_driver_disconnect()
260 usb_set_configuration(udev, -1); in usb_generic_driver_disconnect()
265 int usb_generic_driver_suspend(struct usb_device *udev, pm_message_t msg) in usb_generic_driver_suspend() argument
274 if (!udev->parent) in usb_generic_driver_suspend()
275 rc = hcd_bus_suspend(udev, msg); in usb_generic_driver_suspend()
283 && (udev->speed < USB_SPEED_SUPER)) in usb_generic_driver_suspend()
286 rc = usb_port_suspend(udev, msg); in usb_generic_driver_suspend()
289 usbfs_notify_suspend(udev); in usb_generic_driver_suspend()
293 int usb_generic_driver_resume(struct usb_device *udev, pm_message_t msg) in usb_generic_driver_resume() argument
302 if (!udev->parent) in usb_generic_driver_resume()
303 rc = hcd_bus_resume(udev, msg); in usb_generic_driver_resume()
305 rc = usb_port_resume(udev, msg); in usb_generic_driver_resume()
308 usbfs_notify_resume(udev); in usb_generic_driver_resume()