2 * linux/drivers/usb/gadget/jz4740_udc.h
4 * Ingenic JZ4740 on-chip high speed USB device controller
6 * Copyright (C) 2006 Ingenic Semiconductor Inc.
7 * Author: <jlwei@ingenic.cn>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
15 #ifndef __USB_GADGET_JZ4740_H__
16 #define __USB_GADGET_JZ4740_H__
18 /*-------------------------------------------------------------------------*/
21 #define EP0_MAXPACKETSIZE 64
22 #define EPBULK_MAXPACKETSIZE 512
23 #define EPINTR_MAXPACKETSIZE 64
25 #define UDC_MAX_ENDPOINTS 4
27 /*-------------------------------------------------------------------------*/
29 typedef enum ep_type
{
30 ep_control
, ep_bulk_in
, ep_bulk_out
, ep_interrupt
35 struct jz4740_udc
*dev
;
37 const struct usb_endpoint_descriptor
*desc
;
38 unsigned long pio_irqs
;
41 uint8_t bEndpointAddress
;
49 struct list_head queue
;
52 struct jz4740_request
{
53 struct usb_request req
;
54 struct list_head queue
;
58 WAIT_FOR_SETUP
, /* between STATUS ack and SETUP report */
59 DATA_STATE_XMIT
, /* data tx stage */
60 DATA_STATE_NEED_ZLP
, /* data tx zlp stage */
61 WAIT_FOR_OUT_STATUS
, /* status stages */
62 DATA_STATE_RECV
, /* data rx stage */
65 /* For function binding with UDC Disable - Added by River */
72 struct usb_gadget gadget
;
73 struct usb_gadget_driver
*driver
;
77 enum ep0state ep0state
;
78 struct jz4740_ep ep
[UDC_MAX_ENDPOINTS
];
80 unsigned char usb_address
;
93 extern struct jz4740_udc
*the_controller
;
95 #define ep_is_in(EP) (((EP)->bEndpointAddress&USB_DIR_IN)==USB_DIR_IN)
96 #define ep_maxpacket(EP) ((EP)->ep.maxpacket)
97 #define ep_index(EP) ((EP)->bEndpointAddress&0xF)
99 #endif /* __USB_GADGET_JZ4740_H__ */
This page took 0.047892 seconds and 5 git commands to generate.