summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJoe Swantek <joseph.swantek@motorola.com>2009-07-22 20:16:06 -0500
committerColin Cross <ccross@android.com>2011-06-14 09:08:53 -0700
commitb21ab23c7bd34a53cfb4eb532c9c80007831749c (patch)
tree0cc053b17d42d3515e4dd1372f34b15ad2d17c2d /drivers
parent646bb86a454b23d4792883a8d1fd83a87a333f0c (diff)
drivers: usb: gadget: Add helper function for installing ACM gadget function.
Submitted on behalf of James Luan <James.Luan@motorola.com> Signed-off-by: Joe Swantek <joseph.swantek@motorola.com> Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/f_acm.c9
-rw-r--r--drivers/usb/gadget/f_acm.h24
2 files changed, 33 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c
index bd6226cbae8..39363bfa39e 100644
--- a/drivers/usb/gadget/f_acm.c
+++ b/drivers/usb/gadget/f_acm.c
@@ -782,3 +782,12 @@ int acm_bind_config(struct usb_configuration *c, u8 port_num)
kfree(acm);
return status;
}
+
+int __init acm_function_add(struct usb_composite_dev *cdev,
+ struct usb_configuration *c)
+{
+ int ret = acm_bind_config(c, 0);
+ if (ret == 0)
+ gserial_setup(c->cdev->gadget, 1);
+ return ret;
+}
diff --git a/drivers/usb/gadget/f_acm.h b/drivers/usb/gadget/f_acm.h
new file mode 100644
index 00000000000..8e27b344063
--- /dev/null
+++ b/drivers/usb/gadget/f_acm.h
@@ -0,0 +1,24 @@
+/*
+ * Gadget Driver for Android ACM
+ *
+ * Copyright (C) 2009 Motorola, Inc.
+ * Author:
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __F_ACM_H
+#define __F_ACM_H
+
+int acm_function_add(struct usb_composite_dev *cdev,
+ struct usb_configuration *c);
+
+#endif /* __F_ACM_H */