const char *name)
{
struct gadget_info *gi;
- struct device_attribute **attrs;
- struct device_attribute *attr;
- int err;
gi = kzalloc(sizeof(*gi), GFP_KERNEL);
if (!gi)
static void gadgets_drop(struct config_group *group, struct config_item *item)
{
- struct device_attribute **attrs;
- struct device_attribute *attr;
-
config_item_put(item);
android_device_destroy();
}
return 0;
}
-static int
-acc_function_bind(struct usb_configuration *c, struct usb_function *f) {
- return __acc_function_bind(c, f, false);
-}
-
static int
acc_function_bind_configfs(struct usb_configuration *c,
struct usb_function *f) {
VDBG(cdev, "%s disabled\n", dev->function.name);
}
-static int acc_bind_config(struct usb_configuration *c)
-{
- struct acc_dev *dev = _acc_dev;
- int ret;
-
- printk(KERN_INFO "acc_bind_config\n");
-
- /* allocate a string ID for our interface */
- if (acc_string_defs[INTERFACE_STRING_INDEX].id == 0) {
- ret = usb_string_id(c->cdev);
- if (ret < 0)
- return ret;
- acc_string_defs[INTERFACE_STRING_INDEX].id = ret;
- acc_interface_desc.iInterface = ret;
- }
-
- dev->cdev = c->cdev;
- dev->function.name = "accessory";
- dev->function.strings = acc_strings,
- dev->function.fs_descriptors = fs_acc_descs;
- dev->function.hs_descriptors = hs_acc_descs;
- dev->function.bind = acc_function_bind;
- dev->function.unbind = acc_function_unbind;
- dev->function.set_alt = acc_function_set_alt;
- dev->function.disable = acc_function_disable;
-
- return usb_add_function(c, &dev->function);
-}
-
static int acc_setup(void)
{
struct acc_dev *dev;
VDBG(cdev, "%s disabled\n", dev->function.name);
}
-static int mtp_bind_config(struct usb_configuration *c, bool ptp_config)
-{
- struct mtp_dev *dev = _mtp_dev;
- int ret = 0;
-
- printk(KERN_INFO "mtp_bind_config\n");
-
- /* allocate a string ID for our interface */
- if (mtp_string_defs[INTERFACE_STRING_INDEX].id == 0) {
- ret = usb_string_id(c->cdev);
- if (ret < 0)
- return ret;
- mtp_string_defs[INTERFACE_STRING_INDEX].id = ret;
- mtp_interface_desc.iInterface = ret;
- }
-
- dev->cdev = c->cdev;
- dev->function.name = DRIVER_NAME;
- dev->function.strings = mtp_strings;
- if (ptp_config) {
- dev->function.fs_descriptors = fs_ptp_descs;
- dev->function.hs_descriptors = hs_ptp_descs;
- } else {
- dev->function.fs_descriptors = fs_mtp_descs;
- dev->function.hs_descriptors = hs_mtp_descs;
- }
- dev->function.bind = mtp_function_bind;
- dev->function.unbind = mtp_function_unbind;
- dev->function.set_alt = mtp_function_set_alt;
- dev->function.disable = mtp_function_disable;
-
- return usb_add_function(c, &dev->function);
-}
-
static int __mtp_setup(struct mtp_instance *fi_mtp)
{
struct mtp_dev *dev;
return ret;
}
-static int mtp_setup(void)
-{
- return __mtp_setup(NULL);
-}
-
static int mtp_setup_configfs(struct mtp_instance *fi_mtp)
{
return __mtp_setup(fi_mtp);