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 5e043cc..c133aff 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