HDMI_WriteI2C_Byte(0x65, 0xf1);
延迟(5);
HDMI_WriteI2C_Byte(0x65, 0xf3);
HDMI_WriteI2C_Byte(0x04, 0x14);
HDMI_WriteI2C_Byte(0xff, 0x84); //注册银行
// HDMI_WriteI2C_Byte(0x14,0x01);
HDMI_WriteI2C_Byte(0x14, 0x81);
HDMI_WriteI2C_Byte(0x14, 0x82);
DpcdWrite(0x0600, 0x01);
如果(DpcdRead(0x0600)!= 0x01)
{
DpcdWrite(0x0600,0x01);
}
DpcdWrite(0x0100, 0x0a);
#ifdef _2_Lane_DpcdWrite
(0x0101, 0x82); // 2 车道
#endif
#ifdef _1_Lane_
DpcdWrite( 0x0101, 0x81 ); // 1 通道
#endif
DpcdWrite( 0x010a, 0x00 );
#ifdef _SSC_En_
DpcdWrite(0x0107,0x10);// Main-Link 信号向下扩展
#endif
// DpcdWrite(0x0107,0x00);
// DpcdWrite(0x0108,0x01);
如果(DpcdRead(0x0100)!= 0x0a)
{
DpcdWrite(0x0100,0x0a);
}
#ifdef _2_Lane_
if( DpcdRead( 0x0101 ) != 0x82 ) // 2 Lane
{
DpcdWrite( 0x0101, 0x82 );
}
#endif
#ifdef _1_Lane_
if( DpcdRead( 0x0101 ) != 0x81 ) // 1 Lane
{
DpcdWrite( 0x0101, 0x81 );
}
#endif
if( DpcdRead( 0x010a ) != 0x00 )
{
DpcdWrite( 0x010a, 0x00 );
}
// DpcdWrite(0x0102,0x00);
DpcdWrite(0x0102, 0x01); // 发送 TPS1
DpcdWrite( 0x0103, 0x01 );//0x00 );
#ifdef _2_Lane_
DpcdWrite(0x0104, 0x01);//0x00);
#endif
if( DpcdRead( 0x0102 ) != 0x01 )
{
DpcdWrite( 0x0102, 0x01 );
}
mdelay(16);
DPCD0204H = DpcdRead(0x0204);
DPCD0202H = DpcdRead(0x0202);
swing_adj_cnt = 0x05;
#ifdef _2_Lane_DPCD0202H
= DPCD0202H & 0x11; // 2 车道 0x11 ; 1 车道 0x01
while( ( (DPCD0202H & 0x11) != 0x11) && ( swing_adj_cnt 》 0 ) ) // 1080P 0x11; 1366 0x01
#endif
#ifdef _1_Lane_DPCD0202H
= DPCD0202H & 0x01; // 2 车道 0x11 ; 1 车道 0x01
而(((DPCD0202H & 0x01)!= 0x01)&&(swing_adj_cnt》 0))//1080P 0x11;1366 0x01
#endif
{
DPCD0206H = DpcdRead(0x0206);
adj_swing();
swing_adj_cnt--;
延迟(1);
DPCD0202H = DpcdRead(0x0202);
#ifdef _2_Lane_DPCD0202H
= DPCD0202H & 0x11; // 2 车道 0x11 ; 1 通道 0x01
#endif
#ifdef _1_Lane_
DPCD0202H = DPCD0202H & 0x01; // 2 车道 0x11 ; 1 通道 0x01
#endif
}
// HDMI_WriteI2C_Byte(0xff,0x82); //用于调试
// HDMI_WriteI2C_Byte(0x1b,DPCD0202H);
#ifdef _2_Lane_
if(DPCD0202H == 0x11) // 2 通道 0x11 ; 1 通道 0x01
#endif
#ifdef _1_Lane_
if( DPCD0202H == 0x01 ) // 2 通道 0x11 ; 1 通道 0x01
#endif
{
HDMI_WriteI2C_Byte( 0xff, 0x80 ); //寄存器组
HDMI_WriteI2C_Byte(0x04, 0x18);
HDMI_WriteI2C_Byte(0xff, 0x84); //寄存器库
// HDMI_WriteI2C_Byte(0x14,0x04);
HDMI_WriteI2C_Byte(0x14, 0x84);
HDMI_WriteI2C_Byte(0x14, 0x88); //0x88
DpcdWrite(0x0102, 0x02); // 发送 TPS2
if( DpcdRead( 0x0102 ) != 0x02 )
{
DpcdWrite( 0x0102, 0x02 );
}
延迟(16);
DPCD0204H = DpcdRead(0x0204);
DPCD0202H = DpcdRead(0x0202);
swing_adj_cnt = 0x05;
#ifdef _2_Lane_
while( ( ( DPCD0202H & 0x77 ) != 0x77 ) && ( swing_adj_cnt 》 0 ) ) // 2 车道 0x77 ; 1 Lane 0x07
#endif
#ifdef _1_Lane_
while( ( ( DPCD0202H & 0x07 ) != 0x07 ) && ( swing_adj_cnt 》 0 ) ) // 2 Lane 0x77 ; 1 通道 0x07
#endif
{
DPCD0206H = DpcdRead( 0x0206 );
HDMI_WriteI2C_Byte(0xff, 0x84); //寄存器组
HDMI_WriteI2C_Byte(0x14, 0x08);
HDMI_WriteI2C_Byte(0x14, 0x88);
adj_swing();
swing_adj_cnt--;
延迟(1);
DPCD0202H = DpcdRead(0x0202);
DPCD0204H = DpcdRead(0x0204);
}
}
// HDMI_WriteI2C_Byte(0xff,0x82);//寄存器库
// HDMI_WriteI2C_Byte(0x1c,DPCD0202H);
DpcdWrite(0x0102, 0x00);
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x04, 0x10);
HDMI_WriteI2C_Byte(0xff, 0x84); //寄存器组
HDMI_WriteI2C_Byte(0x14, 0x80);
HDMI_WriteI2C_Byte(0x14, 0xc0);
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x62, 0xbf);
HDMI_WriteI2C_Byte(0xff, 0x88); //寄存器组
if( HDMI_ReadI2C_Byte( 0x24 ) != 0xc0 )
{
HDMI_WriteI2C_Byte( 0xff, 0x80 ); //寄存器组
HDMI_WriteI2C_Byte(0x62, 0x3f);
HDMI_WriteI2C_Byte(0x62, 0xbf);
}
//HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器库
//HDMI_WriteI2C_Byte( 0x62, 0xbf );
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x65, 0xf1);
延迟(5);
HDMI_WriteI2C_Byte(0x65, 0xf3);
DpcdWrite(0x0102, 0x00); // 发送数据
if( DpcdRead( 0x0102 ) != 0x00 )
{
DpcdWrite(0x0102, 0x00);
}
if( DpcdRead( 0x0600 ) != 0x01 )
{
DpcdWrite( 0x0600, 0x01 ); //
}
if( DpcdRead( 0x010a ) != 0x00 )
{
DpcdWrite( 0x010a, 0x00 ); //
}
DPCD0202H = DpcdRead(0x0202);
}
无效 reset_lt8911( 无效 )
{
edp_reset(1);
延迟(100);
edp_reset(0);
延迟(100);
edp_reset(1);
延迟(100);
}
无效 LT8911B_Initial( 无效 )
{
HDMI_WriteI2C_Byte( 0xff, 0x81 ); //寄存器组
HDMI_WriteI2C_Byte(0x00, 0x04);
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x62, 0x3f);
HDMI_WriteI2C_Byte(0x7a,_SSC_);//0x07);
HDMI_WriteI2C_Byte(0x71, 0x36);
HDMI_WriteI2C_Byte(0x72, 0x00);
HDMI_WriteI2C_Byte(0x73, 0x00);
HDMI_WriteI2C_Byte(0x63, 0x7f);
HDMI_WriteI2C_Byte(0x63, 0xff);
///txpll_analog///
HDMI_WriteI2C_Byte(0xff, 0x81); //寄存器组
HDMI_WriteI2C_Byte(0x0e, 0x37);
HDMI_WriteI2C_Byte(0x01, 0x18);
HDMI_WriteI2C_Byte(0x02, 0x42);
HDMI_WriteI2C_Byte(0x04, 0x00);
HDMI_WriteI2C_Byte(0x04, 0x01);
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte( 0x61, 0x7f );
HDMI_WriteI2C_Byte(0x61, 0xff);
HDMI_WriteI2C_Byte(0xff, 0x81); //寄存器组
HDMI_WriteI2C_Byte(0x05, 0x13);
//txpll_digital
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x74, 0x41);
HDMI_WriteI2C_Byte(0x75, 0x03);
HDMI_WriteI2C_Byte(0x76, 0x0a);
HDMI_WriteI2C_Byte(0x78, 0x0a);
//--------------------------------------------//
HDMI_WriteI2C_Byte(0xff , 0x81 ); //寄存器组
HDMI_WriteI2C_Byte(0x0e, 0x37);
#ifdef _1_Lane_
// 1 通道 eDP 输出
HDMI_WriteI2C_Byte(0x22, 0x11); // 关闭 LANE1 / LANE2 / LANE3 SWING 的电流开关
HDMI_WriteI2C_Byte( 0x23, 0x3e ); // 关闭 LANE1 / LANE2 / LANE3 预加重的电流开关
HDMI_WriteI2C_Byte( 0x25, 0x08 );
HDMI_WriteI2C_Byte(0x18, Swing_Level_0_H);
HDMI_WriteI2C_Byte(0x19, Swing_Level_0_L);
#else
// 2 通道 eDP 输出
HDMI_WriteI2C_Byte(0x22, 0x33); // 关闭 LANE2 / LANE3 SWING 的电流开关
HDMI_WriteI2C_Byte( 0x23, 0x3c ); // 关闭 LANE2 / LANE3 预加重的电流开关
HDMI_WriteI2C_Byte( 0x25, 0x08 );
HDMI_WriteI2C_Byte(0x18, Swing_Level_0_H);
HDMI_WriteI2C_Byte(0x19, Swing_Level_0_L);
HDMI_WriteI2C_Byte(0x1a, Swing_Level_0_H);
HDMI_WriteI2C_Byte(0x1b,Swing_Level_0_L);
printk(“[玉剑]------------2lane--edp--outn”);
#endif
//---------------------------------- //
#ifdef _1080P_eDP_Panel_HDMI_WriteI2C_Byte
(0xff, 0x90); //寄存器组
HDMI_WriteI2C_Byte(0x4a, 0x33); // 148.5MHz
HDMI_WriteI2C_Byte(0x4b, 0x33);
HDMI_WriteI2C_Byte(0x4c,0xd3);
HDMI_WriteI2C_Byte(0x4d,0x10);
printk(“[玉剑]--------1080--edp----n”);
#endif
#ifdef _1366x768_eDP_Panel_
HDMI_WriteI2C_Byte(0xff, 0x90); //寄存器库
// HDMI_WriteI2C_Byte(0x4a,0x66); // 72MHz
// HDMI_WriteI2C_Byte(0x4b,0x66);
// HDMI_WriteI2C_Byte(0x4c,0x66);
HDMI_WriteI2C_Byte(0x4a, 0xab); // 76.42MHz
HDMI_WriteI2C_Byte(0x4b, 0xaf);
HDMI_WriteI2C_Byte(0x4c,0x6c);
HDMI_WriteI2C_Byte(0x4d,0x10);
#endif
#ifdef _1600x900_eDP_Panel_HDMI_WriteI2C_Byte
(0xff,0x90);
HDMI_WriteI2C_Byte(0x4a, 0x65); // 77.82MHz
HDMI_WriteI2C_Byte(0x4b, 0xad);
HDMI_WriteI2C_Byte(0x4c, 0x6e);
//HDMI_WriteI2C_Byte(0x4a, 0xa9); // 77.82MHz
//HDMI_WriteI2C_Byte(0x4b, 0xf1);
//HDMI_WriteI2C_Byte(0x4c, 0x72);
HDMI_WriteI2C_Byte(0x4d,0x10);//0x10:
#endif
HDMI_WriteI2C_Byte(0xff, 0x81); //寄存器组
HDMI_WriteI2C_Byte(0x09, 0x01);
HDMI_WriteI2C_Byte(0x0b,0x0b);
HDMI_WriteI2C_Byte(0x08, 0x13);
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x63, 0x7f);
HDMI_WriteI2C_Byte(0x63, 0xff);
//-----------------主链接---------------------//
HDMI_WriteI2C_Byte( 0xff, 0x88 ) ; //寄存器组
HDMI_WriteI2C_Byte( 0x00, 0x6a );
HDMI_WriteI2C_Byte(0x04, 0xff);
HDMI_WriteI2C_Byte(0x05,(u8)(MIPI_Timing[H_tol] / 256));//RG_HTOTAL[15:0]
HDMI_WriteI2C_Byte( 0x06, (u8)( MIPI_Timing[H_tol] % 256 ) ); //RG_HTOTAL[7:0]
HDMI_WriteI2C_Byte( 0x07, (u8)( ( MIPI_Timing[H_bp] + MIPI_Timing[H_sync] ) / 256 ) ); //RG_HSTART [15:8]
HDMI_WriteI2C_Byte( 0x08, (u8)( ( MIPI_Timing[H_bp] + MIPI_Timing[H_sync] ) % 256 ) ); //RG_HSTART[7:0]=110
#ifdef _Test_Pattern_
HDMI_WriteI2C_Byte(0x09,(u8)(MIPI_Timing[H_sync] / 256));//[7]RG_HSPOL;[6:0]RG_HSYNC_WIDTH[14:8] 0x80--》0x00
HDMI_WriteI2C_Byte( 0x0a, (u8)( MIPI_Timing[H_sync] % 256 ) ); //RG_HSYNC_WIDTH[7:0]=60
#else
HDMI_WriteI2C_Byte(0x09, 0x00); //[7]RG_HSPOL;[6:0]RG_HSYNC_WIDTH[14:8] 0x80--》0x00
HDMI_WriteI2C_Byte(0x0a, 0x00); //RG_HSYNC_WIDTH[7:0]=60
#endif
HDMI_WriteI2C_Byte( 0x0b, (u8)( MIPI_Timing[H_act] / 256 ) ); //RG_HWIDTH[15:8]
HDMI_WriteI2C_Byte(0x0c,(u8)(MIPI_Timing[H_act]%256));//RG_HWIDTH[7:0]
HDMI_WriteI2C_Byte( 0x0d, (u8)( MIPI_Timing[V_tol] / 256 ) ); //RG_VTOTAL [15:8]
HDMI_WriteI2C_Byte( 0x0e, (u8)( MIPI_Timing[V_tol] % 256 ) ); //RG_VTOTAL[7:0]
HDMI_WriteI2C_Byte(0x0f, 0x00); //RG_TOP_VTOTAL[15:8] //fiexd
HDMI_WriteI2C_Byte(0x10, 0x00); //RG_TOP_VTOTAL[7:0] //固定
HDMI_WriteI2C_Byte( 0x11, (u8)( ( MIPI_Timing[V_bp] + MIPI_Timing[V_sync] ) / 256 ) ); //RG_VSTART[15:8]
HDMI_WriteI2C_Byte(0x12, (u8)((MIPI_Timing[V_bp] + MIPI_Timing[V_sync])%256));//RG_VSTART[7:0]
#ifdef _Test_Pattern_HDMI_WriteI2C_Byte
(0x13, (u8)( MIPI_Timing[V_sync] / 256 ) ); //RG_VSPOL;RG_VSYNC_WIDTH[14:8] 0x80--》0x00
HDMI_WriteI2C_Byte( 0x14, (u8)( MIPI_Timing[V_sync] % 256 ) ); //RG_VSYNC_WIDTH[7:0]
#else
HDMI_WriteI2C_Byte(0x13, 0x00); //RG_VSPOL;RG_VSYNC_WIDTH[14:8] 0x80--》0x00
HDMI_WriteI2C_Byte(0x14, 0x00); //RG_VSYNC_WIDTH[7:0]
#endif
HDMI_WriteI2C_Byte(0x15,(u8)(MIPI_Timing[V_act] / 256));//RG_VHEIGTH[15:8]
HDMI_WriteI2C_Byte( 0x16, (u8)( MIPI_Timing[V_act] % 256 ) ); //RG_VHEIGTH[7:0]
HDMI_WriteI2C_Byte(0x65, 0xf1);
延迟(5);
HDMI_WriteI2C_Byte(0x65, 0xf3);
HDMI_WriteI2C_Byte(0x04, 0x14);
HDMI_WriteI2C_Byte(0xff, 0x84); //注册银行
// HDMI_WriteI2C_Byte(0x14,0x01);
HDMI_WriteI2C_Byte(0x14, 0x81);
HDMI_WriteI2C_Byte(0x14, 0x82);
DpcdWrite(0x0600, 0x01);
如果(DpcdRead(0x0600)!= 0x01)
{
DpcdWrite(0x0600,0x01);
}
DpcdWrite(0x0100, 0x0a);
#ifdef _2_Lane_DpcdWrite
(0x0101, 0x82); // 2 车道
#endif
#ifdef _1_Lane_
DpcdWrite( 0x0101, 0x81 ); // 1 通道
#endif
DpcdWrite( 0x010a, 0x00 );
#ifdef _SSC_En_
DpcdWrite(0x0107,0x10);// Main-Link 信号向下扩展
#endif
// DpcdWrite(0x0107,0x00);
// DpcdWrite(0x0108,0x01);
如果(DpcdRead(0x0100)!= 0x0a)
{
DpcdWrite(0x0100,0x0a);
}
#ifdef _2_Lane_
if( DpcdRead( 0x0101 ) != 0x82 ) // 2 Lane
{
DpcdWrite( 0x0101, 0x82 );
}
#endif
#ifdef _1_Lane_
if( DpcdRead( 0x0101 ) != 0x81 ) // 1 Lane
{
DpcdWrite( 0x0101, 0x81 );
}
#endif
if( DpcdRead( 0x010a ) != 0x00 )
{
DpcdWrite( 0x010a, 0x00 );
}
// DpcdWrite(0x0102,0x00);
DpcdWrite(0x0102, 0x01); // 发送 TPS1
DpcdWrite( 0x0103, 0x01 );//0x00 );
#ifdef _2_Lane_
DpcdWrite(0x0104, 0x01);//0x00);
#endif
if( DpcdRead( 0x0102 ) != 0x01 )
{
DpcdWrite( 0x0102, 0x01 );
}
mdelay(16);
DPCD0204H = DpcdRead(0x0204);
DPCD0202H = DpcdRead(0x0202);
swing_adj_cnt = 0x05;
#ifdef _2_Lane_DPCD0202H
= DPCD0202H & 0x11; // 2 车道 0x11 ; 1 车道 0x01
while( ( (DPCD0202H & 0x11) != 0x11) && ( swing_adj_cnt 》 0 ) ) // 1080P 0x11; 1366 0x01
#endif
#ifdef _1_Lane_DPCD0202H
= DPCD0202H & 0x01; // 2 车道 0x11 ; 1 车道 0x01
而(((DPCD0202H & 0x01)!= 0x01)&&(swing_adj_cnt》 0))//1080P 0x11;1366 0x01
#endif
{
DPCD0206H = DpcdRead(0x0206);
adj_swing();
swing_adj_cnt--;
延迟(1);
DPCD0202H = DpcdRead(0x0202);
#ifdef _2_Lane_DPCD0202H
= DPCD0202H & 0x11; // 2 车道 0x11 ; 1 通道 0x01
#endif
#ifdef _1_Lane_
DPCD0202H = DPCD0202H & 0x01; // 2 车道 0x11 ; 1 通道 0x01
#endif
}
// HDMI_WriteI2C_Byte(0xff,0x82); //用于调试
// HDMI_WriteI2C_Byte(0x1b,DPCD0202H);
#ifdef _2_Lane_
if(DPCD0202H == 0x11) // 2 通道 0x11 ; 1 通道 0x01
#endif
#ifdef _1_Lane_
if( DPCD0202H == 0x01 ) // 2 通道 0x11 ; 1 通道 0x01
#endif
{
HDMI_WriteI2C_Byte( 0xff, 0x80 ); //寄存器组
HDMI_WriteI2C_Byte(0x04, 0x18);
HDMI_WriteI2C_Byte(0xff, 0x84); //寄存器库
// HDMI_WriteI2C_Byte(0x14,0x04);
HDMI_WriteI2C_Byte(0x14, 0x84);
HDMI_WriteI2C_Byte(0x14, 0x88); //0x88
DpcdWrite(0x0102, 0x02); // 发送 TPS2
if( DpcdRead( 0x0102 ) != 0x02 )
{
DpcdWrite( 0x0102, 0x02 );
}
延迟(16);
DPCD0204H = DpcdRead(0x0204);
DPCD0202H = DpcdRead(0x0202);
swing_adj_cnt = 0x05;
#ifdef _2_Lane_
while( ( ( DPCD0202H & 0x77 ) != 0x77 ) && ( swing_adj_cnt 》 0 ) ) // 2 车道 0x77 ; 1 Lane 0x07
#endif
#ifdef _1_Lane_
while( ( ( DPCD0202H & 0x07 ) != 0x07 ) && ( swing_adj_cnt 》 0 ) ) // 2 Lane 0x77 ; 1 通道 0x07
#endif
{
DPCD0206H = DpcdRead( 0x0206 );
HDMI_WriteI2C_Byte(0xff, 0x84); //寄存器组
HDMI_WriteI2C_Byte(0x14, 0x08);
HDMI_WriteI2C_Byte(0x14, 0x88);
adj_swing();
swing_adj_cnt--;
延迟(1);
DPCD0202H = DpcdRead(0x0202);
DPCD0204H = DpcdRead(0x0204);
}
}
// HDMI_WriteI2C_Byte(0xff,0x82);//寄存器库
// HDMI_WriteI2C_Byte(0x1c,DPCD0202H);
DpcdWrite(0x0102, 0x00);
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x04, 0x10);
HDMI_WriteI2C_Byte(0xff, 0x84); //寄存器组
HDMI_WriteI2C_Byte(0x14, 0x80);
HDMI_WriteI2C_Byte(0x14, 0xc0);
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x62, 0xbf);
HDMI_WriteI2C_Byte(0xff, 0x88); //寄存器组
if( HDMI_ReadI2C_Byte( 0x24 ) != 0xc0 )
{
HDMI_WriteI2C_Byte( 0xff, 0x80 ); //寄存器组
HDMI_WriteI2C_Byte(0x62, 0x3f);
HDMI_WriteI2C_Byte(0x62, 0xbf);
}
//HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器库
//HDMI_WriteI2C_Byte( 0x62, 0xbf );
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x65, 0xf1);
延迟(5);
HDMI_WriteI2C_Byte(0x65, 0xf3);
DpcdWrite(0x0102, 0x00); // 发送数据
if( DpcdRead( 0x0102 ) != 0x00 )
{
DpcdWrite(0x0102, 0x00);
}
if( DpcdRead( 0x0600 ) != 0x01 )
{
DpcdWrite( 0x0600, 0x01 ); //
}
if( DpcdRead( 0x010a ) != 0x00 )
{
DpcdWrite( 0x010a, 0x00 ); //
}
DPCD0202H = DpcdRead(0x0202);
}
无效 reset_lt8911( 无效 )
{
edp_reset(1);
延迟(100);
edp_reset(0);
延迟(100);
edp_reset(1);
延迟(100);
}
无效 LT8911B_Initial( 无效 )
{
HDMI_WriteI2C_Byte( 0xff, 0x81 ); //寄存器组
HDMI_WriteI2C_Byte(0x00, 0x04);
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x62, 0x3f);
HDMI_WriteI2C_Byte(0x7a,_SSC_);//0x07);
HDMI_WriteI2C_Byte(0x71, 0x36);
HDMI_WriteI2C_Byte(0x72, 0x00);
HDMI_WriteI2C_Byte(0x73, 0x00);
HDMI_WriteI2C_Byte(0x63, 0x7f);
HDMI_WriteI2C_Byte(0x63, 0xff);
///txpll_analog///
HDMI_WriteI2C_Byte(0xff, 0x81); //寄存器组
HDMI_WriteI2C_Byte(0x0e, 0x37);
HDMI_WriteI2C_Byte(0x01, 0x18);
HDMI_WriteI2C_Byte(0x02, 0x42);
HDMI_WriteI2C_Byte(0x04, 0x00);
HDMI_WriteI2C_Byte(0x04, 0x01);
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte( 0x61, 0x7f );
HDMI_WriteI2C_Byte(0x61, 0xff);
HDMI_WriteI2C_Byte(0xff, 0x81); //寄存器组
HDMI_WriteI2C_Byte(0x05, 0x13);
//txpll_digital
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x74, 0x41);
HDMI_WriteI2C_Byte(0x75, 0x03);
HDMI_WriteI2C_Byte(0x76, 0x0a);
HDMI_WriteI2C_Byte(0x78, 0x0a);
//--------------------------------------------//
HDMI_WriteI2C_Byte(0xff , 0x81 ); //寄存器组
HDMI_WriteI2C_Byte(0x0e, 0x37);
#ifdef _1_Lane_
// 1 通道 eDP 输出
HDMI_WriteI2C_Byte(0x22, 0x11); // 关闭 LANE1 / LANE2 / LANE3 SWING 的电流开关
HDMI_WriteI2C_Byte( 0x23, 0x3e ); // 关闭 LANE1 / LANE2 / LANE3 预加重的电流开关
HDMI_WriteI2C_Byte( 0x25, 0x08 );
HDMI_WriteI2C_Byte(0x18, Swing_Level_0_H);
HDMI_WriteI2C_Byte(0x19, Swing_Level_0_L);
#else
// 2 通道 eDP 输出
HDMI_WriteI2C_Byte(0x22, 0x33); // 关闭 LANE2 / LANE3 SWING 的电流开关
HDMI_WriteI2C_Byte( 0x23, 0x3c ); // 关闭 LANE2 / LANE3 预加重的电流开关
HDMI_WriteI2C_Byte( 0x25, 0x08 );
HDMI_WriteI2C_Byte(0x18, Swing_Level_0_H);
HDMI_WriteI2C_Byte(0x19, Swing_Level_0_L);
HDMI_WriteI2C_Byte(0x1a, Swing_Level_0_H);
HDMI_WriteI2C_Byte(0x1b,Swing_Level_0_L);
printk(“[玉剑]------------2lane--edp--outn”);
#endif
//---------------------------------- //
#ifdef _1080P_eDP_Panel_HDMI_WriteI2C_Byte
(0xff, 0x90); //寄存器组
HDMI_WriteI2C_Byte(0x4a, 0x33); // 148.5MHz
HDMI_WriteI2C_Byte(0x4b, 0x33);
HDMI_WriteI2C_Byte(0x4c,0xd3);
HDMI_WriteI2C_Byte(0x4d,0x10);
printk(“[玉剑]--------1080--edp----n”);
#endif
#ifdef _1366x768_eDP_Panel_
HDMI_WriteI2C_Byte(0xff, 0x90); //寄存器库
// HDMI_WriteI2C_Byte(0x4a,0x66); // 72MHz
// HDMI_WriteI2C_Byte(0x4b,0x66);
// HDMI_WriteI2C_Byte(0x4c,0x66);
HDMI_WriteI2C_Byte(0x4a, 0xab); // 76.42MHz
HDMI_WriteI2C_Byte(0x4b, 0xaf);
HDMI_WriteI2C_Byte(0x4c,0x6c);
HDMI_WriteI2C_Byte(0x4d,0x10);
#endif
#ifdef _1600x900_eDP_Panel_HDMI_WriteI2C_Byte
(0xff,0x90);
HDMI_WriteI2C_Byte(0x4a, 0x65); // 77.82MHz
HDMI_WriteI2C_Byte(0x4b, 0xad);
HDMI_WriteI2C_Byte(0x4c, 0x6e);
//HDMI_WriteI2C_Byte(0x4a, 0xa9); // 77.82MHz
//HDMI_WriteI2C_Byte(0x4b, 0xf1);
//HDMI_WriteI2C_Byte(0x4c, 0x72);
HDMI_WriteI2C_Byte(0x4d,0x10);//0x10:
#endif
HDMI_WriteI2C_Byte(0xff, 0x81); //寄存器组
HDMI_WriteI2C_Byte(0x09, 0x01);
HDMI_WriteI2C_Byte(0x0b,0x0b);
HDMI_WriteI2C_Byte(0x08, 0x13);
HDMI_WriteI2C_Byte(0xff, 0x80); //寄存器组
HDMI_WriteI2C_Byte(0x63, 0x7f);
HDMI_WriteI2C_Byte(0x63, 0xff);
//-----------------主链接---------------------//
HDMI_WriteI2C_Byte( 0xff, 0x88 ) ; //寄存器组
HDMI_WriteI2C_Byte( 0x00, 0x6a );
HDMI_WriteI2C_Byte(0x04, 0xff);
HDMI_WriteI2C_Byte(0x05,(u8)(MIPI_Timing[H_tol] / 256));//RG_HTOTAL[15:0]
HDMI_WriteI2C_Byte( 0x06, (u8)( MIPI_Timing[H_tol] % 256 ) ); //RG_HTOTAL[7:0]
HDMI_WriteI2C_Byte( 0x07, (u8)( ( MIPI_Timing[H_bp] + MIPI_Timing[H_sync] ) / 256 ) ); //RG_HSTART [15:8]
HDMI_WriteI2C_Byte( 0x08, (u8)( ( MIPI_Timing[H_bp] + MIPI_Timing[H_sync] ) % 256 ) ); //RG_HSTART[7:0]=110
#ifdef _Test_Pattern_
HDMI_WriteI2C_Byte(0x09,(u8)(MIPI_Timing[H_sync] / 256));//[7]RG_HSPOL;[6:0]RG_HSYNC_WIDTH[14:8] 0x80--》0x00
HDMI_WriteI2C_Byte( 0x0a, (u8)( MIPI_Timing[H_sync] % 256 ) ); //RG_HSYNC_WIDTH[7:0]=60
#else
HDMI_WriteI2C_Byte(0x09, 0x00); //[7]RG_HSPOL;[6:0]RG_HSYNC_WIDTH[14:8] 0x80--》0x00
HDMI_WriteI2C_Byte(0x0a, 0x00); //RG_HSYNC_WIDTH[7:0]=60
#endif
HDMI_WriteI2C_Byte( 0x0b, (u8)( MIPI_Timing[H_act] / 256 ) ); //RG_HWIDTH[15:8]
HDMI_WriteI2C_Byte(0x0c,(u8)(MIPI_Timing[H_act]%256));//RG_HWIDTH[7:0]
HDMI_WriteI2C_Byte( 0x0d, (u8)( MIPI_Timing[V_tol] / 256 ) ); //RG_VTOTAL [15:8]
HDMI_WriteI2C_Byte( 0x0e, (u8)( MIPI_Timing[V_tol] % 256 ) ); //RG_VTOTAL[7:0]
HDMI_WriteI2C_Byte(0x0f, 0x00); //RG_TOP_VTOTAL[15:8] //fiexd
HDMI_WriteI2C_Byte(0x10, 0x00); //RG_TOP_VTOTAL[7:0] //固定
HDMI_WriteI2C_Byte( 0x11, (u8)( ( MIPI_Timing[V_bp] + MIPI_Timing[V_sync] ) / 256 ) ); //RG_VSTART[15:8]
HDMI_WriteI2C_Byte(0x12, (u8)((MIPI_Timing[V_bp] + MIPI_Timing[V_sync])%256));//RG_VSTART[7:0]
#ifdef _Test_Pattern_HDMI_WriteI2C_Byte
(0x13, (u8)( MIPI_Timing[V_sync] / 256 ) ); //RG_VSPOL;RG_VSYNC_WIDTH[14:8] 0x80--》0x00
HDMI_WriteI2C_Byte( 0x14, (u8)( MIPI_Timing[V_sync] % 256 ) ); //RG_VSYNC_WIDTH[7:0]
#else
HDMI_WriteI2C_Byte(0x13, 0x00); //RG_VSPOL;RG_VSYNC_WIDTH[14:8] 0x80--》0x00
HDMI_WriteI2C_Byte(0x14, 0x00); //RG_VSYNC_WIDTH[7:0]
#endif
HDMI_WriteI2C_Byte(0x15,(u8)(MIPI_Timing[V_act] / 256));//RG_VHEIGTH[15:8]
HDMI_WriteI2C_Byte( 0x16, (u8)( MIPI_Timing[V_act] % 256 ) ); //RG_VHEIGTH[7:0]
举报