]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: gadget: s3c-hsudc: add ep capabilities support
authorRobert Baldyga <r.baldyga@samsung.com>
Fri, 31 Jul 2015 14:00:42 +0000 (16:00 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 4 Aug 2015 17:26:53 +0000 (12:26 -0500)
Convert endpoint configuration to new capabilities model.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/s3c-hsudc.c

index 85a712a033439b5cb3ac1fa16646049051581304..e9def42ce50d735eaafb9a39abb0b8f497392402 100644 (file)
@@ -1005,6 +1005,21 @@ static void s3c_hsudc_initep(struct s3c_hsudc *hsudc,
        hsep->stopped = 0;
        hsep->wedge = 0;
 
+       if (epnum == 0) {
+               hsep->ep.caps.type_control = true;
+               hsep->ep.caps.dir_in = true;
+               hsep->ep.caps.dir_out = true;
+       } else {
+               hsep->ep.caps.type_iso = true;
+               hsep->ep.caps.type_bulk = true;
+               hsep->ep.caps.type_int = true;
+       }
+
+       if (epnum & 1)
+               hsep->ep.caps.dir_in = true;
+       else
+               hsep->ep.caps.dir_out = true;
+
        set_index(hsudc, epnum);
        writel(hsep->ep.maxpacket, hsudc->regs + S3C_MPR);
 }