From f1eb9aaddf7a4d0b568f2c2ab084c2d5850b185f Mon Sep 17 00:00:00 2001 From: ligen Date: Wed, 25 Oct 2023 17:09:28 +0800 Subject: [PATCH] edid belongs to it66021 --- src/driver/it66021.c | 35 +++++++++++++++++++++++++++++++++++ src/driver/it66021.h | 1 + src/driver/it66121.c | 36 ------------------------------------ src/driver/it66121.h | 1 - 4 files changed, 36 insertions(+), 37 deletions(-) diff --git a/src/driver/it66021.c b/src/driver/it66021.c index de8974cc..d2c08caa 100644 --- a/src/driver/it66021.c +++ b/src/driver/it66021.c @@ -204,6 +204,7 @@ void IT66021_init() { IT66021_Mask_WR(1, 0x0f, 0x10, 0x00); usleep(1000); + IT66021_edid(); } int IT66021_Sig_det() { @@ -297,3 +298,37 @@ void IT66021_Set_CSMatrix(int cs) { IT66021_Mask_WR(0, 0x65, 0x03, 0x00); } } + +void IT66021_edid() { + // 0x49->0xc4 must set same data with edid[0x7f] + // 0x49->0xc5 must set same data with edid[0xff] + const uint8_t edid[256] = { + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x26, 0x85, 0x02, 0x66, 0x01, 0x68, 0x00, 0x00, + 0x00, 0x17, 0x01, 0x03, 0x80, 0x73, 0x41, 0x78, 0x2A, 0x7C, 0x11, 0x9E, 0x59, 0x47, 0x9B, 0x27, + 0x10, 0x50, 0x54, 0x00, 0x00, 0x00, 0x81, 0xC0, 0x81, 0xE8, 0xD1, 0xC0, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3A, 0x80, 0xD0, 0x72, 0x38, 0x2D, 0x40, 0x58, 0x2C, + 0x45, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x01, 0x1D, 0x00, 0x72, 0x51, 0xD0, 0x1E, 0x20, + 0x6E, 0x28, 0x55, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x49, + 0x54, 0x45, 0x36, 0x38, 0x30, 0x32, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xFD, + 0x00, 0x30, 0x7A, 0x0F, 0x50, 0x10, 0x00, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x2C, + 0x02, 0x03, 0x17, 0x74, 0x44, 0x84, 0x9F, 0xA9, 0x90, 0x23, 0x09, 0x07, 0x07, 0x83, 0x01, 0x00, + 0x00, 0x65, 0x03, 0x0C, 0x00, 0x10, 0x00, 0x01, 0x1D, 0x00, 0x72, 0x51, 0xD0, 0x1E, 0x20, 0x6E, + 0x28, 0x55, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x02, 0x3A, 0x80, 0xD0, 0x72, 0x38, 0x2D, + 0x40, 0x58, 0x2C, 0x45, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDA}; + uint16_t i; + I2C_L_Write(0x49, 0xc0, 0x40); + I2C_L_Write(0x49, 0xc4, edid[0x7f]); + I2C_L_Write(0x49, 0xc5, edid[0xff]); + + for (i = 0; i < 256; i++) { + I2C_L_Write(0x54, i, edid[i]); + } + + I2C_L_Write(0x49, 0xc0, 0x24); + usleep(2000); + I2C_L_Write(0x49, 0xc0, 0x04); +} diff --git a/src/driver/it66021.h b/src/driver/it66021.h index 682fe8c2..d821f7a4 100644 --- a/src/driver/it66021.h +++ b/src/driver/it66021.h @@ -9,4 +9,5 @@ int IT66021_Get_VTMG(int *freq_ref); int IT66021_Get_CS(); void IT66021_Set_CSMatrix(int cs); int IT66021_Get_PCLKFREQ(); +void IT66021_edid(); #endif \ No newline at end of file diff --git a/src/driver/it66121.c b/src/driver/it66121.c index 3a676d32..2b301a25 100644 --- a/src/driver/it66121.c +++ b/src/driver/it66121.c @@ -134,40 +134,4 @@ void IT66121_init() { I2C_R_Write(ADDR_IT66121, 0x98, 0x02); I2C_R_Write(ADDR_IT66121, 0x99, 0xd2); I2C_R_Write(ADDR_IT66121, 0x0f, 0x08); - - IT66121_edid(); -} - -void IT66121_edid() { - // 0x49->0xc4 must set same data with edid[0x7f] - // 0x49->0xc5 must set same data with edid[0xff] - const uint8_t edid[256] = { - 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x26, 0x85, 0x02, 0x66, 0x01, 0x68, 0x00, 0x00, - 0x00, 0x17, 0x01, 0x03, 0x80, 0x73, 0x41, 0x78, 0x2A, 0x7C, 0x11, 0x9E, 0x59, 0x47, 0x9B, 0x27, - 0x10, 0x50, 0x54, 0x00, 0x00, 0x00, 0x81, 0xC0, 0x81, 0xE8, 0xD1, 0xC0, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x3A, 0x80, 0xD0, 0x72, 0x38, 0x2D, 0x40, 0x58, 0x2C, - 0x45, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x01, 0x1D, 0x00, 0x72, 0x51, 0xD0, 0x1E, 0x20, - 0x6E, 0x28, 0x55, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x49, - 0x54, 0x45, 0x36, 0x38, 0x30, 0x32, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xFD, - 0x00, 0x30, 0x7A, 0x0F, 0x50, 0x10, 0x00, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x2C, - 0x02, 0x03, 0x17, 0x74, 0x44, 0x84, 0x9F, 0xA9, 0x90, 0x23, 0x09, 0x07, 0x07, 0x83, 0x01, 0x00, - 0x00, 0x65, 0x03, 0x0C, 0x00, 0x10, 0x00, 0x01, 0x1D, 0x00, 0x72, 0x51, 0xD0, 0x1E, 0x20, 0x6E, - 0x28, 0x55, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x02, 0x3A, 0x80, 0xD0, 0x72, 0x38, 0x2D, - 0x40, 0x58, 0x2C, 0x45, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDA}; - uint16_t i; - I2C_L_Write(0x49, 0xc0, 0x40); - I2C_L_Write(0x49, 0xc4, edid[0x7f]); - I2C_L_Write(0x49, 0xc5, edid[0xff]); - - for (i = 0; i < 256; i++) { - I2C_L_Write(0x54, i, edid[i]); - } - - I2C_L_Write(0x49, 0xc0, 0x24); - usleep(2000); - I2C_L_Write(0x49, 0xc0, 0x04); } diff --git a/src/driver/it66121.h b/src/driver/it66121.h index 0d966524..9dafdddd 100644 --- a/src/driver/it66121.h +++ b/src/driver/it66121.h @@ -3,5 +3,4 @@ void IT66121_close(); void IT66121_init(); -void IT66121_edid(); #endif \ No newline at end of file