显示屏及TP的设备树文件:
vim kernel/arch/arm64/boot/dts/rockchip/rp-lcd-mipi_5-720-1280.dtsi
关于TP的配置:
&i2c1 {
status = "okay";
hynitron@1a {
compatible = "hynitron,cst1xx";
reg = <0x1a>;
hynitron,display-coords = <0 0 720 1280>;
hynitron,panel-coords = <0 0 720 1280>;
hynitron,button-map= <139 102 158>;
hynitron,vdd_ana = <2800>;
hynitron,vcc_i2c = <1800>;
gtp_int_tarigger = <1>;
gtp_change_x2y = <0>;
gtp_overturn_x = <1>;
gtp_overturn_y = <1>;
gtp_send_cfg = <1>;
gtp_touch_wakeup = <1>;
hynitron,rst-gpio = <&gpio0 RK_PB4 GPIO_ACTIVE_LOW>;
hynitron,irq-gpio = <&gpio0 RK_PA5 IRQ_TYPE_EDGE_FALLING>;
};
};
其中1a 是I2C设备的地址。
TP的驱动文件位于 kernel/drivers/input/touchscreen/hyn_cst3xx.c
static const struct of_device_id tpd_of_match[] = {
{.compatible = "hynitron,cst1xx"},
{},
};
驱动文件中的 compatible 要与设备树上的compatible一致,否则进入驱动程序。
关于显示的配置:
&dsi {
status = "okay";
panel@0 {
compatible = "sitronix,st7703", "simple-panel-dsi";
reg = <0>;
power-supply = <&vcc3v3_lcd>;
backlight = <&backlight>;
prepare-delay-ms = <2>;
reset-delay-ms = <1>;
init-delay-ms = <20>;
enable-delay-ms = <120>;
disable-delay-ms = <50>;
unprepare-delay-ms = <20>;
width-mm = <68>;
height-mm = <121>;
//enable-gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
dsi,format = ;
dsi,lanes = <4>;
panel-init-sequence = [
39 00 04 B9 F1 12 83
39 00 1C BA 33 81 05 f9 0e 0e 20 00 00 00 00 00 00 00 44 25 00 91 0a 00 00 02 4F d1 00 00 37
//39 00 05 B8 23 22 20 03
39 00 02 B8 25
39 00 04 BF 02 10 00
39 00 0B B3 07 0B 1E 1E 03 ff 00 00 00 00
39 00 0A C0 73 73 50 50 00 00 08 70 00
39 00 02 BC 46
39 00 02 CC 0B
39 00 02 B4 80
39 00 03 B2 C8 12
39 00 0F E3 07 07 0b 0b 07 0b 00 00 00 00 ff 80 40 10
39 00 0d c1 53 00 1e 1e 77 f1 ff ff cc cc 77 77
39 00 03 B5 09 09
39 00 03 B6 6E 6E
39 00 40 E9 c2 10 0a 05 a1 0a b0 12 31 23 37 86 0a b0 37 18 00 00 30 00 00 00 00 00 30 00 00 00 46 02 02 88 88 F8 8A B8 88 88 88 57 13 13 88 88 F8 8A B8 88 88 88 00 00 00 00 00 00 00 00 00 00 00 00 00
39 00 3e EA 0B 12 01 01 00 06 00 00 00 00 00 00 31 75 31 88 88 8F 8A B8 88 88 88 20 64 20 88 88 8F 8A B8 88 88 88 23 10 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 08 E0 00 00 00 00
39 00 23 E0 00 06 07 2e 31 3F 34 30 07 0B 0C 10 11 11 12 0E 15 00 06 07 2E 31 3f 34 30 07 0B 0C 10 11 11 12 0E 15
05 FA 01 11
05 32 01 29
// 05 00 01 FF
];
panel-exit-sequence = [
05 00 01 28
05 78 01 10
];
panel-init-sequence 是Panel 的启动顺序,39是命令格式,00 是延时时间
编译内核及所有文件的命令:
sudo vim ./build.sh kernel
sudo vim ./build.sh
将相关的 img打包成update.img:
sudo vim ./build.sh updateimg
编译内核会生成 resource.img 与 kernel.img 更新这两个文件即可。
[resource.img 是与设备树相关的,如没有修改设备树,则无须烧写 resource.img ]
阅读(1636) | 评论(0) | 转发(0) |