]> git.karo-electronics.de Git - karo-tx-uboot.git/blob - include/usb/pxa27x_udc.h
Add GPL-2.0+ SPDX-License-Identifier to source files
[karo-tx-uboot.git] / include / usb / pxa27x_udc.h
1 /*
2  * PXA27x register declarations and HCD data structures
3  *
4  * Copyright (C) 2007 Rodolfo Giometti <giometti@linux.it>
5  * Copyright (C) 2007 Eurotech S.p.A. <info@eurotech.it>
6  *
7  * SPDX-License-Identifier:     GPL-2.0+
8  */
9
10
11 #ifndef __PXA270X_UDC_H__
12 #define __PXA270X_UDC_H__
13
14 #include <asm/byteorder.h>
15
16 /* Endpoint 0 states */
17 #define EP0_IDLE                0
18 #define EP0_IN_DATA             1
19 #define EP0_OUT_DATA            2
20 #define EP0_XFER_COMPLETE       3
21
22
23 /* Endpoint parameters */
24 #define MAX_ENDPOINTS           4
25 #define EP_MAX_PACKET_SIZE      64
26
27 #define EP0_MAX_PACKET_SIZE     16
28 #define UDC_OUT_ENDPOINT        0x02
29 #define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
30 #define UDC_IN_ENDPOINT         0x01
31 #define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
32 #define UDC_INT_ENDPOINT        0x05
33 #define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
34 #define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
35
36 void udc_irq(void);
37 /* Flow control */
38 void udc_set_nak(int epid);
39 void udc_unset_nak(int epid);
40
41 /* Higher level functions for abstracting away from specific device */
42 int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
43
44 int  udc_init(void);
45
46 void udc_enable(struct usb_device_instance *device);
47 void udc_disable(void);
48
49 void udc_connect(void);
50 void udc_disconnect(void);
51
52 void udc_startup_events(struct usb_device_instance *device);
53 void udc_setup_ep(struct usb_device_instance *device,
54          unsigned int ep, struct usb_endpoint_instance *endpoint);
55
56 #endif