]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
a1428969 TA |
2 | /* |
3 | * Mentor USB OTG Core host controller driver. | |
4 | * | |
5 | * Copyright (c) 2008 Texas Instruments | |
6 | * | |
a1428969 TA |
7 | * Author: Thomas Abraham [email protected], Texas Instruments |
8 | */ | |
9 | ||
10 | #ifndef __MUSB_HCD_H__ | |
11 | #define __MUSB_HCD_H__ | |
12 | ||
13 | #include "musb_core.h" | |
14 | #ifdef CONFIG_USB_KEYBOARD | |
52cb4d4f | 15 | #include <stdio_dev.h> |
a1428969 TA |
16 | extern unsigned char new[]; |
17 | #endif | |
18 | ||
8de73b7b | 19 | #define MUSB_TIMEOUT 100000 |
c3a012ce | 20 | |
a1428969 TA |
21 | /* This defines the endpoint number used for control transfers */ |
22 | #define MUSB_CONTROL_EP 0 | |
23 | ||
24 | /* This defines the endpoint number used for bulk transfer */ | |
e608f221 BW |
25 | #ifndef MUSB_BULK_EP |
26 | # define MUSB_BULK_EP 1 | |
27 | #endif | |
a1428969 TA |
28 | |
29 | /* This defines the endpoint number used for interrupt transfer */ | |
30 | #define MUSB_INTR_EP 2 | |
31 | ||
32 | /* Determine the operating speed of MUSB core */ | |
33 | #define musb_ishighspeed() \ | |
34 | ((readb(&musbr->power) & MUSB_POWER_HSMODE) \ | |
35 | >> MUSB_POWER_HSMODE_SHIFT) | |
36 | ||
321790f6 BW |
37 | /* USB HUB CONSTANTS (not OHCI-specific; see hub.h) */ |
38 | ||
39 | /* destination of request */ | |
40 | #define RH_INTERFACE 0x01 | |
41 | #define RH_ENDPOINT 0x02 | |
42 | #define RH_OTHER 0x03 | |
43 | ||
44 | #define RH_CLASS 0x20 | |
45 | #define RH_VENDOR 0x40 | |
46 | ||
47 | /* Requests: bRequest << 8 | bmRequestType */ | |
48 | #define RH_GET_STATUS 0x0080 | |
49 | #define RH_CLEAR_FEATURE 0x0100 | |
50 | #define RH_SET_FEATURE 0x0300 | |
51 | #define RH_SET_ADDRESS 0x0500 | |
52 | #define RH_GET_DESCRIPTOR 0x0680 | |
53 | #define RH_SET_DESCRIPTOR 0x0700 | |
54 | #define RH_GET_CONFIGURATION 0x0880 | |
55 | #define RH_SET_CONFIGURATION 0x0900 | |
56 | #define RH_GET_STATE 0x0280 | |
57 | #define RH_GET_INTERFACE 0x0A80 | |
58 | #define RH_SET_INTERFACE 0x0B00 | |
59 | #define RH_SYNC_FRAME 0x0C80 | |
60 | /* Our Vendor Specific Request */ | |
61 | #define RH_SET_EP 0x2000 | |
62 | ||
63 | /* Hub port features */ | |
64 | #define RH_PORT_CONNECTION 0x00 | |
65 | #define RH_PORT_ENABLE 0x01 | |
66 | #define RH_PORT_SUSPEND 0x02 | |
67 | #define RH_PORT_OVER_CURRENT 0x03 | |
68 | #define RH_PORT_RESET 0x04 | |
69 | #define RH_PORT_POWER 0x08 | |
70 | #define RH_PORT_LOW_SPEED 0x09 | |
71 | ||
72 | #define RH_C_PORT_CONNECTION 0x10 | |
73 | #define RH_C_PORT_ENABLE 0x11 | |
74 | #define RH_C_PORT_SUSPEND 0x12 | |
75 | #define RH_C_PORT_OVER_CURRENT 0x13 | |
76 | #define RH_C_PORT_RESET 0x14 | |
77 | ||
78 | /* Hub features */ | |
79 | #define RH_C_HUB_LOCAL_POWER 0x00 | |
80 | #define RH_C_HUB_OVER_CURRENT 0x01 | |
81 | ||
82 | #define RH_DEVICE_REMOTE_WAKEUP 0x00 | |
83 | #define RH_ENDPOINT_STALL 0x01 | |
84 | ||
85 | #define RH_ACK 0x01 | |
86 | #define RH_REQ_ERR -1 | |
87 | #define RH_NACK 0x00 | |
88 | ||
a1428969 TA |
89 | /* extern functions */ |
90 | extern int musb_platform_init(void); | |
91 | extern void musb_platform_deinit(void); | |
92 | ||
93 | #endif /* __MUSB_HCD_H__ */ |