summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINSUN PYO <insun.pyo@samsung.com>2020-02-06 03:58:30 (GMT)
committerINSUN PYO <insun.pyo@samsung.com>2020-02-06 04:07:44 (GMT)
commite4dc7cd95d50c2bd6cd62085615f09160fbdeb87 (patch)
tree81fe693f4c23a40a7a7f14a5ddd10da53ebe96a8
parentdd1cbed348b34066d03129c73a6121292f8e25fe (diff)
downloadlibdevice-node-e4dc7cd95d50c2bd6cd62085615f09160fbdeb87.zip
libdevice-node-e4dc7cd95d50c2bd6cd62085615f09160fbdeb87.tar.gz
libdevice-node-e4dc7cd95d50c2bd6cd62085615f09160fbdeb87.tar.bz2
TV profile doesn't have mtp-responder.service. If mtp-responder.service does not exist in the configfs environment, usb initialization will fail. So, we check to see if mtp-responder.service exists and remove MTP from usb mode if it doesn't exist. If you do not build deviced in engineer mode and have a TV profile, ACM only mode exists. (Engineer mode always adds SDB to usb mode.) Change-Id: I0472ee10e572e36638d73df7b2be691c49d8f857 (cherry picked from commit 16d7f6721fe4650090cb94af21e001713956de7d)
-rw-r--r--hw/usb_gadget_common.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/hw/usb_gadget_common.c b/hw/usb_gadget_common.c
index 368077a..70d6c51 100644
--- a/hw/usb_gadget_common.c
+++ b/hw/usb_gadget_common.c
@@ -234,20 +234,27 @@ static int simple_id_to_gadget(struct usb_gadget_id *gadget_id,
* so in this switch we sort our functions in a correct order
*/
switch (gadget_id->function_mask) {
- case USB_FUNCTION_SDB:
+ case USB_FUNCTION_MTP:
n_configs = 1;
- functions[0][0] = USB_FUNCTION_SDB;
+ functions[0][0] = USB_FUNCTION_MTP;
functions[0][1] = 0;
- gadget->attrs.idProduct = 0x685d;
+ gadget->attrs.idProduct = 0x6860;
break;
- case USB_FUNCTION_MTP:
+ case USB_FUNCTION_ACM:
n_configs = 1;
- functions[0][0] = USB_FUNCTION_MTP;
+ functions[0][0] = USB_FUNCTION_ACM;
functions[0][1] = 0;
gadget->attrs.idProduct = 0x6860;
break;
+ case USB_FUNCTION_SDB:
+ n_configs = 1;
+ functions[0][0] = USB_FUNCTION_SDB;
+ functions[0][1] = 0;
+ gadget->attrs.idProduct = 0x685d;
+ break;
+
case USB_FUNCTION_RNDIS:
n_configs = 1;
functions[0][0] = USB_FUNCTION_RNDIS;