It is used for udc to pullup dp when necessary

Signed-off-by: Peter Chen <peter.c...@freescale.com>
---
 drivers/usb/gadget/composite.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 6935a82..c4ce977 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -2066,6 +2066,17 @@ composite_resume(struct usb_gadget *gadget)
        cdev->suspended = 0;
 }
 
+/*
+ * UDC driver calls this when it wants to pull up dp.
+ */
+static int composite_connect(struct usb_gadget *gadget, bool connect)
+{
+       if (connect)
+               return usb_gadget_connect(gadget);
+       else
+               return usb_gadget_disconnect(gadget);
+}
+
 /*-------------------------------------------------------------------------*/
 
 static const struct usb_gadget_driver composite_driver_template = {
@@ -2078,6 +2089,8 @@ static const struct usb_gadget_driver 
composite_driver_template = {
        .suspend        = composite_suspend,
        .resume         = composite_resume,
 
+       .connect        = composite_connect,
+
        .driver = {
                .owner          = THIS_MODULE,
        },
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to