blob: efb5d159ae1c15e720fba227e89654946ccb0e84 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
#ifndef _MUSBFSH_ICUSB_H
#define _MUSBFSH_ICUSB_H
enum PHY_VOLTAGE_TYPE
{
VOL_18 = 0,
VOL_33,
VOL_50,
};
enum SESSION_CONTROL_ACTION
{
STOP_SESSION = 0,
START_SESSION,
};
enum WAIT_DISCONNECT_DONE_ACTION
{
WAIT_DISCONNECT_DONE_DFT_ACTION = 0,
};
#define IC_USB_CMD_LEN 255
struct IC_USB_CMD
{
unsigned char type;
unsigned char length;
unsigned char data[IC_USB_CMD_LEN];
};
enum IC_USB_CMD_TYPE
{
USB11_SESSION_CONTROL = 0,
USB11_INIT_PHY_BY_VOLTAGE,
USB11_WAIT_DISCONNECT_DONE,
};
/* ICUSB feature list */
/* --- sysfs controlable feature --- */
#define MTK_ICUSB_POWER_AND_RESUME_TIME_NEOGO_SUPPORT
#define MTK_ICUSB_SKIP_SESSION_REQ
#define MTK_ICUSB_SKIP_ENABLE_SESSION
#define MTK_ICUSB_SKIP_MAC_INIT
#define MTK_ICUSB_RESISTOR_CONTROL
#define MTK_ICUSB_HW_DBG
//#define MTK_ICUSB_SKIP_PORT_PM
/* --- non sysfs controlable feature --- */
//#define MTK_ICUSB_TAKE_WAKE_LOCK
//#define MTK_ICUSB_BABBLE_RECOVER
struct my_attr {
struct attribute attr;
int value;
};
/* power neogo */
#define IC_USB_REQ_TYPE_GET_INTERFACE_POWER 0xC0
#define IC_USB_REQ_TYPE_SET_INTERFACE_POWER 0x40
#define IC_USB_REQ_GET_INTERFACE_POWER 0x01
#define IC_USB_REQ_SET_INTERFACE_POWER 0x02
#define IC_USB_WVALUE_POWER_NEGOTIATION 0
#define IC_USB_WINDEX_POWER_NEGOTIATION 0
#define IC_USB_LEN_POWER_NEGOTIATION 2
#define IC_USB_PREFER_CLASSB_ENABLE_BIT 0x80
#define IC_USB_RETRIES_POWER_NEGOTIATION 3
#define IC_USB_CLASSB (1<<1)
#define IC_USB_CLASSC (1<<2)
#define IC_USB_CURRENT 100 // in 2 mA unit, 100 denotes 200 mA
/* resume_time neogo */
#define IC_USB_REQ_TYPE_GET_INTERFACE_RESUME_TIME 0xC0
#define IC_USB_REQ_GET_INTERFACE_RESUME_TIME 0x03
#define IC_USB_WVALUE_RESUME_TIME_NEGOTIATION 0
#define IC_USB_WINDEX_RESUME_TIME_NEGOTIATION 0
#define IC_USB_LEN_RESUME_TIME_NEGOTIATION 3
#define IC_USB_RETRIES_RESUME_TIME_NEGOTIATION 3
//== ===================
// ic_usb_status :
// Byte4 : wait disconnect status
// Byte3 Byte2 : get interface power reqest data field
// Byte1 : power negotiation result
//
//=====================
#define PREFER_VOL_STS_SHIFT (0)
#define PREFER_VOL_STS_MSK (0x3)
#define PREFER_VOL_NOT_INITED 0x0
#define PREFER_VOL_PWR_NEG_FAIL 0x1
#define PREFER_VOL_PWR_NEG_OK 0x2
#define PREFER_VOL_CLASS_SHIFT (8)
#define PREFER_VOL_CLASS_MSK (0xff)
#define USB_PORT1_STS_SHIFT (24)
#define USB_PORT1_STS_MSK (0xf)
#define USB_PORT1_DISCONNECTING 0x0
#define USB_PORT1_DISCONNECT_DONE 0x1
#define USB_PORT1_CONNECT 0x2
#endif
|