2 * PXA27x register declarations and HCD data structures
4 * Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it>
5 * Copyright (C) 2007 Eurotech S.p.A. <info@eurotech.it>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #ifndef __PXA270X_UDC_H__
25 #define __PXA270X_UDC_H__
27 #include <asm/byteorder.h>
29 /* Endpoint 0 states */
32 #define EP0_OUT_DATA 2
33 #define EP0_XFER_COMPLETE 3
36 /* Endpoint parameters */
37 #define MAX_ENDPOINTS 4
38 #define EP_MAX_PACKET_SIZE 64
40 #define EP0_MAX_PACKET_SIZE 16
41 #define UDC_OUT_ENDPOINT 0x02
42 #define UDC_OUT_PACKET_SIZE EP_MAX_PACKET_SIZE
43 #define UDC_IN_ENDPOINT 0x01
44 #define UDC_IN_PACKET_SIZE EP_MAX_PACKET_SIZE
45 #define UDC_INT_ENDPOINT 0x05
46 #define UDC_INT_PACKET_SIZE EP_MAX_PACKET_SIZE
47 #define UDC_BULK_PACKET_SIZE EP_MAX_PACKET_SIZE
51 void udc_set_nak(int epid);
52 void udc_unset_nak(int epid);
54 /* Higher level functions for abstracting away from specific device */
55 int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
59 void udc_enable(struct usb_device_instance *device);
60 void udc_disable(void);
62 void udc_connect(void);
63 void udc_disconnect(void);
65 void udc_startup_events(struct usb_device_instance *device);
66 void udc_setup_ep(struct usb_device_instance *device,
67 unsigned int ep, struct usb_endpoint_instance *endpoint);