diff --git a/adapter/khdf/uniproton/BUILD.gn b/adapter/khdf/uniproton/BUILD.gn deleted file mode 100644 index 3d4526328f209686c73ae46a3843c4b34870cf52..0000000000000000000000000000000000000000 --- a/adapter/khdf/uniproton/BUILD.gn +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of -# conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list -# of conditions and the following disclaimer in the documentation and/or other materials -# provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be used -# to endorse or promote products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import("hdf.gni") - -HDF_FRAMEWORKS_PATH = "./../../../framework" -HDF_INTERFACE_PATH = ".../../../interfaces" -HDF_ADAPTER_PATH = ".../../../adapter" - -hdf_driver("hdf_lite") { - deps = [ - "core", - "osal", - "platform", - HDF_ADAPTER_PLATFORM_PATH, - ] - if (defined(LOSCFG_DRIVERS_HDF_TESTS_ENABLE)) { - deps += [ "test" ] - } -} - -config("public") { - configs = [ - "core:public", - "osal:public", - "platform:public", - ] -} - -config("hdf_config") { - configs = [ ":public" ] - include_dirs = [ - "//utils/native/lite/include", - "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", - "osal/include", - "$HDF_FRAMEWORKS_PATH/include", - "$HDF_FRAMEWORKS_PATH/include/osal", - "$HDF_FRAMEWORKS_PATH/include/utils", - "$HDF_FRAMEWORKS_PATH/utils/include", - "$HDF_FRAMEWORKS_PATH/include/platform", - "$HDF_FRAMEWORKS_PATH/include/core", - "$HDF_FRAMEWORKS_PATH/support/platform/include", - "$HDF_FRAMEWORKS_PATH/support/platform/include/common", - "$HDF_FRAMEWORKS_PATH/support/platform/include/fwk", - "$HDF_FRAMEWORKS_PATH/core/host/include", - "$HDF_FRAMEWORKS_PATH/core/manager/include", - "$HDF_FRAMEWORKS_PATH/core/shared/include", - "$HDF_FRAMEWORKS_PATH/core/common/include/manager", - "$HDF_FRAMEWORKS_PATH/core/common/include/host", - "$HDF_FRAMEWORKS_PATH/core/adapter/vnode/include", - "$HDF_FRAMEWORKS_PATH/core/adapter/syscall/include", - "$HDF_FRAMEWORKS_PATH/test/unittest/osal", - "$HDF_ADAPTER_PATH/khdf/uniproton/osal/include", - "$HDF_ADAPTER_PATH/khdf/uniproton/test/sample_driver/include", - "$HDF_ADAPTER_PATH/uhdf2/include/host", - "$HDF_INTERFACE_PATH/inner_api/core", - "$HDF_INTERFACE_PATH/inner_api/utils", - "$HDF_INTERFACE_PATH/inner_api/osal/shared", - "$HDF_INTERFACE_PATH/inner_api/host/shared", - ] -} diff --git a/framework/model/display/driver/panel/mipi_icn9700.c b/framework/model/display/driver/panel/mipi_icn9700.c index 279ed825eb9368ed758a9e65aaa93a692bfca386..4bf6b4e07bc1dec87f5daeab7ccdc97ccbcc4d4c 100644 --- a/framework/model/display/driver/panel/mipi_icn9700.c +++ b/framework/model/display/driver/panel/mipi_icn9700.c @@ -33,7 +33,17 @@ #define VERTICAL_SYNC_WIDTH 2 #define FRAME_RATE 60 -/* panel on command payload */ +#define WIDTH1 480 +#define HEIGHT1 960 +#define HORIZONTAL_BACK_PORCH1 44 +#define HORIZONTAL_FRONT_PORCH1 46 +#define HORIZONTAL_SYNC_WIDTH1 4 +#define VERTICAL_BACK_PORCH1 15 +#define VERTICAL_FRONT_PORCH1 15 +#define VERTICAL_SYNC_WIDTH1 2 +#define FRAME_RATE1 60 + +/* panel0 on command payload */ static uint8_t g_payLoad0[] = { 0xF0, 0x5A, 0x5A }; static uint8_t g_payLoad1[] = { 0xF1, 0xA5, 0xA5 }; static uint8_t g_payLoad2[] = { 0xB3, 0x03, 0x03, 0x03, 0x07, 0x05, 0x0D, 0x0F, 0x11, 0x13, 0x09, 0x0B }; @@ -60,7 +70,7 @@ static uint8_t g_payLoad18[] = { static uint8_t g_payLoad19[] = { 0x11 }; static uint8_t g_payLoad20[] = { 0x29 }; -struct DsiCmdDesc g_OnCmd[] = { +struct DsiCmdDesc g_OnCmd0[] = { { 0x29, 0, sizeof(g_payLoad0), g_payLoad0 }, { 0x29, 0, sizeof(g_payLoad1), g_payLoad1 }, { 0x29, 0, sizeof(g_payLoad2), g_payLoad2 }, @@ -84,6 +94,105 @@ struct DsiCmdDesc g_OnCmd[] = { { 0x05, 120, sizeof(g_payLoad20), g_payLoad20 }, }; +/* panel1 on command payload */ +static uint8_t g_payLoad1_0[] = { 0xFF, 0x77, 0x01, 0x00, 0x00, 0x13 }; +static uint8_t g_payLoad1_1[] = { 0xEF, 0x08 }; +static uint8_t g_payLoad1_2[] = { 0xFF, 0x77, 0x01, 0x00, 0x00, 0x10 }; +static uint8_t g_payLoad1_3[] = { 0xC0, 0xF7, 0x02 }; +static uint8_t g_payLoad1_4[] = { 0xC1, 0x0C, 0x02 }; +static uint8_t g_payLoad1_5[] = { 0xC2, 0x07, 0x02 }; +static uint8_t g_payLoad1_6[] = { 0xC6, 0x21 }; +static uint8_t g_payLoad1_7[] = { 0xCC, 0x30 }; +static uint8_t g_payLoad1_8[] = { + 0xB0, 0x00, 0x0B, 0x12, 0x0D, 0x11, 0x07, 0x04, 0x08, 0x07, 0x20, 0x05, 0x12, 0x0F, 0x28, 0x30, 0x1B +}; +static uint8_t g_payLoad1_9[] = { + 0xB1, 0x00, 0x0B, 0x12, 0x0D, 0x11, 0x05, 0x03, 0x08, 0x08, 0x20, 0x03, 0x10, 0x10, 0x29, 0x30, 0x1B +}; +static uint8_t g_payLoad1_10[] = { 0xFF, 0x77, 0x01, 0x00, 0x00, 0x11 }; +static uint8_t g_payLoad1_11[] = { 0xB0, 0x4D }; +static uint8_t g_payLoad1_12[] = { 0xB1, 0x2A }; +static uint8_t g_payLoad1_13[] = { 0xB2, 0x87 }; +static uint8_t g_payLoad1_14[] = { 0xB3, 0x80 }; +static uint8_t g_payLoad1_15[] = { 0xB5, 0x49 }; +static uint8_t g_payLoad1_16[] = { 0xB7, 0x87 }; +static uint8_t g_payLoad1_17[] = { 0xB8, 0x21 }; +static uint8_t g_payLoad1_18[] = { 0xB9, 0x10 }; +static uint8_t g_payLoad1_19[] = { 0xBB, 0x00 }; +static uint8_t g_payLoad1_20[] = { 0xC0, 0x09 }; +static uint8_t g_payLoad1_21[] = { 0xC1, 0x78 }; +static uint8_t g_payLoad1_22[] = { 0xC2, 0x78 }; +static uint8_t g_payLoad1_23[] = { 0xD0, 0x88 }; +static uint8_t g_payLoad1_24[] = { 0xFF, 0x77, 0x01, 0x00, 0x00, 0x11 }; +static uint8_t g_payLoad1_25[] = { 0xE0, 0x00, 0x19, 0x00 }; +static uint8_t g_payLoad1_26[] = { 0xE1, 0x07, 0x82, 0x00, 0x82, 0x06, 0x82, 0x00, 0x82, 0x00, 0x40, 0x40 }; +static uint8_t g_payLoad1_27[] = { + 0xE2, 0x30, 0x30, 0x40, 0x40, 0xCC, 0x82, 0x00, 0x82, 0xCB, 0x82, 0x00, 0x82, 0x00 +}; +static uint8_t g_payLoad1_28[] = { 0xE3, 0x00, 0x00, 0x33, 0x33 }; +static uint8_t g_payLoad1_29[] = { 0xE4, 0x44, 0x44 }; +static uint8_t g_payLoad1_30[] = { + 0xE5, 0x09, 0xC5, 0xAA, 0x82, 0x0B, 0xC7, 0xAA, 0x82, 0x0D, 0xC9, 0xAA, 0x82, 0x0F, 0xCB, 0xAA, 0x82 +}; +static uint8_t g_payLoad1_31[] = { 0xE6, 0x00, 0x00, 0x33, 0x33 }; +static uint8_t g_payLoad1_32[] = { 0xE7, 0x44, 0x44 }; +static uint8_t g_payLoad1_33[] = { + 0xE8, 0x08, 0xC4, 0xAA, 0x82, 0x0A, 0xC6, 0xAA, 0x82, 0x0C, 0xC8, 0xAA, 0x82, 0x0E, 0xCA, 0xAA, 0x82 +}; +static uint8_t g_payLoad1_34[] = { 0xEB, 0x00, 0x00, 0xE4, 0xE4, 0x88, 0x00, 0x10 }; +static uint8_t g_payLoad1_35[] = { 0xEC, 0x3D, 0x00 }; +static uint8_t g_payLoad1_36[] = { + 0xED, 0xAB, 0x98, 0x76, 0x54, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x20, 0x45, 0x67, 0x89, 0xBA +}; +static uint8_t g_payLoad1_37[] = { 0xEF, 0x08, 0x08, 0x08, 0x45, 0x3F, 0x54 }; +static uint8_t g_payLoad1_38[] = { 0xFF, 0x77, 0x01, 0x00, 0x00, 0x00 }; +static uint8_t g_payLoad1_42[] = { 0x11 }; +static uint8_t g_payLoad1_43[] = { 0x29 }; + +struct DsiCmdDesc g_OnCmd1[] = { + { 0x29, 0, sizeof(g_payLoad1_0), g_payLoad1_0 }, + { 0x23, 0, sizeof(g_payLoad1_1), g_payLoad1_1 }, + { 0x29, 0, sizeof(g_payLoad1_2), g_payLoad1_2 }, + { 0x29, 0, sizeof(g_payLoad1_3), g_payLoad1_3 }, + { 0x29, 0, sizeof(g_payLoad1_4), g_payLoad1_4 }, + { 0x29, 0, sizeof(g_payLoad1_5), g_payLoad1_5 }, + { 0x23, 0, sizeof(g_payLoad1_6), g_payLoad1_6 }, + { 0x23, 0, sizeof(g_payLoad1_7), g_payLoad1_7 }, + { 0x29, 0, sizeof(g_payLoad1_8), g_payLoad1_8 }, + { 0x29, 0, sizeof(g_payLoad1_9), g_payLoad1_9 }, + { 0x29, 0, sizeof(g_payLoad1_10), g_payLoad1_10 }, + { 0x23, 0, sizeof(g_payLoad1_11), g_payLoad1_11 }, + { 0x23, 0, sizeof(g_payLoad1_12), g_payLoad1_12 }, + { 0x23, 0, sizeof(g_payLoad1_13), g_payLoad1_13 }, + { 0x23, 0, sizeof(g_payLoad1_14), g_payLoad1_14 }, + { 0x23, 0, sizeof(g_payLoad1_15), g_payLoad1_15 }, + { 0x23, 0, sizeof(g_payLoad1_16), g_payLoad1_16 }, + { 0x23, 0, sizeof(g_payLoad1_17), g_payLoad1_17 }, + { 0x23, 0, sizeof(g_payLoad1_18), g_payLoad1_18 }, + { 0x23, 0, sizeof(g_payLoad1_19), g_payLoad1_19 }, + { 0x23, 0, sizeof(g_payLoad1_20), g_payLoad1_20 }, + { 0x23, 0, sizeof(g_payLoad1_21), g_payLoad1_21 }, + { 0x23, 0, sizeof(g_payLoad1_22), g_payLoad1_22 }, + { 0x23, 0, sizeof(g_payLoad1_23), g_payLoad1_23 }, + { 0x29, 0, sizeof(g_payLoad1_24), g_payLoad1_24 }, + { 0x29, 0, sizeof(g_payLoad1_25), g_payLoad1_25 }, + { 0x29, 0, sizeof(g_payLoad1_26), g_payLoad1_26 }, + { 0x29, 0, sizeof(g_payLoad1_27), g_payLoad1_27 }, + { 0x29, 0, sizeof(g_payLoad1_28), g_payLoad1_28 }, + { 0x29, 0, sizeof(g_payLoad1_29), g_payLoad1_29 }, + { 0x29, 0, sizeof(g_payLoad1_30), g_payLoad1_30 }, + { 0x29, 0, sizeof(g_payLoad1_31), g_payLoad1_31 }, + { 0x29, 0, sizeof(g_payLoad1_32), g_payLoad1_32 }, + { 0x29, 0, sizeof(g_payLoad1_33), g_payLoad1_33 }, + { 0x29, 0, sizeof(g_payLoad1_34), g_payLoad1_34 }, + { 0x29, 0, sizeof(g_payLoad1_35), g_payLoad1_35 }, + { 0x29, 0, sizeof(g_payLoad1_36), g_payLoad1_36 }, + { 0x29, 0, sizeof(g_payLoad1_37), g_payLoad1_37 }, + { 0x29, 0, sizeof(g_payLoad1_38), g_payLoad1_38 }, + { 0x05, 120, sizeof(g_payLoad1_42), g_payLoad1_42 }, + { 0x05, 50, sizeof(g_payLoad1_43), g_payLoad1_43 }, +}; + /* panel off command payload */ static uint8_t g_offPayLoad0[] = { 0x28 }; static uint8_t g_offPayLoad1[] = { 0x10 }; @@ -92,6 +201,8 @@ struct DsiCmdDesc g_offCmd[] = { { 0x05, 120, sizeof(g_offPayLoad1), g_offPayLoad1 }, }; +static uint8_t g_panelSolution = 0; // 0-icn9700[default], 1-ST7701SN + struct Icn9700Dev { struct PanelData panel; DevHandle mipiHandle; @@ -153,6 +264,42 @@ static struct Icn9700Dev *PanelToIcn9700Dev(const struct PanelData *panel) return icn9700; } +static int32_t LcdCheckChipId(struct PanelData *panel) +{ + int32_t ret; + struct Icn9700Dev *icn9700 = NULL; + uint8_t payload = 0xA1; + uint8_t bufRead[2] = { 0 }; + struct DsiCmdDesc cmdRead = { + .dataType = 0x06, /* 0x06: read data type */ + .dataLen = 1, /* 1: data len */ + .delay = 0, + .payload = &payload, + }; + icn9700 = PanelToIcn9700Dev(panel); + if ((icn9700 == NULL) || (icn9700->mipiHandle == NULL)) { + HDF_LOGE("%s: icn9700 || mipiHandle is null", __func__); + return HDF_FAILURE; + } + /* lcd reset power on */ + ret = LcdResetOn(icn9700); + if (ret != HDF_SUCCESS) { + HDF_LOGE("%s: LcdResetOn failed", __func__); + return HDF_FAILURE; + } + ret = MipiDsiRx(icn9700->mipiHandle, &cmdRead, sizeof(bufRead), bufRead); + if (ret == HDF_SUCCESS) { + if (bufRead[0] == 0x99) { + g_panelSolution = 1; + } else { + g_panelSolution = 0; + } + } + /* lcd reset power off */ + ret = LcdResetOff(icn9700); + return ret; +} + static int32_t Icn9700Init(struct PanelData *panel) { struct Icn9700Dev *icn9700 = NULL; @@ -167,6 +314,7 @@ static int32_t Icn9700Init(struct PanelData *panel) HDF_LOGE("%s: MipiDsiOpen failed", __func__); return HDF_FAILURE; } + LcdCheckChipId(panel); return HDF_SUCCESS; } @@ -191,8 +339,16 @@ static int32_t Icn9700On(struct PanelData *panel) return HDF_FAILURE; } /* send mipi init code */ - int32_t count = sizeof(g_OnCmd) / sizeof(g_OnCmd[0]); + int32_t count = 0; int32_t i; + struct DsiCmdDesc* g_OnCmd = NULL; + if (g_panelSolution == 1) { + count = sizeof(g_OnCmd1) / sizeof(g_OnCmd1[0]); + g_OnCmd = &(g_OnCmd1[0]); + } else { + count = sizeof(g_OnCmd0) / sizeof(g_OnCmd0[0]); + g_OnCmd = &(g_OnCmd0[0]); + } /* set mipi to lp mode */ MipiDsiSetLpMode(icn9700->mipiHandle); for (i = 0; i < count; i++) { @@ -257,15 +413,15 @@ static int32_t Icn9700EsdCheckFunc(struct PanelData *panel) #define OUTPUT_USER 0 /* output timing type */ static struct PanelInfo g_panelInfo = { - .width = WIDTH, /* width */ - .height = HEIGHT, /* height */ - .hbp = HORIZONTAL_BACK_PORCH, /* horizontal back porch */ - .hfp = HORIZONTAL_FRONT_PORCH, /* horizontal front porch */ - .hsw = HORIZONTAL_SYNC_WIDTH, /* horizontal sync width */ - .vbp = VERTICAL_BACK_PORCH, /* vertical back porch */ - .vfp = VERTICAL_FRONT_PORCH, /* vertical front porch */ - .vsw = VERTICAL_SYNC_WIDTH, /* vertical sync width */ - .frameRate = FRAME_RATE, /* frame rate */ + .width = WIDTH1, /* width */ + .height = HEIGHT1, /* height */ + .hbp = HORIZONTAL_BACK_PORCH1, /* horizontal back porch */ + .hfp = HORIZONTAL_FRONT_PORCH1, /* horizontal front porch */ + .hsw = HORIZONTAL_SYNC_WIDTH1, /* horizontal sync width */ + .vbp = VERTICAL_BACK_PORCH1, /* vertical back porch */ + .vfp = VERTICAL_FRONT_PORCH1, /* vertical front porch */ + .vsw = VERTICAL_SYNC_WIDTH1, /* vertical sync width */ + .frameRate = FRAME_RATE1, /* frame rate */ .intfType = MIPI_DSI, /* panel interface type */ .intfSync = OUTPUT_USER, /* mipi config info */