Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/panel: sitronix-st7789v: add jasonic jt240mhqs-hwt-ek-e3 support

The Jasonic JT240MHQS-HWT-EK-E3 is a custom panel using the Sitronix
ST7789V controller. While the controller features a resolution of
320x240, only an area of 280x240 is visible by design.

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230718-feature-lcd-panel-v2-4-2485ca07b49d@wolfvision.net

authored by

Michael Riesch and committed by
Neil Armstrong
0fbbe96b a82db604

+29
+29
drivers/gpu/drm/panel/panel-sitronix-st7789v.c
··· 279 279 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC, 280 280 }; 281 281 282 + static const struct drm_display_mode jt240mhqs_hwt_ek_e3_mode = { 283 + .clock = 6000, 284 + .hdisplay = 240, 285 + .hsync_start = 240 + 28, 286 + .hsync_end = 240 + 28 + 10, 287 + .htotal = 240 + 28 + 10 + 10, 288 + .vdisplay = 280, 289 + .vsync_start = 280 + 8, 290 + .vsync_end = 280 + 8 + 4, 291 + .vtotal = 280 + 8 + 4 + 4, 292 + .width_mm = 43, 293 + .height_mm = 37, 294 + .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC, 295 + }; 296 + 282 297 static const struct st7789_panel_info default_panel = { 283 298 .mode = &default_mode, 284 299 .invert_mode = true, ··· 316 301 .bus_format = MEDIA_BUS_FMT_RGB666_1X18, 317 302 .bus_flags = DRM_BUS_FLAG_DE_HIGH | 318 303 DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE, 304 + }; 305 + 306 + static const struct st7789_panel_info jt240mhqs_hwt_ek_e3_panel = { 307 + .mode = &jt240mhqs_hwt_ek_e3_mode, 308 + .invert_mode = true, 309 + .bus_format = MEDIA_BUS_FMT_RGB666_1X18, 310 + .bus_flags = DRM_BUS_FLAG_DE_HIGH | 311 + DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE, 312 + .partial_mode = true, 313 + .partial_start = 38, 314 + .partial_end = 318, 319 315 }; 320 316 321 317 static int st7789v_get_modes(struct drm_panel *panel, ··· 661 635 { "st7789v", (unsigned long) &default_panel }, 662 636 { "t28cp45tn89-v17", (unsigned long) &t28cp45tn89_panel }, 663 637 { "et028013dma", (unsigned long) &et028013dma_panel }, 638 + { "jt240mhqs-hwt-ek-e3", (unsigned long) &jt240mhqs_hwt_ek_e3_panel }, 664 639 { } 665 640 }; 666 641 MODULE_DEVICE_TABLE(spi, st7789v_spi_id); ··· 670 643 { .compatible = "sitronix,st7789v", .data = &default_panel }, 671 644 { .compatible = "inanbo,t28cp45tn89-v17", .data = &t28cp45tn89_panel }, 672 645 { .compatible = "edt,et028013dma", .data = &et028013dma_panel }, 646 + { .compatible = "jasonic,jt240mhqs-hwt-ek-e3", 647 + .data = &jt240mhqs_hwt_ek_e3_panel }, 673 648 { } 674 649 }; 675 650 MODULE_DEVICE_TABLE(of, st7789v_of_match);