]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: gadget: set gadget state as configured
authorPeter Chen <peter.chen@freescale.com>
Tue, 29 Apr 2014 05:26:28 +0000 (13:26 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:18:10 +0000 (21:18 -0600)
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>
drivers/usb/gadget/composite.c
drivers/usb/gadget/inode.c

index eaefdd1a66148f18221f05c02e72d81e586a92d5..66de2a09ba0efdb1972f47b792342788d9b0cf81 100644 (file)
@@ -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. */
index 4ac9e9928d67a940d7cd8a0ef89cd46a4b45e83e..0505265ba7a3f1eba7ef2c148fac3fd14e397fc0 100644 (file)
@@ -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;