一,问题现象
系统使用LVDS接口屏幕,进入系统有些界面会闪,图像抖动;
二,解决办法:
1.调试
调节LCD0的LVDS电压幅度,寄存器地址是0x06511220(具体是在User Manual中的LCD LVDS Analog Register 0),bit19:bit17控制差模电压大小,bit10:bit8控制共模电压大小。
kernel调试命令:
echo 0x06511220 >/sys/class/sunxi_dump/dump&&cat /sys/class/sunxi_dump/dump
echo 0x06511220 0xc1fe0320 > /sys/class/sunxi_dump/write
2.代码固化
参考如下,uboot和kernel都需要修改,然后读取寄存器检查是否设置成功。
diff --git a/longan/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/de/lowlevel_v2x/de_lcd.c b/longan/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/de/lowlevel_v2x/de_lcd.c
index a8335b8072..493e654c64 100644
--- a/longan/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/de/lowlevel_v2x/de_lcd.c
+++ b/longan/kernel/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/de/lowlevel_v2x/de_lcd.c
@@ -380,10 +380,10 @@ s32 lvds_open(u32 sel, struct disp_panel_para *panel)
if (sel == 0)
lvds_combphy_open(sel, panel);
#endif
- lcd_dev[sel]->tcon0_lvds_ana[0].bits.c = 2;
+ lcd_dev[sel]->tcon0_lvds_ana[0].bits.c = 3;
lcd_dev[sel]->tcon0_lvds_ana[0].bits.v = 3;
lcd_dev[sel]->tcon0_lvds_ana[0].bits.pd = 2;
- lcd_dev[sel]->tcon0_lvds_ana[1].bits.c = 2;
+ lcd_dev[sel]->tcon0_lvds_ana[1].bits.c = 3;
lcd_dev[sel]->tcon0_lvds_ana[1].bits.v = 3;
lcd_dev[sel]->tcon0_lvds_ana[1].bits.pd = 2;
@@ -414,10 +414,10 @@ s32 lvds_open(u32 sel, struct disp_panel_para *panel)
if (sel == 0)
lvds_combphy_open(sel, panel);
#endif
- lcd_dev[sel]->tcon0_lvds_ana[0].bits.c = 2;
+ lcd_dev[sel]->tcon0_lvds_ana[0].bits.c = 3;
lcd_dev[sel]->tcon0_lvds_ana[0].bits.v = 3;
lcd_dev[sel]->tcon0_lvds_ana[0].bits.pd = 2;
- lcd_dev[sel]->tcon0_lvds_ana[1].bits.c = 2;
+ lcd_dev[sel]->tcon0_lvds_ana[1].bits.c = 3;
lcd_dev[sel]->tcon0_lvds_ana[1].bits.v = 3;
lcd_dev[sel]->tcon0_lvds_ana[1].bits.pd = 2;
@@ -445,6 +445,7 @@ s32 lvds_open(u32 sel, struct disp_panel_para *panel)
#if defined(SUPPORT_COMBO_DPHY)
if (sel == 0) {
lvds_combphy_open(sel, panel);
+ lcd_dev[sel]->tcon0_lvds_ana[0].bits.c = 3;
} else {
lcd_dev[sel]->tcon0_lvds_ana[0].bits.c = 2;
lcd_dev[sel]->tcon0_lvds_ana[0].bits.v = 3;
@@ -467,7 +468,7 @@ s32 lvds_open(u32 sel, struct disp_panel_para *panel)
}
#else
{
- lcd_dev[sel]->tcon0_lvds_ana[sel].bits.c = 2;
+ lcd_dev[sel]->tcon0_lvds_ana[sel].bits.c = 3;
lcd_dev[sel]->tcon0_lvds_ana[sel].bits.v = 3;
lcd_dev[sel]->tcon0_lvds_ana[sel].bits.pd = 2;
3. 检查
读取寄存器检查值是否为所设值
echo 0x06511220 >/sys/class/sunxi_dump/dump&&cat /sys/class/sunxi_dump/dump