It is used for udc to pullup dp when necessary

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

diff --git a/drivers/usb/gadget/legacy/inode.c 
b/drivers/usb/gadget/legacy/inode.c
index 2e4ce77..1166e77 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -1770,6 +1770,17 @@ gadgetfs_suspend (struct usb_gadget *gadget)
        spin_unlock (&dev->lock);
 }
 
+/*
+ * UDC driver calls this when it wants to pull up dp.
+ */
+static int gadgetfs_connect(struct usb_gadget *gadget, bool connect)
+{
+       if (connect)
+               return usb_gadget_connect(gadget);
+       else
+               return usb_gadget_disconnect(gadget);
+}
+
 static struct usb_gadget_driver gadgetfs_driver = {
        .function       = (char *) driver_desc,
        .bind           = gadgetfs_bind,
@@ -1777,6 +1788,7 @@ static struct usb_gadget_driver gadgetfs_driver = {
        .setup          = gadgetfs_setup,
        .disconnect     = gadgetfs_disconnect,
        .suspend        = gadgetfs_suspend,
+       .connect        = gadgetfs_connect,
 
        .driver = {
                .name           = (char *) shortname,
-- 
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