1 /* 2 * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef LCD_ABS_IF_H 17 #define LCD_ABS_IF_H 18 19 #include "disp_hal.h" 20 21 /* support max panel number */ 22 #define PANEL_MAX 1 23 #define LCD_PANEL_DEV_ID 0 24 25 struct BlkDesc { 26 uint32_t type; 27 uint32_t minLevel; 28 uint32_t maxLevel; 29 uint32_t defLevel; 30 }; 31 32 struct PanelInfo { 33 uint32_t width; 34 uint32_t height; 35 uint32_t hbp; 36 uint32_t hfp; 37 uint32_t hsw; 38 uint32_t vbp; 39 uint32_t vfp; 40 uint32_t vsw; 41 uint32_t frameRate; 42 uint32_t dev_id; 43 uint32_t intfType; 44 enum IntfSync intfSync; 45 struct BlkDesc blk; 46 }; 47 48 struct PanelStatus { 49 uint32_t currLevel; 50 }; 51 52 struct PanelData { 53 struct HdfDeviceObject *object; 54 int32_t (*init)(struct PanelData *panel); 55 int32_t (*on)(struct PanelData *panel); 56 int32_t (*off)(struct PanelData *panel); 57 int32_t (*setBacklight)(struct PanelData *panel, uint32_t level); 58 int32_t (*dispFlush)(uint16_t disWidth, uint16_t disHeight, uint16_t *dataBuffer); 59 struct PanelInfo *info; 60 struct PanelStatus status; 61 }; 62 63 struct PanelManager { 64 struct PanelData *panel[PANEL_MAX]; 65 uint32_t panelNum; 66 }; 67 68 int32_t RegisterPanel(struct PanelData *data); 69 struct PanelManager *GetPanelManager(void); 70 struct PanelData *GetPanel(int32_t index); 71 72 #endif /* LCD_ABS_IF_H */ 73