1: 屏幕的规格书
2:RK3568中DTS的配置
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2020 Rockchip Electronics Co., Ltd.
https://www.cnblogs.com/chenfulin5/p/12918924.html
https://blog.csdn.net/qq_28515331/article/details/90763875?spm=1001.2101.3001.6650.6&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-6-90763875-blog-125692889.pc_relevant_aa2&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-6-90763875-blog-125692889.pc_relevant_aa2&utm_relevant_index=12
https://blog.csdn.net/u011784994/article/details/102476182
MEDIA_BUS_FMT_RGB666_1X7X3_JEIDA
lvds_timing0: lvds-timing0 {
clock-frequency = <75000000>;
hactive = <1280>;
vactive = <800>;
hsync-active = <0>;
hback-porch = <100>;
hfront-porch = <100>;
vsync-len = <3>;
vback-porch = <15>;
vfront-porch = <20>;
hsync-len = <2>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
*/
#include <dt-bindings/display/media-bus-format.h>
/ {
lvds_panel: panel {
compatible = "simple-panel";
backlight = <&backlight>;
power-supply = <&vcc3v3_lcd0_n>;
enable-delay-ms = <20>;
prepare-delay-ms = <20>;
unprepare-delay-ms = <20>;
disable-delay-ms = <20>;
bus-format = <MEDIA_BUS_FMT_RGB888_1X7X4_SPWG>;
width-mm = <261>; //ÎïÀí¿í¶È
height-mm = <163>;//ÎïÀí¸ß¶È
display-timings {
native-mode = <&lvds_timing0>; HS+HBP+HFP =38£¬ VS+VBP+VFP=200
lvds_timing0: lvds-timing0{
clock-frequency = <74000000>;
hactive = <1280>;
vactive = <800>;
hback-porch = <80>;
hfront-porch = <48>;
vback-porch = <22>;
vfront-porch = <3>;
hsync-len = <32>;
vsync-len = <6>;
hsync-active = <1>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
#dual-lvds-even-pixels;
panel_in_lvds: endpoint {
remote-endpoint = <&lvds_out_panel>;
};
};
};
};
};
&dsi0 {
status = "disabled";
};
&dsi0_in_vp0 {
status = "disabled";
};
&dsi0_in_vp1 {
status = "disabled";
};
&video_phy0 {
status = "okay";
};
&lvds {
status = "okay";
ports {
port@1 {
reg = <1>;
lvds_out_panel: endpoint {
remote-endpoint = <&panel_in_lvds>;
};
};
};
};
&lvds {
status = "okay";
};
&lvds_panel{
status = "okay";
};
&lvds_in_vp1 {
status = "disabled";
};
&backlight {
status = "okay";
};
&lvds_in_vp2 {
status = "okay";
};
&video_phy0{
status="okay";
};
&route_lvds {
status = "okay";
connect = <&vp2_out_lvds>;
};
注意上面DTS中:
&lvds_in_vp1 {
status = "disabled";
};
和
&lvds_in_vp2 {
status = "okay";
};
如果使能的是
&lvds_in_vp1 {
status = "okay";
};
时,驱动中信息如下:使用的是Video Port1:
如果使能的是
&lvds_in_vp2 {
status = "okay";
};
时,驱动中信息如下:使用的是Video Port2:
3:驱动程序
也需要驱动 compatible = "simple-panel";
4:触摸芯片
http://211.72.159.212/AP/Service/TPDriver.nsf/Homepage_CC_2019.xsp?Category=Drivers&OS=Linux 解压密码为: Ili888
屏幕中已经集成了USB接口,故使用的是USB驱动程序,其中触摸芯片是:ILI2511
在Linux下面驱动模块几乎是默认选择的:hid multitouch驱动
5:Linux下驱动日志
2|rk3568_r:/dev # cd input/
rk3568_r:/dev/input # ls
event0 event1 event2 event3 event4
rk3568_r:/dev/input # ls -al
total 0
drwxr-xr-x 2 root root 140 2023-01-12 10:03 .
drwxr-xr-x 22 root root 2060 2023-01-12 10:03 ..
crw-rw-rw- 1 input system 13, 64 2023-01-12 10:03 event0
crw-rw-rw- 1 input system 13, 65 2023-01-12 10:03 event1
crw-rw-rw- 1 input system 13, 66 2023-01-12 10:03 event2
crw-rw-rw- 1 input system 13, 67 2023-01-12 10:03 event3
crw-rw-rw- 1 input system 13, 68 2023-01-12 10:03 event4
rk3568_r:/dev/input # gete
getenforce getevent
rk3568_r:/dev/input # getevent -ltr /dev/input/e
event0 event1 event2 event3 event4
rk3568_r:/dev/input # getevent -ltr /dev/input/event2
[ 22416.313067] EV_ABS ABS_MT_TRACKING_ID 00000006
[ 22416.313067] EV_ABS ABS_MT_POSITION_X 00001e05
[ 22416.313067] EV_ABS ABS_MT_POSITION_Y 00001bc3
[ 22416.313067] EV_KEY BTN_TOUCH DOWN
[ 22416.313067] EV_ABS ABS_X 00001e05
[ 22416.313067] EV_ABS ABS_Y 00001bc3
[ 22416.313067] EV_MSC MSC_TIMESTAMP 00000000
[ 22416.313067] EV_SYN SYN_REPORT 00000000
[ 22416.337066] EV_MSC MSC_TIMESTAMP 00001f40
[ 22416.337066] EV_SYN SYN_REPORT 00000000 rate 41
[ 22416.361062] EV_MSC MSC_TIMESTAMP 00003e80
[ 22416.361062] EV_SYN SYN_REPORT 00000000 rate 41
[ 22416.385060] EV_MSC MSC_TIMESTAMP 00005dc0
[ 22416.385060] EV_SYN SYN_REPORT 00000000 rate 41
[ 22416.420074] EV_MSC MSC_TIMESTAMP 00007d00
[ 22416.420074] EV_SYN SYN_REPORT 00000000 rate 28
[ 22416.444067] EV_ABS ABS_MT_POSITION_Y 00001bca
[ 22416.444067] EV_ABS ABS_Y 00001bca
[ 22416.444067] EV_MSC MSC_TIMESTAMP 00009c40
[ 22416.444067] EV_SYN SYN_REPORT 00000000 rate 41
[ 22416.468064] EV_ABS ABS_MT_POSITION_X 00001e09
[ 22416.468064] EV_ABS ABS_MT_POSITION_Y 00001bd0
[ 22416.468064] EV_ABS ABS_X 00001e09
[ 22416.468064] EV_ABS ABS_Y 00001bd0
[ 22416.468064] EV_MSC MSC_TIMESTAMP 0000bb80
[ 22416.468064] EV_SYN SYN_REPORT 00000000 rate 41
[ 22416.492068] EV_ABS ABS_MT_POSITION_X 00001e10
[ 22416.492068] EV_ABS ABS_MT_POSITION_Y 00001bda
[ 22416.492068] EV_ABS ABS_X 00001e10
[ 22416.492068] EV_ABS ABS_Y 00001bda
[ 22416.492068] EV_MSC MSC_TIMESTAMP 0000dac0
[ 22416.492068] EV_SYN SYN_REPORT 00000000 rate 41
[ 22416.528070] EV_ABS ABS_MT_POSITION_X 00001e21
[ 22416.528070] EV_ABS ABS_MT_POSITION_Y 00001be8
[ 22416.528070] EV_ABS ABS_X 00001e21
[ 22416.528070] EV_ABS ABS_Y 00001be8
[ 22416.528070] EV_MSC MSC_TIMESTAMP 0000fa00
[ 22416.528070] EV_SYN SYN_REPORT 00000000 rate 27
[ 22416.552118] EV_ABS ABS_MT_POSITION_X 00001e39
[ 22416.552118] EV_ABS ABS_MT_POSITION_Y 00001bf5
[ 22416.552118] EV_ABS ABS_X 00001e39
[ 22416.552118] EV_ABS ABS_Y 00001bf5
[ 22416.552118] EV_MSC MSC_TIMESTAMP 00011940
[ 22416.552118] EV_SYN SYN_REPORT 00000000 rate 41
[ 22416.576081] EV_ABS ABS_MT_POSITION_X 00001e59
[ 22416.576081] EV_ABS ABS_MT_POSITION_Y 00001c02
[ 22416.576081] EV_ABS ABS_X 00001e59
[ 22416.576081] EV_ABS ABS_Y 00001c02
[ 22416.576081] EV_MSC MSC_TIMESTAMP 00013880
[ 22416.576081] EV_SYN SYN_REPORT 00000000 rate 41
[ 22416.600068] EV_ABS ABS_MT_POSITION_X 00001e7b
rk3568_r:/sys/class/input # cd input2/
rk3568_r:/sys/class/input/input2 # ls
capabilities device event2 id modalias name phys power properties subsystem uevent uniq
rk3568_r:/sys/class/input/input2 # ls -al
total 0
drwxr-xr-x 6 root root 0 2023-01-12 10:03 .
drwxr-xr-x 3 root root 0 2023-01-12 10:03 ..
drwxr-xr-x 2 root root 0 2023-01-12 10:03 capabilities
lrwxrwxrwx 1 root root 0 2023-01-12 10:13 device -> ../../../0003:222A:0001.0001
drwxr-xr-x 3 root root 0 2023-01-12 10:03 event2
drwxr-xr-x 2 root root 0 2023-01-12 10:03 id
-r--r--r-- 1 root root 4096 2023-01-12 10:13 modalias
-r--r--r-- 1 root root 4096 2023-01-12 10:13 name
-r--r--r-- 1 root root 4096 2023-01-12 10:13 phys
drwxr-xr-x 2 root root 0 2023-01-12 10:03 power
-r--r--r-- 1 root root 4096 2023-01-12 10:13 properties
lrwxrwxrwx 1 root root 0 2023-01-12 10:13 subsystem -> ../../../../../../../../../class/input
-rw-r--r-- 1 root root 4096 2023-01-12 10:03 uevent
-r--r--r-- 1 root root 4096 2023-01-12 10:13 uniq
rk3568_r:/sys/class/input/input2 # cat id/
cat: id/: Is a directory
1|rk3568_r:/sys/class/input/input2 # cat name
ILITEK ILITEK-TP
rk3568_r:/sys/class/input/input2 # cat p
phys power/ properties
rk3568_r:/sys/class/input/input2 # cat phys
usb-fd840000.usb-1/input0
rk3568_r:/sys/class/input/input2 # cat modalias
input:b0003v222Ap0001e0110-e0,1,3,4,k14A,ra0,1,2F,35,36,39,m5,lsfw
rk3568_r:/sys/class/input/input2 # cat capabilities/
abs ev ff key led msc rel snd sw
rk3568_r:/sys/class/input/input2 # cat capabilities/
abs ev ff key led msc rel snd sw
rk3568_r:/sys/class/input/input2 # cat capabilities/sw
0
rk3568_r:/sys/class/input/input2 # cat u
uevent uniq
rk3568_r:/sys/class/input/input2 # cat uevent
PRODUCT=3/222a/1/110
NAME="ILITEK ILITEK-TP"
PHYS="usb-fd840000.usb-1/input0"
UNIQ=""
PROP=2
EV=1b
KEY=400 0 0 0 0 0
ABS=260800000000003
MSC=20
MODALIAS=input:b0003v222Ap0001e0110-e0,1,3,4,k14A,ra0,1,2F,35,36,39,m5,lsfw
rk3568_r:/sys/class/input/input2 #
T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=222a ProdID=0001 Rev= 0.02
S: Manufacturer=ILITEK
S: Product=ILITEK-TP
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=400mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=1ms
E: Ad=02(O) Atr=03(Int.) MxPS= 64 Ivl=1ms
6:原理图
注意
LCD0_PWREN_H_GPIO0_C7 IO用来给LCD上电用的
LCD0_BL_PWM4 用来连接及控制LCD的背光