summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2014-04-29 13:26:28 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-01-15 21:18:10 -0600
commit4edf53ae0f564aef213e0e125383240bf54db0ab (patch)
treeb81829761b67414de56b09e7d6f8d1bb15068932 /drivers/usb/gadget
parent3c99af7c9c2de4ec7160274a42e3098a8f097984 (diff)
usb: gadget: set gadget state as configured
Set gadget device state as configurated after set configuration has finished. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/composite.c1
-rw-r--r--drivers/usb/gadget/inode.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index eaefdd1a6614..66de2a09ba0e 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -634,6 +634,7 @@ static int set_config(struct usb_composite_dev *cdev,
if (!c)
goto done;
+ usb_gadget_set_state(gadget, USB_STATE_CONFIGURED);
cdev->config = c;
/* Initialize all interfaces by setting them to altsetting zero. */
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 4ac9e9928d67..0505265ba7a3 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1497,6 +1497,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
*/
if (value == 0) {
INFO (dev, "configuration #%d\n", dev->current_config);
+ usb_gadget_set_state(gadget, USB_STATE_CONFIGURED);
if (dev->usermode_setup) {
dev->setup_can_stall = 0;
goto delegate;