Skip to content

Commit a411558

Browse files
sresuperna9999
authored andcommitted
drm/panel: sitronix-st7789v: add Inanbo T28CP45TN89 support
UNI-T UTi260b has a Inanbo T28CP45TN89 v17 panel. I could not find proper documentation for the panel apart from a technical drawing, but according to the vendor U-Boot it is based on a Sitronix st7789v chip. I generated the init sequence by modifying the default one until proper graphics output has been seen on the device. Reviewed-by: Michael Riesch <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e4572f9 commit a411558

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

drivers/gpu/drm/panel/panel-sitronix-st7789v.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,21 @@ static const struct drm_display_mode default_mode = {
173173
.flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
174174
};
175175

176+
static const struct drm_display_mode t28cp45tn89_mode = {
177+
.clock = 6008,
178+
.hdisplay = 240,
179+
.hsync_start = 240 + 38,
180+
.hsync_end = 240 + 38 + 10,
181+
.htotal = 240 + 38 + 10 + 10,
182+
.vdisplay = 320,
183+
.vsync_start = 320 + 8,
184+
.vsync_end = 320 + 8 + 4,
185+
.vtotal = 320 + 8 + 4 + 4,
186+
.width_mm = 43,
187+
.height_mm = 57,
188+
.flags = DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_NVSYNC,
189+
};
190+
176191
static const struct st7789_panel_info default_panel = {
177192
.mode = &default_mode,
178193
.invert_mode = true,
@@ -181,6 +196,14 @@ static const struct st7789_panel_info default_panel = {
181196
DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
182197
};
183198

199+
static const struct st7789_panel_info t28cp45tn89_panel = {
200+
.mode = &t28cp45tn89_mode,
201+
.invert_mode = false,
202+
.bus_format = MEDIA_BUS_FMT_RGB565_1X16,
203+
.bus_flags = DRM_BUS_FLAG_DE_HIGH |
204+
DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
205+
};
206+
184207
static int st7789v_get_modes(struct drm_panel *panel,
185208
struct drm_connector *connector)
186209
{
@@ -446,12 +469,14 @@ static void st7789v_remove(struct spi_device *spi)
446469

447470
static const struct spi_device_id st7789v_spi_id[] = {
448471
{ "st7789v", (unsigned long) &default_panel },
472+
{ "t28cp45tn89-v17", (unsigned long) &t28cp45tn89_panel },
449473
{ }
450474
};
451475
MODULE_DEVICE_TABLE(spi, st7789v_spi_id);
452476

453477
static const struct of_device_id st7789v_of_match[] = {
454478
{ .compatible = "sitronix,st7789v", .data = &default_panel },
479+
{ .compatible = "inanbo,t28cp45tn89-v17", .data = &t28cp45tn89_panel },
455480
{ }
456481
};
457482
MODULE_DEVICE_TABLE(of, st7789v_of_match);

0 commit comments

Comments
 (0)