From fdef4496af98d25ad6d3d3ef81d0eec5f08b5379 Mon Sep 17 00:00:00 2001 From: Joe Swantek Date: Wed, 22 Jul 2009 20:16:06 -0500 Subject: [PATCH] drivers: usb: gadget: Add helper function for installing ACM gadget function. Submitted on behalf of James Luan Signed-off-by: Joe Swantek Signed-off-by: Mike Lockwood --- drivers/usb/gadget/f_acm.c | 9 +++++++++ drivers/usb/gadget/f_acm.h | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 drivers/usb/gadget/f_acm.h diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c index d47a123f15ab..ee0a18c5f7aa 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 000000000000..8e27b3440635 --- /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 */ -- 2.34.1