usb: gadget: android: add the handler for ptp class requests
Rakesh Bodla [Wed, 16 May 2012 14:02:28 +0000 (19:02 +0530)]
Adding the handler for control requests of ptp
function driver.

Bug 980195

Change-Id: I3ddfc44d7ec4a98d29c7358be1f1d34799f92be9
Signed-off-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/103007
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

drivers/usb/gadget/android.c

index fbafe8a..4805670 100644 (file)
@@ -319,6 +319,13 @@ static int mtp_function_ctrlrequest(struct android_usb_function *f,
        return mtp_ctrlrequest(cdev, c);
 }
 
+static int ptp_function_ctrlrequest(struct android_usb_function *f,
+                                               struct usb_composite_dev *cdev,
+                                               const struct usb_ctrlrequest *c)
+{
+       return mtp_ctrlrequest(cdev, c);
+}
+
 static struct android_usb_function mtp_function = {
        .name           = "mtp",
        .init           = mtp_function_init,
@@ -333,6 +340,7 @@ static struct android_usb_function ptp_function = {
        .init           = ptp_function_init,
        .cleanup        = ptp_function_cleanup,
        .bind_config    = ptp_function_bind_config,
+       .ctrlrequest    = ptp_function_ctrlrequest,
 };