分辨率为2560x1600
触摸屏的接口为eDP
触摸芯片是goodix GT9721, 在kernel的driver为gt9xx.c
修改DTSI文件
根据原理图,修改为对应的GPIO接口,以及根据面板配置时序
将eDP配置到vopb输出
根据datasheet, vopb支持4k输出,vopl不支持4k输出
tp-size为101,gt9xx.c会根据该类型,决定是否对调XY坐标等等操作
$ vi kernel/arch/arm64/boot/dts/rockchip/lcd-edp-for-toybrick.dtsi
panel: panel {
//compatible = "simple-panel";
compatible = "samsung,ltl101dl03";
backlight = <&backlight>;
enable-gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>;
prepare-delay-ms = <20>;
enable-delay-ms = <20>;
reset-delay-ms = <20>;
pinctrl-names = "default";
pinctrl-0 = <&lcd_bl_en_h>;
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <205000000>;
hactive = <2560>;
vactive = <1600>;
hfront-porch = <12>;
hsync-len = <16>;
hback-porch = <48>;
vfront-porch = <8>;
vsync-len = <4>;
vback-porch = <8>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
ports {
panel_in: endpoint {
remote-endpoint = <&edp_out>;
};
};
};
&edp_in_vopl {
status = "disabled";
};
&edp_in_vopb {
status = "okay";
};
&i2c4 {
status = "okay";
i2c-scl-rising-time-ns = <345>;
i2c-scl-falling-time-ns = <11>;
gt9xx: gt9xx@14 {
status = "okay";
compatible = "goodix,gt9xx";
reg = <0x14>;
pinctrl-names = "default";
pinctrl-0 = <&touch_int_d>;
touch-gpio = <&gpio2 RK_PD0 IRQ_TYPE_LEVEL_LOW>;
//touch-gpio = <&gpio2 RK_PD0 IRQ_TYPE_EDGE_RISING>;
reset-gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
//reset-gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_LOW>;
max-x = <2560>;
max-y = <1600>;
tp-size = <101>;
};
};
$ vi kernel/arch/arm64/boot/dts/rockchip/rk3399pro-toybrick.dtsi
#include "lcd-edp-for-toybrick.dtsi" // enable by renton
$ vi rk3399pro-toybrick.dtsi
&vopl {
assigned-clocks = <&cru DCLK_VOP1_DIV>;
assigned-clock-parents = <&cru PLL_VPLL>;
};
&vopb {
assigned-clocks = <&cru DCLK_VOP0_DIV>;
assigned-clock-parents = <&cru PLL_CPLL>;
};
$ vi rk3399pro-toybrick-prod-android.dts
&route_edp {
status = "okay";
connect = <&vopb_out_edp>;
};
&route_dsi {
status = "disabled";
connect = <&vopl_out_dsi>;
};
$ vi rk3399pro-toybrick.dtsi
&hdmi_in_vopb {
status = "disabled";
};
&hdmi_in_vopl {
status = "okay";
};
&vopl {
assigned-clocks = <&cru DCLK_VOP1_DIV>;
assigned-clock-parents = <&cru PLL_VPLL>;
};
&vopb {
assigned-clocks = <&cru DCLK_VOP0_DIV>;
assigned-clock-parents = <&cru PLL_CPLL>;
};
增加kernel以及u-boot中的面板类型
$ vi kernel/drivers/gpu/drm/panel/panel-simple.c
static const struct drm_display_mode samsung_ltl101dl03_mode = {
.clock = 205000,
.hdisplay = 2560,
.hsync_start = 2560 + 12,
.hsync_end = 2560 + 12 + 16,
.htotal = 2560 + 12 + 16 + 48,
.vdisplay = 1600,
.vsync_start = 1600 + 8,
.vsync_end = 1600 + 8 + 4,
.vtotal = 1600 + 8 + 4 + 8,
.vrefresh = 60,
};
static const struct panel_desc samsung_ltl101dl03 = {
.modes = &samsung_ltl101dl03_mode,
.num_modes = 1,
.size = {
.width = 216,
.height = 135,
},
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
};
static const struct of_device_id platform_of_match[] = {
// ...
{
// add by renton
.compatible = "samsung,ltl101dl03",
.data = &samsung_ltl101dl03,
},
// ...
};
MODULE_DEVICE_TABLE(of, platform_of_match);
$ vi u-boot/drivers/video/drm/rockchip_panel.c
static int rockchip_panel_probe(struct udevice *dev) {
// ...
ret = gpio_request_by_name(dev, "enable-gpios", 0,
&priv->enable_gpio, GPIOD_IS_OUT);
if (ret && ret != -ENOENT) {
printf("%s: Cannot get enable GPIO: %dn", __func__, ret);
return ret;
}
// for edp connection add by renton
if (dm_gpio_is_valid(&priv->enable_gpio)) {
dm_gpio_set_value(&priv->enable_gpio, 1);
mdelay(300);
}
// end by renton
// ...
}
// add by renton
static const struct drm_display_mode samsung_ltl101dl03_mode = {
.clock = 205000,
.hdisplay = 2560,
.hsync_start = 2560 + 12,
.hsync_end = 2560 + 12 + 16,
.htotal = 2560 + 12 + 16 + 48,
.vdisplay = 1600,
.vsync_start = 1600 + 8,
.vsync_end = 1600 + 8 + 4,
.vtotal = 1600 + 8 + 4 + 8,
.vrefresh = 60,
.flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
};
static const struct rockchip_panel samsung_ltl101dl03 = {
.funcs = &rockchip_panel_funcs,
.data = &samsung_ltl101dl03_mode,
};
// end by renton
static const struct rockchip_panel panel_simple_driver_data = {
// ...
}
static const struct udevice_id rockchip_panel_ids[] = {
// ...
{
.compatible = "samsung,ltl101dl03",
.data = (ulong)&samsung_ltl101dl03,
},
// ...
};
接下来,还需要把goodix对应的2560x1600的cfg文件拷贝进去驱动目录。
在gt9xx_cfg.h中对其进行包含。
分辨率为2560x1600
触摸屏的接口为eDP
触摸芯片是goodix GT9721, 在kernel的driver为gt9xx.c
修改DTSI文件
根据原理图,修改为对应的GPIO接口,以及根据面板配置时序
将eDP配置到vopb输出
根据datasheet, vopb支持4k输出,vopl不支持4k输出
tp-size为101,gt9xx.c会根据该类型,决定是否对调XY坐标等等操作
$ vi kernel/arch/arm64/boot/dts/rockchip/lcd-edp-for-toybrick.dtsi
panel: panel {
//compatible = "simple-panel";
compatible = "samsung,ltl101dl03";
backlight = <&backlight>;
enable-gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>;
prepare-delay-ms = <20>;
enable-delay-ms = <20>;
reset-delay-ms = <20>;
pinctrl-names = "default";
pinctrl-0 = <&lcd_bl_en_h>;
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <205000000>;
hactive = <2560>;
vactive = <1600>;
hfront-porch = <12>;
hsync-len = <16>;
hback-porch = <48>;
vfront-porch = <8>;
vsync-len = <4>;
vback-porch = <8>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
ports {
panel_in: endpoint {
remote-endpoint = <&edp_out>;
};
};
};
&edp_in_vopl {
status = "disabled";
};
&edp_in_vopb {
status = "okay";
};
&i2c4 {
status = "okay";
i2c-scl-rising-time-ns = <345>;
i2c-scl-falling-time-ns = <11>;
gt9xx: gt9xx@14 {
status = "okay";
compatible = "goodix,gt9xx";
reg = <0x14>;
pinctrl-names = "default";
pinctrl-0 = <&touch_int_d>;
touch-gpio = <&gpio2 RK_PD0 IRQ_TYPE_LEVEL_LOW>;
//touch-gpio = <&gpio2 RK_PD0 IRQ_TYPE_EDGE_RISING>;
reset-gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
//reset-gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_LOW>;
max-x = <2560>;
max-y = <1600>;
tp-size = <101>;
};
};
$ vi kernel/arch/arm64/boot/dts/rockchip/rk3399pro-toybrick.dtsi
#include "lcd-edp-for-toybrick.dtsi" // enable by renton
$ vi rk3399pro-toybrick.dtsi
&vopl {
assigned-clocks = <&cru DCLK_VOP1_DIV>;
assigned-clock-parents = <&cru PLL_VPLL>;
};
&vopb {
assigned-clocks = <&cru DCLK_VOP0_DIV>;
assigned-clock-parents = <&cru PLL_CPLL>;
};
$ vi rk3399pro-toybrick-prod-android.dts
&route_edp {
status = "okay";
connect = <&vopb_out_edp>;
};
&route_dsi {
status = "disabled";
connect = <&vopl_out_dsi>;
};
$ vi rk3399pro-toybrick.dtsi
&hdmi_in_vopb {
status = "disabled";
};
&hdmi_in_vopl {
status = "okay";
};
&vopl {
assigned-clocks = <&cru DCLK_VOP1_DIV>;
assigned-clock-parents = <&cru PLL_VPLL>;
};
&vopb {
assigned-clocks = <&cru DCLK_VOP0_DIV>;
assigned-clock-parents = <&cru PLL_CPLL>;
};
增加kernel以及u-boot中的面板类型
$ vi kernel/drivers/gpu/drm/panel/panel-simple.c
static const struct drm_display_mode samsung_ltl101dl03_mode = {
.clock = 205000,
.hdisplay = 2560,
.hsync_start = 2560 + 12,
.hsync_end = 2560 + 12 + 16,
.htotal = 2560 + 12 + 16 + 48,
.vdisplay = 1600,
.vsync_start = 1600 + 8,
.vsync_end = 1600 + 8 + 4,
.vtotal = 1600 + 8 + 4 + 8,
.vrefresh = 60,
};
static const struct panel_desc samsung_ltl101dl03 = {
.modes = &samsung_ltl101dl03_mode,
.num_modes = 1,
.size = {
.width = 216,
.height = 135,
},
.bus_format = MEDIA_BUS_FMT_RGB666_1X18,
};
static const struct of_device_id platform_of_match[] = {
// ...
{
// add by renton
.compatible = "samsung,ltl101dl03",
.data = &samsung_ltl101dl03,
},
// ...
};
MODULE_DEVICE_TABLE(of, platform_of_match);
$ vi u-boot/drivers/video/drm/rockchip_panel.c
static int rockchip_panel_probe(struct udevice *dev) {
// ...
ret = gpio_request_by_name(dev, "enable-gpios", 0,
&priv->enable_gpio, GPIOD_IS_OUT);
if (ret && ret != -ENOENT) {
printf("%s: Cannot get enable GPIO: %dn", __func__, ret);
return ret;
}
// for edp connection add by renton
if (dm_gpio_is_valid(&priv->enable_gpio)) {
dm_gpio_set_value(&priv->enable_gpio, 1);
mdelay(300);
}
// end by renton
// ...
}
// add by renton
static const struct drm_display_mode samsung_ltl101dl03_mode = {
.clock = 205000,
.hdisplay = 2560,
.hsync_start = 2560 + 12,
.hsync_end = 2560 + 12 + 16,
.htotal = 2560 + 12 + 16 + 48,
.vdisplay = 1600,
.vsync_start = 1600 + 8,
.vsync_end = 1600 + 8 + 4,
.vtotal = 1600 + 8 + 4 + 8,
.vrefresh = 60,
.flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
};
static const struct rockchip_panel samsung_ltl101dl03 = {
.funcs = &rockchip_panel_funcs,
.data = &samsung_ltl101dl03_mode,
};
// end by renton
static const struct rockchip_panel panel_simple_driver_data = {
// ...
}
static const struct udevice_id rockchip_panel_ids[] = {
// ...
{
.compatible = "samsung,ltl101dl03",
.data = (ulong)&samsung_ltl101dl03,
},
// ...
};
接下来,还需要把goodix对应的2560x1600的cfg文件拷贝进去驱动目录。
在gt9xx_cfg.h中对其进行包含。
举报