From b6cf60844dd32e8ead742a33ca08d6632f9d0875 Mon Sep 17 00:00:00 2001 From: "Liu, DongxingX" Date: Mon, 9 Jan 2012 13:24:44 +0800 Subject: [PATCH] USB: gadget: Add association descriptor for windows BZ: 19004 This patch adds USB association descriptor supporting Android ACM in windows. The descriptor presents itself as "CDC Serial" device to PC in order to match the proper driver in windows. Change-Id: I05a4cee6023fe10375b367e1beafd78214c5e9f3 Signed-off-by: Liu, DongxingX Reviewed-on: http://android.intel.com:8080/31150 Reviewed-by: Tang, Richard Reviewed-by: Alagnou, GregoryX Tested-by: Sun, Jianhua Reviewed-by: buildbot Tested-by: buildbot --- drivers/usb/gadget/f_acm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c index a3d96c9..dedf5a4 100644 --- a/drivers/usb/gadget/f_acm.c +++ b/drivers/usb/gadget/f_acm.c @@ -634,6 +634,10 @@ acm_bind(struct usb_configuration *c, struct usb_function *f) if (c->bConfigurationValue == 4) { /* Descriptors with association descriptor */ fs_function = acm_fs_function; + } else if (c->bConfigurationValue == 1) { + /* If define ACM for Android, + * descriptors with association descriptor */ + fs_function = acm_fs_function; } else { /* Descriptors without association descriptor */ fs_function = &acm_fs_function[1]; @@ -666,6 +670,10 @@ acm_bind(struct usb_configuration *c, struct usb_function *f) if (c->bConfigurationValue == 4) { /* Descriptors with association descriptor */ hs_function = acm_hs_function; + } else if (c->bConfigurationValue == 1) { + /* If define ACM for Android, + * descriptors with association descriptor */ + hs_function = acm_hs_function; } else { /* Descriptors without association descriptor */ hs_function = &acm_hs_function[1]; -- 2.7.4