From 6a8841e932a0fbd45963d8b9c9f3db7aee1c184e Mon Sep 17 00:00:00 2001 From: INSUN PYO Date: Wed, 11 Sep 2019 16:49:44 +0900 Subject: [PATCH] usb_cfs_client: Enable gadget at reconfiguration #2 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 --- hw/usb_cfs_client_common.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/hw/usb_cfs_client_common.c b/hw/usb_cfs_client_common.c index b022bcf..5d0ea75 100755 --- a/hw/usb_cfs_client_common.c +++ b/hw/usb_cfs_client_common.c @@ -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); -- 2.34.1