]> Git Repo - J-linux.git/blob - drivers/gpu/drm/panel/panel-simple.c
drm: Add drm_any_plane_has_format()
[J-linux.git] / drivers / gpu / drm / panel / panel-simple.c
1 /*
2  * Copyright (C) 2013, NVIDIA Corporation.  All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sub license,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice (including the
12  * next paragraph) shall be included in all copies or substantial portions
13  * of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21  * DEALINGS IN THE SOFTWARE.
22  */
23
24 #include <linux/backlight.h>
25 #include <linux/gpio/consumer.h>
26 #include <linux/module.h>
27 #include <linux/of_platform.h>
28 #include <linux/platform_device.h>
29 #include <linux/regulator/consumer.h>
30
31 #include <drm/drmP.h>
32 #include <drm/drm_crtc.h>
33 #include <drm/drm_mipi_dsi.h>
34 #include <drm/drm_panel.h>
35
36 #include <video/display_timing.h>
37 #include <video/videomode.h>
38
39 struct panel_desc {
40         const struct drm_display_mode *modes;
41         unsigned int num_modes;
42         const struct display_timing *timings;
43         unsigned int num_timings;
44
45         unsigned int bpc;
46
47         /**
48          * @width: width (in millimeters) of the panel's active display area
49          * @height: height (in millimeters) of the panel's active display area
50          */
51         struct {
52                 unsigned int width;
53                 unsigned int height;
54         } size;
55
56         /**
57          * @prepare: the time (in milliseconds) that it takes for the panel to
58          *           become ready and start receiving video data
59          * @enable: the time (in milliseconds) that it takes for the panel to
60          *          display the first valid frame after starting to receive
61          *          video data
62          * @disable: the time (in milliseconds) that it takes for the panel to
63          *           turn the display off (no content is visible)
64          * @unprepare: the time (in milliseconds) that it takes for the panel
65          *             to power itself down completely
66          */
67         struct {
68                 unsigned int prepare;
69                 unsigned int enable;
70                 unsigned int disable;
71                 unsigned int unprepare;
72         } delay;
73
74         u32 bus_format;
75         u32 bus_flags;
76 };
77
78 struct panel_simple {
79         struct drm_panel base;
80         bool prepared;
81         bool enabled;
82
83         const struct panel_desc *desc;
84
85         struct backlight_device *backlight;
86         struct regulator *supply;
87         struct i2c_adapter *ddc;
88
89         struct gpio_desc *enable_gpio;
90 };
91
92 static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
93 {
94         return container_of(panel, struct panel_simple, base);
95 }
96
97 static int panel_simple_get_fixed_modes(struct panel_simple *panel)
98 {
99         struct drm_connector *connector = panel->base.connector;
100         struct drm_device *drm = panel->base.drm;
101         struct drm_display_mode *mode;
102         unsigned int i, num = 0;
103
104         if (!panel->desc)
105                 return 0;
106
107         for (i = 0; i < panel->desc->num_timings; i++) {
108                 const struct display_timing *dt = &panel->desc->timings[i];
109                 struct videomode vm;
110
111                 videomode_from_timing(dt, &vm);
112                 mode = drm_mode_create(drm);
113                 if (!mode) {
114                         dev_err(drm->dev, "failed to add mode %ux%u\n",
115                                 dt->hactive.typ, dt->vactive.typ);
116                         continue;
117                 }
118
119                 drm_display_mode_from_videomode(&vm, mode);
120
121                 mode->type |= DRM_MODE_TYPE_DRIVER;
122
123                 if (panel->desc->num_timings == 1)
124                         mode->type |= DRM_MODE_TYPE_PREFERRED;
125
126                 drm_mode_probed_add(connector, mode);
127                 num++;
128         }
129
130         for (i = 0; i < panel->desc->num_modes; i++) {
131                 const struct drm_display_mode *m = &panel->desc->modes[i];
132
133                 mode = drm_mode_duplicate(drm, m);
134                 if (!mode) {
135                         dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
136                                 m->hdisplay, m->vdisplay, m->vrefresh);
137                         continue;
138                 }
139
140                 mode->type |= DRM_MODE_TYPE_DRIVER;
141
142                 if (panel->desc->num_modes == 1)
143                         mode->type |= DRM_MODE_TYPE_PREFERRED;
144
145                 drm_mode_set_name(mode);
146
147                 drm_mode_probed_add(connector, mode);
148                 num++;
149         }
150
151         connector->display_info.bpc = panel->desc->bpc;
152         connector->display_info.width_mm = panel->desc->size.width;
153         connector->display_info.height_mm = panel->desc->size.height;
154         if (panel->desc->bus_format)
155                 drm_display_info_set_bus_formats(&connector->display_info,
156                                                  &panel->desc->bus_format, 1);
157         connector->display_info.bus_flags = panel->desc->bus_flags;
158
159         return num;
160 }
161
162 static int panel_simple_disable(struct drm_panel *panel)
163 {
164         struct panel_simple *p = to_panel_simple(panel);
165
166         if (!p->enabled)
167                 return 0;
168
169         if (p->backlight) {
170                 p->backlight->props.power = FB_BLANK_POWERDOWN;
171                 p->backlight->props.state |= BL_CORE_FBBLANK;
172                 backlight_update_status(p->backlight);
173         }
174
175         if (p->desc->delay.disable)
176                 msleep(p->desc->delay.disable);
177
178         p->enabled = false;
179
180         return 0;
181 }
182
183 static int panel_simple_unprepare(struct drm_panel *panel)
184 {
185         struct panel_simple *p = to_panel_simple(panel);
186
187         if (!p->prepared)
188                 return 0;
189
190         gpiod_set_value_cansleep(p->enable_gpio, 0);
191
192         regulator_disable(p->supply);
193
194         if (p->desc->delay.unprepare)
195                 msleep(p->desc->delay.unprepare);
196
197         p->prepared = false;
198
199         return 0;
200 }
201
202 static int panel_simple_prepare(struct drm_panel *panel)
203 {
204         struct panel_simple *p = to_panel_simple(panel);
205         int err;
206
207         if (p->prepared)
208                 return 0;
209
210         err = regulator_enable(p->supply);
211         if (err < 0) {
212                 dev_err(panel->dev, "failed to enable supply: %d\n", err);
213                 return err;
214         }
215
216         gpiod_set_value_cansleep(p->enable_gpio, 1);
217
218         if (p->desc->delay.prepare)
219                 msleep(p->desc->delay.prepare);
220
221         p->prepared = true;
222
223         return 0;
224 }
225
226 static int panel_simple_enable(struct drm_panel *panel)
227 {
228         struct panel_simple *p = to_panel_simple(panel);
229
230         if (p->enabled)
231                 return 0;
232
233         if (p->desc->delay.enable)
234                 msleep(p->desc->delay.enable);
235
236         if (p->backlight) {
237                 p->backlight->props.state &= ~BL_CORE_FBBLANK;
238                 p->backlight->props.power = FB_BLANK_UNBLANK;
239                 backlight_update_status(p->backlight);
240         }
241
242         p->enabled = true;
243
244         return 0;
245 }
246
247 static int panel_simple_get_modes(struct drm_panel *panel)
248 {
249         struct panel_simple *p = to_panel_simple(panel);
250         int num = 0;
251
252         /* probe EDID if a DDC bus is available */
253         if (p->ddc) {
254                 struct edid *edid = drm_get_edid(panel->connector, p->ddc);
255                 drm_connector_update_edid_property(panel->connector, edid);
256                 if (edid) {
257                         num += drm_add_edid_modes(panel->connector, edid);
258                         kfree(edid);
259                 }
260         }
261
262         /* add hard-coded panel modes */
263         num += panel_simple_get_fixed_modes(p);
264
265         return num;
266 }
267
268 static int panel_simple_get_timings(struct drm_panel *panel,
269                                     unsigned int num_timings,
270                                     struct display_timing *timings)
271 {
272         struct panel_simple *p = to_panel_simple(panel);
273         unsigned int i;
274
275         if (p->desc->num_timings < num_timings)
276                 num_timings = p->desc->num_timings;
277
278         if (timings)
279                 for (i = 0; i < num_timings; i++)
280                         timings[i] = p->desc->timings[i];
281
282         return p->desc->num_timings;
283 }
284
285 static const struct drm_panel_funcs panel_simple_funcs = {
286         .disable = panel_simple_disable,
287         .unprepare = panel_simple_unprepare,
288         .prepare = panel_simple_prepare,
289         .enable = panel_simple_enable,
290         .get_modes = panel_simple_get_modes,
291         .get_timings = panel_simple_get_timings,
292 };
293
294 static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
295 {
296         struct device_node *backlight, *ddc;
297         struct panel_simple *panel;
298         int err;
299
300         panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
301         if (!panel)
302                 return -ENOMEM;
303
304         panel->enabled = false;
305         panel->prepared = false;
306         panel->desc = desc;
307
308         panel->supply = devm_regulator_get(dev, "power");
309         if (IS_ERR(panel->supply))
310                 return PTR_ERR(panel->supply);
311
312         panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
313                                                      GPIOD_OUT_LOW);
314         if (IS_ERR(panel->enable_gpio)) {
315                 err = PTR_ERR(panel->enable_gpio);
316                 if (err != -EPROBE_DEFER)
317                         dev_err(dev, "failed to request GPIO: %d\n", err);
318                 return err;
319         }
320
321         backlight = of_parse_phandle(dev->of_node, "backlight", 0);
322         if (backlight) {
323                 panel->backlight = of_find_backlight_by_node(backlight);
324                 of_node_put(backlight);
325
326                 if (!panel->backlight)
327                         return -EPROBE_DEFER;
328         }
329
330         ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
331         if (ddc) {
332                 panel->ddc = of_find_i2c_adapter_by_node(ddc);
333                 of_node_put(ddc);
334
335                 if (!panel->ddc) {
336                         err = -EPROBE_DEFER;
337                         goto free_backlight;
338                 }
339         }
340
341         drm_panel_init(&panel->base);
342         panel->base.dev = dev;
343         panel->base.funcs = &panel_simple_funcs;
344
345         err = drm_panel_add(&panel->base);
346         if (err < 0)
347                 goto free_ddc;
348
349         dev_set_drvdata(dev, panel);
350
351         return 0;
352
353 free_ddc:
354         if (panel->ddc)
355                 put_device(&panel->ddc->dev);
356 free_backlight:
357         if (panel->backlight)
358                 put_device(&panel->backlight->dev);
359
360         return err;
361 }
362
363 static int panel_simple_remove(struct device *dev)
364 {
365         struct panel_simple *panel = dev_get_drvdata(dev);
366
367         drm_panel_remove(&panel->base);
368
369         panel_simple_disable(&panel->base);
370         panel_simple_unprepare(&panel->base);
371
372         if (panel->ddc)
373                 put_device(&panel->ddc->dev);
374
375         if (panel->backlight)
376                 put_device(&panel->backlight->dev);
377
378         return 0;
379 }
380
381 static void panel_simple_shutdown(struct device *dev)
382 {
383         struct panel_simple *panel = dev_get_drvdata(dev);
384
385         panel_simple_disable(&panel->base);
386         panel_simple_unprepare(&panel->base);
387 }
388
389 static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
390         .clock = 9000,
391         .hdisplay = 480,
392         .hsync_start = 480 + 2,
393         .hsync_end = 480 + 2 + 41,
394         .htotal = 480 + 2 + 41 + 2,
395         .vdisplay = 272,
396         .vsync_start = 272 + 2,
397         .vsync_end = 272 + 2 + 10,
398         .vtotal = 272 + 2 + 10 + 2,
399         .vrefresh = 60,
400         .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
401 };
402
403 static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
404         .modes = &ampire_am_480272h3tmqw_t01h_mode,
405         .num_modes = 1,
406         .bpc = 8,
407         .size = {
408                 .width = 105,
409                 .height = 67,
410         },
411         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
412 };
413
414 static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
415         .clock = 33333,
416         .hdisplay = 800,
417         .hsync_start = 800 + 0,
418         .hsync_end = 800 + 0 + 255,
419         .htotal = 800 + 0 + 255 + 0,
420         .vdisplay = 480,
421         .vsync_start = 480 + 2,
422         .vsync_end = 480 + 2 + 45,
423         .vtotal = 480 + 2 + 45 + 0,
424         .vrefresh = 60,
425         .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
426 };
427
428 static const struct panel_desc ampire_am800480r3tmqwa1h = {
429         .modes = &ampire_am800480r3tmqwa1h_mode,
430         .num_modes = 1,
431         .bpc = 6,
432         .size = {
433                 .width = 152,
434                 .height = 91,
435         },
436         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
437 };
438
439 static const struct drm_display_mode auo_b101aw03_mode = {
440         .clock = 51450,
441         .hdisplay = 1024,
442         .hsync_start = 1024 + 156,
443         .hsync_end = 1024 + 156 + 8,
444         .htotal = 1024 + 156 + 8 + 156,
445         .vdisplay = 600,
446         .vsync_start = 600 + 16,
447         .vsync_end = 600 + 16 + 6,
448         .vtotal = 600 + 16 + 6 + 16,
449         .vrefresh = 60,
450 };
451
452 static const struct panel_desc auo_b101aw03 = {
453         .modes = &auo_b101aw03_mode,
454         .num_modes = 1,
455         .bpc = 6,
456         .size = {
457                 .width = 223,
458                 .height = 125,
459         },
460 };
461
462 static const struct drm_display_mode auo_b101ean01_mode = {
463         .clock = 72500,
464         .hdisplay = 1280,
465         .hsync_start = 1280 + 119,
466         .hsync_end = 1280 + 119 + 32,
467         .htotal = 1280 + 119 + 32 + 21,
468         .vdisplay = 800,
469         .vsync_start = 800 + 4,
470         .vsync_end = 800 + 4 + 20,
471         .vtotal = 800 + 4 + 20 + 8,
472         .vrefresh = 60,
473 };
474
475 static const struct panel_desc auo_b101ean01 = {
476         .modes = &auo_b101ean01_mode,
477         .num_modes = 1,
478         .bpc = 6,
479         .size = {
480                 .width = 217,
481                 .height = 136,
482         },
483 };
484
485 static const struct drm_display_mode auo_b101xtn01_mode = {
486         .clock = 72000,
487         .hdisplay = 1366,
488         .hsync_start = 1366 + 20,
489         .hsync_end = 1366 + 20 + 70,
490         .htotal = 1366 + 20 + 70,
491         .vdisplay = 768,
492         .vsync_start = 768 + 14,
493         .vsync_end = 768 + 14 + 42,
494         .vtotal = 768 + 14 + 42,
495         .vrefresh = 60,
496         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
497 };
498
499 static const struct panel_desc auo_b101xtn01 = {
500         .modes = &auo_b101xtn01_mode,
501         .num_modes = 1,
502         .bpc = 6,
503         .size = {
504                 .width = 223,
505                 .height = 125,
506         },
507 };
508
509 static const struct drm_display_mode auo_b116xw03_mode = {
510         .clock = 70589,
511         .hdisplay = 1366,
512         .hsync_start = 1366 + 40,
513         .hsync_end = 1366 + 40 + 40,
514         .htotal = 1366 + 40 + 40 + 32,
515         .vdisplay = 768,
516         .vsync_start = 768 + 10,
517         .vsync_end = 768 + 10 + 12,
518         .vtotal = 768 + 10 + 12 + 6,
519         .vrefresh = 60,
520 };
521
522 static const struct panel_desc auo_b116xw03 = {
523         .modes = &auo_b116xw03_mode,
524         .num_modes = 1,
525         .bpc = 6,
526         .size = {
527                 .width = 256,
528                 .height = 144,
529         },
530 };
531
532 static const struct drm_display_mode auo_b133xtn01_mode = {
533         .clock = 69500,
534         .hdisplay = 1366,
535         .hsync_start = 1366 + 48,
536         .hsync_end = 1366 + 48 + 32,
537         .htotal = 1366 + 48 + 32 + 20,
538         .vdisplay = 768,
539         .vsync_start = 768 + 3,
540         .vsync_end = 768 + 3 + 6,
541         .vtotal = 768 + 3 + 6 + 13,
542         .vrefresh = 60,
543 };
544
545 static const struct panel_desc auo_b133xtn01 = {
546         .modes = &auo_b133xtn01_mode,
547         .num_modes = 1,
548         .bpc = 6,
549         .size = {
550                 .width = 293,
551                 .height = 165,
552         },
553 };
554
555 static const struct drm_display_mode auo_b133htn01_mode = {
556         .clock = 150660,
557         .hdisplay = 1920,
558         .hsync_start = 1920 + 172,
559         .hsync_end = 1920 + 172 + 80,
560         .htotal = 1920 + 172 + 80 + 60,
561         .vdisplay = 1080,
562         .vsync_start = 1080 + 25,
563         .vsync_end = 1080 + 25 + 10,
564         .vtotal = 1080 + 25 + 10 + 10,
565         .vrefresh = 60,
566 };
567
568 static const struct panel_desc auo_b133htn01 = {
569         .modes = &auo_b133htn01_mode,
570         .num_modes = 1,
571         .bpc = 6,
572         .size = {
573                 .width = 293,
574                 .height = 165,
575         },
576         .delay = {
577                 .prepare = 105,
578                 .enable = 20,
579                 .unprepare = 50,
580         },
581 };
582
583 static const struct display_timing auo_g070vvn01_timings = {
584         .pixelclock = { 33300000, 34209000, 45000000 },
585         .hactive = { 800, 800, 800 },
586         .hfront_porch = { 20, 40, 200 },
587         .hback_porch = { 87, 40, 1 },
588         .hsync_len = { 1, 48, 87 },
589         .vactive = { 480, 480, 480 },
590         .vfront_porch = { 5, 13, 200 },
591         .vback_porch = { 31, 31, 29 },
592         .vsync_len = { 1, 1, 3 },
593 };
594
595 static const struct panel_desc auo_g070vvn01 = {
596         .timings = &auo_g070vvn01_timings,
597         .num_timings = 1,
598         .bpc = 8,
599         .size = {
600                 .width = 152,
601                 .height = 91,
602         },
603         .delay = {
604                 .prepare = 200,
605                 .enable = 50,
606                 .disable = 50,
607                 .unprepare = 1000,
608         },
609 };
610
611 static const struct drm_display_mode auo_g104sn02_mode = {
612         .clock = 40000,
613         .hdisplay = 800,
614         .hsync_start = 800 + 40,
615         .hsync_end = 800 + 40 + 216,
616         .htotal = 800 + 40 + 216 + 128,
617         .vdisplay = 600,
618         .vsync_start = 600 + 10,
619         .vsync_end = 600 + 10 + 35,
620         .vtotal = 600 + 10 + 35 + 2,
621         .vrefresh = 60,
622 };
623
624 static const struct panel_desc auo_g104sn02 = {
625         .modes = &auo_g104sn02_mode,
626         .num_modes = 1,
627         .bpc = 8,
628         .size = {
629                 .width = 211,
630                 .height = 158,
631         },
632 };
633
634 static const struct display_timing auo_g133han01_timings = {
635         .pixelclock = { 134000000, 141200000, 149000000 },
636         .hactive = { 1920, 1920, 1920 },
637         .hfront_porch = { 39, 58, 77 },
638         .hback_porch = { 59, 88, 117 },
639         .hsync_len = { 28, 42, 56 },
640         .vactive = { 1080, 1080, 1080 },
641         .vfront_porch = { 3, 8, 11 },
642         .vback_porch = { 5, 14, 19 },
643         .vsync_len = { 4, 14, 19 },
644 };
645
646 static const struct panel_desc auo_g133han01 = {
647         .timings = &auo_g133han01_timings,
648         .num_timings = 1,
649         .bpc = 8,
650         .size = {
651                 .width = 293,
652                 .height = 165,
653         },
654         .delay = {
655                 .prepare = 200,
656                 .enable = 50,
657                 .disable = 50,
658                 .unprepare = 1000,
659         },
660         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
661 };
662
663 static const struct display_timing auo_g185han01_timings = {
664         .pixelclock = { 120000000, 144000000, 175000000 },
665         .hactive = { 1920, 1920, 1920 },
666         .hfront_porch = { 18, 60, 74 },
667         .hback_porch = { 12, 44, 54 },
668         .hsync_len = { 10, 24, 32 },
669         .vactive = { 1080, 1080, 1080 },
670         .vfront_porch = { 6, 10, 40 },
671         .vback_porch = { 2, 5, 20 },
672         .vsync_len = { 2, 5, 20 },
673 };
674
675 static const struct panel_desc auo_g185han01 = {
676         .timings = &auo_g185han01_timings,
677         .num_timings = 1,
678         .bpc = 8,
679         .size = {
680                 .width = 409,
681                 .height = 230,
682         },
683         .delay = {
684                 .prepare = 50,
685                 .enable = 200,
686                 .disable = 110,
687                 .unprepare = 1000,
688         },
689         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
690 };
691
692 static const struct display_timing auo_p320hvn03_timings = {
693         .pixelclock = { 106000000, 148500000, 164000000 },
694         .hactive = { 1920, 1920, 1920 },
695         .hfront_porch = { 25, 50, 130 },
696         .hback_porch = { 25, 50, 130 },
697         .hsync_len = { 20, 40, 105 },
698         .vactive = { 1080, 1080, 1080 },
699         .vfront_porch = { 8, 17, 150 },
700         .vback_porch = { 8, 17, 150 },
701         .vsync_len = { 4, 11, 100 },
702 };
703
704 static const struct panel_desc auo_p320hvn03 = {
705         .timings = &auo_p320hvn03_timings,
706         .num_timings = 1,
707         .bpc = 8,
708         .size = {
709                 .width = 698,
710                 .height = 393,
711         },
712         .delay = {
713                 .prepare = 1,
714                 .enable = 450,
715                 .unprepare = 500,
716         },
717         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
718 };
719
720 static const struct drm_display_mode auo_t215hvn01_mode = {
721         .clock = 148800,
722         .hdisplay = 1920,
723         .hsync_start = 1920 + 88,
724         .hsync_end = 1920 + 88 + 44,
725         .htotal = 1920 + 88 + 44 + 148,
726         .vdisplay = 1080,
727         .vsync_start = 1080 + 4,
728         .vsync_end = 1080 + 4 + 5,
729         .vtotal = 1080 + 4 + 5 + 36,
730         .vrefresh = 60,
731 };
732
733 static const struct panel_desc auo_t215hvn01 = {
734         .modes = &auo_t215hvn01_mode,
735         .num_modes = 1,
736         .bpc = 8,
737         .size = {
738                 .width = 430,
739                 .height = 270,
740         },
741         .delay = {
742                 .disable = 5,
743                 .unprepare = 1000,
744         }
745 };
746
747 static const struct drm_display_mode avic_tm070ddh03_mode = {
748         .clock = 51200,
749         .hdisplay = 1024,
750         .hsync_start = 1024 + 160,
751         .hsync_end = 1024 + 160 + 4,
752         .htotal = 1024 + 160 + 4 + 156,
753         .vdisplay = 600,
754         .vsync_start = 600 + 17,
755         .vsync_end = 600 + 17 + 1,
756         .vtotal = 600 + 17 + 1 + 17,
757         .vrefresh = 60,
758 };
759
760 static const struct panel_desc avic_tm070ddh03 = {
761         .modes = &avic_tm070ddh03_mode,
762         .num_modes = 1,
763         .bpc = 8,
764         .size = {
765                 .width = 154,
766                 .height = 90,
767         },
768         .delay = {
769                 .prepare = 20,
770                 .enable = 200,
771                 .disable = 200,
772         },
773 };
774
775 static const struct drm_display_mode bananapi_s070wv20_ct16_mode = {
776         .clock = 30000,
777         .hdisplay = 800,
778         .hsync_start = 800 + 40,
779         .hsync_end = 800 + 40 + 48,
780         .htotal = 800 + 40 + 48 + 40,
781         .vdisplay = 480,
782         .vsync_start = 480 + 13,
783         .vsync_end = 480 + 13 + 3,
784         .vtotal = 480 + 13 + 3 + 29,
785 };
786
787 static const struct panel_desc bananapi_s070wv20_ct16 = {
788         .modes = &bananapi_s070wv20_ct16_mode,
789         .num_modes = 1,
790         .bpc = 6,
791         .size = {
792                 .width = 154,
793                 .height = 86,
794         },
795 };
796
797 static const struct drm_display_mode boe_hv070wsa_mode = {
798         .clock = 42105,
799         .hdisplay = 1024,
800         .hsync_start = 1024 + 30,
801         .hsync_end = 1024 + 30 + 30,
802         .htotal = 1024 + 30 + 30 + 30,
803         .vdisplay = 600,
804         .vsync_start = 600 + 10,
805         .vsync_end = 600 + 10 + 10,
806         .vtotal = 600 + 10 + 10 + 10,
807         .vrefresh = 60,
808 };
809
810 static const struct panel_desc boe_hv070wsa = {
811         .modes = &boe_hv070wsa_mode,
812         .num_modes = 1,
813         .size = {
814                 .width = 154,
815                 .height = 90,
816         },
817 };
818
819 static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
820         {
821                 .clock = 71900,
822                 .hdisplay = 1280,
823                 .hsync_start = 1280 + 48,
824                 .hsync_end = 1280 + 48 + 32,
825                 .htotal = 1280 + 48 + 32 + 80,
826                 .vdisplay = 800,
827                 .vsync_start = 800 + 3,
828                 .vsync_end = 800 + 3 + 5,
829                 .vtotal = 800 + 3 + 5 + 24,
830                 .vrefresh = 60,
831         },
832         {
833                 .clock = 57500,
834                 .hdisplay = 1280,
835                 .hsync_start = 1280 + 48,
836                 .hsync_end = 1280 + 48 + 32,
837                 .htotal = 1280 + 48 + 32 + 80,
838                 .vdisplay = 800,
839                 .vsync_start = 800 + 3,
840                 .vsync_end = 800 + 3 + 5,
841                 .vtotal = 800 + 3 + 5 + 24,
842                 .vrefresh = 48,
843         },
844 };
845
846 static const struct panel_desc boe_nv101wxmn51 = {
847         .modes = boe_nv101wxmn51_modes,
848         .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
849         .bpc = 8,
850         .size = {
851                 .width = 217,
852                 .height = 136,
853         },
854         .delay = {
855                 .prepare = 210,
856                 .enable = 50,
857                 .unprepare = 160,
858         },
859 };
860
861 static const struct drm_display_mode cdtech_s043wq26h_ct7_mode = {
862         .clock = 9000,
863         .hdisplay = 480,
864         .hsync_start = 480 + 5,
865         .hsync_end = 480 + 5 + 5,
866         .htotal = 480 + 5 + 5 + 40,
867         .vdisplay = 272,
868         .vsync_start = 272 + 8,
869         .vsync_end = 272 + 8 + 8,
870         .vtotal = 272 + 8 + 8 + 8,
871         .vrefresh = 60,
872         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
873 };
874
875 static const struct panel_desc cdtech_s043wq26h_ct7 = {
876         .modes = &cdtech_s043wq26h_ct7_mode,
877         .num_modes = 1,
878         .bpc = 8,
879         .size = {
880                 .width = 95,
881                 .height = 54,
882         },
883         .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
884 };
885
886 static const struct drm_display_mode cdtech_s070wv95_ct16_mode = {
887         .clock = 35000,
888         .hdisplay = 800,
889         .hsync_start = 800 + 40,
890         .hsync_end = 800 + 40 + 40,
891         .htotal = 800 + 40 + 40 + 48,
892         .vdisplay = 480,
893         .vsync_start = 480 + 29,
894         .vsync_end = 480 + 29 + 13,
895         .vtotal = 480 + 29 + 13 + 3,
896         .vrefresh = 60,
897         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
898 };
899
900 static const struct panel_desc cdtech_s070wv95_ct16 = {
901         .modes = &cdtech_s070wv95_ct16_mode,
902         .num_modes = 1,
903         .bpc = 8,
904         .size = {
905                 .width = 154,
906                 .height = 85,
907         },
908 };
909
910 static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
911         .clock = 66770,
912         .hdisplay = 800,
913         .hsync_start = 800 + 49,
914         .hsync_end = 800 + 49 + 33,
915         .htotal = 800 + 49 + 33 + 17,
916         .vdisplay = 1280,
917         .vsync_start = 1280 + 1,
918         .vsync_end = 1280 + 1 + 7,
919         .vtotal = 1280 + 1 + 7 + 15,
920         .vrefresh = 60,
921         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
922 };
923
924 static const struct panel_desc chunghwa_claa070wp03xg = {
925         .modes = &chunghwa_claa070wp03xg_mode,
926         .num_modes = 1,
927         .bpc = 6,
928         .size = {
929                 .width = 94,
930                 .height = 150,
931         },
932 };
933
934 static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
935         .clock = 72070,
936         .hdisplay = 1366,
937         .hsync_start = 1366 + 58,
938         .hsync_end = 1366 + 58 + 58,
939         .htotal = 1366 + 58 + 58 + 58,
940         .vdisplay = 768,
941         .vsync_start = 768 + 4,
942         .vsync_end = 768 + 4 + 4,
943         .vtotal = 768 + 4 + 4 + 4,
944         .vrefresh = 60,
945 };
946
947 static const struct panel_desc chunghwa_claa101wa01a = {
948         .modes = &chunghwa_claa101wa01a_mode,
949         .num_modes = 1,
950         .bpc = 6,
951         .size = {
952                 .width = 220,
953                 .height = 120,
954         },
955 };
956
957 static const struct drm_display_mode chunghwa_claa101wb01_mode = {
958         .clock = 69300,
959         .hdisplay = 1366,
960         .hsync_start = 1366 + 48,
961         .hsync_end = 1366 + 48 + 32,
962         .htotal = 1366 + 48 + 32 + 20,
963         .vdisplay = 768,
964         .vsync_start = 768 + 16,
965         .vsync_end = 768 + 16 + 8,
966         .vtotal = 768 + 16 + 8 + 16,
967         .vrefresh = 60,
968 };
969
970 static const struct panel_desc chunghwa_claa101wb01 = {
971         .modes = &chunghwa_claa101wb01_mode,
972         .num_modes = 1,
973         .bpc = 6,
974         .size = {
975                 .width = 223,
976                 .height = 125,
977         },
978 };
979
980 static const struct drm_display_mode dataimage_scf0700c48ggu18_mode = {
981         .clock = 33260,
982         .hdisplay = 800,
983         .hsync_start = 800 + 40,
984         .hsync_end = 800 + 40 + 128,
985         .htotal = 800 + 40 + 128 + 88,
986         .vdisplay = 480,
987         .vsync_start = 480 + 10,
988         .vsync_end = 480 + 10 + 2,
989         .vtotal = 480 + 10 + 2 + 33,
990         .vrefresh = 60,
991         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
992 };
993
994 static const struct panel_desc dataimage_scf0700c48ggu18 = {
995         .modes = &dataimage_scf0700c48ggu18_mode,
996         .num_modes = 1,
997         .bpc = 8,
998         .size = {
999                 .width = 152,
1000                 .height = 91,
1001         },
1002         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1003         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
1004 };
1005
1006 static const struct display_timing dlc_dlc0700yzg_1_timing = {
1007         .pixelclock = { 45000000, 51200000, 57000000 },
1008         .hactive = { 1024, 1024, 1024 },
1009         .hfront_porch = { 100, 106, 113 },
1010         .hback_porch = { 100, 106, 113 },
1011         .hsync_len = { 100, 108, 114 },
1012         .vactive = { 600, 600, 600 },
1013         .vfront_porch = { 8, 11, 15 },
1014         .vback_porch = { 8, 11, 15 },
1015         .vsync_len = { 9, 13, 15 },
1016         .flags = DISPLAY_FLAGS_DE_HIGH,
1017 };
1018
1019 static const struct panel_desc dlc_dlc0700yzg_1 = {
1020         .timings = &dlc_dlc0700yzg_1_timing,
1021         .num_timings = 1,
1022         .bpc = 6,
1023         .size = {
1024                 .width = 154,
1025                 .height = 86,
1026         },
1027         .delay = {
1028                 .prepare = 30,
1029                 .enable = 200,
1030                 .disable = 200,
1031         },
1032         .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1033 };
1034
1035 static const struct display_timing dlc_dlc1010gig_timing = {
1036         .pixelclock = { 68900000, 71100000, 73400000 },
1037         .hactive = { 1280, 1280, 1280 },
1038         .hfront_porch = { 43, 53, 63 },
1039         .hback_porch = { 43, 53, 63 },
1040         .hsync_len = { 44, 54, 64 },
1041         .vactive = { 800, 800, 800 },
1042         .vfront_porch = { 5, 8, 11 },
1043         .vback_porch = { 5, 8, 11 },
1044         .vsync_len = { 5, 7, 11 },
1045         .flags = DISPLAY_FLAGS_DE_HIGH,
1046 };
1047
1048 static const struct panel_desc dlc_dlc1010gig = {
1049         .timings = &dlc_dlc1010gig_timing,
1050         .num_timings = 1,
1051         .bpc = 8,
1052         .size = {
1053                 .width = 216,
1054                 .height = 135,
1055         },
1056         .delay = {
1057                 .prepare = 60,
1058                 .enable = 150,
1059                 .disable = 100,
1060                 .unprepare = 60,
1061         },
1062         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1063 };
1064
1065 static const struct drm_display_mode edt_et057090dhu_mode = {
1066         .clock = 25175,
1067         .hdisplay = 640,
1068         .hsync_start = 640 + 16,
1069         .hsync_end = 640 + 16 + 30,
1070         .htotal = 640 + 16 + 30 + 114,
1071         .vdisplay = 480,
1072         .vsync_start = 480 + 10,
1073         .vsync_end = 480 + 10 + 3,
1074         .vtotal = 480 + 10 + 3 + 32,
1075         .vrefresh = 60,
1076         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1077 };
1078
1079 static const struct panel_desc edt_et057090dhu = {
1080         .modes = &edt_et057090dhu_mode,
1081         .num_modes = 1,
1082         .bpc = 6,
1083         .size = {
1084                 .width = 115,
1085                 .height = 86,
1086         },
1087         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1088         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
1089 };
1090
1091 static const struct drm_display_mode edt_etm0700g0dh6_mode = {
1092         .clock = 33260,
1093         .hdisplay = 800,
1094         .hsync_start = 800 + 40,
1095         .hsync_end = 800 + 40 + 128,
1096         .htotal = 800 + 40 + 128 + 88,
1097         .vdisplay = 480,
1098         .vsync_start = 480 + 10,
1099         .vsync_end = 480 + 10 + 2,
1100         .vtotal = 480 + 10 + 2 + 33,
1101         .vrefresh = 60,
1102         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1103 };
1104
1105 static const struct panel_desc edt_etm0700g0dh6 = {
1106         .modes = &edt_etm0700g0dh6_mode,
1107         .num_modes = 1,
1108         .bpc = 6,
1109         .size = {
1110                 .width = 152,
1111                 .height = 91,
1112         },
1113         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1114         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
1115 };
1116
1117 static const struct panel_desc edt_etm0700g0bdh6 = {
1118         .modes = &edt_etm0700g0dh6_mode,
1119         .num_modes = 1,
1120         .bpc = 6,
1121         .size = {
1122                 .width = 152,
1123                 .height = 91,
1124         },
1125         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1126         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
1127 };
1128
1129 static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
1130         .clock = 32260,
1131         .hdisplay = 800,
1132         .hsync_start = 800 + 168,
1133         .hsync_end = 800 + 168 + 64,
1134         .htotal = 800 + 168 + 64 + 88,
1135         .vdisplay = 480,
1136         .vsync_start = 480 + 37,
1137         .vsync_end = 480 + 37 + 2,
1138         .vtotal = 480 + 37 + 2 + 8,
1139         .vrefresh = 60,
1140 };
1141
1142 static const struct panel_desc foxlink_fl500wvr00_a0t = {
1143         .modes = &foxlink_fl500wvr00_a0t_mode,
1144         .num_modes = 1,
1145         .bpc = 8,
1146         .size = {
1147                 .width = 108,
1148                 .height = 65,
1149         },
1150         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1151 };
1152
1153 static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
1154         .clock = 9000,
1155         .hdisplay = 480,
1156         .hsync_start = 480 + 5,
1157         .hsync_end = 480 + 5 + 1,
1158         .htotal = 480 + 5 + 1 + 40,
1159         .vdisplay = 272,
1160         .vsync_start = 272 + 8,
1161         .vsync_end = 272 + 8 + 1,
1162         .vtotal = 272 + 8 + 1 + 8,
1163         .vrefresh = 60,
1164 };
1165
1166 static const struct panel_desc giantplus_gpg482739qs5 = {
1167         .modes = &giantplus_gpg482739qs5_mode,
1168         .num_modes = 1,
1169         .bpc = 8,
1170         .size = {
1171                 .width = 95,
1172                 .height = 54,
1173         },
1174         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1175 };
1176
1177 static const struct display_timing hannstar_hsd070pww1_timing = {
1178         .pixelclock = { 64300000, 71100000, 82000000 },
1179         .hactive = { 1280, 1280, 1280 },
1180         .hfront_porch = { 1, 1, 10 },
1181         .hback_porch = { 1, 1, 10 },
1182         /*
1183          * According to the data sheet, the minimum horizontal blanking interval
1184          * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
1185          * minimum working horizontal blanking interval to be 60 clocks.
1186          */
1187         .hsync_len = { 58, 158, 661 },
1188         .vactive = { 800, 800, 800 },
1189         .vfront_porch = { 1, 1, 10 },
1190         .vback_porch = { 1, 1, 10 },
1191         .vsync_len = { 1, 21, 203 },
1192         .flags = DISPLAY_FLAGS_DE_HIGH,
1193 };
1194
1195 static const struct panel_desc hannstar_hsd070pww1 = {
1196         .timings = &hannstar_hsd070pww1_timing,
1197         .num_timings = 1,
1198         .bpc = 6,
1199         .size = {
1200                 .width = 151,
1201                 .height = 94,
1202         },
1203         .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1204 };
1205
1206 static const struct display_timing hannstar_hsd100pxn1_timing = {
1207         .pixelclock = { 55000000, 65000000, 75000000 },
1208         .hactive = { 1024, 1024, 1024 },
1209         .hfront_porch = { 40, 40, 40 },
1210         .hback_porch = { 220, 220, 220 },
1211         .hsync_len = { 20, 60, 100 },
1212         .vactive = { 768, 768, 768 },
1213         .vfront_porch = { 7, 7, 7 },
1214         .vback_porch = { 21, 21, 21 },
1215         .vsync_len = { 10, 10, 10 },
1216         .flags = DISPLAY_FLAGS_DE_HIGH,
1217 };
1218
1219 static const struct panel_desc hannstar_hsd100pxn1 = {
1220         .timings = &hannstar_hsd100pxn1_timing,
1221         .num_timings = 1,
1222         .bpc = 6,
1223         .size = {
1224                 .width = 203,
1225                 .height = 152,
1226         },
1227         .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1228 };
1229
1230 static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
1231         .clock = 33333,
1232         .hdisplay = 800,
1233         .hsync_start = 800 + 85,
1234         .hsync_end = 800 + 85 + 86,
1235         .htotal = 800 + 85 + 86 + 85,
1236         .vdisplay = 480,
1237         .vsync_start = 480 + 16,
1238         .vsync_end = 480 + 16 + 13,
1239         .vtotal = 480 + 16 + 13 + 16,
1240         .vrefresh = 60,
1241 };
1242
1243 static const struct panel_desc hitachi_tx23d38vm0caa = {
1244         .modes = &hitachi_tx23d38vm0caa_mode,
1245         .num_modes = 1,
1246         .bpc = 6,
1247         .size = {
1248                 .width = 195,
1249                 .height = 117,
1250         },
1251         .delay = {
1252                 .enable = 160,
1253                 .disable = 160,
1254         },
1255 };
1256
1257 static const struct drm_display_mode innolux_at043tn24_mode = {
1258         .clock = 9000,
1259         .hdisplay = 480,
1260         .hsync_start = 480 + 2,
1261         .hsync_end = 480 + 2 + 41,
1262         .htotal = 480 + 2 + 41 + 2,
1263         .vdisplay = 272,
1264         .vsync_start = 272 + 2,
1265         .vsync_end = 272 + 2 + 10,
1266         .vtotal = 272 + 2 + 10 + 2,
1267         .vrefresh = 60,
1268         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1269 };
1270
1271 static const struct panel_desc innolux_at043tn24 = {
1272         .modes = &innolux_at043tn24_mode,
1273         .num_modes = 1,
1274         .bpc = 8,
1275         .size = {
1276                 .width = 95,
1277                 .height = 54,
1278         },
1279         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1280         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
1281 };
1282
1283 static const struct drm_display_mode innolux_at070tn92_mode = {
1284         .clock = 33333,
1285         .hdisplay = 800,
1286         .hsync_start = 800 + 210,
1287         .hsync_end = 800 + 210 + 20,
1288         .htotal = 800 + 210 + 20 + 46,
1289         .vdisplay = 480,
1290         .vsync_start = 480 + 22,
1291         .vsync_end = 480 + 22 + 10,
1292         .vtotal = 480 + 22 + 23 + 10,
1293         .vrefresh = 60,
1294 };
1295
1296 static const struct panel_desc innolux_at070tn92 = {
1297         .modes = &innolux_at070tn92_mode,
1298         .num_modes = 1,
1299         .size = {
1300                 .width = 154,
1301                 .height = 86,
1302         },
1303         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1304 };
1305
1306 static const struct display_timing innolux_g070y2_l01_timing = {
1307         .pixelclock = { 28000000, 29500000, 32000000 },
1308         .hactive = { 800, 800, 800 },
1309         .hfront_porch = { 61, 91, 141 },
1310         .hback_porch = { 60, 90, 140 },
1311         .hsync_len = { 12, 12, 12 },
1312         .vactive = { 480, 480, 480 },
1313         .vfront_porch = { 4, 9, 30 },
1314         .vback_porch = { 4, 8, 28 },
1315         .vsync_len = { 2, 2, 2 },
1316         .flags = DISPLAY_FLAGS_DE_HIGH,
1317 };
1318
1319 static const struct panel_desc innolux_g070y2_l01 = {
1320         .timings = &innolux_g070y2_l01_timing,
1321         .num_timings = 1,
1322         .bpc = 6,
1323         .size = {
1324                 .width = 152,
1325                 .height = 91,
1326         },
1327         .delay = {
1328                 .prepare = 10,
1329                 .enable = 100,
1330                 .disable = 100,
1331                 .unprepare = 800,
1332         },
1333         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1334 };
1335
1336 static const struct display_timing innolux_g101ice_l01_timing = {
1337         .pixelclock = { 60400000, 71100000, 74700000 },
1338         .hactive = { 1280, 1280, 1280 },
1339         .hfront_porch = { 41, 80, 100 },
1340         .hback_porch = { 40, 79, 99 },
1341         .hsync_len = { 1, 1, 1 },
1342         .vactive = { 800, 800, 800 },
1343         .vfront_porch = { 5, 11, 14 },
1344         .vback_porch = { 4, 11, 14 },
1345         .vsync_len = { 1, 1, 1 },
1346         .flags = DISPLAY_FLAGS_DE_HIGH,
1347 };
1348
1349 static const struct panel_desc innolux_g101ice_l01 = {
1350         .timings = &innolux_g101ice_l01_timing,
1351         .num_timings = 1,
1352         .bpc = 8,
1353         .size = {
1354                 .width = 217,
1355                 .height = 135,
1356         },
1357         .delay = {
1358                 .enable = 200,
1359                 .disable = 200,
1360         },
1361         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1362 };
1363
1364 static const struct display_timing innolux_g121i1_l01_timing = {
1365         .pixelclock = { 67450000, 71000000, 74550000 },
1366         .hactive = { 1280, 1280, 1280 },
1367         .hfront_porch = { 40, 80, 160 },
1368         .hback_porch = { 39, 79, 159 },
1369         .hsync_len = { 1, 1, 1 },
1370         .vactive = { 800, 800, 800 },
1371         .vfront_porch = { 5, 11, 100 },
1372         .vback_porch = { 4, 11, 99 },
1373         .vsync_len = { 1, 1, 1 },
1374 };
1375
1376 static const struct panel_desc innolux_g121i1_l01 = {
1377         .timings = &innolux_g121i1_l01_timing,
1378         .num_timings = 1,
1379         .bpc = 6,
1380         .size = {
1381                 .width = 261,
1382                 .height = 163,
1383         },
1384         .delay = {
1385                 .enable = 200,
1386                 .disable = 20,
1387         },
1388         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1389 };
1390
1391 static const struct drm_display_mode innolux_g121x1_l03_mode = {
1392         .clock = 65000,
1393         .hdisplay = 1024,
1394         .hsync_start = 1024 + 0,
1395         .hsync_end = 1024 + 1,
1396         .htotal = 1024 + 0 + 1 + 320,
1397         .vdisplay = 768,
1398         .vsync_start = 768 + 38,
1399         .vsync_end = 768 + 38 + 1,
1400         .vtotal = 768 + 38 + 1 + 0,
1401         .vrefresh = 60,
1402         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1403 };
1404
1405 static const struct panel_desc innolux_g121x1_l03 = {
1406         .modes = &innolux_g121x1_l03_mode,
1407         .num_modes = 1,
1408         .bpc = 6,
1409         .size = {
1410                 .width = 246,
1411                 .height = 185,
1412         },
1413         .delay = {
1414                 .enable = 200,
1415                 .unprepare = 200,
1416                 .disable = 400,
1417         },
1418 };
1419
1420 static const struct drm_display_mode innolux_n116bge_mode = {
1421         .clock = 76420,
1422         .hdisplay = 1366,
1423         .hsync_start = 1366 + 136,
1424         .hsync_end = 1366 + 136 + 30,
1425         .htotal = 1366 + 136 + 30 + 60,
1426         .vdisplay = 768,
1427         .vsync_start = 768 + 8,
1428         .vsync_end = 768 + 8 + 12,
1429         .vtotal = 768 + 8 + 12 + 12,
1430         .vrefresh = 60,
1431         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1432 };
1433
1434 static const struct panel_desc innolux_n116bge = {
1435         .modes = &innolux_n116bge_mode,
1436         .num_modes = 1,
1437         .bpc = 6,
1438         .size = {
1439                 .width = 256,
1440                 .height = 144,
1441         },
1442 };
1443
1444 static const struct drm_display_mode innolux_n156bge_l21_mode = {
1445         .clock = 69300,
1446         .hdisplay = 1366,
1447         .hsync_start = 1366 + 16,
1448         .hsync_end = 1366 + 16 + 34,
1449         .htotal = 1366 + 16 + 34 + 50,
1450         .vdisplay = 768,
1451         .vsync_start = 768 + 2,
1452         .vsync_end = 768 + 2 + 6,
1453         .vtotal = 768 + 2 + 6 + 12,
1454         .vrefresh = 60,
1455 };
1456
1457 static const struct panel_desc innolux_n156bge_l21 = {
1458         .modes = &innolux_n156bge_l21_mode,
1459         .num_modes = 1,
1460         .bpc = 6,
1461         .size = {
1462                 .width = 344,
1463                 .height = 193,
1464         },
1465 };
1466
1467 static const struct drm_display_mode innolux_tv123wam_mode = {
1468         .clock = 206016,
1469         .hdisplay = 2160,
1470         .hsync_start = 2160 + 48,
1471         .hsync_end = 2160 + 48 + 32,
1472         .htotal = 2160 + 48 + 32 + 80,
1473         .vdisplay = 1440,
1474         .vsync_start = 1440 + 3,
1475         .vsync_end = 1440 + 3 + 10,
1476         .vtotal = 1440 + 3 + 10 + 27,
1477         .vrefresh = 60,
1478         .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
1479 };
1480
1481 static const struct panel_desc innolux_tv123wam = {
1482         .modes = &innolux_tv123wam_mode,
1483         .num_modes = 1,
1484         .bpc = 8,
1485         .size = {
1486                 .width = 259,
1487                 .height = 173,
1488         },
1489         .delay = {
1490                 .unprepare = 500,
1491         },
1492 };
1493
1494 static const struct drm_display_mode innolux_zj070na_01p_mode = {
1495         .clock = 51501,
1496         .hdisplay = 1024,
1497         .hsync_start = 1024 + 128,
1498         .hsync_end = 1024 + 128 + 64,
1499         .htotal = 1024 + 128 + 64 + 128,
1500         .vdisplay = 600,
1501         .vsync_start = 600 + 16,
1502         .vsync_end = 600 + 16 + 4,
1503         .vtotal = 600 + 16 + 4 + 16,
1504         .vrefresh = 60,
1505 };
1506
1507 static const struct panel_desc innolux_zj070na_01p = {
1508         .modes = &innolux_zj070na_01p_mode,
1509         .num_modes = 1,
1510         .bpc = 6,
1511         .size = {
1512                 .width = 154,
1513                 .height = 90,
1514         },
1515 };
1516
1517 static const struct display_timing koe_tx31d200vm0baa_timing = {
1518         .pixelclock = { 39600000, 43200000, 48000000 },
1519         .hactive = { 1280, 1280, 1280 },
1520         .hfront_porch = { 16, 36, 56 },
1521         .hback_porch = { 16, 36, 56 },
1522         .hsync_len = { 8, 8, 8 },
1523         .vactive = { 480, 480, 480 },
1524         .vfront_porch = { 6, 21, 33 },
1525         .vback_porch = { 6, 21, 33 },
1526         .vsync_len = { 8, 8, 8 },
1527         .flags = DISPLAY_FLAGS_DE_HIGH,
1528 };
1529
1530 static const struct panel_desc koe_tx31d200vm0baa = {
1531         .timings = &koe_tx31d200vm0baa_timing,
1532         .num_timings = 1,
1533         .bpc = 6,
1534         .size = {
1535                 .width = 292,
1536                 .height = 109,
1537         },
1538         .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1539 };
1540
1541 static const struct display_timing kyo_tcg121xglp_timing = {
1542         .pixelclock = { 52000000, 65000000, 71000000 },
1543         .hactive = { 1024, 1024, 1024 },
1544         .hfront_porch = { 2, 2, 2 },
1545         .hback_porch = { 2, 2, 2 },
1546         .hsync_len = { 86, 124, 244 },
1547         .vactive = { 768, 768, 768 },
1548         .vfront_porch = { 2, 2, 2 },
1549         .vback_porch = { 2, 2, 2 },
1550         .vsync_len = { 6, 34, 73 },
1551         .flags = DISPLAY_FLAGS_DE_HIGH,
1552 };
1553
1554 static const struct panel_desc kyo_tcg121xglp = {
1555         .timings = &kyo_tcg121xglp_timing,
1556         .num_timings = 1,
1557         .bpc = 8,
1558         .size = {
1559                 .width = 246,
1560                 .height = 184,
1561         },
1562         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1563 };
1564
1565 static const struct drm_display_mode lg_lb070wv8_mode = {
1566         .clock = 33246,
1567         .hdisplay = 800,
1568         .hsync_start = 800 + 88,
1569         .hsync_end = 800 + 88 + 80,
1570         .htotal = 800 + 88 + 80 + 88,
1571         .vdisplay = 480,
1572         .vsync_start = 480 + 10,
1573         .vsync_end = 480 + 10 + 25,
1574         .vtotal = 480 + 10 + 25 + 10,
1575         .vrefresh = 60,
1576 };
1577
1578 static const struct panel_desc lg_lb070wv8 = {
1579         .modes = &lg_lb070wv8_mode,
1580         .num_modes = 1,
1581         .bpc = 16,
1582         .size = {
1583                 .width = 151,
1584                 .height = 91,
1585         },
1586         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1587 };
1588
1589 static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1590         .clock = 200000,
1591         .hdisplay = 1536,
1592         .hsync_start = 1536 + 12,
1593         .hsync_end = 1536 + 12 + 16,
1594         .htotal = 1536 + 12 + 16 + 48,
1595         .vdisplay = 2048,
1596         .vsync_start = 2048 + 8,
1597         .vsync_end = 2048 + 8 + 4,
1598         .vtotal = 2048 + 8 + 4 + 8,
1599         .vrefresh = 60,
1600         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1601 };
1602
1603 static const struct panel_desc lg_lp079qx1_sp0v = {
1604         .modes = &lg_lp079qx1_sp0v_mode,
1605         .num_modes = 1,
1606         .size = {
1607                 .width = 129,
1608                 .height = 171,
1609         },
1610 };
1611
1612 static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1613         .clock = 205210,
1614         .hdisplay = 2048,
1615         .hsync_start = 2048 + 150,
1616         .hsync_end = 2048 + 150 + 5,
1617         .htotal = 2048 + 150 + 5 + 5,
1618         .vdisplay = 1536,
1619         .vsync_start = 1536 + 3,
1620         .vsync_end = 1536 + 3 + 1,
1621         .vtotal = 1536 + 3 + 1 + 9,
1622         .vrefresh = 60,
1623 };
1624
1625 static const struct panel_desc lg_lp097qx1_spa1 = {
1626         .modes = &lg_lp097qx1_spa1_mode,
1627         .num_modes = 1,
1628         .size = {
1629                 .width = 208,
1630                 .height = 147,
1631         },
1632 };
1633
1634 static const struct drm_display_mode lg_lp120up1_mode = {
1635         .clock = 162300,
1636         .hdisplay = 1920,
1637         .hsync_start = 1920 + 40,
1638         .hsync_end = 1920 + 40 + 40,
1639         .htotal = 1920 + 40 + 40+ 80,
1640         .vdisplay = 1280,
1641         .vsync_start = 1280 + 4,
1642         .vsync_end = 1280 + 4 + 4,
1643         .vtotal = 1280 + 4 + 4 + 12,
1644         .vrefresh = 60,
1645 };
1646
1647 static const struct panel_desc lg_lp120up1 = {
1648         .modes = &lg_lp120up1_mode,
1649         .num_modes = 1,
1650         .bpc = 8,
1651         .size = {
1652                 .width = 267,
1653                 .height = 183,
1654         },
1655 };
1656
1657 static const struct drm_display_mode lg_lp129qe_mode = {
1658         .clock = 285250,
1659         .hdisplay = 2560,
1660         .hsync_start = 2560 + 48,
1661         .hsync_end = 2560 + 48 + 32,
1662         .htotal = 2560 + 48 + 32 + 80,
1663         .vdisplay = 1700,
1664         .vsync_start = 1700 + 3,
1665         .vsync_end = 1700 + 3 + 10,
1666         .vtotal = 1700 + 3 + 10 + 36,
1667         .vrefresh = 60,
1668 };
1669
1670 static const struct panel_desc lg_lp129qe = {
1671         .modes = &lg_lp129qe_mode,
1672         .num_modes = 1,
1673         .bpc = 8,
1674         .size = {
1675                 .width = 272,
1676                 .height = 181,
1677         },
1678 };
1679
1680 static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
1681         .clock = 30400,
1682         .hdisplay = 800,
1683         .hsync_start = 800 + 0,
1684         .hsync_end = 800 + 1,
1685         .htotal = 800 + 0 + 1 + 160,
1686         .vdisplay = 480,
1687         .vsync_start = 480 + 0,
1688         .vsync_end = 480 + 48 + 1,
1689         .vtotal = 480 + 48 + 1 + 0,
1690         .vrefresh = 60,
1691         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1692 };
1693
1694 static const struct panel_desc mitsubishi_aa070mc01 = {
1695         .modes = &mitsubishi_aa070mc01_mode,
1696         .num_modes = 1,
1697         .bpc = 8,
1698         .size = {
1699                 .width = 152,
1700                 .height = 91,
1701         },
1702
1703         .delay = {
1704                 .enable = 200,
1705                 .unprepare = 200,
1706                 .disable = 400,
1707         },
1708         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1709         .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1710 };
1711
1712 static const struct display_timing nec_nl12880bc20_05_timing = {
1713         .pixelclock = { 67000000, 71000000, 75000000 },
1714         .hactive = { 1280, 1280, 1280 },
1715         .hfront_porch = { 2, 30, 30 },
1716         .hback_porch = { 6, 100, 100 },
1717         .hsync_len = { 2, 30, 30 },
1718         .vactive = { 800, 800, 800 },
1719         .vfront_porch = { 5, 5, 5 },
1720         .vback_porch = { 11, 11, 11 },
1721         .vsync_len = { 7, 7, 7 },
1722 };
1723
1724 static const struct panel_desc nec_nl12880bc20_05 = {
1725         .timings = &nec_nl12880bc20_05_timing,
1726         .num_timings = 1,
1727         .bpc = 8,
1728         .size = {
1729                 .width = 261,
1730                 .height = 163,
1731         },
1732         .delay = {
1733                 .enable = 50,
1734                 .disable = 50,
1735         },
1736         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1737 };
1738
1739 static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
1740         .clock = 10870,
1741         .hdisplay = 480,
1742         .hsync_start = 480 + 2,
1743         .hsync_end = 480 + 2 + 41,
1744         .htotal = 480 + 2 + 41 + 2,
1745         .vdisplay = 272,
1746         .vsync_start = 272 + 2,
1747         .vsync_end = 272 + 2 + 4,
1748         .vtotal = 272 + 2 + 4 + 2,
1749         .vrefresh = 74,
1750         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1751 };
1752
1753 static const struct panel_desc nec_nl4827hc19_05b = {
1754         .modes = &nec_nl4827hc19_05b_mode,
1755         .num_modes = 1,
1756         .bpc = 8,
1757         .size = {
1758                 .width = 95,
1759                 .height = 54,
1760         },
1761         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1762         .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
1763 };
1764
1765 static const struct drm_display_mode netron_dy_e231732_mode = {
1766         .clock = 66000,
1767         .hdisplay = 1024,
1768         .hsync_start = 1024 + 160,
1769         .hsync_end = 1024 + 160 + 70,
1770         .htotal = 1024 + 160 + 70 + 90,
1771         .vdisplay = 600,
1772         .vsync_start = 600 + 127,
1773         .vsync_end = 600 + 127 + 20,
1774         .vtotal = 600 + 127 + 20 + 3,
1775         .vrefresh = 60,
1776 };
1777
1778 static const struct panel_desc netron_dy_e231732 = {
1779         .modes = &netron_dy_e231732_mode,
1780         .num_modes = 1,
1781         .size = {
1782                 .width = 154,
1783                 .height = 87,
1784         },
1785         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1786 };
1787
1788 static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
1789         .clock = 9000,
1790         .hdisplay = 480,
1791         .hsync_start = 480 + 2,
1792         .hsync_end = 480 + 2 + 41,
1793         .htotal = 480 + 2 + 41 + 2,
1794         .vdisplay = 272,
1795         .vsync_start = 272 + 2,
1796         .vsync_end = 272 + 2 + 10,
1797         .vtotal = 272 + 2 + 10 + 2,
1798         .vrefresh = 60,
1799         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1800 };
1801
1802 static const struct panel_desc newhaven_nhd_43_480272ef_atxl = {
1803         .modes = &newhaven_nhd_43_480272ef_atxl_mode,
1804         .num_modes = 1,
1805         .bpc = 8,
1806         .size = {
1807                 .width = 95,
1808                 .height = 54,
1809         },
1810         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1811         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE |
1812                      DRM_BUS_FLAG_SYNC_POSEDGE,
1813 };
1814
1815 static const struct display_timing nlt_nl192108ac18_02d_timing = {
1816         .pixelclock = { 130000000, 148350000, 163000000 },
1817         .hactive = { 1920, 1920, 1920 },
1818         .hfront_porch = { 80, 100, 100 },
1819         .hback_porch = { 100, 120, 120 },
1820         .hsync_len = { 50, 60, 60 },
1821         .vactive = { 1080, 1080, 1080 },
1822         .vfront_porch = { 12, 30, 30 },
1823         .vback_porch = { 4, 10, 10 },
1824         .vsync_len = { 4, 5, 5 },
1825 };
1826
1827 static const struct panel_desc nlt_nl192108ac18_02d = {
1828         .timings = &nlt_nl192108ac18_02d_timing,
1829         .num_timings = 1,
1830         .bpc = 8,
1831         .size = {
1832                 .width = 344,
1833                 .height = 194,
1834         },
1835         .delay = {
1836                 .unprepare = 500,
1837         },
1838         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1839 };
1840
1841 static const struct drm_display_mode nvd_9128_mode = {
1842         .clock = 29500,
1843         .hdisplay = 800,
1844         .hsync_start = 800 + 130,
1845         .hsync_end = 800 + 130 + 98,
1846         .htotal = 800 + 0 + 130 + 98,
1847         .vdisplay = 480,
1848         .vsync_start = 480 + 10,
1849         .vsync_end = 480 + 10 + 50,
1850         .vtotal = 480 + 0 + 10 + 50,
1851 };
1852
1853 static const struct panel_desc nvd_9128 = {
1854         .modes = &nvd_9128_mode,
1855         .num_modes = 1,
1856         .bpc = 8,
1857         .size = {
1858                 .width = 156,
1859                 .height = 88,
1860         },
1861         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1862 };
1863
1864 static const struct display_timing okaya_rs800480t_7x0gp_timing = {
1865         .pixelclock = { 30000000, 30000000, 40000000 },
1866         .hactive = { 800, 800, 800 },
1867         .hfront_porch = { 40, 40, 40 },
1868         .hback_porch = { 40, 40, 40 },
1869         .hsync_len = { 1, 48, 48 },
1870         .vactive = { 480, 480, 480 },
1871         .vfront_porch = { 13, 13, 13 },
1872         .vback_porch = { 29, 29, 29 },
1873         .vsync_len = { 3, 3, 3 },
1874         .flags = DISPLAY_FLAGS_DE_HIGH,
1875 };
1876
1877 static const struct panel_desc okaya_rs800480t_7x0gp = {
1878         .timings = &okaya_rs800480t_7x0gp_timing,
1879         .num_timings = 1,
1880         .bpc = 6,
1881         .size = {
1882                 .width = 154,
1883                 .height = 87,
1884         },
1885         .delay = {
1886                 .prepare = 41,
1887                 .enable = 50,
1888                 .unprepare = 41,
1889                 .disable = 50,
1890         },
1891         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1892 };
1893
1894 static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
1895         .clock = 9000,
1896         .hdisplay = 480,
1897         .hsync_start = 480 + 5,
1898         .hsync_end = 480 + 5 + 30,
1899         .htotal = 480 + 5 + 30 + 10,
1900         .vdisplay = 272,
1901         .vsync_start = 272 + 8,
1902         .vsync_end = 272 + 8 + 5,
1903         .vtotal = 272 + 8 + 5 + 3,
1904         .vrefresh = 60,
1905 };
1906
1907 static const struct panel_desc olimex_lcd_olinuxino_43ts = {
1908         .modes = &olimex_lcd_olinuxino_43ts_mode,
1909         .num_modes = 1,
1910         .size = {
1911                 .width = 95,
1912                 .height = 54,
1913         },
1914         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1915 };
1916
1917 /*
1918  * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1919  * pixel clocks, but this is the timing that was being used in the Adafruit
1920  * installation instructions.
1921  */
1922 static const struct drm_display_mode ontat_yx700wv03_mode = {
1923         .clock = 29500,
1924         .hdisplay = 800,
1925         .hsync_start = 824,
1926         .hsync_end = 896,
1927         .htotal = 992,
1928         .vdisplay = 480,
1929         .vsync_start = 483,
1930         .vsync_end = 493,
1931         .vtotal = 500,
1932         .vrefresh = 60,
1933         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1934 };
1935
1936 /*
1937  * Specification at:
1938  * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1939  */
1940 static const struct panel_desc ontat_yx700wv03 = {
1941         .modes = &ontat_yx700wv03_mode,
1942         .num_modes = 1,
1943         .bpc = 8,
1944         .size = {
1945                 .width = 154,
1946                 .height = 83,
1947         },
1948         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1949 };
1950
1951 static const struct drm_display_mode ortustech_com43h4m85ulc_mode  = {
1952         .clock = 25000,
1953         .hdisplay = 480,
1954         .hsync_start = 480 + 10,
1955         .hsync_end = 480 + 10 + 10,
1956         .htotal = 480 + 10 + 10 + 15,
1957         .vdisplay = 800,
1958         .vsync_start = 800 + 3,
1959         .vsync_end = 800 + 3 + 3,
1960         .vtotal = 800 + 3 + 3 + 3,
1961         .vrefresh = 60,
1962 };
1963
1964 static const struct panel_desc ortustech_com43h4m85ulc = {
1965         .modes = &ortustech_com43h4m85ulc_mode,
1966         .num_modes = 1,
1967         .bpc = 8,
1968         .size = {
1969                 .width = 56,
1970                 .height = 93,
1971         },
1972         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1973         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
1974 };
1975
1976 static const struct drm_display_mode qd43003c0_40_mode = {
1977         .clock = 9000,
1978         .hdisplay = 480,
1979         .hsync_start = 480 + 8,
1980         .hsync_end = 480 + 8 + 4,
1981         .htotal = 480 + 8 + 4 + 39,
1982         .vdisplay = 272,
1983         .vsync_start = 272 + 4,
1984         .vsync_end = 272 + 4 + 10,
1985         .vtotal = 272 + 4 + 10 + 2,
1986         .vrefresh = 60,
1987 };
1988
1989 static const struct panel_desc qd43003c0_40 = {
1990         .modes = &qd43003c0_40_mode,
1991         .num_modes = 1,
1992         .bpc = 8,
1993         .size = {
1994                 .width = 95,
1995                 .height = 53,
1996         },
1997         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1998 };
1999
2000 static const struct display_timing rocktech_rk070er9427_timing = {
2001         .pixelclock = { 26400000, 33300000, 46800000 },
2002         .hactive = { 800, 800, 800 },
2003         .hfront_porch = { 16, 210, 354 },
2004         .hback_porch = { 46, 46, 46 },
2005         .hsync_len = { 1, 1, 1 },
2006         .vactive = { 480, 480, 480 },
2007         .vfront_porch = { 7, 22, 147 },
2008         .vback_porch = { 23, 23, 23 },
2009         .vsync_len = { 1, 1, 1 },
2010         .flags = DISPLAY_FLAGS_DE_HIGH,
2011 };
2012
2013 static const struct panel_desc rocktech_rk070er9427 = {
2014         .timings = &rocktech_rk070er9427_timing,
2015         .num_timings = 1,
2016         .bpc = 6,
2017         .size = {
2018                 .width = 154,
2019                 .height = 86,
2020         },
2021         .delay = {
2022                 .prepare = 41,
2023                 .enable = 50,
2024                 .unprepare = 41,
2025                 .disable = 50,
2026         },
2027         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2028 };
2029
2030 static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
2031         .clock = 271560,
2032         .hdisplay = 2560,
2033         .hsync_start = 2560 + 48,
2034         .hsync_end = 2560 + 48 + 32,
2035         .htotal = 2560 + 48 + 32 + 80,
2036         .vdisplay = 1600,
2037         .vsync_start = 1600 + 2,
2038         .vsync_end = 1600 + 2 + 5,
2039         .vtotal = 1600 + 2 + 5 + 57,
2040         .vrefresh = 60,
2041 };
2042
2043 static const struct panel_desc samsung_lsn122dl01_c01 = {
2044         .modes = &samsung_lsn122dl01_c01_mode,
2045         .num_modes = 1,
2046         .size = {
2047                 .width = 263,
2048                 .height = 164,
2049         },
2050 };
2051
2052 static const struct drm_display_mode samsung_ltn101nt05_mode = {
2053         .clock = 54030,
2054         .hdisplay = 1024,
2055         .hsync_start = 1024 + 24,
2056         .hsync_end = 1024 + 24 + 136,
2057         .htotal = 1024 + 24 + 136 + 160,
2058         .vdisplay = 600,
2059         .vsync_start = 600 + 3,
2060         .vsync_end = 600 + 3 + 6,
2061         .vtotal = 600 + 3 + 6 + 61,
2062         .vrefresh = 60,
2063 };
2064
2065 static const struct panel_desc samsung_ltn101nt05 = {
2066         .modes = &samsung_ltn101nt05_mode,
2067         .num_modes = 1,
2068         .bpc = 6,
2069         .size = {
2070                 .width = 223,
2071                 .height = 125,
2072         },
2073 };
2074
2075 static const struct drm_display_mode samsung_ltn140at29_301_mode = {
2076         .clock = 76300,
2077         .hdisplay = 1366,
2078         .hsync_start = 1366 + 64,
2079         .hsync_end = 1366 + 64 + 48,
2080         .htotal = 1366 + 64 + 48 + 128,
2081         .vdisplay = 768,
2082         .vsync_start = 768 + 2,
2083         .vsync_end = 768 + 2 + 5,
2084         .vtotal = 768 + 2 + 5 + 17,
2085         .vrefresh = 60,
2086 };
2087
2088 static const struct panel_desc samsung_ltn140at29_301 = {
2089         .modes = &samsung_ltn140at29_301_mode,
2090         .num_modes = 1,
2091         .bpc = 6,
2092         .size = {
2093                 .width = 320,
2094                 .height = 187,
2095         },
2096 };
2097
2098 static const struct drm_display_mode sharp_lq035q7db03_mode = {
2099         .clock = 5500,
2100         .hdisplay = 240,
2101         .hsync_start = 240 + 16,
2102         .hsync_end = 240 + 16 + 7,
2103         .htotal = 240 + 16 + 7 + 5,
2104         .vdisplay = 320,
2105         .vsync_start = 320 + 9,
2106         .vsync_end = 320 + 9 + 1,
2107         .vtotal = 320 + 9 + 1 + 7,
2108         .vrefresh = 60,
2109 };
2110
2111 static const struct panel_desc sharp_lq035q7db03 = {
2112         .modes = &sharp_lq035q7db03_mode,
2113         .num_modes = 1,
2114         .bpc = 6,
2115         .size = {
2116                 .width = 54,
2117                 .height = 72,
2118         },
2119         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2120 };
2121
2122 static const struct display_timing sharp_lq101k1ly04_timing = {
2123         .pixelclock = { 60000000, 65000000, 80000000 },
2124         .hactive = { 1280, 1280, 1280 },
2125         .hfront_porch = { 20, 20, 20 },
2126         .hback_porch = { 20, 20, 20 },
2127         .hsync_len = { 10, 10, 10 },
2128         .vactive = { 800, 800, 800 },
2129         .vfront_porch = { 4, 4, 4 },
2130         .vback_porch = { 4, 4, 4 },
2131         .vsync_len = { 4, 4, 4 },
2132         .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
2133 };
2134
2135 static const struct panel_desc sharp_lq101k1ly04 = {
2136         .timings = &sharp_lq101k1ly04_timing,
2137         .num_timings = 1,
2138         .bpc = 8,
2139         .size = {
2140                 .width = 217,
2141                 .height = 136,
2142         },
2143         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
2144 };
2145
2146 static const struct display_timing sharp_lq123p1jx31_timing = {
2147         .pixelclock = { 252750000, 252750000, 266604720 },
2148         .hactive = { 2400, 2400, 2400 },
2149         .hfront_porch = { 48, 48, 48 },
2150         .hback_porch = { 80, 80, 84 },
2151         .hsync_len = { 32, 32, 32 },
2152         .vactive = { 1600, 1600, 1600 },
2153         .vfront_porch = { 3, 3, 3 },
2154         .vback_porch = { 33, 33, 120 },
2155         .vsync_len = { 10, 10, 10 },
2156         .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
2157 };
2158
2159 static const struct panel_desc sharp_lq123p1jx31 = {
2160         .timings = &sharp_lq123p1jx31_timing,
2161         .num_timings = 1,
2162         .bpc = 8,
2163         .size = {
2164                 .width = 259,
2165                 .height = 173,
2166         },
2167         .delay = {
2168                 .prepare = 110,
2169                 .enable = 50,
2170                 .unprepare = 550,
2171         },
2172 };
2173
2174 static const struct drm_display_mode sharp_lq150x1lg11_mode = {
2175         .clock = 71100,
2176         .hdisplay = 1024,
2177         .hsync_start = 1024 + 168,
2178         .hsync_end = 1024 + 168 + 64,
2179         .htotal = 1024 + 168 + 64 + 88,
2180         .vdisplay = 768,
2181         .vsync_start = 768 + 37,
2182         .vsync_end = 768 + 37 + 2,
2183         .vtotal = 768 + 37 + 2 + 8,
2184         .vrefresh = 60,
2185 };
2186
2187 static const struct panel_desc sharp_lq150x1lg11 = {
2188         .modes = &sharp_lq150x1lg11_mode,
2189         .num_modes = 1,
2190         .bpc = 6,
2191         .size = {
2192                 .width = 304,
2193                 .height = 228,
2194         },
2195         .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
2196 };
2197
2198 static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
2199         .clock = 33300,
2200         .hdisplay = 800,
2201         .hsync_start = 800 + 1,
2202         .hsync_end = 800 + 1 + 64,
2203         .htotal = 800 + 1 + 64 + 64,
2204         .vdisplay = 480,
2205         .vsync_start = 480 + 1,
2206         .vsync_end = 480 + 1 + 23,
2207         .vtotal = 480 + 1 + 23 + 22,
2208         .vrefresh = 60,
2209 };
2210
2211 static const struct panel_desc shelly_sca07010_bfn_lnn = {
2212         .modes = &shelly_sca07010_bfn_lnn_mode,
2213         .num_modes = 1,
2214         .size = {
2215                 .width = 152,
2216                 .height = 91,
2217         },
2218         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2219 };
2220
2221 static const struct drm_display_mode starry_kr122ea0sra_mode = {
2222         .clock = 147000,
2223         .hdisplay = 1920,
2224         .hsync_start = 1920 + 16,
2225         .hsync_end = 1920 + 16 + 16,
2226         .htotal = 1920 + 16 + 16 + 32,
2227         .vdisplay = 1200,
2228         .vsync_start = 1200 + 15,
2229         .vsync_end = 1200 + 15 + 2,
2230         .vtotal = 1200 + 15 + 2 + 18,
2231         .vrefresh = 60,
2232         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2233 };
2234
2235 static const struct panel_desc starry_kr122ea0sra = {
2236         .modes = &starry_kr122ea0sra_mode,
2237         .num_modes = 1,
2238         .size = {
2239                 .width = 263,
2240                 .height = 164,
2241         },
2242         .delay = {
2243                 .prepare = 10 + 200,
2244                 .enable = 50,
2245                 .unprepare = 10 + 500,
2246         },
2247 };
2248
2249 static const struct display_timing tianma_tm070jdhg30_timing = {
2250         .pixelclock = { 62600000, 68200000, 78100000 },
2251         .hactive = { 1280, 1280, 1280 },
2252         .hfront_porch = { 15, 64, 159 },
2253         .hback_porch = { 5, 5, 5 },
2254         .hsync_len = { 1, 1, 256 },
2255         .vactive = { 800, 800, 800 },
2256         .vfront_porch = { 3, 40, 99 },
2257         .vback_porch = { 2, 2, 2 },
2258         .vsync_len = { 1, 1, 128 },
2259         .flags = DISPLAY_FLAGS_DE_HIGH,
2260 };
2261
2262 static const struct panel_desc tianma_tm070jdhg30 = {
2263         .timings = &tianma_tm070jdhg30_timing,
2264         .num_timings = 1,
2265         .bpc = 8,
2266         .size = {
2267                 .width = 151,
2268                 .height = 95,
2269         },
2270         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2271 };
2272
2273 static const struct display_timing tianma_tm070rvhg71_timing = {
2274         .pixelclock = { 27700000, 29200000, 39600000 },
2275         .hactive = { 800, 800, 800 },
2276         .hfront_porch = { 12, 40, 212 },
2277         .hback_porch = { 88, 88, 88 },
2278         .hsync_len = { 1, 1, 40 },
2279         .vactive = { 480, 480, 480 },
2280         .vfront_porch = { 1, 13, 88 },
2281         .vback_porch = { 32, 32, 32 },
2282         .vsync_len = { 1, 1, 3 },
2283         .flags = DISPLAY_FLAGS_DE_HIGH,
2284 };
2285
2286 static const struct panel_desc tianma_tm070rvhg71 = {
2287         .timings = &tianma_tm070rvhg71_timing,
2288         .num_timings = 1,
2289         .bpc = 8,
2290         .size = {
2291                 .width = 154,
2292                 .height = 86,
2293         },
2294         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2295 };
2296
2297 static const struct drm_display_mode toshiba_lt089ac29000_mode = {
2298         .clock = 79500,
2299         .hdisplay = 1280,
2300         .hsync_start = 1280 + 192,
2301         .hsync_end = 1280 + 192 + 128,
2302         .htotal = 1280 + 192 + 128 + 64,
2303         .vdisplay = 768,
2304         .vsync_start = 768 + 20,
2305         .vsync_end = 768 + 20 + 7,
2306         .vtotal = 768 + 20 + 7 + 3,
2307         .vrefresh = 60,
2308 };
2309
2310 static const struct panel_desc toshiba_lt089ac29000 = {
2311         .modes = &toshiba_lt089ac29000_mode,
2312         .num_modes = 1,
2313         .size = {
2314                 .width = 194,
2315                 .height = 116,
2316         },
2317         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2318         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
2319 };
2320
2321 static const struct drm_display_mode tpk_f07a_0102_mode = {
2322         .clock = 33260,
2323         .hdisplay = 800,
2324         .hsync_start = 800 + 40,
2325         .hsync_end = 800 + 40 + 128,
2326         .htotal = 800 + 40 + 128 + 88,
2327         .vdisplay = 480,
2328         .vsync_start = 480 + 10,
2329         .vsync_end = 480 + 10 + 2,
2330         .vtotal = 480 + 10 + 2 + 33,
2331         .vrefresh = 60,
2332 };
2333
2334 static const struct panel_desc tpk_f07a_0102 = {
2335         .modes = &tpk_f07a_0102_mode,
2336         .num_modes = 1,
2337         .size = {
2338                 .width = 152,
2339                 .height = 91,
2340         },
2341         .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
2342 };
2343
2344 static const struct drm_display_mode tpk_f10a_0102_mode = {
2345         .clock = 45000,
2346         .hdisplay = 1024,
2347         .hsync_start = 1024 + 176,
2348         .hsync_end = 1024 + 176 + 5,
2349         .htotal = 1024 + 176 + 5 + 88,
2350         .vdisplay = 600,
2351         .vsync_start = 600 + 20,
2352         .vsync_end = 600 + 20 + 5,
2353         .vtotal = 600 + 20 + 5 + 25,
2354         .vrefresh = 60,
2355 };
2356
2357 static const struct panel_desc tpk_f10a_0102 = {
2358         .modes = &tpk_f10a_0102_mode,
2359         .num_modes = 1,
2360         .size = {
2361                 .width = 223,
2362                 .height = 125,
2363         },
2364 };
2365
2366 static const struct display_timing urt_umsh_8596md_timing = {
2367         .pixelclock = { 33260000, 33260000, 33260000 },
2368         .hactive = { 800, 800, 800 },
2369         .hfront_porch = { 41, 41, 41 },
2370         .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
2371         .hsync_len = { 71, 128, 128 },
2372         .vactive = { 480, 480, 480 },
2373         .vfront_porch = { 10, 10, 10 },
2374         .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
2375         .vsync_len = { 2, 2, 2 },
2376         .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
2377                 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
2378 };
2379
2380 static const struct panel_desc urt_umsh_8596md_lvds = {
2381         .timings = &urt_umsh_8596md_timing,
2382         .num_timings = 1,
2383         .bpc = 6,
2384         .size = {
2385                 .width = 152,
2386                 .height = 91,
2387         },
2388         .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
2389 };
2390
2391 static const struct panel_desc urt_umsh_8596md_parallel = {
2392         .timings = &urt_umsh_8596md_timing,
2393         .num_timings = 1,
2394         .bpc = 6,
2395         .size = {
2396                 .width = 152,
2397                 .height = 91,
2398         },
2399         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2400 };
2401
2402 static const struct drm_display_mode winstar_wf35ltiacd_mode = {
2403         .clock = 6410,
2404         .hdisplay = 320,
2405         .hsync_start = 320 + 20,
2406         .hsync_end = 320 + 20 + 30,
2407         .htotal = 320 + 20 + 30 + 38,
2408         .vdisplay = 240,
2409         .vsync_start = 240 + 4,
2410         .vsync_end = 240 + 4 + 3,
2411         .vtotal = 240 + 4 + 3 + 15,
2412         .vrefresh = 60,
2413         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2414 };
2415
2416 static const struct panel_desc winstar_wf35ltiacd = {
2417         .modes = &winstar_wf35ltiacd_mode,
2418         .num_modes = 1,
2419         .bpc = 8,
2420         .size = {
2421                 .width = 70,
2422                 .height = 53,
2423         },
2424         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2425 };
2426
2427 static const struct drm_display_mode arm_rtsm_mode[] = {
2428         {
2429                 .clock = 65000,
2430                 .hdisplay = 1024,
2431                 .hsync_start = 1024 + 24,
2432                 .hsync_end = 1024 + 24 + 136,
2433                 .htotal = 1024 + 24 + 136 + 160,
2434                 .vdisplay = 768,
2435                 .vsync_start = 768 + 3,
2436                 .vsync_end = 768 + 3 + 6,
2437                 .vtotal = 768 + 3 + 6 + 29,
2438                 .vrefresh = 60,
2439                 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2440         },
2441 };
2442
2443 static const struct panel_desc arm_rtsm = {
2444         .modes = arm_rtsm_mode,
2445         .num_modes = 1,
2446         .bpc = 8,
2447         .size = {
2448                 .width = 400,
2449                 .height = 300,
2450         },
2451         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2452 };
2453
2454 static const struct of_device_id platform_of_match[] = {
2455         {
2456                 .compatible = "ampire,am-480272h3tmqw-t01h",
2457                 .data = &ampire_am_480272h3tmqw_t01h,
2458         }, {
2459                 .compatible = "ampire,am800480r3tmqwa1h",
2460                 .data = &ampire_am800480r3tmqwa1h,
2461         }, {
2462                 .compatible = "arm,rtsm-display",
2463                 .data = &arm_rtsm,
2464         }, {
2465                 .compatible = "auo,b101aw03",
2466                 .data = &auo_b101aw03,
2467         }, {
2468                 .compatible = "auo,b101ean01",
2469                 .data = &auo_b101ean01,
2470         }, {
2471                 .compatible = "auo,b101xtn01",
2472                 .data = &auo_b101xtn01,
2473         }, {
2474                 .compatible = "auo,b116xw03",
2475                 .data = &auo_b116xw03,
2476         }, {
2477                 .compatible = "auo,b133htn01",
2478                 .data = &auo_b133htn01,
2479         }, {
2480                 .compatible = "auo,b133xtn01",
2481                 .data = &auo_b133xtn01,
2482         }, {
2483                 .compatible = "auo,g070vvn01",
2484                 .data = &auo_g070vvn01,
2485         }, {
2486                 .compatible = "auo,g104sn02",
2487                 .data = &auo_g104sn02,
2488         }, {
2489                 .compatible = "auo,g133han01",
2490                 .data = &auo_g133han01,
2491         }, {
2492                 .compatible = "auo,g185han01",
2493                 .data = &auo_g185han01,
2494         }, {
2495                 .compatible = "auo,p320hvn03",
2496                 .data = &auo_p320hvn03,
2497         }, {
2498                 .compatible = "auo,t215hvn01",
2499                 .data = &auo_t215hvn01,
2500         }, {
2501                 .compatible = "avic,tm070ddh03",
2502                 .data = &avic_tm070ddh03,
2503         }, {
2504                 .compatible = "bananapi,s070wv20-ct16",
2505                 .data = &bananapi_s070wv20_ct16,
2506         }, {
2507                 .compatible = "boe,hv070wsa-100",
2508                 .data = &boe_hv070wsa
2509         }, {
2510                 .compatible = "boe,nv101wxmn51",
2511                 .data = &boe_nv101wxmn51,
2512         }, {
2513                 .compatible = "cdtech,s043wq26h-ct7",
2514                 .data = &cdtech_s043wq26h_ct7,
2515         }, {
2516                 .compatible = "cdtech,s070wv95-ct16",
2517                 .data = &cdtech_s070wv95_ct16,
2518         }, {
2519                 .compatible = "chunghwa,claa070wp03xg",
2520                 .data = &chunghwa_claa070wp03xg,
2521         }, {
2522                 .compatible = "chunghwa,claa101wa01a",
2523                 .data = &chunghwa_claa101wa01a
2524         }, {
2525                 .compatible = "chunghwa,claa101wb01",
2526                 .data = &chunghwa_claa101wb01
2527         }, {
2528                 .compatible = "dataimage,scf0700c48ggu18",
2529                 .data = &dataimage_scf0700c48ggu18,
2530         }, {
2531                 .compatible = "dlc,dlc0700yzg-1",
2532                 .data = &dlc_dlc0700yzg_1,
2533         }, {
2534                 .compatible = "dlc,dlc1010gig",
2535                 .data = &dlc_dlc1010gig,
2536         }, {
2537                 .compatible = "edt,et057090dhu",
2538                 .data = &edt_et057090dhu,
2539         }, {
2540                 .compatible = "edt,et070080dh6",
2541                 .data = &edt_etm0700g0dh6,
2542         }, {
2543                 .compatible = "edt,etm0700g0dh6",
2544                 .data = &edt_etm0700g0dh6,
2545         }, {
2546                 .compatible = "edt,etm0700g0bdh6",
2547                 .data = &edt_etm0700g0bdh6,
2548         }, {
2549                 .compatible = "edt,etm0700g0edh6",
2550                 .data = &edt_etm0700g0bdh6,
2551         }, {
2552                 .compatible = "foxlink,fl500wvr00-a0t",
2553                 .data = &foxlink_fl500wvr00_a0t,
2554         }, {
2555                 .compatible = "giantplus,gpg482739qs5",
2556                 .data = &giantplus_gpg482739qs5
2557         }, {
2558                 .compatible = "hannstar,hsd070pww1",
2559                 .data = &hannstar_hsd070pww1,
2560         }, {
2561                 .compatible = "hannstar,hsd100pxn1",
2562                 .data = &hannstar_hsd100pxn1,
2563         }, {
2564                 .compatible = "hit,tx23d38vm0caa",
2565                 .data = &hitachi_tx23d38vm0caa
2566         }, {
2567                 .compatible = "innolux,at043tn24",
2568                 .data = &innolux_at043tn24,
2569         }, {
2570                 .compatible = "innolux,at070tn92",
2571                 .data = &innolux_at070tn92,
2572         }, {
2573                 .compatible = "innolux,g070y2-l01",
2574                 .data = &innolux_g070y2_l01,
2575         }, {
2576                 .compatible = "innolux,g101ice-l01",
2577                 .data = &innolux_g101ice_l01
2578         }, {
2579                 .compatible = "innolux,g121i1-l01",
2580                 .data = &innolux_g121i1_l01
2581         }, {
2582                 .compatible = "innolux,g121x1-l03",
2583                 .data = &innolux_g121x1_l03,
2584         }, {
2585                 .compatible = "innolux,n116bge",
2586                 .data = &innolux_n116bge,
2587         }, {
2588                 .compatible = "innolux,n156bge-l21",
2589                 .data = &innolux_n156bge_l21,
2590         }, {
2591                 .compatible = "innolux,tv123wam",
2592                 .data = &innolux_tv123wam,
2593         }, {
2594                 .compatible = "innolux,zj070na-01p",
2595                 .data = &innolux_zj070na_01p,
2596         }, {
2597                 .compatible = "koe,tx31d200vm0baa",
2598                 .data = &koe_tx31d200vm0baa,
2599         }, {
2600                 .compatible = "kyo,tcg121xglp",
2601                 .data = &kyo_tcg121xglp,
2602         }, {
2603                 .compatible = "lg,lb070wv8",
2604                 .data = &lg_lb070wv8,
2605         }, {
2606                 .compatible = "lg,lp079qx1-sp0v",
2607                 .data = &lg_lp079qx1_sp0v,
2608         }, {
2609                 .compatible = "lg,lp097qx1-spa1",
2610                 .data = &lg_lp097qx1_spa1,
2611         }, {
2612                 .compatible = "lg,lp120up1",
2613                 .data = &lg_lp120up1,
2614         }, {
2615                 .compatible = "lg,lp129qe",
2616                 .data = &lg_lp129qe,
2617         }, {
2618                 .compatible = "mitsubishi,aa070mc01-ca1",
2619                 .data = &mitsubishi_aa070mc01,
2620         }, {
2621                 .compatible = "nec,nl12880bc20-05",
2622                 .data = &nec_nl12880bc20_05,
2623         }, {
2624                 .compatible = "nec,nl4827hc19-05b",
2625                 .data = &nec_nl4827hc19_05b,
2626         }, {
2627                 .compatible = "netron-dy,e231732",
2628                 .data = &netron_dy_e231732,
2629         }, {
2630                 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
2631                 .data = &newhaven_nhd_43_480272ef_atxl,
2632         }, {
2633                 .compatible = "nlt,nl192108ac18-02d",
2634                 .data = &nlt_nl192108ac18_02d,
2635         }, {
2636                 .compatible = "nvd,9128",
2637                 .data = &nvd_9128,
2638         }, {
2639                 .compatible = "okaya,rs800480t-7x0gp",
2640                 .data = &okaya_rs800480t_7x0gp,
2641         }, {
2642                 .compatible = "olimex,lcd-olinuxino-43-ts",
2643                 .data = &olimex_lcd_olinuxino_43ts,
2644         }, {
2645                 .compatible = "ontat,yx700wv03",
2646                 .data = &ontat_yx700wv03,
2647         }, {
2648                 .compatible = "ortustech,com43h4m85ulc",
2649                 .data = &ortustech_com43h4m85ulc,
2650         }, {
2651                 .compatible = "qiaodian,qd43003c0-40",
2652                 .data = &qd43003c0_40,
2653         }, {
2654                 .compatible = "rocktech,rk070er9427",
2655                 .data = &rocktech_rk070er9427,
2656         }, {
2657                 .compatible = "samsung,lsn122dl01-c01",
2658                 .data = &samsung_lsn122dl01_c01,
2659         }, {
2660                 .compatible = "samsung,ltn101nt05",
2661                 .data = &samsung_ltn101nt05,
2662         }, {
2663                 .compatible = "samsung,ltn140at29-301",
2664                 .data = &samsung_ltn140at29_301,
2665         }, {
2666                 .compatible = "sharp,lq035q7db03",
2667                 .data = &sharp_lq035q7db03,
2668         }, {
2669                 .compatible = "sharp,lq101k1ly04",
2670                 .data = &sharp_lq101k1ly04,
2671         }, {
2672                 .compatible = "sharp,lq123p1jx31",
2673                 .data = &sharp_lq123p1jx31,
2674         }, {
2675                 .compatible = "sharp,lq150x1lg11",
2676                 .data = &sharp_lq150x1lg11,
2677         }, {
2678                 .compatible = "shelly,sca07010-bfn-lnn",
2679                 .data = &shelly_sca07010_bfn_lnn,
2680         }, {
2681                 .compatible = "starry,kr122ea0sra",
2682                 .data = &starry_kr122ea0sra,
2683         }, {
2684                 .compatible = "tianma,tm070jdhg30",
2685                 .data = &tianma_tm070jdhg30,
2686         }, {
2687                 .compatible = "tianma,tm070rvhg71",
2688                 .data = &tianma_tm070rvhg71,
2689         }, {
2690                 .compatible = "toshiba,lt089ac29000",
2691                 .data = &toshiba_lt089ac29000,
2692         }, {
2693                 .compatible = "tpk,f07a-0102",
2694                 .data = &tpk_f07a_0102,
2695         }, {
2696                 .compatible = "tpk,f10a-0102",
2697                 .data = &tpk_f10a_0102,
2698         }, {
2699                 .compatible = "urt,umsh-8596md-t",
2700                 .data = &urt_umsh_8596md_parallel,
2701         }, {
2702                 .compatible = "urt,umsh-8596md-1t",
2703                 .data = &urt_umsh_8596md_parallel,
2704         }, {
2705                 .compatible = "urt,umsh-8596md-7t",
2706                 .data = &urt_umsh_8596md_parallel,
2707         }, {
2708                 .compatible = "urt,umsh-8596md-11t",
2709                 .data = &urt_umsh_8596md_lvds,
2710         }, {
2711                 .compatible = "urt,umsh-8596md-19t",
2712                 .data = &urt_umsh_8596md_lvds,
2713         }, {
2714                 .compatible = "urt,umsh-8596md-20t",
2715                 .data = &urt_umsh_8596md_parallel,
2716         }, {
2717                 .compatible = "winstar,wf35ltiacd",
2718                 .data = &winstar_wf35ltiacd,
2719         }, {
2720                 /* sentinel */
2721         }
2722 };
2723 MODULE_DEVICE_TABLE(of, platform_of_match);
2724
2725 static int panel_simple_platform_probe(struct platform_device *pdev)
2726 {
2727         const struct of_device_id *id;
2728
2729         id = of_match_node(platform_of_match, pdev->dev.of_node);
2730         if (!id)
2731                 return -ENODEV;
2732
2733         return panel_simple_probe(&pdev->dev, id->data);
2734 }
2735
2736 static int panel_simple_platform_remove(struct platform_device *pdev)
2737 {
2738         return panel_simple_remove(&pdev->dev);
2739 }
2740
2741 static void panel_simple_platform_shutdown(struct platform_device *pdev)
2742 {
2743         panel_simple_shutdown(&pdev->dev);
2744 }
2745
2746 static struct platform_driver panel_simple_platform_driver = {
2747         .driver = {
2748                 .name = "panel-simple",
2749                 .of_match_table = platform_of_match,
2750         },
2751         .probe = panel_simple_platform_probe,
2752         .remove = panel_simple_platform_remove,
2753         .shutdown = panel_simple_platform_shutdown,
2754 };
2755
2756 struct panel_desc_dsi {
2757         struct panel_desc desc;
2758
2759         unsigned long flags;
2760         enum mipi_dsi_pixel_format format;
2761         unsigned int lanes;
2762 };
2763
2764 static const struct drm_display_mode auo_b080uan01_mode = {
2765         .clock = 154500,
2766         .hdisplay = 1200,
2767         .hsync_start = 1200 + 62,
2768         .hsync_end = 1200 + 62 + 4,
2769         .htotal = 1200 + 62 + 4 + 62,
2770         .vdisplay = 1920,
2771         .vsync_start = 1920 + 9,
2772         .vsync_end = 1920 + 9 + 2,
2773         .vtotal = 1920 + 9 + 2 + 8,
2774         .vrefresh = 60,
2775 };
2776
2777 static const struct panel_desc_dsi auo_b080uan01 = {
2778         .desc = {
2779                 .modes = &auo_b080uan01_mode,
2780                 .num_modes = 1,
2781                 .bpc = 8,
2782                 .size = {
2783                         .width = 108,
2784                         .height = 272,
2785                 },
2786         },
2787         .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2788         .format = MIPI_DSI_FMT_RGB888,
2789         .lanes = 4,
2790 };
2791
2792 static const struct drm_display_mode boe_tv080wum_nl0_mode = {
2793         .clock = 160000,
2794         .hdisplay = 1200,
2795         .hsync_start = 1200 + 120,
2796         .hsync_end = 1200 + 120 + 20,
2797         .htotal = 1200 + 120 + 20 + 21,
2798         .vdisplay = 1920,
2799         .vsync_start = 1920 + 21,
2800         .vsync_end = 1920 + 21 + 3,
2801         .vtotal = 1920 + 21 + 3 + 18,
2802         .vrefresh = 60,
2803         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2804 };
2805
2806 static const struct panel_desc_dsi boe_tv080wum_nl0 = {
2807         .desc = {
2808                 .modes = &boe_tv080wum_nl0_mode,
2809                 .num_modes = 1,
2810                 .size = {
2811                         .width = 107,
2812                         .height = 172,
2813                 },
2814         },
2815         .flags = MIPI_DSI_MODE_VIDEO |
2816                  MIPI_DSI_MODE_VIDEO_BURST |
2817                  MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
2818         .format = MIPI_DSI_FMT_RGB888,
2819         .lanes = 4,
2820 };
2821
2822 static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
2823         .clock = 71000,
2824         .hdisplay = 800,
2825         .hsync_start = 800 + 32,
2826         .hsync_end = 800 + 32 + 1,
2827         .htotal = 800 + 32 + 1 + 57,
2828         .vdisplay = 1280,
2829         .vsync_start = 1280 + 28,
2830         .vsync_end = 1280 + 28 + 1,
2831         .vtotal = 1280 + 28 + 1 + 14,
2832         .vrefresh = 60,
2833 };
2834
2835 static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
2836         .desc = {
2837                 .modes = &lg_ld070wx3_sl01_mode,
2838                 .num_modes = 1,
2839                 .bpc = 8,
2840                 .size = {
2841                         .width = 94,
2842                         .height = 151,
2843                 },
2844         },
2845         .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2846         .format = MIPI_DSI_FMT_RGB888,
2847         .lanes = 4,
2848 };
2849
2850 static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
2851         .clock = 67000,
2852         .hdisplay = 720,
2853         .hsync_start = 720 + 12,
2854         .hsync_end = 720 + 12 + 4,
2855         .htotal = 720 + 12 + 4 + 112,
2856         .vdisplay = 1280,
2857         .vsync_start = 1280 + 8,
2858         .vsync_end = 1280 + 8 + 4,
2859         .vtotal = 1280 + 8 + 4 + 12,
2860         .vrefresh = 60,
2861 };
2862
2863 static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
2864         .desc = {
2865                 .modes = &lg_lh500wx1_sd03_mode,
2866                 .num_modes = 1,
2867                 .bpc = 8,
2868                 .size = {
2869                         .width = 62,
2870                         .height = 110,
2871                 },
2872         },
2873         .flags = MIPI_DSI_MODE_VIDEO,
2874         .format = MIPI_DSI_FMT_RGB888,
2875         .lanes = 4,
2876 };
2877
2878 static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
2879         .clock = 157200,
2880         .hdisplay = 1920,
2881         .hsync_start = 1920 + 154,
2882         .hsync_end = 1920 + 154 + 16,
2883         .htotal = 1920 + 154 + 16 + 32,
2884         .vdisplay = 1200,
2885         .vsync_start = 1200 + 17,
2886         .vsync_end = 1200 + 17 + 2,
2887         .vtotal = 1200 + 17 + 2 + 16,
2888         .vrefresh = 60,
2889 };
2890
2891 static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
2892         .desc = {
2893                 .modes = &panasonic_vvx10f004b00_mode,
2894                 .num_modes = 1,
2895                 .bpc = 8,
2896                 .size = {
2897                         .width = 217,
2898                         .height = 136,
2899                 },
2900         },
2901         .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
2902                  MIPI_DSI_CLOCK_NON_CONTINUOUS,
2903         .format = MIPI_DSI_FMT_RGB888,
2904         .lanes = 4,
2905 };
2906
2907 static const struct of_device_id dsi_of_match[] = {
2908         {
2909                 .compatible = "auo,b080uan01",
2910                 .data = &auo_b080uan01
2911         }, {
2912                 .compatible = "boe,tv080wum-nl0",
2913                 .data = &boe_tv080wum_nl0
2914         }, {
2915                 .compatible = "lg,ld070wx3-sl01",
2916                 .data = &lg_ld070wx3_sl01
2917         }, {
2918                 .compatible = "lg,lh500wx1-sd03",
2919                 .data = &lg_lh500wx1_sd03
2920         }, {
2921                 .compatible = "panasonic,vvx10f004b00",
2922                 .data = &panasonic_vvx10f004b00
2923         }, {
2924                 /* sentinel */
2925         }
2926 };
2927 MODULE_DEVICE_TABLE(of, dsi_of_match);
2928
2929 static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
2930 {
2931         const struct panel_desc_dsi *desc;
2932         const struct of_device_id *id;
2933         int err;
2934
2935         id = of_match_node(dsi_of_match, dsi->dev.of_node);
2936         if (!id)
2937                 return -ENODEV;
2938
2939         desc = id->data;
2940
2941         err = panel_simple_probe(&dsi->dev, &desc->desc);
2942         if (err < 0)
2943                 return err;
2944
2945         dsi->mode_flags = desc->flags;
2946         dsi->format = desc->format;
2947         dsi->lanes = desc->lanes;
2948
2949         return mipi_dsi_attach(dsi);
2950 }
2951
2952 static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
2953 {
2954         int err;
2955
2956         err = mipi_dsi_detach(dsi);
2957         if (err < 0)
2958                 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
2959
2960         return panel_simple_remove(&dsi->dev);
2961 }
2962
2963 static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
2964 {
2965         panel_simple_shutdown(&dsi->dev);
2966 }
2967
2968 static struct mipi_dsi_driver panel_simple_dsi_driver = {
2969         .driver = {
2970                 .name = "panel-simple-dsi",
2971                 .of_match_table = dsi_of_match,
2972         },
2973         .probe = panel_simple_dsi_probe,
2974         .remove = panel_simple_dsi_remove,
2975         .shutdown = panel_simple_dsi_shutdown,
2976 };
2977
2978 static int __init panel_simple_init(void)
2979 {
2980         int err;
2981
2982         err = platform_driver_register(&panel_simple_platform_driver);
2983         if (err < 0)
2984                 return err;
2985
2986         if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
2987                 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
2988                 if (err < 0)
2989                         return err;
2990         }
2991
2992         return 0;
2993 }
2994 module_init(panel_simple_init);
2995
2996 static void __exit panel_simple_exit(void)
2997 {
2998         if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
2999                 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
3000
3001         platform_driver_unregister(&panel_simple_platform_driver);
3002 }
3003 module_exit(panel_simple_exit);
3004
3005 MODULE_AUTHOR("Thierry Reding <[email protected]>");
3006 MODULE_DESCRIPTION("DRM Driver for Simple Panels");
3007 MODULE_LICENSE("GPL and additional rights");
This page took 0.222925 seconds and 4 git commands to generate.