• Home
  • Raw
  • Download

Lines Matching refs:gadget

48 	struct usb_gadget		*gadget;  member
441 int usb_gadget_frame_number(struct usb_gadget *gadget) in usb_gadget_frame_number() argument
445 ret = gadget->ops->get_frame(gadget); in usb_gadget_frame_number()
447 trace_usb_gadget_frame_number(gadget, ret); in usb_gadget_frame_number()
466 int usb_gadget_wakeup(struct usb_gadget *gadget) in usb_gadget_wakeup() argument
470 if (!gadget->ops->wakeup) { in usb_gadget_wakeup()
475 ret = gadget->ops->wakeup(gadget); in usb_gadget_wakeup()
478 trace_usb_gadget_wakeup(gadget, ret); in usb_gadget_wakeup()
493 int usb_gadget_set_selfpowered(struct usb_gadget *gadget) in usb_gadget_set_selfpowered() argument
497 if (!gadget->ops->set_selfpowered) { in usb_gadget_set_selfpowered()
502 ret = gadget->ops->set_selfpowered(gadget, 1); in usb_gadget_set_selfpowered()
505 trace_usb_gadget_set_selfpowered(gadget, ret); in usb_gadget_set_selfpowered()
521 int usb_gadget_clear_selfpowered(struct usb_gadget *gadget) in usb_gadget_clear_selfpowered() argument
525 if (!gadget->ops->set_selfpowered) { in usb_gadget_clear_selfpowered()
530 ret = gadget->ops->set_selfpowered(gadget, 0); in usb_gadget_clear_selfpowered()
533 trace_usb_gadget_clear_selfpowered(gadget, ret); in usb_gadget_clear_selfpowered()
552 int usb_gadget_vbus_connect(struct usb_gadget *gadget) in usb_gadget_vbus_connect() argument
556 if (!gadget->ops->vbus_session) { in usb_gadget_vbus_connect()
561 ret = gadget->ops->vbus_session(gadget, 1); in usb_gadget_vbus_connect()
564 trace_usb_gadget_vbus_connect(gadget, ret); in usb_gadget_vbus_connect()
582 int usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) in usb_gadget_vbus_draw() argument
586 if (!gadget->ops->vbus_draw) { in usb_gadget_vbus_draw()
591 ret = gadget->ops->vbus_draw(gadget, mA); in usb_gadget_vbus_draw()
593 gadget->mA = mA; in usb_gadget_vbus_draw()
596 trace_usb_gadget_vbus_draw(gadget, ret); in usb_gadget_vbus_draw()
613 int usb_gadget_vbus_disconnect(struct usb_gadget *gadget) in usb_gadget_vbus_disconnect() argument
617 if (!gadget->ops->vbus_session) { in usb_gadget_vbus_disconnect()
622 ret = gadget->ops->vbus_session(gadget, 0); in usb_gadget_vbus_disconnect()
625 trace_usb_gadget_vbus_disconnect(gadget, ret); in usb_gadget_vbus_disconnect()
642 int usb_gadget_connect(struct usb_gadget *gadget) in usb_gadget_connect() argument
646 if (!gadget->ops->pullup) { in usb_gadget_connect()
651 if (gadget->deactivated) { in usb_gadget_connect()
656 gadget->connected = true; in usb_gadget_connect()
660 ret = gadget->ops->pullup(gadget, 1); in usb_gadget_connect()
662 gadget->connected = 1; in usb_gadget_connect()
665 trace_usb_gadget_connect(gadget, ret); in usb_gadget_connect()
681 int usb_gadget_disconnect(struct usb_gadget *gadget) in usb_gadget_disconnect() argument
685 if (!gadget->ops->pullup) { in usb_gadget_disconnect()
690 if (gadget->deactivated) { in usb_gadget_disconnect()
695 gadget->connected = false; in usb_gadget_disconnect()
699 ret = gadget->ops->pullup(gadget, 0); in usb_gadget_disconnect()
701 gadget->connected = 0; in usb_gadget_disconnect()
704 trace_usb_gadget_disconnect(gadget, ret); in usb_gadget_disconnect()
721 int usb_gadget_deactivate(struct usb_gadget *gadget) in usb_gadget_deactivate() argument
725 if (gadget->deactivated) in usb_gadget_deactivate()
728 if (gadget->connected) { in usb_gadget_deactivate()
729 ret = usb_gadget_disconnect(gadget); in usb_gadget_deactivate()
737 gadget->connected = true; in usb_gadget_deactivate()
739 gadget->deactivated = true; in usb_gadget_deactivate()
742 trace_usb_gadget_deactivate(gadget, ret); in usb_gadget_deactivate()
757 int usb_gadget_activate(struct usb_gadget *gadget) in usb_gadget_activate() argument
761 if (!gadget->deactivated) in usb_gadget_activate()
764 gadget->deactivated = false; in usb_gadget_activate()
770 if (gadget->connected) in usb_gadget_activate()
771 ret = usb_gadget_connect(gadget); in usb_gadget_activate()
774 trace_usb_gadget_activate(gadget, ret); in usb_gadget_activate()
815 int usb_gadget_map_request(struct usb_gadget *gadget, in usb_gadget_map_request() argument
818 return usb_gadget_map_request_by_dev(gadget->dev.parent, req, is_in); in usb_gadget_map_request()
840 void usb_gadget_unmap_request(struct usb_gadget *gadget, in usb_gadget_unmap_request() argument
843 usb_gadget_unmap_request_by_dev(gadget->dev.parent, req, is_in); in usb_gadget_unmap_request()
893 int usb_gadget_ep_match_desc(struct usb_gadget *gadget, in usb_gadget_ep_match_desc() argument
917 if (!gadget_is_dualspeed(gadget) && usb_endpoint_maxp_mult(desc) > 1) in usb_gadget_ep_match_desc()
928 if (!gadget_is_dualspeed(gadget) && max > 1023) in usb_gadget_ep_match_desc()
934 if (ep_comp && gadget_is_superspeed(gadget)) { in usb_gadget_ep_match_desc()
951 if (!gadget_is_dualspeed(gadget) && max > 64) in usb_gadget_ep_match_desc()
964 struct usb_gadget *gadget = work_to_gadget(work); in usb_gadget_state_work() local
965 struct usb_udc *udc = gadget->udc; in usb_gadget_state_work()
971 void usb_gadget_set_state(struct usb_gadget *gadget, in usb_gadget_set_state() argument
974 gadget->state = state; in usb_gadget_set_state()
975 schedule_work(&gadget->work); in usb_gadget_set_state()
984 usb_gadget_connect(udc->gadget); in usb_udc_connect_control()
986 usb_gadget_disconnect(udc->gadget); in usb_udc_connect_control()
998 void usb_udc_vbus_handler(struct usb_gadget *gadget, bool status) in usb_udc_vbus_handler() argument
1000 struct usb_udc *udc = gadget->udc; in usb_udc_vbus_handler()
1018 void usb_gadget_udc_reset(struct usb_gadget *gadget, in usb_gadget_udc_reset() argument
1021 driver->reset(gadget); in usb_gadget_udc_reset()
1022 usb_gadget_set_state(gadget, USB_STATE_DEFAULT); in usb_gadget_udc_reset()
1041 return udc->gadget->ops->udc_start(udc->gadget, udc->driver); in usb_gadget_udc_start()
1058 udc->gadget->ops->udc_stop(udc->gadget); in usb_gadget_udc_stop()
1111 int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget, in usb_add_gadget_udc_release() argument
1121 dev_set_name(&gadget->dev, "gadget"); in usb_add_gadget_udc_release()
1122 INIT_WORK(&gadget->work, usb_gadget_state_work); in usb_add_gadget_udc_release()
1123 gadget->dev.parent = parent; in usb_add_gadget_udc_release()
1126 gadget->dev.release = release; in usb_add_gadget_udc_release()
1128 gadget->dev.release = usb_udc_nop_release; in usb_add_gadget_udc_release()
1130 ret = device_register(&gadget->dev); in usb_add_gadget_udc_release()
1143 udc->gadget = gadget; in usb_add_gadget_udc_release()
1144 gadget->udc = udc; in usb_add_gadget_udc_release()
1153 usb_gadget_set_state(gadget, USB_STATE_NOTATTACHED); in usb_add_gadget_udc_release()
1174 device_del(&gadget->dev); in usb_add_gadget_udc_release()
1177 put_device(&gadget->dev); in usb_add_gadget_udc_release()
1206 name = kstrdup(udc->gadget->name, GFP_KERNEL); in usb_get_gadget_udc_name()
1223 int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget) in usb_add_gadget_udc() argument
1225 return usb_add_gadget_udc_release(parent, gadget, NULL); in usb_add_gadget_udc()
1236 usb_gadget_disconnect(udc->gadget); in usb_gadget_remove_driver()
1237 udc->driver->disconnect(udc->gadget); in usb_gadget_remove_driver()
1238 udc->driver->unbind(udc->gadget); in usb_gadget_remove_driver()
1243 udc->gadget->dev.driver = NULL; in usb_gadget_remove_driver()
1253 void usb_del_gadget_udc(struct usb_gadget *gadget) in usb_del_gadget_udc() argument
1255 struct usb_udc *udc = gadget->udc; in usb_del_gadget_udc()
1260 dev_vdbg(gadget->dev.parent, "unregistering gadget\n"); in usb_del_gadget_udc()
1274 flush_work(&gadget->work); in usb_del_gadget_udc()
1276 device_unregister(&gadget->dev); in usb_del_gadget_udc()
1291 udc->gadget->dev.driver = &driver->driver; in udc_bind_to_driver()
1293 ret = driver->bind(udc->gadget, driver); in udc_bind_to_driver()
1298 driver->unbind(udc->gadget); in udc_bind_to_driver()
1311 udc->gadget->dev.driver = NULL; in udc_bind_to_driver()
1372 usb_gadget_set_state(udc->gadget, in usb_gadget_unregister_driver()
1403 usb_gadget_wakeup(udc->gadget); in usb_udc_srp_store()
1421 usb_gadget_connect(udc->gadget); in usb_udc_softconn_store()
1423 usb_gadget_disconnect(udc->gadget); in usb_udc_softconn_store()
1424 udc->driver->disconnect(udc->gadget); in usb_udc_softconn_store()
1439 struct usb_gadget *gadget = udc->gadget; in state_show() local
1441 return sprintf(buf, "%s\n", usb_state_string(gadget->state)); in state_show()
1451 usb_speed_string(udc->gadget->param)); \
1463 struct usb_gadget *gadget = udc->gadget; \
1465 return snprintf(buf, PAGE_SIZE, "%d\n", gadget->name); \
1506 ret = add_uevent_var(env, "USB_UDC_NAME=%s", udc->gadget->name); in usb_udc_uevent()