• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 LITE_LCDKIT_H
10 #define LITE_LCDKIT_H
11 #include "hdf_base.h"
12 #include "device_resource_if.h"
13 #include "osal_mem.h"
14 #ifdef HDF_LOG_TAG
15 #undef HDF_LOG_TAG
16 #endif
17 #define HDF_LOG_TAG HDF_DISP
18 
19 #define DSI_CMD_HEAD          3
20 #define DATA_LEN              2
21 #define CMD_DELAY             1
22 #define DATA_TYPE             0
23 #define POWER_SETTING_SIZE    3
24 #define POWER_SEQUEUE_SIZE    4
25 #define MAX_PANEL_CFG         50
26 
27 enum PowerType {
28     GPIO_POWER,
29     REGULATOR_POWER,
30 };
31 
32 struct PanelCmd {
33     struct DsiCmdDesc  *dsiCmd;
34     uint32_t           count;
35 };
36 
37 struct PowerDesc {
38     uint32_t type;
39     uint32_t num;
40     uint32_t vol;
41 };
42 
43 struct PowerCtrl {
44     uint32_t type;
45     uint32_t num;
46     uint32_t opt;
47     uint32_t delay;
48 };
49 
50 struct PowerSequeue {
51     struct PowerCtrl  *pwCtrl;
52     uint32_t          count;
53 };
54 
55 struct PowerSetting {
56     struct PowerDesc  *power;
57     uint32_t          count;
58 };
59 
60 struct PanelConfig {
61     const char   *actPanel;
62     uint32_t     dsiDev;
63     DevHandle    pwmHandle;
64     DevHandle    dsiHandle;
65     struct PanelInfo      info;
66     struct PanelCmd       onCmd;
67     struct PanelCmd       offCmd;
68     struct PowerSetting   setting;
69     struct PowerSequeue   onSeq;
70     struct PowerSequeue   offSeq;
71 };
72 
73 int32_t ParseLcdConfig(const struct DeviceResourceNode *node, struct PanelConfig *cfg);
74 #endif /* LITE_LCDKIT_H */
75