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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2014 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
// MStar Semiconductor Inc. and be kept in strict confidence
// (??MStar Confidential Information??) by the recipient.
// Any unauthorized act including without limitation unauthorized disclosure,
// copying, use, reproduction, sale, distribution, modification, disassembling,
// reverse engineering and compiling of the contents of MStar Confidential
// Information is unlawful and strictly prohibited. MStar hereby reserves the
// rights to any and all damages, losses, costs and expenses resulting therefrom.
//
////////////////////////////////////////////////////////////////////////////////
/**
*
* @file mstar_drv_ic_fw_porting_layer.c
*
* @brief This file defines the interface of touch screen
*
*
*/
/*=============================================================*/
// INCLUDE FILE
/*=============================================================*/
#include "mstar_drv_ic_fw_porting_layer.h"
/*=============================================================*/
// EXTERN VARIABLE DECLARATION
/*=============================================================*/
#ifdef CONFIG_ENABLE_GESTURE_WAKEUP
extern u32 g_GestureWakeupMode[2];
extern u8 g_GestureWakeupFlag;
#endif //CONFIG_ENABLE_GESTURE_WAKEUP
/*=============================================================*/
// GLOBAL FUNCTION DEFINITION
/*=============================================================*/
void DrvIcFwLyrVariableInitialize(void)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlVariableInitialize();
}
void DrvIcFwLyrOptimizeCurrentConsumption(void)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlOptimizeCurrentConsumption();
}
u8 DrvIcFwLyrGetChipType(void)
{
// DBG("*** %s() ***\n", __func__);
return DrvFwCtrlGetChipType();
}
void DrvIcFwLyrGetCustomerFirmwareVersion(u16 *pMajor, u16 *pMinor, u8 **ppVersion)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlGetCustomerFirmwareVersion(pMajor, pMinor, ppVersion);
}
void DrvIcFwLyrGetPlatformFirmwareVersion(u8 **ppVersion)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlGetPlatformFirmwareVersion(ppVersion);
}
s32 DrvIcFwLyrUpdateFirmware(u8 szFwData[][1024], EmemType_e eEmemType)
{
// DBG("*** %s() ***\n", __func__);
return DrvFwCtrlUpdateFirmware(szFwData, eEmemType);
}
s32 DrvIcFwLyrUpdateFirmwareBySdCard(const char *pFilePath)
{
// DBG("*** %s() ***\n", __func__);
return DrvFwCtrlUpdateFirmwareBySdCard(pFilePath);
}
u32 DrvIcFwLyrIsRegisterFingerTouchInterruptHandler(void)
{
DBG("*** %s() ***\n", __func__);
return 1; // Indicate that it is necessary to register interrupt handler with GPIO INT pin when firmware is running on IC
}
void DrvIcFwLyrHandleFingerTouch(u8 *pPacket, u16 nLength)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlHandleFingerTouch();
}
//------------------------------------------------------------------------------//
#ifdef CONFIG_ENABLE_GESTURE_WAKEUP
void DrvIcFwLyrOpenGestureWakeup(u32 *pWakeupMode)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlOpenGestureWakeup(pWakeupMode);
}
void DrvIcFwLyrCloseGestureWakeup(void)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlCloseGestureWakeup();
}
#ifdef CONFIG_ENABLE_GESTURE_DEBUG_MODE
void DrvIcFwLyrOpenGestureDebugMode(u8 nGestureFlag)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlOpenGestureDebugMode(nGestureFlag);
}
void DrvIcFwLyrCloseGestureDebugMode(void)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlCloseGestureDebugMode();
}
#endif //CONFIG_ENABLE_GESTURE_DEBUG_MODE
#endif //CONFIG_ENABLE_GESTURE_WAKEUP
u32 DrvIcFwLyrReadDQMemValue(u16 nAddr)
{
// DBG("*** %s() ***\n", __func__);
return DrvFwCtrlReadDQMemValue(nAddr);
}
void DrvIcFwLyrWriteDQMemValue(u16 nAddr, u32 nData)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlWriteDQMemValue(nAddr, nData);
}
//------------------------------------------------------------------------------//
#if defined(CONFIG_ENABLE_TOUCH_DRIVER_FOR_MUTUAL_IC) // use for MSG26XXM only
u16 DrvIcFwLyrGetFirmwareMode(void)
{
// DBG("*** %s() ***\n", __func__);
return DrvFwCtrlGetFirmwareMode();
}
#endif //CONFIG_ENABLE_TOUCH_DRIVER_FOR_MUTUAL_IC
u16 DrvIcFwLyrChangeFirmwareMode(u16 nMode)
{
// DBG("*** %s() ***\n", __func__);
return DrvFwCtrlChangeFirmwareMode(nMode);
}
void DrvIcFwLyrGetFirmwareInfo(FirmwareInfo_t *pInfo)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlGetFirmwareInfo(pInfo);
}
void DrvIcFwLyrRestoreFirmwareModeToLogDataMode(void)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlRestoreFirmwareModeToLogDataMode();
}
//------------------------------------------------------------------------------//
#ifdef CONFIG_UPDATE_FIRMWARE_BY_SW_ID
void DrvIcFwLyrCheckFirmwareUpdateBySwId(void)
{
// DBG("*** %s() ***\n", __func__);
DrvFwCtrlCheckFirmwareUpdateBySwId();
}
#endif //CONFIG_UPDATE_FIRMWARE_BY_SW_ID
//------------------------------------------------------------------------------//
#ifdef CONFIG_ENABLE_ITO_MP_TEST
void DrvIcFwLyrCreateMpTestWorkQueue(void)
{
// DBG("*** %s() ***\n", __func__);
DrvMpTestCreateMpTestWorkQueue();
}
void DrvIcFwLyrScheduleMpTestWork(ItoTestMode_e eItoTestMode)
{
// DBG("*** %s() ***\n", __func__);
DrvMpTestScheduleMpTestWork(eItoTestMode);
}
s32 DrvIcFwLyrGetMpTestResult(void)
{
// DBG("*** %s() ***\n", __func__);
return DrvMpTestGetTestResult();
}
void DrvIcFwLyrGetMpTestFailChannel(ItoTestMode_e eItoTestMode, u8 *pFailChannel, u32 *pFailChannelCount)
{
// DBG("*** %s() ***\n", __func__);
return DrvMpTestGetTestFailChannel(eItoTestMode, pFailChannel, pFailChannelCount);
}
void DrvIcFwLyrGetMpTestDataLog(ItoTestMode_e eItoTestMode, u8 *pDataLog, u32 *pLength)
{
// DBG("*** %s() ***\n", __func__);
return DrvMpTestGetTestDataLog(eItoTestMode, pDataLog, pLength);
}
#if defined(CONFIG_ENABLE_TOUCH_DRIVER_FOR_MUTUAL_IC)
void DrvIcFwLyrGetMpTestScope(TestScopeInfo_t *pInfo)
{
// DBG("*** %s() ***\n", __func__);
return DrvMpTestGetTestScope(pInfo);
}
#endif //CONFIG_ENABLE_TOUCH_DRIVER_FOR_MUTUAL_IC
#endif //CONFIG_ENABLE_ITO_MP_TEST
//------------------------------------------------------------------------------//
#ifdef CONFIG_ENABLE_SEGMENT_READ_FINGER_TOUCH_DATA
#if defined(CONFIG_ENABLE_TOUCH_DRIVER_FOR_MUTUAL_IC)
void DrvIcFwLyrGetTouchPacketAddress(u16 *pDataAddress, u16 *pFlagAddress)
{
// DBG("*** %s() ***\n", __func__);
return DrvFwCtrlGetTouchPacketAddress(pDataAddress, pFlagAddress);
}
#endif //CONFIG_ENABLE_TOUCH_DRIVER_FOR_MUTUAL_IC
#endif //CONFIG_ENABLE_SEGMENT_READ_FINGER_TOUCH_DATA
//------------------------------------------------------------------------------//
#ifdef CONFIG_ENABLE_PROXIMITY_DETECTION
s32 DrvIcFwLyrEnableProximity(void)
{
// DBG("*** %s() ***\n", __func__);
return DrvFwCtrlEnableProximity();
}
s32 DrvIcFwLyrDisableProximity(void)
{
// DBG("*** %s() ***\n", __func__);
return DrvFwCtrlDisableProximity();
}
#endif //CONFIG_ENABLE_PROXIMITY_DETECTION
//------------------------------------------------------------------------------//
#ifdef CONFIG_ENABLE_GLOVE_MODE
void DrvIcFwLyrOpenGloveMode(void)
{
// DBG("*** %s() ***\n", __func__);
DrvIcFwCtrlOpenGloveMode();
}
void DrvIcFwLyrCloseGloveMode(void)
{
// DBG("*** %s() ***\n", __func__);
DrvIcFwCtrlCloseGloveMode();
}
void DrvIcFwLyrGetGloveInfo(u8 *pGloveMode)
{
// DBG("*** %s() ***\n", __func__);
DrvIcFwCtrlGetGloveInfo(pGloveMode);
}
#endif //CONFIG_ENABLE_GLOVE_MODE
//------------------------------------------------------------------------------//
|