XenevaOS
Loading...
Searching...
No Matches
XenevaOS
BaseHdr
linux
usb
otg.h
Go to the documentation of this file.
1
#ifndef __LINUX_USB_OTG_H__
2
#define __LINUX_USB_OTG_H__
3
4
#include <
linux/usb/ch9.h
>
5
6
#define OTG_VERSION_1_3 0x0130
7
#define OTG_VERSION_2_0 0x0200
8
9
enum
usb_dr_mode
{
10
USB_DR_MODE_UNKNOWN
,
11
USB_DR_MODE_HOST
,
12
USB_DR_MODE_PERIPHERAL
,
13
USB_DR_MODE_OTG
,
14
};
15
16
struct
usb_otg_caps
{
17
u16
otg_rev
;
18
bool
hnp_support
;
19
bool
srp_support
;
20
bool
adp_support
;
21
};
22
23
enum
usb_otg_state
{
24
OTG_STATE_UNDEFINED
= 0,
25
OTG_STATE_B_IDLE
,
26
OTG_STATE_B_SRP_INIT
,
27
OTG_STATE_B_PERIPHERAL
,
28
OTG_STATE_B_WAIT_ACON
,
29
OTG_STATE_B_HOST
,
30
OTG_STATE_A_IDLE
,
31
OTG_STATE_A_WAIT_VRISE
,
32
OTG_STATE_A_WAIT_BCON
,
33
OTG_STATE_A_HOST
,
34
OTG_STATE_A_SUSPEND
,
35
OTG_STATE_A_PERIPHERAL
,
36
OTG_STATE_A_WAIT_VFAIL
,
37
OTG_STATE_A_VBUS_ERR
,
38
};
39
40
struct
usb_otg
{
41
u8
default_a
;
42
struct
usb_phy*
phy
;
43
struct
usb_bus
*
host
;
44
struct
usb_gadget*
gadget
;
45
enum
usb_otg_state
state
;
46
47
int (*
set_host
)(
struct
usb_otg
* otg,
struct
usb_bus
*
host
);
48
49
};
50
51
#endif
ch9.h
u8
uint8_t u8
Definition
kernel.h:14
u16
uint16_t u16
Definition
kernel.h:15
usb_otg_state
usb_otg_state
Definition
otg.h:23
OTG_STATE_B_WAIT_ACON
@ OTG_STATE_B_WAIT_ACON
Definition
otg.h:28
OTG_STATE_B_SRP_INIT
@ OTG_STATE_B_SRP_INIT
Definition
otg.h:26
OTG_STATE_UNDEFINED
@ OTG_STATE_UNDEFINED
Definition
otg.h:24
OTG_STATE_A_WAIT_BCON
@ OTG_STATE_A_WAIT_BCON
Definition
otg.h:32
OTG_STATE_A_WAIT_VFAIL
@ OTG_STATE_A_WAIT_VFAIL
Definition
otg.h:36
OTG_STATE_B_IDLE
@ OTG_STATE_B_IDLE
Definition
otg.h:25
OTG_STATE_B_PERIPHERAL
@ OTG_STATE_B_PERIPHERAL
Definition
otg.h:27
OTG_STATE_A_PERIPHERAL
@ OTG_STATE_A_PERIPHERAL
Definition
otg.h:35
OTG_STATE_A_HOST
@ OTG_STATE_A_HOST
Definition
otg.h:33
OTG_STATE_A_VBUS_ERR
@ OTG_STATE_A_VBUS_ERR
Definition
otg.h:37
OTG_STATE_A_WAIT_VRISE
@ OTG_STATE_A_WAIT_VRISE
Definition
otg.h:31
OTG_STATE_B_HOST
@ OTG_STATE_B_HOST
Definition
otg.h:29
OTG_STATE_A_IDLE
@ OTG_STATE_A_IDLE
Definition
otg.h:30
OTG_STATE_A_SUSPEND
@ OTG_STATE_A_SUSPEND
Definition
otg.h:34
usb_dr_mode
usb_dr_mode
Definition
otg.h:9
USB_DR_MODE_PERIPHERAL
@ USB_DR_MODE_PERIPHERAL
Definition
otg.h:12
USB_DR_MODE_HOST
@ USB_DR_MODE_HOST
Definition
otg.h:11
USB_DR_MODE_UNKNOWN
@ USB_DR_MODE_UNKNOWN
Definition
otg.h:10
USB_DR_MODE_OTG
@ USB_DR_MODE_OTG
Definition
otg.h:13
usb_bus
Definition
ch9.h:166
usb_otg_caps
Definition
otg.h:16
usb_otg_caps::adp_support
bool adp_support
Definition
otg.h:20
usb_otg_caps::srp_support
bool srp_support
Definition
otg.h:19
usb_otg_caps::hnp_support
bool hnp_support
Definition
otg.h:18
usb_otg_caps::otg_rev
u16 otg_rev
Definition
otg.h:17
usb_otg
Definition
otg.h:40
usb_otg::phy
struct usb_phy * phy
Definition
otg.h:42
usb_otg::set_host
int(* set_host)(struct usb_otg *otg, struct usb_bus *host)
Definition
otg.h:47
usb_otg::gadget
struct usb_gadget * gadget
Definition
otg.h:44
usb_otg::state
enum usb_otg_state state
Definition
otg.h:45
usb_otg::host
struct usb_bus * host
Definition
otg.h:43
usb_otg::default_a
u8 default_a
Definition
otg.h:41
Generated by
1.9.8