usb:f_mtp: set interface class subclass protocol of mtp as STILL IMAGE
authorjzhuan5 <jin.can.zhuang@intel.com>
Mon, 26 Dec 2011 05:14:48 +0000 (00:14 -0500)
committerbuildbot <buildbot@intel.com>
Tue, 27 Dec 2011 09:28:17 +0000 (01:28 -0800)
BZ: 18203

Windows 7 can identify MTP devices by either the OS Descriptor or the USB
Still Image Class Code (Class 6, Subclass 1, Protocol 1), but our MTP
doesn't report the right Class Code.
The patch make MTP gadget report the Still Image Class Code.

Change-Id: Ia68a3c0876fc1b4f31fec2b71457ad98d6acff05
Signed-off-by: jzhuan5 <jin.can.zhuang@intel.com>
Reviewed-on: http://android.intel.com:8080/29879
Reviewed-by: Huang, Bo B <bo.b.huang@intel.com>
Reviewed-by: Liu, DongxingX <dongxingx.liu@intel.com>
Reviewed-by: Tang, Richard <richard.tang@intel.com>
Reviewed-by: Meng, Zhe <zhe.meng@intel.com>
Tested-by: Meng, Zhe <zhe.meng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/usb/gadget/f_mtp.c

index 2829231..252b3be 100644 (file)
@@ -114,9 +114,9 @@ static struct usb_interface_descriptor mtp_interface_desc = {
        .bDescriptorType        = USB_DT_INTERFACE,
        .bInterfaceNumber       = 0,
        .bNumEndpoints          = 3,
-       .bInterfaceClass        = USB_CLASS_VENDOR_SPEC,
-       .bInterfaceSubClass     = USB_SUBCLASS_VENDOR_SPEC,
-       .bInterfaceProtocol     = 0,
+       .bInterfaceClass        = USB_CLASS_STILL_IMAGE,
+       .bInterfaceSubClass     = 1,
+       .bInterfaceProtocol     = 1,
 };
 
 static struct usb_interface_descriptor ptp_interface_desc = {