1 /*
2  * Copyright (c) 2020-2021 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 #ifndef MIPI_DSI_TEST_H
10 #define MIPI_DSI_TEST_H
11 
12 #include "hdf_device_desc.h"
13 #include "mipi_dsi_if.h"
14 
15 enum MipiDsiTestCmd {
16     MIPI_DSI_TEST_SET_CFG = 0,
17     MIPI_DSI_TEST_GET_CFG = 1,
18     MIPI_DSI_TEST_TX_RX = 2,
19     MIPI_DSI_TEST_TO_LP_TO_HS = 3,
20     MIPI_DSI_TEST_MAX = 4,
21 };
22 
23 struct MipiDsiTest {
24     struct IDeviceIoService service;
25     struct HdfDeviceObject *device;
26     int32_t (*doTest)(struct MipiDsiTest *test, int32_t cmd);
27     DevHandle handle;
28     struct DsiCmdDesc msgs;
29     struct MipiCfg cfg;
30     uint8_t devNo;
31     uint32_t total;
32     uint32_t fails;
33 };
34 
MipiDsiTestServiceGet(void)35 static inline struct MipiDsiTest *MipiDsiTestServiceGet(void)
36 {
37     return (struct MipiDsiTest *)DevSvcManagerClntGetService("PLATFORM_MIPI_DSI_TEST");
38 }
39 #endif /* MIPI_DSI_TEST_H */
40