2 * linux/drivers/usb/gadget/s3c2410_udc.h
3 * Samsung on-chip full speed USB device controllers
5 * Copyright (C) 2004-2007 Herbert Pƶtzl - Arnaud Patard
6 * Additional cleanups by Ben Dooks <ben-linux@fluff.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef _S3C2410_UDC_H
25 #define _S3C2410_UDC_H
28 struct list_head queue
;
29 unsigned long last_io
; /* jiffies timestamp */
30 struct usb_gadget
*gadget
;
31 struct s3c2410_udc
*dev
;
32 const struct usb_endpoint_descriptor
*desc
;
36 unsigned short fifo_size
;
41 unsigned already_seen
: 1;
42 unsigned setup_stage
: 1;
46 /* Warning : ep0 has a fifo of 16 bytes */
47 /* Don't try to set 32 or 64 */
48 /* also testusb 14 fails wit 16 but is */
50 #define EP0_FIFO_SIZE 8
51 #define EP_FIFO_SIZE 64
52 #define DEFAULT_POWER_STATE 0x00
54 #define S3C2440_EP_FIFO_SIZE 128
56 static const char ep0name
[] = "ep0";
58 static const char *const ep_name
[] = {
59 ep0name
, /* everyone has ep0 */
60 /* s3c2410 four bidirectional bulk endpoints */
61 "ep1-bulk", "ep2-bulk", "ep3-bulk", "ep4-bulk",
64 #define S3C2410_ENDPOINTS ARRAY_SIZE(ep_name)
66 struct s3c2410_request
{
67 struct list_head queue
; /* ep's requests */
68 struct usb_request req
;
79 static const char *ep0states
[]= {
90 struct s3c2410_ep ep
[S3C2410_ENDPOINTS
];
92 struct usb_gadget gadget
;
93 struct usb_gadget_driver
*driver
;
94 struct s3c2410_request fifo_req
;
95 u8 fifo_buf
[EP_FIFO_SIZE
];
101 unsigned got_irq
: 1;
103 unsigned req_std
: 1;
104 unsigned req_config
: 1;
105 unsigned req_pending
: 1;
107 struct dentry
*regs_info
;