瀏覽代碼

usb: dwc3: gadget: add ep capabilities support

Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Baldyga 10 年之前
父節點
當前提交
a474d3b73b
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      drivers/usb/dwc3/gadget.c

+ 11 - 0
drivers/usb/dwc3/gadget.c

@@ -1715,6 +1715,17 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc,
 				return ret;
 				return ret;
 		}
 		}
 
 
+		if (epnum == 0 || epnum == 1) {
+			dep->endpoint.caps.type_control = true;
+		} else {
+			dep->endpoint.caps.type_iso = true;
+			dep->endpoint.caps.type_bulk = true;
+			dep->endpoint.caps.type_int = true;
+		}
+
+		dep->endpoint.caps.dir_in = !!direction;
+		dep->endpoint.caps.dir_out = !direction;
+
 		INIT_LIST_HEAD(&dep->request_list);
 		INIT_LIST_HEAD(&dep->request_list);
 		INIT_LIST_HEAD(&dep->req_queued);
 		INIT_LIST_HEAD(&dep->req_queued);
 	}
 	}