usb_cfs_client: Enable gadget at reconfiguration 12/183012/1
authorPaweł Szewczyk <p.szewczyk@samsung.com>
Fri, 29 Jun 2018 13:37:59 +0000 (15:37 +0200)
committerPaweł Szewczyk <p.szewczyk@samsung.com>
Fri, 29 Jun 2018 13:37:59 +0000 (15:37 +0200)
This workaround was introduced on artik, where gadget need to be enabled
before usb connection can be properly monitored. As this does little
harm, it's moved here to prevent regression on artik.

The side effect of this is starting some functionfs daemons long before
they are actually needed, so this should be removed when exton issue is
fixed.

Change-Id: Ia41c21e3c44d7d3a00d557f181e8c22766c6f31b
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
hw/usb_cfs_client_common.c

index 5e043cc360de69f16616f31a06374e897f47f4eb..c133aff17fb4fe4e7517e74cba55de3e20d447c6 100644 (file)
@@ -806,6 +806,11 @@ static int cfs_reconfigure_gadget(struct usb_client *usb,
                        goto out;
        }
 
+       /* Workaround for enabling extcon notification */
+       ret = usbg_enable_gadget(cfs_client->gadget, cfs_client->udc);
+       if (ret)
+               goto out;
+
        ret = cfs_cleanup_left_configs(cfs_client, i);
 
        /* TODO