diff options
author | Benoit Goby <benoit@android.com> | 2011-04-19 20:37:33 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:38:41 -0800 |
commit | 63fc2625d029bb01844f3b6cd4510cb1fffcac27 (patch) | |
tree | 7a3748f7b3f7d0b0a770f46314512f60f4e4fdcf /drivers/usb/gadget/f_acm.c | |
parent | d74a4a005ef4fd02a5fef4e7565fc7c09fad1136 (diff) |
usb: gadget: android: Update android gadget driver
* Functions and the device descriptor are configured from user space:
echo 0 > /sys/class/android_usb/android0/enable
echo adb,acm > /sys/class/android_usb/android0/functions
echo 2 > /sys/class/android_usb/android0/f_acm/instances
echo 1 > /sys/class/android_usb/android0/enable
* Driver does not require platform data anymore
* Moved function initialization to android.c instead of each
function file
* Replaced switches by uevents
Signed-off-by: Benoit Goby <benoit@android.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
Change-Id: If5ad9267c111ad0a442f0d87a0d31082dc5381b6
Diffstat (limited to 'drivers/usb/gadget/f_acm.c')
-rw-r--r-- | drivers/usb/gadget/f_acm.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c index 0812588a13e8..d84debc42215 100644 --- a/drivers/usb/gadget/f_acm.c +++ b/drivers/usb/gadget/f_acm.c @@ -17,7 +17,6 @@ #include <linux/slab.h> #include <linux/kernel.h> #include <linux/device.h> -#include <linux/usb/android_composite.h> #include "u_serial.h" #include "gadget_chips.h" @@ -768,55 +767,3 @@ int acm_bind_config(struct usb_configuration *c, u8 port_num) kfree(acm); return status; } - -#ifdef CONFIG_USB_ANDROID_ACM -#include <linux/platform_device.h> - -static struct acm_platform_data *acm_pdata; - -static int acm_probe(struct platform_device *pdev) -{ - acm_pdata = pdev->dev.platform_data; - return 0; -} - -static struct platform_driver acm_platform_driver = { - .driver = { .name = "acm", }, - .probe = acm_probe, -}; - -int acm_function_bind_config(struct usb_configuration *c) -{ - int i; - u8 num_inst = acm_pdata ? acm_pdata->num_inst : 1; - int ret = gserial_setup(c->cdev->gadget, num_inst); - - if (ret) - return ret; - - for (i = 0; i < num_inst; i++) { - ret = acm_bind_config(c, i); - if (ret) { - pr_err("Could not bind acm%u config\n", i); - break; - } - } - - return ret; -} - -static struct android_usb_function acm_function = { - .name = "acm", - .bind_config = acm_function_bind_config, -}; - -static int __init init(void) -{ - printk(KERN_INFO "f_acm init\n"); - platform_driver_register(&acm_platform_driver); - android_register_function(&acm_function); - return 0; -} -module_init(init); - -#endif /* CONFIG_USB_ANDROID_ACM */ |