usb_cfs_client: Enable gadget at reconfiguration #2 59/213859/1 submit/tizen/20191001.105102
authorINSUN PYO <insun.pyo@samsung.com>
Wed, 11 Sep 2019 07:49:44 +0000 (16:49 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Mon, 16 Sep 2019 02:25:38 +0000 (11:25 +0900)
Because it is a workround code for Artik, restrict this patch to artik.
(This workaround will be removed in tizen 6.0)

Change-Id: Ice81dd8c37359bdc4a37099ecff27d696f7f9ec0
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
hw/usb_cfs_client_common.c

index b022bcf..5d0ea75 100755 (executable)
@@ -804,9 +804,20 @@ static int cfs_reconfigure_gadget(struct usb_client *usb,
        }
 
        /* Workaround for enabling extcon notification */
-       ret = usbg_enable_gadget(cfs_client->gadget, cfs_client->udc);
-       if (ret)
-               goto out;
+       /* ******************************************* */
+       /* ******************************************* */
+       {
+               const char *ARTIK_UDC_NAME = "c0040000.dwc2otg";
+               const char *udc_name = usbg_get_udc_name(cfs_client->udc);
+               if (udc_name && !strncmp(udc_name, ARTIK_UDC_NAME, strlen(ARTIK_UDC_NAME))) {
+                       ret = usbg_enable_gadget(cfs_client->gadget, cfs_client->udc);
+                       if (ret)
+                               goto out;
+               }
+       }
+       /* ******************************************* */
+       /* ******************************************* */
+       /* ******************************************* */
 
        ret = cfs_cleanup_left_configs(cfs_client, i);