• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #include "mipi_csi_test.h"
10 #include "hdf_log.h"
11 #include "osal_time.h"
12 #include "securec.h"
13 
14 #define HDF_LOG_TAG mipi_csi_test
15 #define SEQ_OUTPUT_DELAY 100 /* Delay time of sequential output, unit: ms */
16 
17 // Input interface type of RX.
18 enum InterfaceType {
19     INTERFACE_MIPI = 0,
20     INTERFACE_LVDS,
21     INTERFACE_CMOS,
22     INTERFACE_BUTT
23 };
24 
MipiCsiTestSetUp(struct MipiCsiTest * test)25 static int32_t MipiCsiTestSetUp(struct MipiCsiTest *test)
26 {
27     HDF_LOGI("MipiCsiTestSetUp: enter!");
28 
29     if (test == NULL) {
30         HDF_LOGE("MipiCsiTestSetUp: test is null!");
31         return HDF_ERR_INVALID_OBJECT;
32     }
33 
34     if (test->handle == NULL) {
35         HDF_LOGE("MipiCsiTestSetUp: enter, cntlrId:0x%x!", test->cntlrId);
36         test->cntlrId = 0;
37         test->handle = MipiCsiOpen(test->cntlrId);
38         if (test->handle == NULL) {
39             HDF_LOGE("MipiCsiTestSetUp: fail!");
40             return HDF_FAILURE;
41         }
42     }
43 
44     test->fails = 0;
45     HDF_LOGD("MipiCsiTestSetUp: cntlrId:0x%x!", test->cntlrId);
46     return HDF_SUCCESS;
47 }
48 
MipiCsiTestTearDown(struct MipiCsiTest * test)49 static void MipiCsiTestTearDown(struct MipiCsiTest *test)
50 {
51     if (test == NULL) {
52         HDF_LOGE("MipiCsiTestTearDown: test is null!");
53         return;
54     }
55     if (test->handle != NULL) {
56         MipiCsiClose(test->handle);
57         test->handle = NULL;
58     }
59 }
60 
61 /**
62  * @brief Initialize the device parameters applying LVDS protocol.
63  *
64  * This is not fully tested!
65  *
66  * @since 1.0
67  */
InitLvdsDevAttr(LvdsDevAttr * lvdsAttr)68 static void InitLvdsDevAttr(LvdsDevAttr *lvdsAttr)
69 {
70     int i;
71     int j;
72     int k;
73     LvdsDevAttr attr;
74 
75     if (lvdsAttr == NULL) {
76         HDF_LOGE("InitLvdsDevAttr: lvdsAttr is null!");
77         return;
78     }
79 
80     (void)memset_s(&attr, sizeof(LvdsDevAttr), 0, sizeof(LvdsDevAttr));
81     // Hi3516CV500 (DATA_TYPE_RAW_12BIT), Hi3516EV200 (DATA_TYPE_RAW_12BIT)
82     attr.inputDataType = DATA_TYPE_RAW_12BIT;
83     attr.wdrMode = HI_WDR_MODE_NONE;
84     // LVDS synchronization mode. LVDS_SYNC_MODE_SOF, LVDS_SYNC_MODE_SAV
85     attr.syncMode = LVDS_SYNC_MODE_SOF;
86     // LVDS Vsync type. LVDS_VSYNC_NORMAL, LVDS_VSYNC_SHARE, LVDS_VSYNC_HCONNECT
87     attr.vsyncAttr.syncType = LVDS_VSYNC_NORMAL;
88     // hconnect vsync blanking len, valid when the syncType is LVDS_VSYNC_HCONNECT
89     // This is not fully tested!
90     if (attr.vsyncAttr.syncType == LVDS_VSYNC_HCONNECT) {
91         attr.vsyncAttr.hblank1 = 0;
92         attr.vsyncAttr.hblank2 = 0;
93     }
94     // frame identification code: LVDS_FID_NONE, LVDS_FID_IN_SAV, LVDS_FID_IN_DATA
95     attr.fidAttr.fidType = LVDS_FID_NONE;
96     // Sony DOL has the Frame Information Line, in DOL H-Connection mode, should
97     // configure this flag as false to disable output the Frame Information Line.
98     // This is not fully tested!
99     attr.fidAttr.outputFil = 'm';
100     // LVDS bit size end mode: LVDS_ENDIAN_LITTLE, LVDS_ENDIAN_BIG
101     attr.dataEndian = LVDS_ENDIAN_LITTLE;
102     // sync code endian: little/big, LVDS_ENDIAN_LITTLE, LVDS_ENDIAN_BIG
103     attr.syncCodeEndian = LVDS_ENDIAN_LITTLE;
104     // laneId: -1 - disable
105     attr.laneId[0] = 0; /* 0 -- laneId 0 */
106     attr.laneId[1] = 1; /* 1 -- laneId 1 */
107     attr.laneId[2] = 2; /* 2 -- laneId 2 */
108     attr.laneId[3] = 3; /* 3 -- laneId 3 */
109 
110     /** each vc has 4 params, syncCode[i]:
111         syncMode is SYNC_MODE_SOF: SOF, EOF, SOL, EOL
112         syncMode is SYNC_MODE_SAV: invalid sav, invalid eav, valid sav, valid eav */
113     // This is not fully tested!
114     for (i = 0; i < LVDS_LANE_NUM; i++) {
115         for (j = 0; j < WDR_VC_NUM; j++) {
116             for (k = 0; k < SYNC_CODE_NUM; k++) {
117                 attr.syncCode[i][j][k] = 0; /* 0 -- frame0 sof */
118             }
119         }
120     }
121 
122     *lvdsAttr = attr;
123 }
124 
125 /**
126  * @brief Initialize MIPI device attributes.
127  *
128  * Data type (DT: data type)
129  * The data type describes the format and content of load data. Up to 64 data types are supported.
130  * There are only two data types for short packets, and the others belong to long packets.
131  *
132  * @Data type describe
133  * 0x00 – 0x07 Synchronous short packet data type
134  * 0x08 – 0x0F General short packet data type
135  * 0x10 – 0x17 General long packet data type
136  * 0x18 – 0x1F YUV data
137  * 0x20 – 0x27 RGB data
138  * 0x28 – 0x2F Raw data
139  * 0x30 – 0x37 User defined byte based data type
140  * 0x38 – 0x3F Reserved
141  *
142  * @since 1.0
143  */
InitMipiDevAttr(MipiDevAttr * mipiAttr)144 static void InitMipiDevAttr(MipiDevAttr *mipiAttr)
145 {
146     MipiDevAttr attr;
147 
148     if (mipiAttr == NULL) {
149         HDF_LOGE("InitMipiDevAttr: mipiAttr is null!");
150         return;
151     }
152 
153     HDF_LOGI("InitMipiDevAttr: enter!");
154     (void)memset_s(&attr, sizeof(MipiDevAttr), 0, sizeof(MipiDevAttr));
155     // Hi3516CV500 (DATA_TYPE_RAW_12BIT), Hi3516EV200 (DATA_TYPE_RAW_12BIT)
156     attr.inputDataType = DATA_TYPE_RAW_12BIT;
157     // Hi3516CV500 (HI_MIPI_WDR_MODE_NONE), Hi3516EV200 (HI_MIPI_WDR_MODE_NONE)
158     attr.wdrMode = HI_MIPI_WDR_MODE_NONE;
159     // laneId: -1 - disable
160     // Hi3516CV500 (0, 1, 2, 3), Hi3516EV200 (0, 1, -1, -1)
161     attr.laneId[0] = 0; /* 0 -- laneId 0 */
162     attr.laneId[1] = 1; /* 1 -- laneId 1 */
163     attr.laneId[2] = 2; /* 2 -- laneId 2 */
164     attr.laneId[3] = 3; /* 3 -- laneId 3 */
165 
166     // Used by the HI_MIPI_WDR_MODE_DT, This is not fully tested!
167     if (attr.wdrMode == HI_MIPI_WDR_MODE_DT) {
168         attr.dataType[0] = 0x39; /* 0x39 -- data type reserved */
169         attr.dataType[1] = 0x39; /* 0x39 -- data type reserved */
170         attr.dataType[2] = 0x39; /* 0x39 -- data type reserved */
171         attr.dataType[3] = 0x39; /* 0x39 -- data type reserved */
172     }
173 
174     *mipiAttr = attr;
175 }
176 
MipiGetIntputModeType(InputMode inputMode)177 static int MipiGetIntputModeType(InputMode inputMode)
178 {
179     switch (inputMode) {
180         case INPUT_MODE_SUBLVDS:
181         case INPUT_MODE_LVDS:
182         case INPUT_MODE_HISPI:
183             return INTERFACE_LVDS;
184         case INPUT_MODE_MIPI:
185             return INTERFACE_MIPI;
186         case INPUT_MODE_CMOS:
187         case INPUT_MODE_BT1120:
188         case INPUT_MODE_BT656:
189         case INPUT_MODE_BYPASS:
190             return INTERFACE_CMOS;
191         default:
192             break;
193     }
194 
195     return INTERFACE_BUTT;
196 }
197 
InitComboDevAttr(struct MipiCsiTest * test)198 static void InitComboDevAttr(struct MipiCsiTest *test)
199 {
200     enum InterfaceType interType;
201     ComboDevAttr attr;
202 
203     (void)memset_s(&attr, sizeof(ComboDevAttr), 0, sizeof(ComboDevAttr));
204     // Hi3516CV500(0), Hi3516EV200(0)
205     attr.devno = 0;
206     // Hi3516CV500(INPUT_MODE_MIPI), Hi3516EV200(INPUT_MODE_MIPI)
207     attr.inputMode = INPUT_MODE_MIPI;
208     // Hi3516CV500(MIPI_DATA_RATE_X1), Hi3516EV200(MIPI_DATA_RATE_X1)
209     attr.dataRate = MIPI_DATA_RATE_X1;
210     // Hi3516CV500 (0, 204, 2592, 1944), Hi3516EV200 (0, 204, 2304, 1296), Hi3516DV300-imx335 (0, 0, 2592, 1944)
211     attr.imgRect.x = 0; /* 0: image sensor left-top position */
212     attr.imgRect.y = 0; /* 0: image sensor right-top position */
213     attr.imgRect.width = 2592; /* 2592: image sensor width size */
214     attr.imgRect.height = 1944; /* 1944: image sensor height size */
215 
216     interType = MipiGetIntputModeType(attr.inputMode);
217     if (interType == INTERFACE_MIPI) {
218         HDF_LOGI("InitComboDevAttr: call[InitMipiDevAttr]!");
219         InitMipiDevAttr(&attr.mipiAttr);
220     } else if (interType == INTERFACE_LVDS) {
221         HDF_LOGI("InitComboDevAttr: call[InitLvdsDevAttr]!");
222         InitLvdsDevAttr(&attr.lvdsAttr);
223     } else {
224         HDF_LOGE("InitComboDevAttr: interType = %d is error!", attr.inputMode);
225     }
226 
227     test->attr = attr;
228 }
229 
MipiCsiSetComboDevAttrTest(struct MipiCsiTest * test)230 static int32_t MipiCsiSetComboDevAttrTest(struct MipiCsiTest *test)
231 {
232     int32_t ret;
233 
234     InitComboDevAttr(test);
235     ret = MipiCsiSetComboDevAttr(test->handle, &(test->attr));
236     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
237         return HDF_SUCCESS;
238     }
239 
240     HDF_LOGE("MipiCsiSetComboDevAttrTest: fail!");
241     return ret;
242 }
243 
MipiCsiSetPhyCmvmodeTest(struct MipiCsiTest * test)244 static int32_t MipiCsiSetPhyCmvmodeTest(struct MipiCsiTest *test)
245 {
246     int32_t ret;
247 
248     test->devno = 0;
249     // PHY_CMV_GE1200MV or PHY_CMV_LT1200MV
250     test->cmvMode = PHY_CMV_GE1200MV;
251     ret = MipiCsiSetPhyCmvmode(test->handle, test->devno, test->cmvMode);
252     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
253         return HDF_SUCCESS;
254     }
255     HDF_LOGE("MipiCsiSetPhyCmvmodeTest: fail!");
256 
257     return ret;
258 }
259 
MipiCsiResetSensorTest(struct MipiCsiTest * test)260 static int32_t MipiCsiResetSensorTest(struct MipiCsiTest *test)
261 {
262     int32_t ret;
263 
264     // snsResetSource select 0 or 1, and must be less than SNS_MAX_RST_SOURCE_NUM
265     test->snsResetSource = 0;
266     ret = MipiCsiResetSensor(test->handle, test->snsResetSource);
267     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
268         return HDF_SUCCESS;
269     }
270     HDF_LOGE("MipiCsiResetSensorTest: fail!");
271 
272     return ret;
273 }
274 
MipiCsiUnresetSensorTest(struct MipiCsiTest * test)275 static int32_t MipiCsiUnresetSensorTest(struct MipiCsiTest *test)
276 {
277     int32_t ret;
278 
279     // snsResetSource select 0 or 1, and must be less than SNS_MAX_RST_SOURCE_NUM
280     test->snsResetSource = 0;
281     ret = MipiCsiUnresetSensor(test->handle, test->snsResetSource);
282     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
283         return HDF_SUCCESS;
284     }
285     HDF_LOGE("MipiCsiUnresetSensorTest: fail!");
286 
287     return ret;
288 }
289 
MipiCsiResetRxTest(struct MipiCsiTest * test)290 static int32_t MipiCsiResetRxTest(struct MipiCsiTest *test)
291 {
292     int32_t ret;
293 
294     // comboDev select 0 or 1, and must be less than MIPI_RX_MAX_DEV_NUM
295     test->comboDev = 0;
296     ret = MipiCsiResetRx(test->handle, test->comboDev);
297     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
298         return HDF_SUCCESS;
299     }
300     HDF_LOGE("MipiCsiResetRxTest: fail!");
301 
302     return ret;
303 }
304 
MipiCsiUnresetRxTest(struct MipiCsiTest * test)305 static int32_t MipiCsiUnresetRxTest(struct MipiCsiTest *test)
306 {
307     int32_t ret;
308 
309     // comboDev select 0 or 1, and must be less than MIPI_RX_MAX_DEV_NUM
310     test->comboDev = 0;
311     ret = MipiCsiUnresetRx(test->handle, test->comboDev);
312     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
313         return HDF_SUCCESS;
314     }
315     HDF_LOGE("MipiCsiUnresetRxTest: fail!");
316 
317     return ret;
318 }
319 
MipiCsiSetHsModeTest(struct MipiCsiTest * test)320 static int32_t MipiCsiSetHsModeTest(struct MipiCsiTest *test)
321 {
322     int32_t ret;
323 
324     // laneDivideMode: Hi3516CV500(LANE_DIVIDE_MODE_0), Hi3516EV200(LANE_DIVIDE_MODE_0)
325     test->laneDivideMode = LANE_DIVIDE_MODE_0;
326     ret = MipiCsiSetHsMode(test->handle, test->laneDivideMode);
327     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
328         return HDF_SUCCESS;
329     }
330     HDF_LOGE("MipiCsiSetHsModeTest: fail!");
331 
332     return ret;
333 }
334 
MipiCsiEnableMipiClockTest(struct MipiCsiTest * test)335 static int32_t MipiCsiEnableMipiClockTest(struct MipiCsiTest *test)
336 {
337     int32_t ret;
338 
339     // comboDev select 0 or 1, and must be less than MIPI_RX_MAX_DEV_NUM
340     test->comboDev = 0;
341     ret = MipiCsiEnableClock(test->handle, test->comboDev);
342     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
343         return HDF_SUCCESS;
344     }
345     HDF_LOGE("MipiCsiEnableMipiClockTest: fail!");
346 
347     return ret;
348 }
349 
MipiCsiDisableMipiClockTest(struct MipiCsiTest * test)350 static int32_t MipiCsiDisableMipiClockTest(struct MipiCsiTest *test)
351 {
352     int32_t ret;
353 
354     // comboDev select 0 or 1, and must be less than MIPI_RX_MAX_DEV_NUM
355     test->comboDev = 0;
356     ret = MipiCsiDisableClock(test->handle, test->comboDev);
357     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
358         return HDF_SUCCESS;
359     }
360     HDF_LOGE("MipiCsiDisableMipiClockTest: fail!");
361 
362     return ret;
363 }
364 
MipiCsiEnableSensorClockTest(struct MipiCsiTest * test)365 static int32_t MipiCsiEnableSensorClockTest(struct MipiCsiTest *test)
366 {
367     int32_t ret;
368 
369     // snsClkSource select 0 or 1, and must be less than SNS_MAX_CLK_SOURCE_NUM
370     test->snsClkSource = 0;
371     ret = MipiCsiEnableSensorClock(test->handle, test->snsClkSource);
372     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
373         return HDF_SUCCESS;
374     }
375     HDF_LOGE("MipiCsiEnableSensorClockTest: fail!");
376 
377     return ret;
378 }
379 
MipiCsiDisableSensorClockTest(struct MipiCsiTest * test)380 static int32_t MipiCsiDisableSensorClockTest(struct MipiCsiTest *test)
381 {
382     int32_t ret;
383 
384     // snsClkSource select 0 or 1, and must be less than SNS_MAX_CLK_SOURCE_NUM
385     test->snsClkSource = 0;
386     ret = MipiCsiDisableSensorClock(test->handle, test->snsClkSource);
387     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
388         return HDF_SUCCESS;
389     }
390     HDF_LOGE("MipiCsiDisableSensorClockTest: fail!");
391 
392     return ret;
393 }
394 
MipiCsiSetExtDataTypeTest(struct MipiCsiTest * test)395 static int32_t MipiCsiSetExtDataTypeTest(struct MipiCsiTest *test)
396 {
397     int32_t ret;
398     ExtDataType dataType;
399     dataType.devno = 0;
400     dataType.num = 0;
401     uint8_t i = 0;
402 
403     // extDataBitWidth set 8, 10, 12, 14 or 16.
404     dataType.extDataBitWidth[i++] = 12; /* 12:magic bit width */
405     dataType.extDataBitWidth[i++] = 12; /* 12:magic bit width */
406     dataType.extDataBitWidth[i] = 12;   /* 12:magic bit width */
407 
408     i = 0;
409     dataType.extDataType[i++] = 0x39; /* 0x39 -- data type reserved */
410     dataType.extDataType[i++] = 0x39; /* 0x39 -- data type reserved */
411     dataType.extDataType[i] = 0x39;   /* 0x39 -- data type reserved */
412     test->dataType = dataType;
413 
414     ret = MipiCsiSetExtDataType(test->handle, &test->dataType);
415     if ((ret == HDF_SUCCESS) || (ret == HDF_ERR_NOT_SUPPORT)) {
416         return HDF_SUCCESS;
417     }
418     HDF_LOGE("MipiCsiSetExtDataTypeTest: fail!");
419 
420     return ret;
421 }
422 
MipiCsiTestByCmd(struct MipiCsiTest * test,uint8_t cmd)423 static int32_t MipiCsiTestByCmd(struct MipiCsiTest *test, uint8_t cmd)
424 {
425     int32_t ret = HDF_FAILURE;
426 
427     if (test == NULL) {
428         HDF_LOGE("MipiCsiTestByCmd: test is null!");
429         return ret;
430     }
431 
432     HDF_LOGI("MipiCsiTestByCmd: test cmd %u, enter!", cmd);
433     switch (cmd) {
434         case MIPI_CSI_TEST_SET_HS_MODE:
435             ret = MipiCsiSetHsModeTest(test);
436             break;
437         case MIPI_CSI_TEST_DISABLE_MIPI_CLOCK:
438             ret = MipiCsiDisableMipiClockTest(test);
439             break;
440         case MIPI_CSI_TEST_ENABLE_MIPI_CLOCK:
441             ret = MipiCsiEnableMipiClockTest(test);
442             break;
443         case MIPI_CSI_TEST_RESET_RX:
444             ret = MipiCsiResetRxTest(test);
445             break;
446         case MIPI_CSI_TEST_DISABLE_SENSOR_CLOCK:
447             ret = MipiCsiDisableSensorClockTest(test);
448             break;
449         case MIPI_CSI_TEST_ENABLE_SENSOR_CLOCK:
450             ret = MipiCsiEnableSensorClockTest(test);
451             break;
452         case MIPI_CSI_TEST_RESET_SENSOR:
453             ret = MipiCsiResetSensorTest(test);
454             break;
455         case MIPI_CSI_TEST_SET_DEV_ATTR:
456             ret = MipiCsiSetComboDevAttrTest(test);
457             break;
458         case MIPI_CSI_TEST_SET_PHY_CMVMODE:
459             ret = MipiCsiSetPhyCmvmodeTest(test);
460             break;
461         case MIPI_CSI_TEST_SET_EXT_DATA_TYPE:
462             ret = MipiCsiSetExtDataTypeTest(test);
463             break;
464         case MIPI_CSI_TEST_UNRESET_RX:
465             ret = MipiCsiUnresetRxTest(test);
466             break;
467         case MIPI_CSI_TEST_UNRESET_SENSOR:
468             ret = MipiCsiUnresetSensorTest(test);
469             break;
470         default:
471             HDF_LOGE("MipiCsiTestByCmd: not support!");
472             break;
473     }
474     HDF_LOGI("MipiCsiTestByCmd: test cmd %u, ret %d done!", cmd, ret);
475 
476     return ret;
477 }
478 
MipiCsiTestDoTest(struct MipiCsiTest * test,uint8_t cmd)479 static int32_t MipiCsiTestDoTest(struct MipiCsiTest *test, uint8_t cmd)
480 {
481     int32_t ret;
482     OsalMSleep(SEQ_OUTPUT_DELAY);
483 
484     if (test == NULL) {
485         return HDF_ERR_INVALID_OBJECT;
486     }
487 
488 #ifdef MIPI_CSI_TEST_SELF
489     int32_t i;
490     if (cmd != 0) {
491         return HDF_SUCCESS;
492     }
493     ret = MipiCsiTestSetUp(test);
494     if (ret != HDF_SUCCESS) {
495         HDF_LOGE("MipiCsiTestDoTest: setup fail!");
496         return ret;
497     }
498 
499     for (i = 0; i < test->total; i++) {
500         if (MipiCsiTestByCmd(test, i) != HDF_SUCCESS) {
501             test->fails++;
502         }
503     }
504     HDF_LOGI("\n\nMipiCsiTestDoTest: **********PASS:%u  FAIL:%u**************\n\n",
505         __func__, test->total - test->fails, test->fails);
506     ret = (test->fails > 0) ? HDF_FAILURE : HDF_SUCCESS;
507     MipiCsiTestTearDown(test);
508 #else
509     if (cmd == 0) {
510         ret = MipiCsiTestSetUp(test);
511         if (ret != HDF_SUCCESS) {
512             HDF_LOGE("MipiCsiTestDoTest: [MipiCsiTestSetUp] fail!");
513             return ret;
514         }
515     }
516     ret = MipiCsiTestByCmd(test, cmd);
517     if (cmd == (test->total - 1)) {
518         MipiCsiTestTearDown(test);
519     }
520 #endif
521     OsalMSleep(SEQ_OUTPUT_DELAY);
522 
523     return ret;
524 }
525 
MipiCsiTestBind(struct HdfDeviceObject * device)526 static int32_t MipiCsiTestBind(struct HdfDeviceObject *device)
527 {
528     static struct MipiCsiTest test;
529 
530     test.cntlrId = 0;
531     test.total = MIPI_CSI_TEST_MAX;
532     test.doTest = MipiCsiTestDoTest;
533     device->service = &test.service;
534 #ifdef MIPI_CSI_TEST_SELF
535     HDF_LOGI("MipiCsiTestBind: test on init!");
536     test.doTest(&test, -1);
537 #endif
538     return HDF_SUCCESS;
539 }
540 
MipiCsiTestInit(struct HdfDeviceObject * device)541 static int32_t MipiCsiTestInit(struct HdfDeviceObject *device)
542 {
543     (void)device;
544     return HDF_SUCCESS;
545 }
546 
547 struct HdfDriverEntry g_mipiCsiTestEntry = {
548     .moduleVersion = 1,
549     .Bind = MipiCsiTestBind,
550     .Init = MipiCsiTestInit,
551     .moduleName = "PLATFORM_MIPI_CSI_TEST",
552 };
553 HDF_INIT(g_mipiCsiTestEntry);
554