1 /* 2 * Copyright (C) 2005-2013 Atmel Corporation 3 * Bo Shen <voice.shen@atmel.com> 4 * 5 * SPDX-License-Identifier: GPL-2.0+ 6 */ 7 8 #ifndef __ATMEL_USBA_UDC_H__ 9 #define __ATMEL_USBA_UDC_H__ 10 11 #include <linux/usb/atmel_usba_udc.h> 12 13 #define EP(nam, idx, maxpkt, maxbk, dma, isoc) \ 14 [idx] = { \ 15 .name = nam, \ 16 .index = idx, \ 17 .fifo_size = maxpkt, \ 18 .nr_banks = maxbk, \ 19 .can_dma = dma, \ 20 .can_isoc = isoc, \ 21 } 22 23 #if defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \ 24 defined(CONFIG_AT91SAM9X5) 25 static struct usba_ep_data usba_udc_ep[] = { 26 EP("ep0", 0, 64, 1, 0, 0), 27 EP("ep1", 1, 1024, 2, 1, 1), 28 EP("ep2", 2, 1024, 2, 1, 1), 29 EP("ep3", 3, 1024, 3, 1, 0), 30 EP("ep4", 4, 1024, 3, 1, 0), 31 EP("ep5", 5, 1024, 3, 1, 1), 32 EP("ep6", 6, 1024, 3, 1, 1), 33 }; 34 #elif defined(CONFIG_SAMA5D3) || defined(CONFIG_SAMA5D4) 35 static struct usba_ep_data usba_udc_ep[] = { 36 EP("ep0", 0, 64, 1, 0, 0), 37 EP("ep1", 1, 1024, 3, 1, 0), 38 EP("ep2", 2, 1024, 3, 1, 0), 39 EP("ep3", 3, 1024, 2, 1, 0), 40 EP("ep4", 4, 1024, 2, 1, 0), 41 EP("ep5", 5, 1024, 2, 1, 0), 42 EP("ep6", 6, 1024, 2, 1, 0), 43 EP("ep7", 7, 1024, 2, 1, 0), 44 EP("ep8", 8, 1024, 2, 0, 0), 45 EP("ep9", 9, 1024, 2, 0, 0), 46 EP("ep10", 10, 1024, 2, 0, 0), 47 EP("ep11", 11, 1024, 2, 0, 0), 48 EP("ep12", 12, 1024, 2, 0, 0), 49 EP("ep13", 13, 1024, 2, 0, 0), 50 EP("ep14", 14, 1024, 2, 0, 0), 51 EP("ep15", 15, 1024, 2, 0, 0), 52 }; 53 #else 54 # error "NO usba_udc_ep defined" 55 #endif 56 57 #undef EP 58 59 struct usba_platform_data pdata = { 60 .num_ep = ARRAY_SIZE(usba_udc_ep), 61 .ep = usba_udc_ep, 62 }; 63 64 #endif 65