1 // SPDX-License-Identifier: GPL-2.0+
3 * linux/drivers/usb/gadget/s3c2410_udc.h
4 * Samsung on-chip full speed USB device controllers
6 * Copyright (C) 2004-2007 Herbert Pƶtzl - Arnaud Patard
7 * Additional cleanups by Ben Dooks <ben-linux@fluff.org>
10 #ifndef _S3C2410_UDC_H
11 #define _S3C2410_UDC_H
14 struct list_head queue
;
15 unsigned long last_io
; /* jiffies timestamp */
16 struct usb_gadget
*gadget
;
17 struct s3c2410_udc
*dev
;
21 unsigned short fifo_size
;
26 unsigned already_seen
: 1;
27 unsigned setup_stage
: 1;
31 /* Warning : ep0 has a fifo of 16 bytes */
32 /* Don't try to set 32 or 64 */
33 /* also testusb 14 fails wit 16 but is */
35 #define EP0_FIFO_SIZE 8
36 #define EP_FIFO_SIZE 64
37 #define DEFAULT_POWER_STATE 0x00
39 #define S3C2440_EP_FIFO_SIZE 128
41 static const char ep0name
[] = "ep0";
43 static const char *const ep_name
[] = {
44 ep0name
, /* everyone has ep0 */
45 /* s3c2410 four bidirectional bulk endpoints */
46 "ep1-bulk", "ep2-bulk", "ep3-bulk", "ep4-bulk",
49 #define S3C2410_ENDPOINTS ARRAY_SIZE(ep_name)
51 struct s3c2410_request
{
52 struct list_head queue
; /* ep's requests */
53 struct usb_request req
;
64 static const char *ep0states
[]= {
75 struct s3c2410_ep ep
[S3C2410_ENDPOINTS
];
77 struct usb_gadget gadget
;
78 struct usb_gadget_driver
*driver
;
79 struct s3c2410_request fifo_req
;
80 u8 fifo_buf
[EP_FIFO_SIZE
];
89 unsigned req_config
: 1;
90 unsigned req_pending
: 1;
92 struct dentry
*regs_info
;
95 #define to_s3c2410(g) (container_of((g), struct s3c2410_udc, gadget))