Lines Matching refs:gadget
166 struct usb_gadget *gadget; member
203 usb_ep_dequeue(dev->gadget->ep0, dev->req); in dev_free()
204 usb_ep_free_request(dev->gadget->ep0, dev->req); in dev_free()
267 static int gadget_bind(struct usb_gadget *gadget, in gadget_bind() argument
276 if (strcmp(gadget->name, dev->udc_name) != 0) in gadget_bind()
279 set_gadget_data(gadget, dev); in gadget_bind()
280 req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL); in gadget_bind()
282 dev_err(&gadget->dev, "usb_ep_alloc_request failed\n"); in gadget_bind()
283 set_gadget_data(gadget, NULL); in gadget_bind()
291 dev->gadget = gadget; in gadget_bind()
292 gadget_for_each_ep(ep, dev->gadget) { in gadget_bind()
306 dev_err(&gadget->dev, "failed to queue event\n"); in gadget_bind()
311 static void gadget_unbind(struct usb_gadget *gadget) in gadget_unbind() argument
313 struct raw_dev *dev = get_gadget_data(gadget); in gadget_unbind()
315 set_gadget_data(gadget, NULL); in gadget_unbind()
320 static int gadget_setup(struct usb_gadget *gadget, in gadget_setup() argument
324 struct raw_dev *dev = get_gadget_data(gadget); in gadget_setup()
329 dev_err(&gadget->dev, "ignoring, device is not running\n"); in gadget_setup()
334 dev_dbg(&gadget->dev, "stalling, request already pending\n"); in gadget_setup()
346 dev_err(&gadget->dev, "failed to queue event\n"); in gadget_setup()
356 static void gadget_disconnect(struct usb_gadget *gadget) { } in gadget_disconnect() argument
357 static void gadget_suspend(struct usb_gadget *gadget) { } in gadget_suspend() argument
358 static void gadget_resume(struct usb_gadget *gadget) { } in gadget_resume() argument
359 static void gadget_reset(struct usb_gadget *gadget) { } in gadget_reset() argument
391 if (!dev->gadget) { in raw_release()
548 if (!dev->gadget) { in raw_ioctl_event_fetch()
557 dev_dbg(&dev->gadget->dev, "event fetching interrupted\n"); in raw_ioctl_event_fetch()
561 dev_err(&dev->gadget->dev, "failed to fetch event\n"); in raw_ioctl_event_fetch()
612 if (!dev->gadget) { in raw_process_ep0_io()
618 dev_dbg(&dev->gadget->dev, "fail, urb already queued\n"); in raw_process_ep0_io()
624 dev_dbg(&dev->gadget->dev, "fail, wrong direction\n"); in raw_process_ep0_io()
645 ret = usb_ep_queue(dev->gadget->ep0, dev->req, GFP_KERNEL); in raw_process_ep0_io()
647 dev_err(&dev->gadget->dev, in raw_process_ep0_io()
656 dev_dbg(&dev->gadget->dev, "wait interrupted\n"); in raw_process_ep0_io()
657 usb_ep_dequeue(dev->gadget->ep0, dev->req); in raw_process_ep0_io()
724 if (!dev->gadget) { in raw_ioctl_ep0_stall()
730 dev_dbg(&dev->gadget->dev, "fail, urb already queued\n"); in raw_ioctl_ep0_stall()
735 dev_dbg(&dev->gadget->dev, "fail, no request pending\n"); in raw_ioctl_ep0_stall()
740 ret = usb_ep_set_halt(dev->gadget->ep0); in raw_ioctl_ep0_stall()
742 dev_err(&dev->gadget->dev, in raw_ioctl_ep0_stall()
782 if (!dev->gadget) { in raw_ioctl_ep_enable()
795 if (!usb_gadget_ep_match_desc(dev->gadget, ep->ep, desc, NULL)) in raw_ioctl_ep_enable()
800 dev_err(&dev->gadget->dev, in raw_ioctl_ep_enable()
806 dev_err(&dev->gadget->dev, in raw_ioctl_ep_enable()
818 dev_dbg(&dev->gadget->dev, "fail, no gadget endpoints available\n"); in raw_ioctl_ep_enable()
839 if (!dev->gadget) { in raw_ioctl_ep_disable()
850 dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n"); in raw_ioctl_ep_disable()
855 dev_dbg(&dev->gadget->dev, in raw_ioctl_ep_disable()
861 dev_dbg(&dev->gadget->dev, in raw_ioctl_ep_disable()
894 if (!dev->gadget) { in raw_ioctl_ep_set_clear_halt_wedge()
905 dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n"); in raw_ioctl_ep_set_clear_halt_wedge()
910 dev_dbg(&dev->gadget->dev, in raw_ioctl_ep_set_clear_halt_wedge()
916 dev_dbg(&dev->gadget->dev, in raw_ioctl_ep_set_clear_halt_wedge()
922 dev_dbg(&dev->gadget->dev, in raw_ioctl_ep_set_clear_halt_wedge()
931 dev_err(&dev->gadget->dev, in raw_ioctl_ep_set_clear_halt_wedge()
936 dev_err(&dev->gadget->dev, in raw_ioctl_ep_set_clear_halt_wedge()
941 dev_err(&dev->gadget->dev, in raw_ioctl_ep_set_clear_halt_wedge()
980 if (!dev->gadget) { in raw_process_ep_io()
986 dev_dbg(&dev->gadget->dev, "fail, invalid endpoint\n"); in raw_process_ep_io()
992 dev_dbg(&dev->gadget->dev, "fail, endpoint is not enabled\n"); in raw_process_ep_io()
997 dev_dbg(&dev->gadget->dev, in raw_process_ep_io()
1003 dev_dbg(&dev->gadget->dev, "fail, urb already queued\n"); in raw_process_ep_io()
1008 dev_dbg(&dev->gadget->dev, "fail, wrong direction\n"); in raw_process_ep_io()
1024 dev_err(&dev->gadget->dev, in raw_process_ep_io()
1033 dev_dbg(&dev->gadget->dev, "wait interrupted\n"); in raw_process_ep_io()
1101 if (!dev->gadget) { in raw_ioctl_configure()
1106 usb_gadget_set_state(dev->gadget, USB_STATE_CONFIGURED); in raw_ioctl_configure()
1124 if (!dev->gadget) { in raw_ioctl_vbus_draw()
1129 usb_gadget_vbus_draw(dev->gadget, 2 * value); in raw_ioctl_vbus_draw()
1173 if (!dev->gadget) { in raw_ioctl_eps_info()