Lines Matching refs:gadget
66 * In normal operation the main thread is started during the gadget's
69 * gadget running when the thread is dead. So just before the thread
70 * exits, it deregisters the gadget driver. This makes things a little
156 #include <linux/usb/gadget.h>
326 struct usb_gadget *gadget;
334 struct usb_ep *ep0; // Handy copy of gadget->ep0
500 static int populate_config_buf(struct usb_gadget *gadget,
503 enum usb_device_speed speed = gadget->speed;
510 if (gadget_is_dualspeed(gadget) && type == USB_DT_OTHER_SPEED_CONFIG)
512 function = gadget_is_dualspeed(gadget) && speed == USB_SPEED_HIGH
517 if (!gadget_is_otg(gadget))
566 static void fsg_disconnect(struct usb_gadget *gadget)
568 struct fsg_dev *fsg = get_gadget_data(gadget);
841 if (!gadget_is_dualspeed(fsg->gadget))
849 if (!gadget_is_dualspeed(fsg->gadget))
855 value = populate_config_buf(fsg->gadget,
934 static int fsg_setup(struct usb_gadget *gadget,
937 struct fsg_dev *fsg = get_gadget_data(gadget);
2694 d = fsg_ep_desc(fsg->gadget,
2700 d = fsg_ep_desc(fsg->gadget,
2709 d = fsg_ep_desc(fsg->gadget,
2748 * For now we just assume the gadget is always self-powered.
2769 switch (fsg->gadget->speed) {
3006 * gadget driver. */
3043 static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget)
3045 struct fsg_dev *fsg = get_gadget_data(gadget);
3084 set_gadget_data(gadget, NULL);
3104 if (gadget_is_at91(fsg->gadget))
3108 gcnum = usb_gadget_controller_number(fsg->gadget);
3113 fsg->gadget->name);
3226 static int __ref fsg_bind(struct usb_gadget *gadget)
3236 fsg->gadget = gadget;
3237 set_gadget_data(gadget, fsg);
3238 fsg->ep0 = gadget->ep0;
3284 curlun->dev.parent = &gadget->dev;
3288 dev_name(&gadget->dev), i);
3318 usb_ep_autoconfig_reset(gadget);
3319 ep = usb_ep_autoconfig(gadget, &fsg_fs_bulk_in_desc);
3325 ep = usb_ep_autoconfig(gadget, &fsg_fs_bulk_out_desc);
3332 ep = usb_ep_autoconfig(gadget, &fsg_fs_intr_in_desc);
3351 if (gadget_is_dualspeed(gadget)) {
3366 if (gadget_is_otg(gadget))
3394 /* This should reflect the actual gadget power source */
3395 usb_gadget_set_selfpowered(gadget);
3400 gadget->name);
3403 "file-storage-gadget");
3452 fsg_unbind(gadget);
3460 static void fsg_suspend(struct usb_gadget *gadget)
3462 struct fsg_dev *fsg = get_gadget_data(gadget);
3468 static void fsg_resume(struct usb_gadget *gadget)
3470 struct fsg_dev *fsg = get_gadget_data(gadget);