Lines Matching refs:cdev

62 	struct usb_composite_dev cdev;  member
134 return sprintf(page, "0x%02x\n", gi->cdev.desc.__name); \
141 return sprintf(page, "0x%04x\n", le16_to_cpup(&gi->cdev.desc.__name)); \
154 gi->cdev.desc._name = val; \
167 gi->cdev.desc._name = cpu_to_le16p(&val); \
210 gi->cdev.desc.bcdDevice = cpu_to_le16(bcdDevice); in gadget_dev_desc_bcdDevice_store()
227 gi->cdev.desc.bcdUSB = cpu_to_le16(bcdUSB); in gadget_dev_desc_bcdUSB_store()
345 WARN_ON(!list_empty(&gi->cdev.configs)); in gadget_info_attr_release()
375 struct usb_composite_dev *cdev = cfg->c.cdev; in config_usb_cfg_link() local
376 struct gadget_info *gi = container_of(cdev, struct gadget_info, cdev); in config_usb_cfg_link()
426 struct usb_composite_dev *cdev = cfg->c.cdev; in config_usb_cfg_unlink() local
427 struct gadget_info *gi = container_of(cdev, struct gadget_info, cdev); in config_usb_cfg_unlink()
539 static void composite_init_dev(struct usb_composite_dev *cdev) in composite_init_dev() argument
541 spin_lock_init(&cdev->lock); in composite_init_dev()
542 INIT_LIST_HEAD(&cdev->configs); in composite_init_dev()
543 INIT_LIST_HEAD(&cdev->gstrings); in composite_init_dev()
695 ret = usb_add_config_only(&gi->cdev, &cfg->c); in config_desc_make()
882 struct usb_composite_dev *cdev = &gi->cdev; in os_desc_link() local
890 list_for_each_entry(c, &cdev->configs, list) { in os_desc_link()
899 if (cdev->os_desc_config) { in os_desc_link()
904 cdev->os_desc_config = &c_target->c; in os_desc_link()
917 struct usb_composite_dev *cdev = &gi->cdev; in os_desc_unlink() local
922 cdev->os_desc_config = NULL; in os_desc_unlink()
1266 static int configfs_do_nothing(struct usb_composite_dev *cdev) in configfs_do_nothing() argument
1275 int composite_os_desc_req_prepare(struct usb_composite_dev *cdev,
1282 list_for_each_entry(c, &gi->cdev.configs, list) { in purge_configs_funcs()
1292 dev_err(&gi->cdev.gadget->dev, "unbind function" in purge_configs_funcs()
1311 struct usb_composite_dev *cdev = &gi->cdev; in configfs_composite_bind() local
1318 cdev->gadget = gadget; in configfs_composite_bind()
1319 set_gadget_data(gadget, cdev); in configfs_composite_bind()
1320 ret = composite_dev_prepare(composite, cdev); in configfs_composite_bind()
1326 if (list_empty(&gi->cdev.configs)) { in configfs_composite_bind()
1333 list_for_each_entry(c, &gi->cdev.configs, list) { in configfs_composite_bind()
1361 s = usb_gstrings_attach(&gi->cdev, gi->gstrings, in configfs_composite_bind()
1368 gi->cdev.desc.iManufacturer = s[USB_GADGET_MANUFACTURER_IDX].id; in configfs_composite_bind()
1369 gi->cdev.desc.iProduct = s[USB_GADGET_PRODUCT_IDX].id; in configfs_composite_bind()
1370 gi->cdev.desc.iSerialNumber = s[USB_GADGET_SERIAL_IDX].id; in configfs_composite_bind()
1374 cdev->use_os_string = true; in configfs_composite_bind()
1375 cdev->b_vendor_code = gi->b_vendor_code; in configfs_composite_bind()
1376 memcpy(cdev->qw_sign, gi->qw_sign, OS_STRING_QW_SIGN_LEN); in configfs_composite_bind()
1380 list_for_each_entry(c, &gi->cdev.configs, list) { in configfs_composite_bind()
1396 s = usb_gstrings_attach(&gi->cdev, cfg->gstrings, 1); in configfs_composite_bind()
1412 usb_ep_autoconfig_reset(cdev->gadget); in configfs_composite_bind()
1414 if (cdev->use_os_string) { in configfs_composite_bind()
1415 ret = composite_os_desc_req_prepare(cdev, gadget->ep0); in configfs_composite_bind()
1420 usb_ep_autoconfig_reset(cdev->gadget); in configfs_composite_bind()
1426 composite_dev_cleanup(cdev); in configfs_composite_bind()
1432 struct usb_composite_dev *cdev; in configfs_composite_unbind() local
1437 cdev = get_gadget_data(gadget); in configfs_composite_unbind()
1438 gi = container_of(cdev, struct gadget_info, cdev); in configfs_composite_unbind()
1441 composite_dev_cleanup(cdev); in configfs_composite_unbind()
1442 usb_ep_autoconfig_reset(cdev->gadget); in configfs_composite_unbind()
1443 cdev->gadget = NULL; in configfs_composite_unbind()
1500 composite_init_dev(&gi->cdev); in gadgets_make()
1501 gi->cdev.desc.bLength = USB_DT_DEVICE_SIZE; in gadgets_make()
1502 gi->cdev.desc.bDescriptorType = USB_DT_DEVICE; in gadgets_make()
1503 gi->cdev.desc.bcdDevice = cpu_to_le16(get_default_bcdDevice()); in gadgets_make()