So I've followed the steps here to download and compile the kernel: https://www.raspberrypi.com/documentati ... ernel.html
I've gone in and edited/added:
I've gone in and edited/added:
- /linux/drivers/gpu/drm/panel/panel-sitronix-st7701.c - adding in duplicate functions based (on the TS8550b) of the init_sequence, gip_sequence, drm_display_mode, and st7701_panel_desc. Only making edits to the drm_display_mode function and the references in the st7701_panel_desc.
edited drm_display_mode:edited st7701_panel_desc:Code:
static const struct drm_display_mode custom_mode = { .clock = 29300, .hdisplay = 480, .hsync_start = 480 + 40, .hsync_end = 480 + 40 + 40, .htotal = 480 + 40 + 40 + 30, .vdisplay = 800, .vsync_start = 800 + 8, .vsync_end = 800 + 8 + 16, .vtotal = 800 + 8 + 16 + 4, .width_mm = 56, .height_mm = 94, .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,};
edited .compatible string to allow the dts file to reference the new functionsCode:
static const struct st7701_panel_desc custom_desc = { .mode = &custom_mode, .lanes = 2, .format = MIPI_DSI_FMT_RGB888, .panel_sleep_delay = 80, /* panel need extra 80ms for sleep out cmd */ .init_sequence = custom_init_sequence, .conn_type = DRM_MODE_CONNECTOR_DSI, .interface = ST7701_CTRL_DSI,
Code:
static const struct of_device_id st7701_dsi_of_match[] = { { .compatible = "densitron,dmt028vghmcmi-1a", .data = &dmt028vghmcmi_1a_desc }, { .compatible = "techstar,ts8550b", .data = &ts8550b_desc }, { .compatible = "custom,custom", .data = &custom_desc }, { }
- /linux/arch/arm64/boot/dts/overlays/ - i've added a dts file
dts file - "custom-panel.dts":Code:
/dts-v1/;/plugin/;/ { compatible = "brcm,bcm2835"; fragment@0 { target = <&dsi1>; __overlay__ { status = "okay"; #address-cells = <1>; #size-cells = <0>; port { dsi_out:endpoint { remote-endpoint = <&panel_dsi_port>; }; }; panel: panel-dsi-custom@0 { compatible = "custom,custom", "sitronix,st7701"; reg=<0>; VCC-supply = <®_dldo2>; IOVCC-supply = <®_dldo2>; reset-gpio = <&gpio 20 1>; port { panel_dsi_port: endpoint { remote-endpoint = <&dsi_out>; }; }; }; }; }; fragment@1 { target = <&gpio>; __overlay__ { gpio_pins: gpio_pins { brcm,pins = <20>; brcm,function = <1>; brcm,pull =<0>; }; }; };};
- I added "dtoverlay=custom-panel" to /boot/config.txt
Statistics: Posted by ncarley — Wed Jan 24, 2024 5:48 am