blob: b2e0c6b6f5159d8768d382858809f55bc4160eb5 [file] [log] [blame]
Troy Kiskydf446f52013-10-10 15:28:04 -07001/*
2 * SPDX-License-Identifier: GPL-2.0+
3 */
4#ifndef USB_UDC_H
5#define USB_UDC_H
6
7#ifndef EP0_MAX_PACKET_SIZE
8#define EP0_MAX_PACKET_SIZE 64
9#endif
10
11#ifndef EP_MAX_PACKET_SIZE
12#define EP_MAX_PACKET_SIZE 64
13#endif
14
Masahiro Yamada641e3ce2014-07-30 19:11:41 +090015#if !defined(CONFIG_PPC)
16/* mpc8xx_udc.h will set these values */
Troy Kiskydf446f52013-10-10 15:28:04 -070017#define UDC_OUT_PACKET_SIZE EP_MAX_PACKET_SIZE
18#define UDC_IN_PACKET_SIZE EP_MAX_PACKET_SIZE
19#define UDC_INT_PACKET_SIZE EP_MAX_PACKET_SIZE
20#define UDC_BULK_PACKET_SIZE EP_MAX_PACKET_SIZE
21#endif
22
23#define UDC_BULK_HS_PACKET_SIZE 512
24
25#ifndef UDC_INT_ENDPOINT
26#define UDC_INT_ENDPOINT 1
27#endif
28
29#ifndef UDC_OUT_ENDPOINT
30#define UDC_OUT_ENDPOINT 2
31#endif
32
33#ifndef UDC_IN_ENDPOINT
34#define UDC_IN_ENDPOINT 3
35#endif
36
37/* function declarations */
38int udc_init(void);
39void udc_irq(void);
40int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
41void udc_setup_ep(struct usb_device_instance *device, unsigned int ep,
42 struct usb_endpoint_instance *endpoint);
43void udc_connect(void);
44void udc_disconnect(void);
45void udc_enable(struct usb_device_instance *device);
46void udc_disable(void);
47void udc_startup_events(struct usb_device_instance *device);
48
49/* Flow control */
50void udc_set_nak(int epid);
51void udc_unset_nak(int epid);
52
53#endif