1、EDP屏调试:
&edp {
status = "okay";
};
&edp_panel {
compatible = "simple-panel";
backlight = <&backlight>;
enable-gpios = <&gpio7 13 GPIO_ACTIVE_HIGH>;
enable-delay-ms = <120>;
prepare-delay-ms = <200>; //上电时序延时加大解决uboot出现Aux通信出错
bus-format = ;
power-supply = <&vcc_lcd>;
status = "okay";
disp_timings: display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <141000000>;
hactive = <1920>;
vactive = <1080>;
hfront-porch = <30>;
hsync-len = <5>;
hback-porch = <153>;
vfront-porch = <15>;
vsync-len = <1>;//8
vback-porch = <20>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
};
&edp_phy {
status = "okay";
};
&route_edp {
status = "okay";
};
碰到问题:开机很大概率不会亮屏,去掉&route_edp ,可以正常开机,但无法显示静态logo图像,测试发现以太网通信时屏幕会抖动,确认是硬件干扰所致,还有EDP走线过长引起。
2、MIPI屏调试:
&dsi0 {
status = "okay";
panel: panel {
compatible = "simple-panel-dsi";
reg = <0>;
backlight = <&backlight>;
1v8-gpio = <&gpio7 2 GPIO_ACTIVE_HIGH>; //添加1.8v的使能,需要修改panel_simple.c
enable-gpios = <&gpio7 3 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;//复位时序是高低高,系统默认是低高低,需
要修改panel_simple.c的上下电时的状态,从log看,他是先走上电函数,在下电,绑定vop成功的时候在执行上电函数。
power-supply = <&vcc_lcd>;
dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST)>;
dsi,format = ;
dsi,lanes = <4>;
reset-delay-ms = <20>;
init-delay-ms = <20>;
enable-delay-ms = <120>;
prepare-delay-ms = <120>;
status = "okay";
panel-init-sequence = [ //屏初始化代码,找屏厂要
15 00 02 E0 00 //02代表长度,E0代表cmd,00代表data
15 00 02 E1 93
15 00 02 E2 65
15 00 02 E3 F8
15 00 02 80 03
15 00 02 E0 04
15 00 02 2D 03
15 00 02 E0 01
15 00 02 00 00
15 00 02 01 5C
…………………………
];
panel-exit-sequence = [
05 00 01 28
05 78 01 10
];
disp_timings: display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <67000000>;
hactive = <800>;
vactive = <1280>;
hback-porch = <18>;
hfront-porch = <18>;
vback-porch = <8>;
vfront-porch = <30>;
hsync-len = <18>;
vsync-len = <4>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
};
};
3、gt9712触摸屏调试。
系统有gt9xx的驱动,gt9系列基本这个驱动都兼容,在内核配置编译gt9xx,调试的时候打开debug,在gt9xx.h,有个DEBUG_SWITCH 宏,修改dts。
&i2c4{
status = "okay";
gt9xx@5d {
compatible = "goodix,gt9xx";
reg = <0x5d>;
touch-gpio = <&gpio7 6 IRQ_TYPE_LEVEL_HIGH>;
reset-gpio = <&gpio7 5 GPIO_ACTIVE_LOW>;
max-x = <800>;
max-y = <1280>;
tp-size = <101>; //从驱动查看,这个跟x或y水平翻转,x y对调等等
tp-supply = <&vcc_tp>; //根据硬件,这个电压是2.8,系统默认是3.3,修改
status = "okay";
};
};
vcc_tp: LDO_REG1 {
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <2800000>; //修改2.8V TP供电电压
regulator-max-microvolt = <2800000>;
regulator-name = "vcc_tp";
regulator-state-mem {
regulator-off-in-suspend;
};
};
看看tp-size在驱动中表现:
if (of_property_read_u32(np, "tp-size", &val)) {
dev_err(&client->dev, "no max-x defined\n");
return -EINVAL;
}
if (val == 89) {
m89or101 = TRUE;
gtp_change_x2y = TRUE;
gtp_x_reverse = FALSE;
gtp_y_reverse = TRUE;
} else if (val == 101) {
m89or101 = FALSE;
gtp_change_x2y = TRUE;
gtp_x_reverse = TRUE;
gtp_y_reverse = FALSE;
} else if (val == 911) {
m89or101 = FALSE;
bgt911 = TRUE;
gtp_change_x2y = TRUE;
gtp_x_reverse = FALSE;
gtp_y_reverse = TRUE;
} else if (val == 970) {
m89or101 = FALSE;
bgt911 = FALSE;
bgt970 = TRUE;
gtp_change_x2y = FALSE;
gtp_x_reverse = FALSE;
gtp_y_reverse = TRUE;
} else if (val == 910) {
m89or101 = FALSE;
bgt911 = FALSE;
bgt970 = FALSE;
bgt910 = TRUE;
gtp_change_x2y = TRUE;
gtp_x_reverse = FALSE;
gtp_y_reverse = TRUE;
}
根据出现的现象给tp-size选择就行了。
还需要添加TP固件,TP厂会提供cfg文件,把这个文件拷贝到驱动目录下,修改gt9xx_cfg.c文件,配置cfg文件进去即可。