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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
#ifndef __DSI_DRV_H__
#define __DSI_DRV_H__
#include <mach/mt_typedefs.h>
#include "lcm_drv.h"
#include "ddp_hal.h"
#include <video/fbconfig_kdebug_k2.h>
#ifdef __cplusplus
extern "C" {
#endif
// ---------------------------------------------------------------------------
#define DSI_CHECK_RET(expr) \
do { \
DSI_STATUS ret = (expr); \
ASSERT(DSI_STATUS_OK == ret); \
} while (0)
// ---------------------------------------------------------------------------
#define DSI_DCS_SHORT_PACKET_ID_0 0x05
#define DSI_DCS_SHORT_PACKET_ID_1 0x15
#define DSI_DCS_LONG_PACKET_ID 0x39
#define DSI_DCS_READ_PACKET_ID 0x06
#define DSI_GERNERIC_SHORT_PACKET_ID_1 0x13
#define DSI_GERNERIC_SHORT_PACKET_ID_2 0x23
#define DSI_GERNERIC_LONG_PACKET_ID 0x29
#define DSI_GERNERIC_READ_LONG_PACKET_ID 0x14
#define DSI_NULL_PACKET_ID 0x09
#define DSI_WMEM_CONTI (0x3C)
#define DSI_RMEM_CONTI (0x3E)
// ESD recovery method for video mode LCM
#define METHOD_NONCONTINUOUS_CLK (0x1)
#define METHOD_BUS_TURN_AROUND (0x2)
// State of DSI engine
#define DSI_VDO_VSA_VS_STATE (0x008)
#define DSI_VDO_VSA_HS_STATE (0x010)
#define DSI_VDO_VSA_VE_STATE (0x020)
#define DSI_VDO_VBP_STATE (0x040)
#define DSI_VDO_VACT_STATE (0x080)
#define DSI_VDO_VFP_STATE (0x100)
// ---------------------------------------------------------------------------
typedef enum
{
DSI_STATUS_OK = 0,
DSI_STATUS_ERROR,
} DSI_STATUS;
typedef enum
{
SHORT_PACKET_RW = 0,
FB_WRITE = 1,
LONG_PACKET_W = 2,
FB_READ = 3,
} DSI_INS_TYPE;
typedef enum
{
DISABLE_BTA = 0,
ENABLE_BTA = 1,
} DSI_CMDQ_BTA;
typedef enum
{
LOW_POWER = 0,
HIGH_SPEED = 1,
} DSI_CMDQ_HS;
typedef enum
{
CL_8BITS = 0,
CL_16BITS = 1,
} DSI_CMDQ_CL;
typedef enum
{
DISABLE_TE = 0,
ENABLE_TE = 1,
} DSI_CMDQ_TE;
typedef enum
{
DISABLE_RPT = 0,
ENABLE_RPT = 1,
} DSI_CMDQ_RPT;
typedef struct
{
unsigned type : 2;
unsigned BTA : 1;
unsigned HS : 1;
unsigned CL : 1;
unsigned TE : 1;
unsigned Rsv : 1;
unsigned RPT : 1;
} DSI_CMDQ_CONFG, *PDSI_CMDQ_CONFIG;
typedef struct
{
unsigned CONFG : 8;
unsigned Data_ID : 8;
unsigned Data0 : 8;
unsigned Data1 : 8;
} DSI_T0_INS, *PDSI_T0_INS;
typedef struct
{
unsigned CONFG : 8;
unsigned Data_ID : 8;
unsigned mem_start0 : 8;
unsigned mem_start1 : 8;
} DSI_T1_INS, *PDSI_T1_INS;
typedef struct
{
unsigned CONFG : 8;
unsigned Data_ID : 8;
unsigned WC16 : 16;
unsigned int *pdata;
} DSI_T2_INS, *PDSI_T2_INS;
typedef struct
{
unsigned CONFG : 8;
unsigned Data_ID : 8;
unsigned mem_start0 : 8;
unsigned mem_start1 : 8;
} DSI_T3_INS, *PDSI_T3_INS;
typedef struct
{
UINT8 TXDIV0;
UINT8 TXDIV1;
UINT32 SDM_PCW;
UINT8 SSC_PH_INIT;
UINT16 SSC_PRD;
UINT16 SSC_DELTA1;
UINT16 SSC_DELTA;
}DSI_PLL_CONFIG;
typedef enum
{
DSI_INTERFACE_0= 0,
DSI_INTERFACE_1,
DSI_INTERFACE_DUAL,
DSI_INTERFACE_NUM,
}DSI_INTERFACE_ID;
void DSI_ChangeClk(DISP_MODULE_ENUM module,UINT32 clk);
INT32 DSI_ssc_enable(UINT32 dsi_idx,UINT32 en);
UINT32 PanelMaster_get_CC(UINT32 dsi_idx);
void PanelMaster_set_CC(UINT32 dsi_index,UINT32 enable);
UINT32 PanelMaster_get_dsi_timing(UINT32 dsi_index,MIPI_SETTING_TYPE type);
UINT32 PanelMaster_get_TE_status(UINT32 dsi_idx);
void PanelMaster_DSI_set_timing(UINT32 dsi_index,MIPI_TIMING timing);
unsigned int PanelMaster_set_PM_enable( unsigned int value);
UINT32 DSI_dcs_read_lcm_reg_v2(DISP_MODULE_ENUM module, cmdqRecHandle cmdq, UINT8 cmd, UINT8 *buffer, UINT8 buffer_size);
void*get_dsi_params_handle(UINT32 dsi_idx);
#ifdef __cplusplus
}
#endif
#endif // __DPI_DRV_H__
|