USB: gadget: Add association descriptor for windows
authorLiu, DongxingX <dongxingx.liu@intel.com>
Mon, 9 Jan 2012 05:24:44 +0000 (13:24 +0800)
committerbuildbot <buildbot@intel.com>
Tue, 10 Jan 2012 04:33:42 +0000 (20:33 -0800)
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 <dongxingx.liu@intel.com>
Reviewed-on: http://android.intel.com:8080/31150
Reviewed-by: Tang, Richard <richard.tang@intel.com>
Reviewed-by: Alagnou, GregoryX <gregoryx.alagnou@intel.com>
Tested-by: Sun, Jianhua <jianhua.sun@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/usb/gadget/f_acm.c

index a3d96c9..dedf5a4 100644 (file)
@@ -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];