@@ -557,6 +557,37 @@ static const struct of_device_id dsi_of_match[] = {
557557};
558558MODULE_DEVICE_TABLE (of , dsi_of_match );
559559
560+ static const struct drm_display_mode waveshare_5inch_mode = {
561+ .clock = 30000000 / 1000 ,
562+ .hdisplay = 800 ,
563+ .hsync_start = 800 + 120 ,
564+ .hsync_end = 800 + 120 + 2 ,
565+ .htotal = 800 + 120 + 2 + 52 ,
566+ .vdisplay = 480 ,
567+ .vsync_start = 480 + 7 ,
568+ .vsync_end = 480 + 7 + 2 ,
569+ .vtotal = 480 + 7 + 2 + 21 ,
570+ .vrefresh = 60 ,
571+ .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC ,
572+ };
573+
574+ static const struct bridge_desc waveshare_5inch_bridge = {
575+ .desc = {
576+ .modes = & waveshare_5inch_mode ,
577+ .num_modes = 1 ,
578+ .bpc = 8 ,
579+ .size = {
580+ .width = 113 ,
581+ .height = 68 ,
582+ },
583+ },
584+ .flags = MIPI_DSI_MODE_VIDEO |
585+ MIPI_DSI_MODE_VIDEO_BURST ,
586+ .format = MIPI_DSI_FMT_RGB888 ,
587+ .lanes = 1 ,
588+ };
589+
590+
560591int tc358762_dsi_probe (struct mipi_dsi_device * dsi )
561592{
562593 const struct bridge_desc * desc ;
@@ -570,8 +601,14 @@ int tc358762_dsi_probe(struct mipi_dsi_device *dsi)
570601 //id = of_match_node(dsi_of_match, np);
571602 //if (!id)
572603 // return -ENODEV;
573- id = & dsi_of_match [0 ];
574- desc = id -> data ;
604+ printk ("tc358762_dsi_probe waveshare_5inch=%d\n" , of_property_read_bool (np , "waveshare_5inch" ));
605+ if (of_property_read_bool (np , "waveshare_5inch" )) {
606+ desc = & waveshare_5inch_bridge ;
607+ } else {
608+ id = & dsi_of_match [0 ];
609+ desc = id -> data ;
610+ }
611+
575612
576613 if (desc ) {
577614 dsi -> mode_flags = desc -> flags ;
0 commit comments