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