This source file includes following definitions.
- tpo_vid_get_config_mode
- tpo_vid_get_panel_info
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 #include "mdfld_dsi_dpi.h"
29
30 static struct drm_display_mode *tpo_vid_get_config_mode(struct drm_device *dev)
31 {
32 struct drm_display_mode *mode;
33
34 mode = kzalloc(sizeof(*mode), GFP_KERNEL);
35 if (!mode)
36 return NULL;
37
38 mode->hdisplay = 864;
39 mode->vdisplay = 480;
40 mode->hsync_start = 873;
41 mode->hsync_end = 876;
42 mode->htotal = 887;
43 mode->vsync_start = 487;
44 mode->vsync_end = 490;
45 mode->vtotal = 499;
46 mode->clock = 33264;
47
48 drm_mode_set_name(mode);
49 drm_mode_set_crtcinfo(mode, 0);
50
51 mode->type |= DRM_MODE_TYPE_PREFERRED;
52
53 return mode;
54 }
55
56 static int tpo_vid_get_panel_info(struct drm_device *dev,
57 int pipe,
58 struct panel_info *pi)
59 {
60 if (!dev || !pi)
61 return -EINVAL;
62
63 pi->width_mm = TPO_PANEL_WIDTH;
64 pi->height_mm = TPO_PANEL_HEIGHT;
65
66 return 0;
67 }
68
69
70 static const struct drm_encoder_helper_funcs
71 mdfld_tpo_dpi_encoder_helper_funcs = {
72 .dpms = mdfld_dsi_dpi_dpms,
73 .mode_fixup = mdfld_dsi_dpi_mode_fixup,
74 .prepare = mdfld_dsi_dpi_prepare,
75 .mode_set = mdfld_dsi_dpi_mode_set,
76 .commit = mdfld_dsi_dpi_commit,
77 };
78
79
80 static const struct drm_encoder_funcs mdfld_tpo_dpi_encoder_funcs = {
81 .destroy = drm_encoder_cleanup,
82 };
83
84 const struct panel_funcs mdfld_tpo_vid_funcs = {
85 .encoder_funcs = &mdfld_tpo_dpi_encoder_funcs,
86 .encoder_helper_funcs = &mdfld_tpo_dpi_encoder_helper_funcs,
87 .get_config_mode = &tpo_vid_get_config_mode,
88 .get_panel_info = tpo_vid_get_panel_info,
89 };