]> asedeno.scripts.mit.edu Git - linux.git/blob - drivers/gpu/drm/panel/panel-simple.c
drm/panel: Add and fill drm_panel type field
[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/delay.h>
26 #include <linux/gpio/consumer.h>
27 #include <linux/module.h>
28 #include <linux/of_platform.h>
29 #include <linux/platform_device.h>
30 #include <linux/regulator/consumer.h>
31
32 #include <video/display_timing.h>
33 #include <video/of_display_timing.h>
34 #include <video/videomode.h>
35
36 #include <drm/drm_crtc.h>
37 #include <drm/drm_device.h>
38 #include <drm/drm_mipi_dsi.h>
39 #include <drm/drm_panel.h>
40
41 /**
42  * @modes: Pointer to array of fixed modes appropriate for this panel.  If
43  *         only one mode then this can just be the address of this the mode.
44  *         NOTE: cannot be used with "timings" and also if this is specified
45  *         then you cannot override the mode in the device tree.
46  * @num_modes: Number of elements in modes array.
47  * @timings: Pointer to array of display timings.  NOTE: cannot be used with
48  *           "modes" and also these will be used to validate a device tree
49  *           override if one is present.
50  * @num_timings: Number of elements in timings array.
51  * @bpc: Bits per color.
52  * @size: Structure containing the physical size of this panel.
53  * @delay: Structure containing various delay values for this panel.
54  * @bus_format: See MEDIA_BUS_FMT_... defines.
55  * @bus_flags: See DRM_BUS_FLAG_... defines.
56  */
57 struct panel_desc {
58         const struct drm_display_mode *modes;
59         unsigned int num_modes;
60         const struct display_timing *timings;
61         unsigned int num_timings;
62
63         unsigned int bpc;
64
65         /**
66          * @width: width (in millimeters) of the panel's active display area
67          * @height: height (in millimeters) of the panel's active display area
68          */
69         struct {
70                 unsigned int width;
71                 unsigned int height;
72         } size;
73
74         /**
75          * @prepare: the time (in milliseconds) that it takes for the panel to
76          *           become ready and start receiving video data
77          * @hpd_absent_delay: Add this to the prepare delay if we know Hot
78          *                    Plug Detect isn't used.
79          * @enable: the time (in milliseconds) that it takes for the panel to
80          *          display the first valid frame after starting to receive
81          *          video data
82          * @disable: the time (in milliseconds) that it takes for the panel to
83          *           turn the display off (no content is visible)
84          * @unprepare: the time (in milliseconds) that it takes for the panel
85          *             to power itself down completely
86          */
87         struct {
88                 unsigned int prepare;
89                 unsigned int hpd_absent_delay;
90                 unsigned int enable;
91                 unsigned int disable;
92                 unsigned int unprepare;
93         } delay;
94
95         u32 bus_format;
96         u32 bus_flags;
97         int connector_type;
98 };
99
100 struct panel_simple {
101         struct drm_panel base;
102         bool prepared;
103         bool enabled;
104         bool no_hpd;
105
106         const struct panel_desc *desc;
107
108         struct backlight_device *backlight;
109         struct regulator *supply;
110         struct i2c_adapter *ddc;
111
112         struct gpio_desc *enable_gpio;
113
114         struct drm_display_mode override_mode;
115 };
116
117 static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
118 {
119         return container_of(panel, struct panel_simple, base);
120 }
121
122 static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel)
123 {
124         struct drm_connector *connector = panel->base.connector;
125         struct drm_device *drm = panel->base.drm;
126         struct drm_display_mode *mode;
127         unsigned int i, num = 0;
128
129         for (i = 0; i < panel->desc->num_timings; i++) {
130                 const struct display_timing *dt = &panel->desc->timings[i];
131                 struct videomode vm;
132
133                 videomode_from_timing(dt, &vm);
134                 mode = drm_mode_create(drm);
135                 if (!mode) {
136                         dev_err(drm->dev, "failed to add mode %ux%u\n",
137                                 dt->hactive.typ, dt->vactive.typ);
138                         continue;
139                 }
140
141                 drm_display_mode_from_videomode(&vm, mode);
142
143                 mode->type |= DRM_MODE_TYPE_DRIVER;
144
145                 if (panel->desc->num_timings == 1)
146                         mode->type |= DRM_MODE_TYPE_PREFERRED;
147
148                 drm_mode_probed_add(connector, mode);
149                 num++;
150         }
151
152         return num;
153 }
154
155 static unsigned int panel_simple_get_display_modes(struct panel_simple *panel)
156 {
157         struct drm_connector *connector = panel->base.connector;
158         struct drm_device *drm = panel->base.drm;
159         struct drm_display_mode *mode;
160         unsigned int i, num = 0;
161
162         for (i = 0; i < panel->desc->num_modes; i++) {
163                 const struct drm_display_mode *m = &panel->desc->modes[i];
164
165                 mode = drm_mode_duplicate(drm, m);
166                 if (!mode) {
167                         dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
168                                 m->hdisplay, m->vdisplay, m->vrefresh);
169                         continue;
170                 }
171
172                 mode->type |= DRM_MODE_TYPE_DRIVER;
173
174                 if (panel->desc->num_modes == 1)
175                         mode->type |= DRM_MODE_TYPE_PREFERRED;
176
177                 drm_mode_set_name(mode);
178
179                 drm_mode_probed_add(connector, mode);
180                 num++;
181         }
182
183         return num;
184 }
185
186 static int panel_simple_get_non_edid_modes(struct panel_simple *panel)
187 {
188         struct drm_connector *connector = panel->base.connector;
189         struct drm_device *drm = panel->base.drm;
190         struct drm_display_mode *mode;
191         bool has_override = panel->override_mode.type;
192         unsigned int num = 0;
193
194         if (!panel->desc)
195                 return 0;
196
197         if (has_override) {
198                 mode = drm_mode_duplicate(drm, &panel->override_mode);
199                 if (mode) {
200                         drm_mode_probed_add(connector, mode);
201                         num = 1;
202                 } else {
203                         dev_err(drm->dev, "failed to add override mode\n");
204                 }
205         }
206
207         /* Only add timings if override was not there or failed to validate */
208         if (num == 0 && panel->desc->num_timings)
209                 num = panel_simple_get_timings_modes(panel);
210
211         /*
212          * Only add fixed modes if timings/override added no mode.
213          *
214          * We should only ever have either the display timings specified
215          * or a fixed mode. Anything else is rather bogus.
216          */
217         WARN_ON(panel->desc->num_timings && panel->desc->num_modes);
218         if (num == 0)
219                 num = panel_simple_get_display_modes(panel);
220
221         connector->display_info.bpc = panel->desc->bpc;
222         connector->display_info.width_mm = panel->desc->size.width;
223         connector->display_info.height_mm = panel->desc->size.height;
224         if (panel->desc->bus_format)
225                 drm_display_info_set_bus_formats(&connector->display_info,
226                                                  &panel->desc->bus_format, 1);
227         connector->display_info.bus_flags = panel->desc->bus_flags;
228
229         return num;
230 }
231
232 static int panel_simple_disable(struct drm_panel *panel)
233 {
234         struct panel_simple *p = to_panel_simple(panel);
235
236         if (!p->enabled)
237                 return 0;
238
239         if (p->backlight) {
240                 p->backlight->props.power = FB_BLANK_POWERDOWN;
241                 p->backlight->props.state |= BL_CORE_FBBLANK;
242                 backlight_update_status(p->backlight);
243         }
244
245         if (p->desc->delay.disable)
246                 msleep(p->desc->delay.disable);
247
248         p->enabled = false;
249
250         return 0;
251 }
252
253 static int panel_simple_unprepare(struct drm_panel *panel)
254 {
255         struct panel_simple *p = to_panel_simple(panel);
256
257         if (!p->prepared)
258                 return 0;
259
260         gpiod_set_value_cansleep(p->enable_gpio, 0);
261
262         regulator_disable(p->supply);
263
264         if (p->desc->delay.unprepare)
265                 msleep(p->desc->delay.unprepare);
266
267         p->prepared = false;
268
269         return 0;
270 }
271
272 static int panel_simple_prepare(struct drm_panel *panel)
273 {
274         struct panel_simple *p = to_panel_simple(panel);
275         unsigned int delay;
276         int err;
277
278         if (p->prepared)
279                 return 0;
280
281         err = regulator_enable(p->supply);
282         if (err < 0) {
283                 dev_err(panel->dev, "failed to enable supply: %d\n", err);
284                 return err;
285         }
286
287         gpiod_set_value_cansleep(p->enable_gpio, 1);
288
289         delay = p->desc->delay.prepare;
290         if (p->no_hpd)
291                 delay += p->desc->delay.hpd_absent_delay;
292         if (delay)
293                 msleep(delay);
294
295         p->prepared = true;
296
297         return 0;
298 }
299
300 static int panel_simple_enable(struct drm_panel *panel)
301 {
302         struct panel_simple *p = to_panel_simple(panel);
303
304         if (p->enabled)
305                 return 0;
306
307         if (p->desc->delay.enable)
308                 msleep(p->desc->delay.enable);
309
310         if (p->backlight) {
311                 p->backlight->props.state &= ~BL_CORE_FBBLANK;
312                 p->backlight->props.power = FB_BLANK_UNBLANK;
313                 backlight_update_status(p->backlight);
314         }
315
316         p->enabled = true;
317
318         return 0;
319 }
320
321 static int panel_simple_get_modes(struct drm_panel *panel)
322 {
323         struct panel_simple *p = to_panel_simple(panel);
324         int num = 0;
325
326         /* probe EDID if a DDC bus is available */
327         if (p->ddc) {
328                 struct edid *edid = drm_get_edid(panel->connector, p->ddc);
329                 drm_connector_update_edid_property(panel->connector, edid);
330                 if (edid) {
331                         num += drm_add_edid_modes(panel->connector, edid);
332                         kfree(edid);
333                 }
334         }
335
336         /* add hard-coded panel modes */
337         num += panel_simple_get_non_edid_modes(p);
338
339         return num;
340 }
341
342 static int panel_simple_get_timings(struct drm_panel *panel,
343                                     unsigned int num_timings,
344                                     struct display_timing *timings)
345 {
346         struct panel_simple *p = to_panel_simple(panel);
347         unsigned int i;
348
349         if (p->desc->num_timings < num_timings)
350                 num_timings = p->desc->num_timings;
351
352         if (timings)
353                 for (i = 0; i < num_timings; i++)
354                         timings[i] = p->desc->timings[i];
355
356         return p->desc->num_timings;
357 }
358
359 static const struct drm_panel_funcs panel_simple_funcs = {
360         .disable = panel_simple_disable,
361         .unprepare = panel_simple_unprepare,
362         .prepare = panel_simple_prepare,
363         .enable = panel_simple_enable,
364         .get_modes = panel_simple_get_modes,
365         .get_timings = panel_simple_get_timings,
366 };
367
368 #define PANEL_SIMPLE_BOUNDS_CHECK(to_check, bounds, field) \
369         (to_check->field.typ >= bounds->field.min && \
370          to_check->field.typ <= bounds->field.max)
371 static void panel_simple_parse_panel_timing_node(struct device *dev,
372                                                  struct panel_simple *panel,
373                                                  const struct display_timing *ot)
374 {
375         const struct panel_desc *desc = panel->desc;
376         struct videomode vm;
377         unsigned int i;
378
379         if (WARN_ON(desc->num_modes)) {
380                 dev_err(dev, "Reject override mode: panel has a fixed mode\n");
381                 return;
382         }
383         if (WARN_ON(!desc->num_timings)) {
384                 dev_err(dev, "Reject override mode: no timings specified\n");
385                 return;
386         }
387
388         for (i = 0; i < panel->desc->num_timings; i++) {
389                 const struct display_timing *dt = &panel->desc->timings[i];
390
391                 if (!PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hactive) ||
392                     !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hfront_porch) ||
393                     !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hback_porch) ||
394                     !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hsync_len) ||
395                     !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vactive) ||
396                     !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vfront_porch) ||
397                     !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vback_porch) ||
398                     !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vsync_len))
399                         continue;
400
401                 if (ot->flags != dt->flags)
402                         continue;
403
404                 videomode_from_timing(ot, &vm);
405                 drm_display_mode_from_videomode(&vm, &panel->override_mode);
406                 panel->override_mode.type |= DRM_MODE_TYPE_DRIVER |
407                                              DRM_MODE_TYPE_PREFERRED;
408                 break;
409         }
410
411         if (WARN_ON(!panel->override_mode.type))
412                 dev_err(dev, "Reject override mode: No display_timing found\n");
413 }
414
415 static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
416 {
417         struct device_node *backlight, *ddc;
418         struct panel_simple *panel;
419         struct display_timing dt;
420         int err;
421
422         panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
423         if (!panel)
424                 return -ENOMEM;
425
426         panel->enabled = false;
427         panel->prepared = false;
428         panel->desc = desc;
429
430         panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd");
431
432         panel->supply = devm_regulator_get(dev, "power");
433         if (IS_ERR(panel->supply))
434                 return PTR_ERR(panel->supply);
435
436         panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
437                                                      GPIOD_OUT_LOW);
438         if (IS_ERR(panel->enable_gpio)) {
439                 err = PTR_ERR(panel->enable_gpio);
440                 if (err != -EPROBE_DEFER)
441                         dev_err(dev, "failed to request GPIO: %d\n", err);
442                 return err;
443         }
444
445         backlight = of_parse_phandle(dev->of_node, "backlight", 0);
446         if (backlight) {
447                 panel->backlight = of_find_backlight_by_node(backlight);
448                 of_node_put(backlight);
449
450                 if (!panel->backlight)
451                         return -EPROBE_DEFER;
452         }
453
454         ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
455         if (ddc) {
456                 panel->ddc = of_find_i2c_adapter_by_node(ddc);
457                 of_node_put(ddc);
458
459                 if (!panel->ddc) {
460                         err = -EPROBE_DEFER;
461                         goto free_backlight;
462                 }
463         }
464
465         if (!of_get_display_timing(dev->of_node, "panel-timing", &dt))
466                 panel_simple_parse_panel_timing_node(dev, panel, &dt);
467
468         drm_panel_init(&panel->base, dev, &panel_simple_funcs,
469                        desc->connector_type);
470
471         err = drm_panel_add(&panel->base);
472         if (err < 0)
473                 goto free_ddc;
474
475         dev_set_drvdata(dev, panel);
476
477         return 0;
478
479 free_ddc:
480         if (panel->ddc)
481                 put_device(&panel->ddc->dev);
482 free_backlight:
483         if (panel->backlight)
484                 put_device(&panel->backlight->dev);
485
486         return err;
487 }
488
489 static int panel_simple_remove(struct device *dev)
490 {
491         struct panel_simple *panel = dev_get_drvdata(dev);
492
493         drm_panel_remove(&panel->base);
494
495         panel_simple_disable(&panel->base);
496         panel_simple_unprepare(&panel->base);
497
498         if (panel->ddc)
499                 put_device(&panel->ddc->dev);
500
501         if (panel->backlight)
502                 put_device(&panel->backlight->dev);
503
504         return 0;
505 }
506
507 static void panel_simple_shutdown(struct device *dev)
508 {
509         struct panel_simple *panel = dev_get_drvdata(dev);
510
511         panel_simple_disable(&panel->base);
512         panel_simple_unprepare(&panel->base);
513 }
514
515 static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
516         .clock = 9000,
517         .hdisplay = 480,
518         .hsync_start = 480 + 2,
519         .hsync_end = 480 + 2 + 41,
520         .htotal = 480 + 2 + 41 + 2,
521         .vdisplay = 272,
522         .vsync_start = 272 + 2,
523         .vsync_end = 272 + 2 + 10,
524         .vtotal = 272 + 2 + 10 + 2,
525         .vrefresh = 60,
526         .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
527 };
528
529 static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
530         .modes = &ampire_am_480272h3tmqw_t01h_mode,
531         .num_modes = 1,
532         .bpc = 8,
533         .size = {
534                 .width = 105,
535                 .height = 67,
536         },
537         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
538 };
539
540 static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
541         .clock = 33333,
542         .hdisplay = 800,
543         .hsync_start = 800 + 0,
544         .hsync_end = 800 + 0 + 255,
545         .htotal = 800 + 0 + 255 + 0,
546         .vdisplay = 480,
547         .vsync_start = 480 + 2,
548         .vsync_end = 480 + 2 + 45,
549         .vtotal = 480 + 2 + 45 + 0,
550         .vrefresh = 60,
551         .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
552 };
553
554 static const struct panel_desc ampire_am800480r3tmqwa1h = {
555         .modes = &ampire_am800480r3tmqwa1h_mode,
556         .num_modes = 1,
557         .bpc = 6,
558         .size = {
559                 .width = 152,
560                 .height = 91,
561         },
562         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
563 };
564
565 static const struct display_timing santek_st0700i5y_rbslw_f_timing = {
566         .pixelclock = { 26400000, 33300000, 46800000 },
567         .hactive = { 800, 800, 800 },
568         .hfront_porch = { 16, 210, 354 },
569         .hback_porch = { 45, 36, 6 },
570         .hsync_len = { 1, 10, 40 },
571         .vactive = { 480, 480, 480 },
572         .vfront_porch = { 7, 22, 147 },
573         .vback_porch = { 22, 13, 3 },
574         .vsync_len = { 1, 10, 20 },
575         .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
576                 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE
577 };
578
579 static const struct panel_desc armadeus_st0700_adapt = {
580         .timings = &santek_st0700i5y_rbslw_f_timing,
581         .num_timings = 1,
582         .bpc = 6,
583         .size = {
584                 .width = 154,
585                 .height = 86,
586         },
587         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
588         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
589 };
590
591 static const struct drm_display_mode auo_b101aw03_mode = {
592         .clock = 51450,
593         .hdisplay = 1024,
594         .hsync_start = 1024 + 156,
595         .hsync_end = 1024 + 156 + 8,
596         .htotal = 1024 + 156 + 8 + 156,
597         .vdisplay = 600,
598         .vsync_start = 600 + 16,
599         .vsync_end = 600 + 16 + 6,
600         .vtotal = 600 + 16 + 6 + 16,
601         .vrefresh = 60,
602 };
603
604 static const struct panel_desc auo_b101aw03 = {
605         .modes = &auo_b101aw03_mode,
606         .num_modes = 1,
607         .bpc = 6,
608         .size = {
609                 .width = 223,
610                 .height = 125,
611         },
612 };
613
614 static const struct display_timing auo_b101ean01_timing = {
615         .pixelclock = { 65300000, 72500000, 75000000 },
616         .hactive = { 1280, 1280, 1280 },
617         .hfront_porch = { 18, 119, 119 },
618         .hback_porch = { 21, 21, 21 },
619         .hsync_len = { 32, 32, 32 },
620         .vactive = { 800, 800, 800 },
621         .vfront_porch = { 4, 4, 4 },
622         .vback_porch = { 8, 8, 8 },
623         .vsync_len = { 18, 20, 20 },
624 };
625
626 static const struct panel_desc auo_b101ean01 = {
627         .timings = &auo_b101ean01_timing,
628         .num_timings = 1,
629         .bpc = 6,
630         .size = {
631                 .width = 217,
632                 .height = 136,
633         },
634 };
635
636 static const struct drm_display_mode auo_b101xtn01_mode = {
637         .clock = 72000,
638         .hdisplay = 1366,
639         .hsync_start = 1366 + 20,
640         .hsync_end = 1366 + 20 + 70,
641         .htotal = 1366 + 20 + 70,
642         .vdisplay = 768,
643         .vsync_start = 768 + 14,
644         .vsync_end = 768 + 14 + 42,
645         .vtotal = 768 + 14 + 42,
646         .vrefresh = 60,
647         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
648 };
649
650 static const struct panel_desc auo_b101xtn01 = {
651         .modes = &auo_b101xtn01_mode,
652         .num_modes = 1,
653         .bpc = 6,
654         .size = {
655                 .width = 223,
656                 .height = 125,
657         },
658 };
659
660 static const struct drm_display_mode auo_b116xw03_mode = {
661         .clock = 70589,
662         .hdisplay = 1366,
663         .hsync_start = 1366 + 40,
664         .hsync_end = 1366 + 40 + 40,
665         .htotal = 1366 + 40 + 40 + 32,
666         .vdisplay = 768,
667         .vsync_start = 768 + 10,
668         .vsync_end = 768 + 10 + 12,
669         .vtotal = 768 + 10 + 12 + 6,
670         .vrefresh = 60,
671 };
672
673 static const struct panel_desc auo_b116xw03 = {
674         .modes = &auo_b116xw03_mode,
675         .num_modes = 1,
676         .bpc = 6,
677         .size = {
678                 .width = 256,
679                 .height = 144,
680         },
681 };
682
683 static const struct drm_display_mode auo_b133xtn01_mode = {
684         .clock = 69500,
685         .hdisplay = 1366,
686         .hsync_start = 1366 + 48,
687         .hsync_end = 1366 + 48 + 32,
688         .htotal = 1366 + 48 + 32 + 20,
689         .vdisplay = 768,
690         .vsync_start = 768 + 3,
691         .vsync_end = 768 + 3 + 6,
692         .vtotal = 768 + 3 + 6 + 13,
693         .vrefresh = 60,
694 };
695
696 static const struct panel_desc auo_b133xtn01 = {
697         .modes = &auo_b133xtn01_mode,
698         .num_modes = 1,
699         .bpc = 6,
700         .size = {
701                 .width = 293,
702                 .height = 165,
703         },
704 };
705
706 static const struct drm_display_mode auo_b133htn01_mode = {
707         .clock = 150660,
708         .hdisplay = 1920,
709         .hsync_start = 1920 + 172,
710         .hsync_end = 1920 + 172 + 80,
711         .htotal = 1920 + 172 + 80 + 60,
712         .vdisplay = 1080,
713         .vsync_start = 1080 + 25,
714         .vsync_end = 1080 + 25 + 10,
715         .vtotal = 1080 + 25 + 10 + 10,
716         .vrefresh = 60,
717 };
718
719 static const struct panel_desc auo_b133htn01 = {
720         .modes = &auo_b133htn01_mode,
721         .num_modes = 1,
722         .bpc = 6,
723         .size = {
724                 .width = 293,
725                 .height = 165,
726         },
727         .delay = {
728                 .prepare = 105,
729                 .enable = 20,
730                 .unprepare = 50,
731         },
732 };
733
734 static const struct display_timing auo_g070vvn01_timings = {
735         .pixelclock = { 33300000, 34209000, 45000000 },
736         .hactive = { 800, 800, 800 },
737         .hfront_porch = { 20, 40, 200 },
738         .hback_porch = { 87, 40, 1 },
739         .hsync_len = { 1, 48, 87 },
740         .vactive = { 480, 480, 480 },
741         .vfront_porch = { 5, 13, 200 },
742         .vback_porch = { 31, 31, 29 },
743         .vsync_len = { 1, 1, 3 },
744 };
745
746 static const struct panel_desc auo_g070vvn01 = {
747         .timings = &auo_g070vvn01_timings,
748         .num_timings = 1,
749         .bpc = 8,
750         .size = {
751                 .width = 152,
752                 .height = 91,
753         },
754         .delay = {
755                 .prepare = 200,
756                 .enable = 50,
757                 .disable = 50,
758                 .unprepare = 1000,
759         },
760 };
761
762 static const struct drm_display_mode auo_g101evn010_mode = {
763         .clock = 68930,
764         .hdisplay = 1280,
765         .hsync_start = 1280 + 82,
766         .hsync_end = 1280 + 82 + 2,
767         .htotal = 1280 + 82 + 2 + 84,
768         .vdisplay = 800,
769         .vsync_start = 800 + 8,
770         .vsync_end = 800 + 8 + 2,
771         .vtotal = 800 + 8 + 2 + 6,
772         .vrefresh = 60,
773 };
774
775 static const struct panel_desc auo_g101evn010 = {
776         .modes = &auo_g101evn010_mode,
777         .num_modes = 1,
778         .bpc = 6,
779         .size = {
780                 .width = 216,
781                 .height = 135,
782         },
783         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
784 };
785
786 static const struct drm_display_mode auo_g104sn02_mode = {
787         .clock = 40000,
788         .hdisplay = 800,
789         .hsync_start = 800 + 40,
790         .hsync_end = 800 + 40 + 216,
791         .htotal = 800 + 40 + 216 + 128,
792         .vdisplay = 600,
793         .vsync_start = 600 + 10,
794         .vsync_end = 600 + 10 + 35,
795         .vtotal = 600 + 10 + 35 + 2,
796         .vrefresh = 60,
797 };
798
799 static const struct panel_desc auo_g104sn02 = {
800         .modes = &auo_g104sn02_mode,
801         .num_modes = 1,
802         .bpc = 8,
803         .size = {
804                 .width = 211,
805                 .height = 158,
806         },
807 };
808
809 static const struct display_timing auo_g133han01_timings = {
810         .pixelclock = { 134000000, 141200000, 149000000 },
811         .hactive = { 1920, 1920, 1920 },
812         .hfront_porch = { 39, 58, 77 },
813         .hback_porch = { 59, 88, 117 },
814         .hsync_len = { 28, 42, 56 },
815         .vactive = { 1080, 1080, 1080 },
816         .vfront_porch = { 3, 8, 11 },
817         .vback_porch = { 5, 14, 19 },
818         .vsync_len = { 4, 14, 19 },
819 };
820
821 static const struct panel_desc auo_g133han01 = {
822         .timings = &auo_g133han01_timings,
823         .num_timings = 1,
824         .bpc = 8,
825         .size = {
826                 .width = 293,
827                 .height = 165,
828         },
829         .delay = {
830                 .prepare = 200,
831                 .enable = 50,
832                 .disable = 50,
833                 .unprepare = 1000,
834         },
835         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
836         .connector_type = DRM_MODE_CONNECTOR_LVDS,
837 };
838
839 static const struct display_timing auo_g185han01_timings = {
840         .pixelclock = { 120000000, 144000000, 175000000 },
841         .hactive = { 1920, 1920, 1920 },
842         .hfront_porch = { 36, 120, 148 },
843         .hback_porch = { 24, 88, 108 },
844         .hsync_len = { 20, 48, 64 },
845         .vactive = { 1080, 1080, 1080 },
846         .vfront_porch = { 6, 10, 40 },
847         .vback_porch = { 2, 5, 20 },
848         .vsync_len = { 2, 5, 20 },
849 };
850
851 static const struct panel_desc auo_g185han01 = {
852         .timings = &auo_g185han01_timings,
853         .num_timings = 1,
854         .bpc = 8,
855         .size = {
856                 .width = 409,
857                 .height = 230,
858         },
859         .delay = {
860                 .prepare = 50,
861                 .enable = 200,
862                 .disable = 110,
863                 .unprepare = 1000,
864         },
865         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
866         .connector_type = DRM_MODE_CONNECTOR_LVDS,
867 };
868
869 static const struct display_timing auo_p320hvn03_timings = {
870         .pixelclock = { 106000000, 148500000, 164000000 },
871         .hactive = { 1920, 1920, 1920 },
872         .hfront_porch = { 25, 50, 130 },
873         .hback_porch = { 25, 50, 130 },
874         .hsync_len = { 20, 40, 105 },
875         .vactive = { 1080, 1080, 1080 },
876         .vfront_porch = { 8, 17, 150 },
877         .vback_porch = { 8, 17, 150 },
878         .vsync_len = { 4, 11, 100 },
879 };
880
881 static const struct panel_desc auo_p320hvn03 = {
882         .timings = &auo_p320hvn03_timings,
883         .num_timings = 1,
884         .bpc = 8,
885         .size = {
886                 .width = 698,
887                 .height = 393,
888         },
889         .delay = {
890                 .prepare = 1,
891                 .enable = 450,
892                 .unprepare = 500,
893         },
894         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
895         .connector_type = DRM_MODE_CONNECTOR_LVDS,
896 };
897
898 static const struct drm_display_mode auo_t215hvn01_mode = {
899         .clock = 148800,
900         .hdisplay = 1920,
901         .hsync_start = 1920 + 88,
902         .hsync_end = 1920 + 88 + 44,
903         .htotal = 1920 + 88 + 44 + 148,
904         .vdisplay = 1080,
905         .vsync_start = 1080 + 4,
906         .vsync_end = 1080 + 4 + 5,
907         .vtotal = 1080 + 4 + 5 + 36,
908         .vrefresh = 60,
909 };
910
911 static const struct panel_desc auo_t215hvn01 = {
912         .modes = &auo_t215hvn01_mode,
913         .num_modes = 1,
914         .bpc = 8,
915         .size = {
916                 .width = 430,
917                 .height = 270,
918         },
919         .delay = {
920                 .disable = 5,
921                 .unprepare = 1000,
922         }
923 };
924
925 static const struct drm_display_mode avic_tm070ddh03_mode = {
926         .clock = 51200,
927         .hdisplay = 1024,
928         .hsync_start = 1024 + 160,
929         .hsync_end = 1024 + 160 + 4,
930         .htotal = 1024 + 160 + 4 + 156,
931         .vdisplay = 600,
932         .vsync_start = 600 + 17,
933         .vsync_end = 600 + 17 + 1,
934         .vtotal = 600 + 17 + 1 + 17,
935         .vrefresh = 60,
936 };
937
938 static const struct panel_desc avic_tm070ddh03 = {
939         .modes = &avic_tm070ddh03_mode,
940         .num_modes = 1,
941         .bpc = 8,
942         .size = {
943                 .width = 154,
944                 .height = 90,
945         },
946         .delay = {
947                 .prepare = 20,
948                 .enable = 200,
949                 .disable = 200,
950         },
951 };
952
953 static const struct drm_display_mode bananapi_s070wv20_ct16_mode = {
954         .clock = 30000,
955         .hdisplay = 800,
956         .hsync_start = 800 + 40,
957         .hsync_end = 800 + 40 + 48,
958         .htotal = 800 + 40 + 48 + 40,
959         .vdisplay = 480,
960         .vsync_start = 480 + 13,
961         .vsync_end = 480 + 13 + 3,
962         .vtotal = 480 + 13 + 3 + 29,
963 };
964
965 static const struct panel_desc bananapi_s070wv20_ct16 = {
966         .modes = &bananapi_s070wv20_ct16_mode,
967         .num_modes = 1,
968         .bpc = 6,
969         .size = {
970                 .width = 154,
971                 .height = 86,
972         },
973 };
974
975 static const struct drm_display_mode boe_hv070wsa_mode = {
976         .clock = 42105,
977         .hdisplay = 1024,
978         .hsync_start = 1024 + 30,
979         .hsync_end = 1024 + 30 + 30,
980         .htotal = 1024 + 30 + 30 + 30,
981         .vdisplay = 600,
982         .vsync_start = 600 + 10,
983         .vsync_end = 600 + 10 + 10,
984         .vtotal = 600 + 10 + 10 + 10,
985         .vrefresh = 60,
986 };
987
988 static const struct panel_desc boe_hv070wsa = {
989         .modes = &boe_hv070wsa_mode,
990         .num_modes = 1,
991         .size = {
992                 .width = 154,
993                 .height = 90,
994         },
995 };
996
997 static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
998         {
999                 .clock = 71900,
1000                 .hdisplay = 1280,
1001                 .hsync_start = 1280 + 48,
1002                 .hsync_end = 1280 + 48 + 32,
1003                 .htotal = 1280 + 48 + 32 + 80,
1004                 .vdisplay = 800,
1005                 .vsync_start = 800 + 3,
1006                 .vsync_end = 800 + 3 + 5,
1007                 .vtotal = 800 + 3 + 5 + 24,
1008                 .vrefresh = 60,
1009         },
1010         {
1011                 .clock = 57500,
1012                 .hdisplay = 1280,
1013                 .hsync_start = 1280 + 48,
1014                 .hsync_end = 1280 + 48 + 32,
1015                 .htotal = 1280 + 48 + 32 + 80,
1016                 .vdisplay = 800,
1017                 .vsync_start = 800 + 3,
1018                 .vsync_end = 800 + 3 + 5,
1019                 .vtotal = 800 + 3 + 5 + 24,
1020                 .vrefresh = 48,
1021         },
1022 };
1023
1024 static const struct panel_desc boe_nv101wxmn51 = {
1025         .modes = boe_nv101wxmn51_modes,
1026         .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
1027         .bpc = 8,
1028         .size = {
1029                 .width = 217,
1030                 .height = 136,
1031         },
1032         .delay = {
1033                 .prepare = 210,
1034                 .enable = 50,
1035                 .unprepare = 160,
1036         },
1037 };
1038
1039 static const struct drm_display_mode cdtech_s043wq26h_ct7_mode = {
1040         .clock = 9000,
1041         .hdisplay = 480,
1042         .hsync_start = 480 + 5,
1043         .hsync_end = 480 + 5 + 5,
1044         .htotal = 480 + 5 + 5 + 40,
1045         .vdisplay = 272,
1046         .vsync_start = 272 + 8,
1047         .vsync_end = 272 + 8 + 8,
1048         .vtotal = 272 + 8 + 8 + 8,
1049         .vrefresh = 60,
1050         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1051 };
1052
1053 static const struct panel_desc cdtech_s043wq26h_ct7 = {
1054         .modes = &cdtech_s043wq26h_ct7_mode,
1055         .num_modes = 1,
1056         .bpc = 8,
1057         .size = {
1058                 .width = 95,
1059                 .height = 54,
1060         },
1061         .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
1062 };
1063
1064 static const struct drm_display_mode cdtech_s070wv95_ct16_mode = {
1065         .clock = 35000,
1066         .hdisplay = 800,
1067         .hsync_start = 800 + 40,
1068         .hsync_end = 800 + 40 + 40,
1069         .htotal = 800 + 40 + 40 + 48,
1070         .vdisplay = 480,
1071         .vsync_start = 480 + 29,
1072         .vsync_end = 480 + 29 + 13,
1073         .vtotal = 480 + 29 + 13 + 3,
1074         .vrefresh = 60,
1075         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1076 };
1077
1078 static const struct panel_desc cdtech_s070wv95_ct16 = {
1079         .modes = &cdtech_s070wv95_ct16_mode,
1080         .num_modes = 1,
1081         .bpc = 8,
1082         .size = {
1083                 .width = 154,
1084                 .height = 85,
1085         },
1086 };
1087
1088 static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
1089         .clock = 66770,
1090         .hdisplay = 800,
1091         .hsync_start = 800 + 49,
1092         .hsync_end = 800 + 49 + 33,
1093         .htotal = 800 + 49 + 33 + 17,
1094         .vdisplay = 1280,
1095         .vsync_start = 1280 + 1,
1096         .vsync_end = 1280 + 1 + 7,
1097         .vtotal = 1280 + 1 + 7 + 15,
1098         .vrefresh = 60,
1099         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1100 };
1101
1102 static const struct panel_desc chunghwa_claa070wp03xg = {
1103         .modes = &chunghwa_claa070wp03xg_mode,
1104         .num_modes = 1,
1105         .bpc = 6,
1106         .size = {
1107                 .width = 94,
1108                 .height = 150,
1109         },
1110 };
1111
1112 static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
1113         .clock = 72070,
1114         .hdisplay = 1366,
1115         .hsync_start = 1366 + 58,
1116         .hsync_end = 1366 + 58 + 58,
1117         .htotal = 1366 + 58 + 58 + 58,
1118         .vdisplay = 768,
1119         .vsync_start = 768 + 4,
1120         .vsync_end = 768 + 4 + 4,
1121         .vtotal = 768 + 4 + 4 + 4,
1122         .vrefresh = 60,
1123 };
1124
1125 static const struct panel_desc chunghwa_claa101wa01a = {
1126         .modes = &chunghwa_claa101wa01a_mode,
1127         .num_modes = 1,
1128         .bpc = 6,
1129         .size = {
1130                 .width = 220,
1131                 .height = 120,
1132         },
1133 };
1134
1135 static const struct drm_display_mode chunghwa_claa101wb01_mode = {
1136         .clock = 69300,
1137         .hdisplay = 1366,
1138         .hsync_start = 1366 + 48,
1139         .hsync_end = 1366 + 48 + 32,
1140         .htotal = 1366 + 48 + 32 + 20,
1141         .vdisplay = 768,
1142         .vsync_start = 768 + 16,
1143         .vsync_end = 768 + 16 + 8,
1144         .vtotal = 768 + 16 + 8 + 16,
1145         .vrefresh = 60,
1146 };
1147
1148 static const struct panel_desc chunghwa_claa101wb01 = {
1149         .modes = &chunghwa_claa101wb01_mode,
1150         .num_modes = 1,
1151         .bpc = 6,
1152         .size = {
1153                 .width = 223,
1154                 .height = 125,
1155         },
1156 };
1157
1158 static const struct drm_display_mode dataimage_scf0700c48ggu18_mode = {
1159         .clock = 33260,
1160         .hdisplay = 800,
1161         .hsync_start = 800 + 40,
1162         .hsync_end = 800 + 40 + 128,
1163         .htotal = 800 + 40 + 128 + 88,
1164         .vdisplay = 480,
1165         .vsync_start = 480 + 10,
1166         .vsync_end = 480 + 10 + 2,
1167         .vtotal = 480 + 10 + 2 + 33,
1168         .vrefresh = 60,
1169         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1170 };
1171
1172 static const struct panel_desc dataimage_scf0700c48ggu18 = {
1173         .modes = &dataimage_scf0700c48ggu18_mode,
1174         .num_modes = 1,
1175         .bpc = 8,
1176         .size = {
1177                 .width = 152,
1178                 .height = 91,
1179         },
1180         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1181         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
1182 };
1183
1184 static const struct display_timing dlc_dlc0700yzg_1_timing = {
1185         .pixelclock = { 45000000, 51200000, 57000000 },
1186         .hactive = { 1024, 1024, 1024 },
1187         .hfront_porch = { 100, 106, 113 },
1188         .hback_porch = { 100, 106, 113 },
1189         .hsync_len = { 100, 108, 114 },
1190         .vactive = { 600, 600, 600 },
1191         .vfront_porch = { 8, 11, 15 },
1192         .vback_porch = { 8, 11, 15 },
1193         .vsync_len = { 9, 13, 15 },
1194         .flags = DISPLAY_FLAGS_DE_HIGH,
1195 };
1196
1197 static const struct panel_desc dlc_dlc0700yzg_1 = {
1198         .timings = &dlc_dlc0700yzg_1_timing,
1199         .num_timings = 1,
1200         .bpc = 6,
1201         .size = {
1202                 .width = 154,
1203                 .height = 86,
1204         },
1205         .delay = {
1206                 .prepare = 30,
1207                 .enable = 200,
1208                 .disable = 200,
1209         },
1210         .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1211         .connector_type = DRM_MODE_CONNECTOR_LVDS,
1212 };
1213
1214 static const struct display_timing dlc_dlc1010gig_timing = {
1215         .pixelclock = { 68900000, 71100000, 73400000 },
1216         .hactive = { 1280, 1280, 1280 },
1217         .hfront_porch = { 43, 53, 63 },
1218         .hback_porch = { 43, 53, 63 },
1219         .hsync_len = { 44, 54, 64 },
1220         .vactive = { 800, 800, 800 },
1221         .vfront_porch = { 5, 8, 11 },
1222         .vback_porch = { 5, 8, 11 },
1223         .vsync_len = { 5, 7, 11 },
1224         .flags = DISPLAY_FLAGS_DE_HIGH,
1225 };
1226
1227 static const struct panel_desc dlc_dlc1010gig = {
1228         .timings = &dlc_dlc1010gig_timing,
1229         .num_timings = 1,
1230         .bpc = 8,
1231         .size = {
1232                 .width = 216,
1233                 .height = 135,
1234         },
1235         .delay = {
1236                 .prepare = 60,
1237                 .enable = 150,
1238                 .disable = 100,
1239                 .unprepare = 60,
1240         },
1241         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1242         .connector_type = DRM_MODE_CONNECTOR_LVDS,
1243 };
1244
1245 static const struct drm_display_mode edt_et035012dm6_mode = {
1246         .clock = 6500,
1247         .hdisplay = 320,
1248         .hsync_start = 320 + 20,
1249         .hsync_end = 320 + 20 + 30,
1250         .htotal = 320 + 20 + 68,
1251         .vdisplay = 240,
1252         .vsync_start = 240 + 4,
1253         .vsync_end = 240 + 4 + 4,
1254         .vtotal = 240 + 4 + 4 + 14,
1255         .vrefresh = 60,
1256         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1257 };
1258
1259 static const struct panel_desc edt_et035012dm6 = {
1260         .modes = &edt_et035012dm6_mode,
1261         .num_modes = 1,
1262         .bpc = 8,
1263         .size = {
1264                 .width = 70,
1265                 .height = 52,
1266         },
1267         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1268         .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
1269 };
1270
1271 static const struct drm_display_mode edt_etm0430g0dh6_mode = {
1272         .clock = 9000,
1273         .hdisplay = 480,
1274         .hsync_start = 480 + 2,
1275         .hsync_end = 480 + 2 + 41,
1276         .htotal = 480 + 2 + 41 + 2,
1277         .vdisplay = 272,
1278         .vsync_start = 272 + 2,
1279         .vsync_end = 272 + 2 + 10,
1280         .vtotal = 272 + 2 + 10 + 2,
1281         .vrefresh = 60,
1282         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1283 };
1284
1285 static const struct panel_desc edt_etm0430g0dh6 = {
1286         .modes = &edt_etm0430g0dh6_mode,
1287         .num_modes = 1,
1288         .bpc = 6,
1289         .size = {
1290                 .width = 95,
1291                 .height = 54,
1292         },
1293 };
1294
1295 static const struct drm_display_mode edt_et057090dhu_mode = {
1296         .clock = 25175,
1297         .hdisplay = 640,
1298         .hsync_start = 640 + 16,
1299         .hsync_end = 640 + 16 + 30,
1300         .htotal = 640 + 16 + 30 + 114,
1301         .vdisplay = 480,
1302         .vsync_start = 480 + 10,
1303         .vsync_end = 480 + 10 + 3,
1304         .vtotal = 480 + 10 + 3 + 32,
1305         .vrefresh = 60,
1306         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1307 };
1308
1309 static const struct panel_desc edt_et057090dhu = {
1310         .modes = &edt_et057090dhu_mode,
1311         .num_modes = 1,
1312         .bpc = 6,
1313         .size = {
1314                 .width = 115,
1315                 .height = 86,
1316         },
1317         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1318         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
1319 };
1320
1321 static const struct drm_display_mode edt_etm0700g0dh6_mode = {
1322         .clock = 33260,
1323         .hdisplay = 800,
1324         .hsync_start = 800 + 40,
1325         .hsync_end = 800 + 40 + 128,
1326         .htotal = 800 + 40 + 128 + 88,
1327         .vdisplay = 480,
1328         .vsync_start = 480 + 10,
1329         .vsync_end = 480 + 10 + 2,
1330         .vtotal = 480 + 10 + 2 + 33,
1331         .vrefresh = 60,
1332         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1333 };
1334
1335 static const struct panel_desc edt_etm0700g0dh6 = {
1336         .modes = &edt_etm0700g0dh6_mode,
1337         .num_modes = 1,
1338         .bpc = 6,
1339         .size = {
1340                 .width = 152,
1341                 .height = 91,
1342         },
1343         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1344         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
1345 };
1346
1347 static const struct panel_desc edt_etm0700g0bdh6 = {
1348         .modes = &edt_etm0700g0dh6_mode,
1349         .num_modes = 1,
1350         .bpc = 6,
1351         .size = {
1352                 .width = 152,
1353                 .height = 91,
1354         },
1355         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1356         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
1357 };
1358
1359 static const struct display_timing evervision_vgg804821_timing = {
1360         .pixelclock = { 27600000, 33300000, 50000000 },
1361         .hactive = { 800, 800, 800 },
1362         .hfront_porch = { 40, 66, 70 },
1363         .hback_porch = { 40, 67, 70 },
1364         .hsync_len = { 40, 67, 70 },
1365         .vactive = { 480, 480, 480 },
1366         .vfront_porch = { 6, 10, 10 },
1367         .vback_porch = { 7, 11, 11 },
1368         .vsync_len = { 7, 11, 11 },
1369         .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH |
1370                  DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
1371                  DISPLAY_FLAGS_SYNC_NEGEDGE,
1372 };
1373
1374 static const struct panel_desc evervision_vgg804821 = {
1375         .timings = &evervision_vgg804821_timing,
1376         .num_timings = 1,
1377         .bpc = 8,
1378         .size = {
1379                 .width = 108,
1380                 .height = 64,
1381         },
1382         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1383         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
1384 };
1385
1386 static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
1387         .clock = 32260,
1388         .hdisplay = 800,
1389         .hsync_start = 800 + 168,
1390         .hsync_end = 800 + 168 + 64,
1391         .htotal = 800 + 168 + 64 + 88,
1392         .vdisplay = 480,
1393         .vsync_start = 480 + 37,
1394         .vsync_end = 480 + 37 + 2,
1395         .vtotal = 480 + 37 + 2 + 8,
1396         .vrefresh = 60,
1397 };
1398
1399 static const struct panel_desc foxlink_fl500wvr00_a0t = {
1400         .modes = &foxlink_fl500wvr00_a0t_mode,
1401         .num_modes = 1,
1402         .bpc = 8,
1403         .size = {
1404                 .width = 108,
1405                 .height = 65,
1406         },
1407         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1408 };
1409
1410 static const struct drm_display_mode friendlyarm_hd702e_mode = {
1411         .clock          = 67185,
1412         .hdisplay       = 800,
1413         .hsync_start    = 800 + 20,
1414         .hsync_end      = 800 + 20 + 24,
1415         .htotal         = 800 + 20 + 24 + 20,
1416         .vdisplay       = 1280,
1417         .vsync_start    = 1280 + 4,
1418         .vsync_end      = 1280 + 4 + 8,
1419         .vtotal         = 1280 + 4 + 8 + 4,
1420         .vrefresh       = 60,
1421         .flags          = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1422 };
1423
1424 static const struct panel_desc friendlyarm_hd702e = {
1425         .modes = &friendlyarm_hd702e_mode,
1426         .num_modes = 1,
1427         .size = {
1428                 .width  = 94,
1429                 .height = 151,
1430         },
1431 };
1432
1433 static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
1434         .clock = 9000,
1435         .hdisplay = 480,
1436         .hsync_start = 480 + 5,
1437         .hsync_end = 480 + 5 + 1,
1438         .htotal = 480 + 5 + 1 + 40,
1439         .vdisplay = 272,
1440         .vsync_start = 272 + 8,
1441         .vsync_end = 272 + 8 + 1,
1442         .vtotal = 272 + 8 + 1 + 8,
1443         .vrefresh = 60,
1444 };
1445
1446 static const struct panel_desc giantplus_gpg482739qs5 = {
1447         .modes = &giantplus_gpg482739qs5_mode,
1448         .num_modes = 1,
1449         .bpc = 8,
1450         .size = {
1451                 .width = 95,
1452                 .height = 54,
1453         },
1454         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1455 };
1456
1457 static const struct display_timing giantplus_gpm940b0_timing = {
1458         .pixelclock = { 13500000, 27000000, 27500000 },
1459         .hactive = { 320, 320, 320 },
1460         .hfront_porch = { 14, 686, 718 },
1461         .hback_porch = { 50, 70, 255 },
1462         .hsync_len = { 1, 1, 1 },
1463         .vactive = { 240, 240, 240 },
1464         .vfront_porch = { 1, 1, 179 },
1465         .vback_porch = { 1, 21, 31 },
1466         .vsync_len = { 1, 1, 6 },
1467         .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
1468 };
1469
1470 static const struct panel_desc giantplus_gpm940b0 = {
1471         .timings = &giantplus_gpm940b0_timing,
1472         .num_timings = 1,
1473         .bpc = 8,
1474         .size = {
1475                 .width = 60,
1476                 .height = 45,
1477         },
1478         .bus_format = MEDIA_BUS_FMT_RGB888_3X8,
1479         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
1480 };
1481
1482 static const struct display_timing hannstar_hsd070pww1_timing = {
1483         .pixelclock = { 64300000, 71100000, 82000000 },
1484         .hactive = { 1280, 1280, 1280 },
1485         .hfront_porch = { 1, 1, 10 },
1486         .hback_porch = { 1, 1, 10 },
1487         /*
1488          * According to the data sheet, the minimum horizontal blanking interval
1489          * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
1490          * minimum working horizontal blanking interval to be 60 clocks.
1491          */
1492         .hsync_len = { 58, 158, 661 },
1493         .vactive = { 800, 800, 800 },
1494         .vfront_porch = { 1, 1, 10 },
1495         .vback_porch = { 1, 1, 10 },
1496         .vsync_len = { 1, 21, 203 },
1497         .flags = DISPLAY_FLAGS_DE_HIGH,
1498 };
1499
1500 static const struct panel_desc hannstar_hsd070pww1 = {
1501         .timings = &hannstar_hsd070pww1_timing,
1502         .num_timings = 1,
1503         .bpc = 6,
1504         .size = {
1505                 .width = 151,
1506                 .height = 94,
1507         },
1508         .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1509         .connector_type = DRM_MODE_CONNECTOR_LVDS,
1510 };
1511
1512 static const struct display_timing hannstar_hsd100pxn1_timing = {
1513         .pixelclock = { 55000000, 65000000, 75000000 },
1514         .hactive = { 1024, 1024, 1024 },
1515         .hfront_porch = { 40, 40, 40 },
1516         .hback_porch = { 220, 220, 220 },
1517         .hsync_len = { 20, 60, 100 },
1518         .vactive = { 768, 768, 768 },
1519         .vfront_porch = { 7, 7, 7 },
1520         .vback_porch = { 21, 21, 21 },
1521         .vsync_len = { 10, 10, 10 },
1522         .flags = DISPLAY_FLAGS_DE_HIGH,
1523 };
1524
1525 static const struct panel_desc hannstar_hsd100pxn1 = {
1526         .timings = &hannstar_hsd100pxn1_timing,
1527         .num_timings = 1,
1528         .bpc = 6,
1529         .size = {
1530                 .width = 203,
1531                 .height = 152,
1532         },
1533         .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1534         .connector_type = DRM_MODE_CONNECTOR_LVDS,
1535 };
1536
1537 static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
1538         .clock = 33333,
1539         .hdisplay = 800,
1540         .hsync_start = 800 + 85,
1541         .hsync_end = 800 + 85 + 86,
1542         .htotal = 800 + 85 + 86 + 85,
1543         .vdisplay = 480,
1544         .vsync_start = 480 + 16,
1545         .vsync_end = 480 + 16 + 13,
1546         .vtotal = 480 + 16 + 13 + 16,
1547         .vrefresh = 60,
1548 };
1549
1550 static const struct panel_desc hitachi_tx23d38vm0caa = {
1551         .modes = &hitachi_tx23d38vm0caa_mode,
1552         .num_modes = 1,
1553         .bpc = 6,
1554         .size = {
1555                 .width = 195,
1556                 .height = 117,
1557         },
1558         .delay = {
1559                 .enable = 160,
1560                 .disable = 160,
1561         },
1562 };
1563
1564 static const struct drm_display_mode innolux_at043tn24_mode = {
1565         .clock = 9000,
1566         .hdisplay = 480,
1567         .hsync_start = 480 + 2,
1568         .hsync_end = 480 + 2 + 41,
1569         .htotal = 480 + 2 + 41 + 2,
1570         .vdisplay = 272,
1571         .vsync_start = 272 + 2,
1572         .vsync_end = 272 + 2 + 10,
1573         .vtotal = 272 + 2 + 10 + 2,
1574         .vrefresh = 60,
1575         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1576 };
1577
1578 static const struct panel_desc innolux_at043tn24 = {
1579         .modes = &innolux_at043tn24_mode,
1580         .num_modes = 1,
1581         .bpc = 8,
1582         .size = {
1583                 .width = 95,
1584                 .height = 54,
1585         },
1586         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1587         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
1588 };
1589
1590 static const struct drm_display_mode innolux_at070tn92_mode = {
1591         .clock = 33333,
1592         .hdisplay = 800,
1593         .hsync_start = 800 + 210,
1594         .hsync_end = 800 + 210 + 20,
1595         .htotal = 800 + 210 + 20 + 46,
1596         .vdisplay = 480,
1597         .vsync_start = 480 + 22,
1598         .vsync_end = 480 + 22 + 10,
1599         .vtotal = 480 + 22 + 23 + 10,
1600         .vrefresh = 60,
1601 };
1602
1603 static const struct panel_desc innolux_at070tn92 = {
1604         .modes = &innolux_at070tn92_mode,
1605         .num_modes = 1,
1606         .size = {
1607                 .width = 154,
1608                 .height = 86,
1609         },
1610         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1611 };
1612
1613 static const struct display_timing innolux_g070y2_l01_timing = {
1614         .pixelclock = { 28000000, 29500000, 32000000 },
1615         .hactive = { 800, 800, 800 },
1616         .hfront_porch = { 61, 91, 141 },
1617         .hback_porch = { 60, 90, 140 },
1618         .hsync_len = { 12, 12, 12 },
1619         .vactive = { 480, 480, 480 },
1620         .vfront_porch = { 4, 9, 30 },
1621         .vback_porch = { 4, 8, 28 },
1622         .vsync_len = { 2, 2, 2 },
1623         .flags = DISPLAY_FLAGS_DE_HIGH,
1624 };
1625
1626 static const struct panel_desc innolux_g070y2_l01 = {
1627         .timings = &innolux_g070y2_l01_timing,
1628         .num_timings = 1,
1629         .bpc = 6,
1630         .size = {
1631                 .width = 152,
1632                 .height = 91,
1633         },
1634         .delay = {
1635                 .prepare = 10,
1636                 .enable = 100,
1637                 .disable = 100,
1638                 .unprepare = 800,
1639         },
1640         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1641         .connector_type = DRM_MODE_CONNECTOR_LVDS,
1642 };
1643
1644 static const struct display_timing innolux_g101ice_l01_timing = {
1645         .pixelclock = { 60400000, 71100000, 74700000 },
1646         .hactive = { 1280, 1280, 1280 },
1647         .hfront_porch = { 41, 80, 100 },
1648         .hback_porch = { 40, 79, 99 },
1649         .hsync_len = { 1, 1, 1 },
1650         .vactive = { 800, 800, 800 },
1651         .vfront_porch = { 5, 11, 14 },
1652         .vback_porch = { 4, 11, 14 },
1653         .vsync_len = { 1, 1, 1 },
1654         .flags = DISPLAY_FLAGS_DE_HIGH,
1655 };
1656
1657 static const struct panel_desc innolux_g101ice_l01 = {
1658         .timings = &innolux_g101ice_l01_timing,
1659         .num_timings = 1,
1660         .bpc = 8,
1661         .size = {
1662                 .width = 217,
1663                 .height = 135,
1664         },
1665         .delay = {
1666                 .enable = 200,
1667                 .disable = 200,
1668         },
1669         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1670         .connector_type = DRM_MODE_CONNECTOR_LVDS,
1671 };
1672
1673 static const struct display_timing innolux_g121i1_l01_timing = {
1674         .pixelclock = { 67450000, 71000000, 74550000 },
1675         .hactive = { 1280, 1280, 1280 },
1676         .hfront_porch = { 40, 80, 160 },
1677         .hback_porch = { 39, 79, 159 },
1678         .hsync_len = { 1, 1, 1 },
1679         .vactive = { 800, 800, 800 },
1680         .vfront_porch = { 5, 11, 100 },
1681         .vback_porch = { 4, 11, 99 },
1682         .vsync_len = { 1, 1, 1 },
1683 };
1684
1685 static const struct panel_desc innolux_g121i1_l01 = {
1686         .timings = &innolux_g121i1_l01_timing,
1687         .num_timings = 1,
1688         .bpc = 6,
1689         .size = {
1690                 .width = 261,
1691                 .height = 163,
1692         },
1693         .delay = {
1694                 .enable = 200,
1695                 .disable = 20,
1696         },
1697         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1698         .connector_type = DRM_MODE_CONNECTOR_LVDS,
1699 };
1700
1701 static const struct drm_display_mode innolux_g121x1_l03_mode = {
1702         .clock = 65000,
1703         .hdisplay = 1024,
1704         .hsync_start = 1024 + 0,
1705         .hsync_end = 1024 + 1,
1706         .htotal = 1024 + 0 + 1 + 320,
1707         .vdisplay = 768,
1708         .vsync_start = 768 + 38,
1709         .vsync_end = 768 + 38 + 1,
1710         .vtotal = 768 + 38 + 1 + 0,
1711         .vrefresh = 60,
1712         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1713 };
1714
1715 static const struct panel_desc innolux_g121x1_l03 = {
1716         .modes = &innolux_g121x1_l03_mode,
1717         .num_modes = 1,
1718         .bpc = 6,
1719         .size = {
1720                 .width = 246,
1721                 .height = 185,
1722         },
1723         .delay = {
1724                 .enable = 200,
1725                 .unprepare = 200,
1726                 .disable = 400,
1727         },
1728 };
1729
1730 /*
1731  * Datasheet specifies that at 60 Hz refresh rate:
1732  * - total horizontal time: { 1506, 1592, 1716 }
1733  * - total vertical time: { 788, 800, 868 }
1734  *
1735  * ...but doesn't go into exactly how that should be split into a front
1736  * porch, back porch, or sync length.  For now we'll leave a single setting
1737  * here which allows a bit of tweaking of the pixel clock at the expense of
1738  * refresh rate.
1739  */
1740 static const struct display_timing innolux_n116bge_timing = {
1741         .pixelclock = { 72600000, 76420000, 80240000 },
1742         .hactive = { 1366, 1366, 1366 },
1743         .hfront_porch = { 136, 136, 136 },
1744         .hback_porch = { 60, 60, 60 },
1745         .hsync_len = { 30, 30, 30 },
1746         .vactive = { 768, 768, 768 },
1747         .vfront_porch = { 8, 8, 8 },
1748         .vback_porch = { 12, 12, 12 },
1749         .vsync_len = { 12, 12, 12 },
1750         .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
1751 };
1752
1753 static const struct panel_desc innolux_n116bge = {
1754         .timings = &innolux_n116bge_timing,
1755         .num_timings = 1,
1756         .bpc = 6,
1757         .size = {
1758                 .width = 256,
1759                 .height = 144,
1760         },
1761 };
1762
1763 static const struct drm_display_mode innolux_n156bge_l21_mode = {
1764         .clock = 69300,
1765         .hdisplay = 1366,
1766         .hsync_start = 1366 + 16,
1767         .hsync_end = 1366 + 16 + 34,
1768         .htotal = 1366 + 16 + 34 + 50,
1769         .vdisplay = 768,
1770         .vsync_start = 768 + 2,
1771         .vsync_end = 768 + 2 + 6,
1772         .vtotal = 768 + 2 + 6 + 12,
1773         .vrefresh = 60,
1774 };
1775
1776 static const struct panel_desc innolux_n156bge_l21 = {
1777         .modes = &innolux_n156bge_l21_mode,
1778         .num_modes = 1,
1779         .bpc = 6,
1780         .size = {
1781                 .width = 344,
1782                 .height = 193,
1783         },
1784 };
1785
1786 static const struct drm_display_mode innolux_p120zdg_bf1_mode = {
1787         .clock = 206016,
1788         .hdisplay = 2160,
1789         .hsync_start = 2160 + 48,
1790         .hsync_end = 2160 + 48 + 32,
1791         .htotal = 2160 + 48 + 32 + 80,
1792         .vdisplay = 1440,
1793         .vsync_start = 1440 + 3,
1794         .vsync_end = 1440 + 3 + 10,
1795         .vtotal = 1440 + 3 + 10 + 27,
1796         .vrefresh = 60,
1797         .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
1798 };
1799
1800 static const struct panel_desc innolux_p120zdg_bf1 = {
1801         .modes = &innolux_p120zdg_bf1_mode,
1802         .num_modes = 1,
1803         .bpc = 8,
1804         .size = {
1805                 .width = 254,
1806                 .height = 169,
1807         },
1808         .delay = {
1809                 .hpd_absent_delay = 200,
1810                 .unprepare = 500,
1811         },
1812 };
1813
1814 static const struct drm_display_mode innolux_zj070na_01p_mode = {
1815         .clock = 51501,
1816         .hdisplay = 1024,
1817         .hsync_start = 1024 + 128,
1818         .hsync_end = 1024 + 128 + 64,
1819         .htotal = 1024 + 128 + 64 + 128,
1820         .vdisplay = 600,
1821         .vsync_start = 600 + 16,
1822         .vsync_end = 600 + 16 + 4,
1823         .vtotal = 600 + 16 + 4 + 16,
1824         .vrefresh = 60,
1825 };
1826
1827 static const struct panel_desc innolux_zj070na_01p = {
1828         .modes = &innolux_zj070na_01p_mode,
1829         .num_modes = 1,
1830         .bpc = 6,
1831         .size = {
1832                 .width = 154,
1833                 .height = 90,
1834         },
1835 };
1836
1837 static const struct display_timing koe_tx14d24vm1bpa_timing = {
1838         .pixelclock = { 5580000, 5850000, 6200000 },
1839         .hactive = { 320, 320, 320 },
1840         .hfront_porch = { 30, 30, 30 },
1841         .hback_porch = { 30, 30, 30 },
1842         .hsync_len = { 1, 5, 17 },
1843         .vactive = { 240, 240, 240 },
1844         .vfront_porch = { 6, 6, 6 },
1845         .vback_porch = { 5, 5, 5 },
1846         .vsync_len = { 1, 2, 11 },
1847         .flags = DISPLAY_FLAGS_DE_HIGH,
1848 };
1849
1850 static const struct panel_desc koe_tx14d24vm1bpa = {
1851         .timings = &koe_tx14d24vm1bpa_timing,
1852         .num_timings = 1,
1853         .bpc = 6,
1854         .size = {
1855                 .width = 115,
1856                 .height = 86,
1857         },
1858 };
1859
1860 static const struct display_timing koe_tx31d200vm0baa_timing = {
1861         .pixelclock = { 39600000, 43200000, 48000000 },
1862         .hactive = { 1280, 1280, 1280 },
1863         .hfront_porch = { 16, 36, 56 },
1864         .hback_porch = { 16, 36, 56 },
1865         .hsync_len = { 8, 8, 8 },
1866         .vactive = { 480, 480, 480 },
1867         .vfront_porch = { 6, 21, 33 },
1868         .vback_porch = { 6, 21, 33 },
1869         .vsync_len = { 8, 8, 8 },
1870         .flags = DISPLAY_FLAGS_DE_HIGH,
1871 };
1872
1873 static const struct panel_desc koe_tx31d200vm0baa = {
1874         .timings = &koe_tx31d200vm0baa_timing,
1875         .num_timings = 1,
1876         .bpc = 6,
1877         .size = {
1878                 .width = 292,
1879                 .height = 109,
1880         },
1881         .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1882         .connector_type = DRM_MODE_CONNECTOR_LVDS,
1883 };
1884
1885 static const struct display_timing kyo_tcg121xglp_timing = {
1886         .pixelclock = { 52000000, 65000000, 71000000 },
1887         .hactive = { 1024, 1024, 1024 },
1888         .hfront_porch = { 2, 2, 2 },
1889         .hback_porch = { 2, 2, 2 },
1890         .hsync_len = { 86, 124, 244 },
1891         .vactive = { 768, 768, 768 },
1892         .vfront_porch = { 2, 2, 2 },
1893         .vback_porch = { 2, 2, 2 },
1894         .vsync_len = { 6, 34, 73 },
1895         .flags = DISPLAY_FLAGS_DE_HIGH,
1896 };
1897
1898 static const struct panel_desc kyo_tcg121xglp = {
1899         .timings = &kyo_tcg121xglp_timing,
1900         .num_timings = 1,
1901         .bpc = 8,
1902         .size = {
1903                 .width = 246,
1904                 .height = 184,
1905         },
1906         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1907         .connector_type = DRM_MODE_CONNECTOR_LVDS,
1908 };
1909
1910 static const struct drm_display_mode lemaker_bl035_rgb_002_mode = {
1911         .clock = 7000,
1912         .hdisplay = 320,
1913         .hsync_start = 320 + 20,
1914         .hsync_end = 320 + 20 + 30,
1915         .htotal = 320 + 20 + 30 + 38,
1916         .vdisplay = 240,
1917         .vsync_start = 240 + 4,
1918         .vsync_end = 240 + 4 + 3,
1919         .vtotal = 240 + 4 + 3 + 15,
1920         .vrefresh = 60,
1921 };
1922
1923 static const struct panel_desc lemaker_bl035_rgb_002 = {
1924         .modes = &lemaker_bl035_rgb_002_mode,
1925         .num_modes = 1,
1926         .size = {
1927                 .width = 70,
1928                 .height = 52,
1929         },
1930         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1931         .bus_flags = DRM_BUS_FLAG_DE_LOW,
1932 };
1933
1934 static const struct drm_display_mode lg_lb070wv8_mode = {
1935         .clock = 33246,
1936         .hdisplay = 800,
1937         .hsync_start = 800 + 88,
1938         .hsync_end = 800 + 88 + 80,
1939         .htotal = 800 + 88 + 80 + 88,
1940         .vdisplay = 480,
1941         .vsync_start = 480 + 10,
1942         .vsync_end = 480 + 10 + 25,
1943         .vtotal = 480 + 10 + 25 + 10,
1944         .vrefresh = 60,
1945 };
1946
1947 static const struct panel_desc lg_lb070wv8 = {
1948         .modes = &lg_lb070wv8_mode,
1949         .num_modes = 1,
1950         .bpc = 16,
1951         .size = {
1952                 .width = 151,
1953                 .height = 91,
1954         },
1955         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1956         .connector_type = DRM_MODE_CONNECTOR_LVDS,
1957 };
1958
1959 static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1960         .clock = 200000,
1961         .hdisplay = 1536,
1962         .hsync_start = 1536 + 12,
1963         .hsync_end = 1536 + 12 + 16,
1964         .htotal = 1536 + 12 + 16 + 48,
1965         .vdisplay = 2048,
1966         .vsync_start = 2048 + 8,
1967         .vsync_end = 2048 + 8 + 4,
1968         .vtotal = 2048 + 8 + 4 + 8,
1969         .vrefresh = 60,
1970         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1971 };
1972
1973 static const struct panel_desc lg_lp079qx1_sp0v = {
1974         .modes = &lg_lp079qx1_sp0v_mode,
1975         .num_modes = 1,
1976         .size = {
1977                 .width = 129,
1978                 .height = 171,
1979         },
1980 };
1981
1982 static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1983         .clock = 205210,
1984         .hdisplay = 2048,
1985         .hsync_start = 2048 + 150,
1986         .hsync_end = 2048 + 150 + 5,
1987         .htotal = 2048 + 150 + 5 + 5,
1988         .vdisplay = 1536,
1989         .vsync_start = 1536 + 3,
1990         .vsync_end = 1536 + 3 + 1,
1991         .vtotal = 1536 + 3 + 1 + 9,
1992         .vrefresh = 60,
1993 };
1994
1995 static const struct panel_desc lg_lp097qx1_spa1 = {
1996         .modes = &lg_lp097qx1_spa1_mode,
1997         .num_modes = 1,
1998         .size = {
1999                 .width = 208,
2000                 .height = 147,
2001         },
2002 };
2003
2004 static const struct drm_display_mode lg_lp120up1_mode = {
2005         .clock = 162300,
2006         .hdisplay = 1920,
2007         .hsync_start = 1920 + 40,
2008         .hsync_end = 1920 + 40 + 40,
2009         .htotal = 1920 + 40 + 40+ 80,
2010         .vdisplay = 1280,
2011         .vsync_start = 1280 + 4,
2012         .vsync_end = 1280 + 4 + 4,
2013         .vtotal = 1280 + 4 + 4 + 12,
2014         .vrefresh = 60,
2015 };
2016
2017 static const struct panel_desc lg_lp120up1 = {
2018         .modes = &lg_lp120up1_mode,
2019         .num_modes = 1,
2020         .bpc = 8,
2021         .size = {
2022                 .width = 267,
2023                 .height = 183,
2024         },
2025 };
2026
2027 static const struct drm_display_mode lg_lp129qe_mode = {
2028         .clock = 285250,
2029         .hdisplay = 2560,
2030         .hsync_start = 2560 + 48,
2031         .hsync_end = 2560 + 48 + 32,
2032         .htotal = 2560 + 48 + 32 + 80,
2033         .vdisplay = 1700,
2034         .vsync_start = 1700 + 3,
2035         .vsync_end = 1700 + 3 + 10,
2036         .vtotal = 1700 + 3 + 10 + 36,
2037         .vrefresh = 60,
2038 };
2039
2040 static const struct panel_desc lg_lp129qe = {
2041         .modes = &lg_lp129qe_mode,
2042         .num_modes = 1,
2043         .bpc = 8,
2044         .size = {
2045                 .width = 272,
2046                 .height = 181,
2047         },
2048 };
2049
2050 static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
2051         .clock = 30400,
2052         .hdisplay = 800,
2053         .hsync_start = 800 + 0,
2054         .hsync_end = 800 + 1,
2055         .htotal = 800 + 0 + 1 + 160,
2056         .vdisplay = 480,
2057         .vsync_start = 480 + 0,
2058         .vsync_end = 480 + 48 + 1,
2059         .vtotal = 480 + 48 + 1 + 0,
2060         .vrefresh = 60,
2061         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2062 };
2063
2064 static const struct panel_desc mitsubishi_aa070mc01 = {
2065         .modes = &mitsubishi_aa070mc01_mode,
2066         .num_modes = 1,
2067         .bpc = 8,
2068         .size = {
2069                 .width = 152,
2070                 .height = 91,
2071         },
2072
2073         .delay = {
2074                 .enable = 200,
2075                 .unprepare = 200,
2076                 .disable = 400,
2077         },
2078         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2079         .connector_type = DRM_MODE_CONNECTOR_LVDS,
2080         .bus_flags = DRM_BUS_FLAG_DE_HIGH,
2081 };
2082
2083 static const struct display_timing nec_nl12880bc20_05_timing = {
2084         .pixelclock = { 67000000, 71000000, 75000000 },
2085         .hactive = { 1280, 1280, 1280 },
2086         .hfront_porch = { 2, 30, 30 },
2087         .hback_porch = { 6, 100, 100 },
2088         .hsync_len = { 2, 30, 30 },
2089         .vactive = { 800, 800, 800 },
2090         .vfront_porch = { 5, 5, 5 },
2091         .vback_porch = { 11, 11, 11 },
2092         .vsync_len = { 7, 7, 7 },
2093 };
2094
2095 static const struct panel_desc nec_nl12880bc20_05 = {
2096         .timings = &nec_nl12880bc20_05_timing,
2097         .num_timings = 1,
2098         .bpc = 8,
2099         .size = {
2100                 .width = 261,
2101                 .height = 163,
2102         },
2103         .delay = {
2104                 .enable = 50,
2105                 .disable = 50,
2106         },
2107         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2108         .connector_type = DRM_MODE_CONNECTOR_LVDS,
2109 };
2110
2111 static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
2112         .clock = 10870,
2113         .hdisplay = 480,
2114         .hsync_start = 480 + 2,
2115         .hsync_end = 480 + 2 + 41,
2116         .htotal = 480 + 2 + 41 + 2,
2117         .vdisplay = 272,
2118         .vsync_start = 272 + 2,
2119         .vsync_end = 272 + 2 + 4,
2120         .vtotal = 272 + 2 + 4 + 2,
2121         .vrefresh = 74,
2122         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2123 };
2124
2125 static const struct panel_desc nec_nl4827hc19_05b = {
2126         .modes = &nec_nl4827hc19_05b_mode,
2127         .num_modes = 1,
2128         .bpc = 8,
2129         .size = {
2130                 .width = 95,
2131                 .height = 54,
2132         },
2133         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2134         .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
2135 };
2136
2137 static const struct drm_display_mode netron_dy_e231732_mode = {
2138         .clock = 66000,
2139         .hdisplay = 1024,
2140         .hsync_start = 1024 + 160,
2141         .hsync_end = 1024 + 160 + 70,
2142         .htotal = 1024 + 160 + 70 + 90,
2143         .vdisplay = 600,
2144         .vsync_start = 600 + 127,
2145         .vsync_end = 600 + 127 + 20,
2146         .vtotal = 600 + 127 + 20 + 3,
2147         .vrefresh = 60,
2148 };
2149
2150 static const struct panel_desc netron_dy_e231732 = {
2151         .modes = &netron_dy_e231732_mode,
2152         .num_modes = 1,
2153         .size = {
2154                 .width = 154,
2155                 .height = 87,
2156         },
2157         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2158 };
2159
2160 static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
2161         .clock = 9000,
2162         .hdisplay = 480,
2163         .hsync_start = 480 + 2,
2164         .hsync_end = 480 + 2 + 41,
2165         .htotal = 480 + 2 + 41 + 2,
2166         .vdisplay = 272,
2167         .vsync_start = 272 + 2,
2168         .vsync_end = 272 + 2 + 10,
2169         .vtotal = 272 + 2 + 10 + 2,
2170         .vrefresh = 60,
2171         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2172 };
2173
2174 static const struct panel_desc newhaven_nhd_43_480272ef_atxl = {
2175         .modes = &newhaven_nhd_43_480272ef_atxl_mode,
2176         .num_modes = 1,
2177         .bpc = 8,
2178         .size = {
2179                 .width = 95,
2180                 .height = 54,
2181         },
2182         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2183         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
2184                      DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
2185 };
2186
2187 static const struct display_timing nlt_nl192108ac18_02d_timing = {
2188         .pixelclock = { 130000000, 148350000, 163000000 },
2189         .hactive = { 1920, 1920, 1920 },
2190         .hfront_porch = { 80, 100, 100 },
2191         .hback_porch = { 100, 120, 120 },
2192         .hsync_len = { 50, 60, 60 },
2193         .vactive = { 1080, 1080, 1080 },
2194         .vfront_porch = { 12, 30, 30 },
2195         .vback_porch = { 4, 10, 10 },
2196         .vsync_len = { 4, 5, 5 },
2197 };
2198
2199 static const struct panel_desc nlt_nl192108ac18_02d = {
2200         .timings = &nlt_nl192108ac18_02d_timing,
2201         .num_timings = 1,
2202         .bpc = 8,
2203         .size = {
2204                 .width = 344,
2205                 .height = 194,
2206         },
2207         .delay = {
2208                 .unprepare = 500,
2209         },
2210         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2211         .connector_type = DRM_MODE_CONNECTOR_LVDS,
2212 };
2213
2214 static const struct drm_display_mode nvd_9128_mode = {
2215         .clock = 29500,
2216         .hdisplay = 800,
2217         .hsync_start = 800 + 130,
2218         .hsync_end = 800 + 130 + 98,
2219         .htotal = 800 + 0 + 130 + 98,
2220         .vdisplay = 480,
2221         .vsync_start = 480 + 10,
2222         .vsync_end = 480 + 10 + 50,
2223         .vtotal = 480 + 0 + 10 + 50,
2224 };
2225
2226 static const struct panel_desc nvd_9128 = {
2227         .modes = &nvd_9128_mode,
2228         .num_modes = 1,
2229         .bpc = 8,
2230         .size = {
2231                 .width = 156,
2232                 .height = 88,
2233         },
2234         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2235         .connector_type = DRM_MODE_CONNECTOR_LVDS,
2236 };
2237
2238 static const struct display_timing okaya_rs800480t_7x0gp_timing = {
2239         .pixelclock = { 30000000, 30000000, 40000000 },
2240         .hactive = { 800, 800, 800 },
2241         .hfront_porch = { 40, 40, 40 },
2242         .hback_porch = { 40, 40, 40 },
2243         .hsync_len = { 1, 48, 48 },
2244         .vactive = { 480, 480, 480 },
2245         .vfront_porch = { 13, 13, 13 },
2246         .vback_porch = { 29, 29, 29 },
2247         .vsync_len = { 3, 3, 3 },
2248         .flags = DISPLAY_FLAGS_DE_HIGH,
2249 };
2250
2251 static const struct panel_desc okaya_rs800480t_7x0gp = {
2252         .timings = &okaya_rs800480t_7x0gp_timing,
2253         .num_timings = 1,
2254         .bpc = 6,
2255         .size = {
2256                 .width = 154,
2257                 .height = 87,
2258         },
2259         .delay = {
2260                 .prepare = 41,
2261                 .enable = 50,
2262                 .unprepare = 41,
2263                 .disable = 50,
2264         },
2265         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2266 };
2267
2268 static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
2269         .clock = 9000,
2270         .hdisplay = 480,
2271         .hsync_start = 480 + 5,
2272         .hsync_end = 480 + 5 + 30,
2273         .htotal = 480 + 5 + 30 + 10,
2274         .vdisplay = 272,
2275         .vsync_start = 272 + 8,
2276         .vsync_end = 272 + 8 + 5,
2277         .vtotal = 272 + 8 + 5 + 3,
2278         .vrefresh = 60,
2279 };
2280
2281 static const struct panel_desc olimex_lcd_olinuxino_43ts = {
2282         .modes = &olimex_lcd_olinuxino_43ts_mode,
2283         .num_modes = 1,
2284         .size = {
2285                 .width = 95,
2286                 .height = 54,
2287         },
2288         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2289 };
2290
2291 /*
2292  * 800x480 CVT. The panel appears to be quite accepting, at least as far as
2293  * pixel clocks, but this is the timing that was being used in the Adafruit
2294  * installation instructions.
2295  */
2296 static const struct drm_display_mode ontat_yx700wv03_mode = {
2297         .clock = 29500,
2298         .hdisplay = 800,
2299         .hsync_start = 824,
2300         .hsync_end = 896,
2301         .htotal = 992,
2302         .vdisplay = 480,
2303         .vsync_start = 483,
2304         .vsync_end = 493,
2305         .vtotal = 500,
2306         .vrefresh = 60,
2307         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2308 };
2309
2310 /*
2311  * Specification at:
2312  * https://www.adafruit.com/images/product-files/2406/c3163.pdf
2313  */
2314 static const struct panel_desc ontat_yx700wv03 = {
2315         .modes = &ontat_yx700wv03_mode,
2316         .num_modes = 1,
2317         .bpc = 8,
2318         .size = {
2319                 .width = 154,
2320                 .height = 83,
2321         },
2322         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2323 };
2324
2325 static const struct drm_display_mode ortustech_com37h3m_mode  = {
2326         .clock = 22153,
2327         .hdisplay = 480,
2328         .hsync_start = 480 + 8,
2329         .hsync_end = 480 + 8 + 10,
2330         .htotal = 480 + 8 + 10 + 10,
2331         .vdisplay = 640,
2332         .vsync_start = 640 + 4,
2333         .vsync_end = 640 + 4 + 3,
2334         .vtotal = 640 + 4 + 3 + 4,
2335         .vrefresh = 60,
2336         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2337 };
2338
2339 static const struct panel_desc ortustech_com37h3m = {
2340         .modes = &ortustech_com37h3m_mode,
2341         .num_modes = 1,
2342         .bpc = 8,
2343         .size = {
2344                 .width = 56,    /* 56.16mm */
2345                 .height = 75,   /* 74.88mm */
2346         },
2347         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2348         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE |
2349                      DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
2350 };
2351
2352 static const struct drm_display_mode ortustech_com43h4m85ulc_mode  = {
2353         .clock = 25000,
2354         .hdisplay = 480,
2355         .hsync_start = 480 + 10,
2356         .hsync_end = 480 + 10 + 10,
2357         .htotal = 480 + 10 + 10 + 15,
2358         .vdisplay = 800,
2359         .vsync_start = 800 + 3,
2360         .vsync_end = 800 + 3 + 3,
2361         .vtotal = 800 + 3 + 3 + 3,
2362         .vrefresh = 60,
2363 };
2364
2365 static const struct panel_desc ortustech_com43h4m85ulc = {
2366         .modes = &ortustech_com43h4m85ulc_mode,
2367         .num_modes = 1,
2368         .bpc = 8,
2369         .size = {
2370                 .width = 56,
2371                 .height = 93,
2372         },
2373         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2374         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
2375 };
2376
2377 static const struct drm_display_mode osddisplays_osd070t1718_19ts_mode  = {
2378         .clock = 33000,
2379         .hdisplay = 800,
2380         .hsync_start = 800 + 210,
2381         .hsync_end = 800 + 210 + 30,
2382         .htotal = 800 + 210 + 30 + 16,
2383         .vdisplay = 480,
2384         .vsync_start = 480 + 22,
2385         .vsync_end = 480 + 22 + 13,
2386         .vtotal = 480 + 22 + 13 + 10,
2387         .vrefresh = 60,
2388         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2389 };
2390
2391 static const struct panel_desc osddisplays_osd070t1718_19ts = {
2392         .modes = &osddisplays_osd070t1718_19ts_mode,
2393         .num_modes = 1,
2394         .bpc = 8,
2395         .size = {
2396                 .width = 152,
2397                 .height = 91,
2398         },
2399         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2400         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
2401 };
2402
2403 static const struct drm_display_mode pda_91_00156_a0_mode = {
2404         .clock = 33300,
2405         .hdisplay = 800,
2406         .hsync_start = 800 + 1,
2407         .hsync_end = 800 + 1 + 64,
2408         .htotal = 800 + 1 + 64 + 64,
2409         .vdisplay = 480,
2410         .vsync_start = 480 + 1,
2411         .vsync_end = 480 + 1 + 23,
2412         .vtotal = 480 + 1 + 23 + 22,
2413         .vrefresh = 60,
2414 };
2415
2416 static const struct panel_desc pda_91_00156_a0  = {
2417         .modes = &pda_91_00156_a0_mode,
2418         .num_modes = 1,
2419         .size = {
2420                 .width = 152,
2421                 .height = 91,
2422         },
2423         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2424 };
2425
2426
2427 static const struct drm_display_mode qd43003c0_40_mode = {
2428         .clock = 9000,
2429         .hdisplay = 480,
2430         .hsync_start = 480 + 8,
2431         .hsync_end = 480 + 8 + 4,
2432         .htotal = 480 + 8 + 4 + 39,
2433         .vdisplay = 272,
2434         .vsync_start = 272 + 4,
2435         .vsync_end = 272 + 4 + 10,
2436         .vtotal = 272 + 4 + 10 + 2,
2437         .vrefresh = 60,
2438 };
2439
2440 static const struct panel_desc qd43003c0_40 = {
2441         .modes = &qd43003c0_40_mode,
2442         .num_modes = 1,
2443         .bpc = 8,
2444         .size = {
2445                 .width = 95,
2446                 .height = 53,
2447         },
2448         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2449 };
2450
2451 static const struct display_timing rocktech_rk070er9427_timing = {
2452         .pixelclock = { 26400000, 33300000, 46800000 },
2453         .hactive = { 800, 800, 800 },
2454         .hfront_porch = { 16, 210, 354 },
2455         .hback_porch = { 46, 46, 46 },
2456         .hsync_len = { 1, 1, 1 },
2457         .vactive = { 480, 480, 480 },
2458         .vfront_porch = { 7, 22, 147 },
2459         .vback_porch = { 23, 23, 23 },
2460         .vsync_len = { 1, 1, 1 },
2461         .flags = DISPLAY_FLAGS_DE_HIGH,
2462 };
2463
2464 static const struct panel_desc rocktech_rk070er9427 = {
2465         .timings = &rocktech_rk070er9427_timing,
2466         .num_timings = 1,
2467         .bpc = 6,
2468         .size = {
2469                 .width = 154,
2470                 .height = 86,
2471         },
2472         .delay = {
2473                 .prepare = 41,
2474                 .enable = 50,
2475                 .unprepare = 41,
2476                 .disable = 50,
2477         },
2478         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2479 };
2480
2481 static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
2482         .clock = 271560,
2483         .hdisplay = 2560,
2484         .hsync_start = 2560 + 48,
2485         .hsync_end = 2560 + 48 + 32,
2486         .htotal = 2560 + 48 + 32 + 80,
2487         .vdisplay = 1600,
2488         .vsync_start = 1600 + 2,
2489         .vsync_end = 1600 + 2 + 5,
2490         .vtotal = 1600 + 2 + 5 + 57,
2491         .vrefresh = 60,
2492 };
2493
2494 static const struct panel_desc samsung_lsn122dl01_c01 = {
2495         .modes = &samsung_lsn122dl01_c01_mode,
2496         .num_modes = 1,
2497         .size = {
2498                 .width = 263,
2499                 .height = 164,
2500         },
2501 };
2502
2503 static const struct drm_display_mode samsung_ltn101nt05_mode = {
2504         .clock = 54030,
2505         .hdisplay = 1024,
2506         .hsync_start = 1024 + 24,
2507         .hsync_end = 1024 + 24 + 136,
2508         .htotal = 1024 + 24 + 136 + 160,
2509         .vdisplay = 600,
2510         .vsync_start = 600 + 3,
2511         .vsync_end = 600 + 3 + 6,
2512         .vtotal = 600 + 3 + 6 + 61,
2513         .vrefresh = 60,
2514 };
2515
2516 static const struct panel_desc samsung_ltn101nt05 = {
2517         .modes = &samsung_ltn101nt05_mode,
2518         .num_modes = 1,
2519         .bpc = 6,
2520         .size = {
2521                 .width = 223,
2522                 .height = 125,
2523         },
2524 };
2525
2526 static const struct drm_display_mode samsung_ltn140at29_301_mode = {
2527         .clock = 76300,
2528         .hdisplay = 1366,
2529         .hsync_start = 1366 + 64,
2530         .hsync_end = 1366 + 64 + 48,
2531         .htotal = 1366 + 64 + 48 + 128,
2532         .vdisplay = 768,
2533         .vsync_start = 768 + 2,
2534         .vsync_end = 768 + 2 + 5,
2535         .vtotal = 768 + 2 + 5 + 17,
2536         .vrefresh = 60,
2537 };
2538
2539 static const struct panel_desc samsung_ltn140at29_301 = {
2540         .modes = &samsung_ltn140at29_301_mode,
2541         .num_modes = 1,
2542         .bpc = 6,
2543         .size = {
2544                 .width = 320,
2545                 .height = 187,
2546         },
2547 };
2548
2549 static const struct drm_display_mode sharp_ld_d5116z01b_mode = {
2550         .clock = 168480,
2551         .hdisplay = 1920,
2552         .hsync_start = 1920 + 48,
2553         .hsync_end = 1920 + 48 + 32,
2554         .htotal = 1920 + 48 + 32 + 80,
2555         .vdisplay = 1280,
2556         .vsync_start = 1280 + 3,
2557         .vsync_end = 1280 + 3 + 10,
2558         .vtotal = 1280 + 3 + 10 + 57,
2559         .vrefresh = 60,
2560         .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2561 };
2562
2563 static const struct panel_desc sharp_ld_d5116z01b = {
2564         .modes = &sharp_ld_d5116z01b_mode,
2565         .num_modes = 1,
2566         .bpc = 8,
2567         .size = {
2568                 .width = 260,
2569                 .height = 120,
2570         },
2571         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2572         .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
2573 };
2574
2575 static const struct drm_display_mode sharp_lq070y3dg3b_mode = {
2576         .clock = 33260,
2577         .hdisplay = 800,
2578         .hsync_start = 800 + 64,
2579         .hsync_end = 800 + 64 + 128,
2580         .htotal = 800 + 64 + 128 + 64,
2581         .vdisplay = 480,
2582         .vsync_start = 480 + 8,
2583         .vsync_end = 480 + 8 + 2,
2584         .vtotal = 480 + 8 + 2 + 35,
2585         .vrefresh = 60,
2586         .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
2587 };
2588
2589 static const struct panel_desc sharp_lq070y3dg3b = {
2590         .modes = &sharp_lq070y3dg3b_mode,
2591         .num_modes = 1,
2592         .bpc = 8,
2593         .size = {
2594                 .width = 152,   /* 152.4mm */
2595                 .height = 91,   /* 91.4mm */
2596         },
2597         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2598         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE |
2599                      DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
2600 };
2601
2602 static const struct drm_display_mode sharp_lq035q7db03_mode = {
2603         .clock = 5500,
2604         .hdisplay = 240,
2605         .hsync_start = 240 + 16,
2606         .hsync_end = 240 + 16 + 7,
2607         .htotal = 240 + 16 + 7 + 5,
2608         .vdisplay = 320,
2609         .vsync_start = 320 + 9,
2610         .vsync_end = 320 + 9 + 1,
2611         .vtotal = 320 + 9 + 1 + 7,
2612         .vrefresh = 60,
2613 };
2614
2615 static const struct panel_desc sharp_lq035q7db03 = {
2616         .modes = &sharp_lq035q7db03_mode,
2617         .num_modes = 1,
2618         .bpc = 6,
2619         .size = {
2620                 .width = 54,
2621                 .height = 72,
2622         },
2623         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2624 };
2625
2626 static const struct display_timing sharp_lq101k1ly04_timing = {
2627         .pixelclock = { 60000000, 65000000, 80000000 },
2628         .hactive = { 1280, 1280, 1280 },
2629         .hfront_porch = { 20, 20, 20 },
2630         .hback_porch = { 20, 20, 20 },
2631         .hsync_len = { 10, 10, 10 },
2632         .vactive = { 800, 800, 800 },
2633         .vfront_porch = { 4, 4, 4 },
2634         .vback_porch = { 4, 4, 4 },
2635         .vsync_len = { 4, 4, 4 },
2636         .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
2637 };
2638
2639 static const struct panel_desc sharp_lq101k1ly04 = {
2640         .timings = &sharp_lq101k1ly04_timing,
2641         .num_timings = 1,
2642         .bpc = 8,
2643         .size = {
2644                 .width = 217,
2645                 .height = 136,
2646         },
2647         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
2648         .connector_type = DRM_MODE_CONNECTOR_LVDS,
2649 };
2650
2651 static const struct display_timing sharp_lq123p1jx31_timing = {
2652         .pixelclock = { 252750000, 252750000, 266604720 },
2653         .hactive = { 2400, 2400, 2400 },
2654         .hfront_porch = { 48, 48, 48 },
2655         .hback_porch = { 80, 80, 84 },
2656         .hsync_len = { 32, 32, 32 },
2657         .vactive = { 1600, 1600, 1600 },
2658         .vfront_porch = { 3, 3, 3 },
2659         .vback_porch = { 33, 33, 120 },
2660         .vsync_len = { 10, 10, 10 },
2661         .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
2662 };
2663
2664 static const struct panel_desc sharp_lq123p1jx31 = {
2665         .timings = &sharp_lq123p1jx31_timing,
2666         .num_timings = 1,
2667         .bpc = 8,
2668         .size = {
2669                 .width = 259,
2670                 .height = 173,
2671         },
2672         .delay = {
2673                 .prepare = 110,
2674                 .enable = 50,
2675                 .unprepare = 550,
2676         },
2677 };
2678
2679 static const struct drm_display_mode sharp_lq150x1lg11_mode = {
2680         .clock = 71100,
2681         .hdisplay = 1024,
2682         .hsync_start = 1024 + 168,
2683         .hsync_end = 1024 + 168 + 64,
2684         .htotal = 1024 + 168 + 64 + 88,
2685         .vdisplay = 768,
2686         .vsync_start = 768 + 37,
2687         .vsync_end = 768 + 37 + 2,
2688         .vtotal = 768 + 37 + 2 + 8,
2689         .vrefresh = 60,
2690 };
2691
2692 static const struct panel_desc sharp_lq150x1lg11 = {
2693         .modes = &sharp_lq150x1lg11_mode,
2694         .num_modes = 1,
2695         .bpc = 6,
2696         .size = {
2697                 .width = 304,
2698                 .height = 228,
2699         },
2700         .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
2701 };
2702
2703 static const struct display_timing sharp_ls020b1dd01d_timing = {
2704         .pixelclock = { 2000000, 4200000, 5000000 },
2705         .hactive = { 240, 240, 240 },
2706         .hfront_porch = { 66, 66, 66 },
2707         .hback_porch = { 1, 1, 1 },
2708         .hsync_len = { 1, 1, 1 },
2709         .vactive = { 160, 160, 160 },
2710         .vfront_porch = { 52, 52, 52 },
2711         .vback_porch = { 6, 6, 6 },
2712         .vsync_len = { 10, 10, 10 },
2713         .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_LOW,
2714 };
2715
2716 static const struct panel_desc sharp_ls020b1dd01d = {
2717         .timings = &sharp_ls020b1dd01d_timing,
2718         .num_timings = 1,
2719         .bpc = 6,
2720         .size = {
2721                 .width = 42,
2722                 .height = 28,
2723         },
2724         .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
2725         .bus_flags = DRM_BUS_FLAG_DE_HIGH
2726                    | DRM_BUS_FLAG_PIXDATA_NEGEDGE
2727                    | DRM_BUS_FLAG_SHARP_SIGNALS,
2728 };
2729
2730 static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
2731         .clock = 33300,
2732         .hdisplay = 800,
2733         .hsync_start = 800 + 1,
2734         .hsync_end = 800 + 1 + 64,
2735         .htotal = 800 + 1 + 64 + 64,
2736         .vdisplay = 480,
2737         .vsync_start = 480 + 1,
2738         .vsync_end = 480 + 1 + 23,
2739         .vtotal = 480 + 1 + 23 + 22,
2740         .vrefresh = 60,
2741 };
2742
2743 static const struct panel_desc shelly_sca07010_bfn_lnn = {
2744         .modes = &shelly_sca07010_bfn_lnn_mode,
2745         .num_modes = 1,
2746         .size = {
2747                 .width = 152,
2748                 .height = 91,
2749         },
2750         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2751 };
2752
2753 static const struct drm_display_mode starry_kr122ea0sra_mode = {
2754         .clock = 147000,
2755         .hdisplay = 1920,
2756         .hsync_start = 1920 + 16,
2757         .hsync_end = 1920 + 16 + 16,
2758         .htotal = 1920 + 16 + 16 + 32,
2759         .vdisplay = 1200,
2760         .vsync_start = 1200 + 15,
2761         .vsync_end = 1200 + 15 + 2,
2762         .vtotal = 1200 + 15 + 2 + 18,
2763         .vrefresh = 60,
2764         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2765 };
2766
2767 static const struct panel_desc starry_kr122ea0sra = {
2768         .modes = &starry_kr122ea0sra_mode,
2769         .num_modes = 1,
2770         .size = {
2771                 .width = 263,
2772                 .height = 164,
2773         },
2774         .delay = {
2775                 .prepare = 10 + 200,
2776                 .enable = 50,
2777                 .unprepare = 10 + 500,
2778         },
2779 };
2780
2781 static const struct drm_display_mode tfc_s9700rtwv43tr_01b_mode = {
2782         .clock = 30000,
2783         .hdisplay = 800,
2784         .hsync_start = 800 + 39,
2785         .hsync_end = 800 + 39 + 47,
2786         .htotal = 800 + 39 + 47 + 39,
2787         .vdisplay = 480,
2788         .vsync_start = 480 + 13,
2789         .vsync_end = 480 + 13 + 2,
2790         .vtotal = 480 + 13 + 2 + 29,
2791         .vrefresh = 62,
2792 };
2793
2794 static const struct panel_desc tfc_s9700rtwv43tr_01b = {
2795         .modes = &tfc_s9700rtwv43tr_01b_mode,
2796         .num_modes = 1,
2797         .bpc = 8,
2798         .size = {
2799                 .width = 155,
2800                 .height = 90,
2801         },
2802         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2803         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
2804 };
2805
2806 static const struct display_timing tianma_tm070jdhg30_timing = {
2807         .pixelclock = { 62600000, 68200000, 78100000 },
2808         .hactive = { 1280, 1280, 1280 },
2809         .hfront_porch = { 15, 64, 159 },
2810         .hback_porch = { 5, 5, 5 },
2811         .hsync_len = { 1, 1, 256 },
2812         .vactive = { 800, 800, 800 },
2813         .vfront_porch = { 3, 40, 99 },
2814         .vback_porch = { 2, 2, 2 },
2815         .vsync_len = { 1, 1, 128 },
2816         .flags = DISPLAY_FLAGS_DE_HIGH,
2817 };
2818
2819 static const struct panel_desc tianma_tm070jdhg30 = {
2820         .timings = &tianma_tm070jdhg30_timing,
2821         .num_timings = 1,
2822         .bpc = 8,
2823         .size = {
2824                 .width = 151,
2825                 .height = 95,
2826         },
2827         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2828         .connector_type = DRM_MODE_CONNECTOR_LVDS,
2829 };
2830
2831 static const struct display_timing tianma_tm070rvhg71_timing = {
2832         .pixelclock = { 27700000, 29200000, 39600000 },
2833         .hactive = { 800, 800, 800 },
2834         .hfront_porch = { 12, 40, 212 },
2835         .hback_porch = { 88, 88, 88 },
2836         .hsync_len = { 1, 1, 40 },
2837         .vactive = { 480, 480, 480 },
2838         .vfront_porch = { 1, 13, 88 },
2839         .vback_porch = { 32, 32, 32 },
2840         .vsync_len = { 1, 1, 3 },
2841         .flags = DISPLAY_FLAGS_DE_HIGH,
2842 };
2843
2844 static const struct panel_desc tianma_tm070rvhg71 = {
2845         .timings = &tianma_tm070rvhg71_timing,
2846         .num_timings = 1,
2847         .bpc = 8,
2848         .size = {
2849                 .width = 154,
2850                 .height = 86,
2851         },
2852         .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2853         .connector_type = DRM_MODE_CONNECTOR_LVDS,
2854 };
2855
2856 static const struct drm_display_mode ti_nspire_cx_lcd_mode[] = {
2857         {
2858                 .clock = 10000,
2859                 .hdisplay = 320,
2860                 .hsync_start = 320 + 50,
2861                 .hsync_end = 320 + 50 + 6,
2862                 .htotal = 320 + 50 + 6 + 38,
2863                 .vdisplay = 240,
2864                 .vsync_start = 240 + 3,
2865                 .vsync_end = 240 + 3 + 1,
2866                 .vtotal = 240 + 3 + 1 + 17,
2867                 .vrefresh = 60,
2868                 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2869         },
2870 };
2871
2872 static const struct panel_desc ti_nspire_cx_lcd_panel = {
2873         .modes = ti_nspire_cx_lcd_mode,
2874         .num_modes = 1,
2875         .bpc = 8,
2876         .size = {
2877                 .width = 65,
2878                 .height = 49,
2879         },
2880         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2881         .bus_flags = DRM_BUS_FLAG_PIXDATA_NEGEDGE,
2882 };
2883
2884 static const struct drm_display_mode ti_nspire_classic_lcd_mode[] = {
2885         {
2886                 .clock = 10000,
2887                 .hdisplay = 320,
2888                 .hsync_start = 320 + 6,
2889                 .hsync_end = 320 + 6 + 6,
2890                 .htotal = 320 + 6 + 6 + 6,
2891                 .vdisplay = 240,
2892                 .vsync_start = 240 + 0,
2893                 .vsync_end = 240 + 0 + 1,
2894                 .vtotal = 240 + 0 + 1 + 0,
2895                 .vrefresh = 60,
2896                 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2897         },
2898 };
2899
2900 static const struct panel_desc ti_nspire_classic_lcd_panel = {
2901         .modes = ti_nspire_classic_lcd_mode,
2902         .num_modes = 1,
2903         /* The grayscale panel has 8 bit for the color .. Y (black) */
2904         .bpc = 8,
2905         .size = {
2906                 .width = 71,
2907                 .height = 53,
2908         },
2909         /* This is the grayscale bus format */
2910         .bus_format = MEDIA_BUS_FMT_Y8_1X8,
2911         .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
2912 };
2913
2914 static const struct drm_display_mode toshiba_lt089ac29000_mode = {
2915         .clock = 79500,
2916         .hdisplay = 1280,
2917         .hsync_start = 1280 + 192,
2918         .hsync_end = 1280 + 192 + 128,
2919         .htotal = 1280 + 192 + 128 + 64,
2920         .vdisplay = 768,
2921         .vsync_start = 768 + 20,
2922         .vsync_end = 768 + 20 + 7,
2923         .vtotal = 768 + 20 + 7 + 3,
2924         .vrefresh = 60,
2925 };
2926
2927 static const struct panel_desc toshiba_lt089ac29000 = {
2928         .modes = &toshiba_lt089ac29000_mode,
2929         .num_modes = 1,
2930         .size = {
2931                 .width = 194,
2932                 .height = 116,
2933         },
2934         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2935         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
2936         .connector_type = DRM_MODE_CONNECTOR_LVDS,
2937 };
2938
2939 static const struct drm_display_mode tpk_f07a_0102_mode = {
2940         .clock = 33260,
2941         .hdisplay = 800,
2942         .hsync_start = 800 + 40,
2943         .hsync_end = 800 + 40 + 128,
2944         .htotal = 800 + 40 + 128 + 88,
2945         .vdisplay = 480,
2946         .vsync_start = 480 + 10,
2947         .vsync_end = 480 + 10 + 2,
2948         .vtotal = 480 + 10 + 2 + 33,
2949         .vrefresh = 60,
2950 };
2951
2952 static const struct panel_desc tpk_f07a_0102 = {
2953         .modes = &tpk_f07a_0102_mode,
2954         .num_modes = 1,
2955         .size = {
2956                 .width = 152,
2957                 .height = 91,
2958         },
2959         .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
2960 };
2961
2962 static const struct drm_display_mode tpk_f10a_0102_mode = {
2963         .clock = 45000,
2964         .hdisplay = 1024,
2965         .hsync_start = 1024 + 176,
2966         .hsync_end = 1024 + 176 + 5,
2967         .htotal = 1024 + 176 + 5 + 88,
2968         .vdisplay = 600,
2969         .vsync_start = 600 + 20,
2970         .vsync_end = 600 + 20 + 5,
2971         .vtotal = 600 + 20 + 5 + 25,
2972         .vrefresh = 60,
2973 };
2974
2975 static const struct panel_desc tpk_f10a_0102 = {
2976         .modes = &tpk_f10a_0102_mode,
2977         .num_modes = 1,
2978         .size = {
2979                 .width = 223,
2980                 .height = 125,
2981         },
2982 };
2983
2984 static const struct display_timing urt_umsh_8596md_timing = {
2985         .pixelclock = { 33260000, 33260000, 33260000 },
2986         .hactive = { 800, 800, 800 },
2987         .hfront_porch = { 41, 41, 41 },
2988         .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
2989         .hsync_len = { 71, 128, 128 },
2990         .vactive = { 480, 480, 480 },
2991         .vfront_porch = { 10, 10, 10 },
2992         .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
2993         .vsync_len = { 2, 2, 2 },
2994         .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
2995                 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
2996 };
2997
2998 static const struct panel_desc urt_umsh_8596md_lvds = {
2999         .timings = &urt_umsh_8596md_timing,
3000         .num_timings = 1,
3001         .bpc = 6,
3002         .size = {
3003                 .width = 152,
3004                 .height = 91,
3005         },
3006         .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
3007         .connector_type = DRM_MODE_CONNECTOR_LVDS,
3008 };
3009
3010 static const struct panel_desc urt_umsh_8596md_parallel = {
3011         .timings = &urt_umsh_8596md_timing,
3012         .num_timings = 1,
3013         .bpc = 6,
3014         .size = {
3015                 .width = 152,
3016                 .height = 91,
3017         },
3018         .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3019 };
3020
3021 static const struct drm_display_mode vl050_8048nt_c01_mode = {
3022         .clock = 33333,
3023         .hdisplay = 800,
3024         .hsync_start = 800 + 210,
3025         .hsync_end = 800 + 210 + 20,
3026         .htotal = 800 + 210 + 20 + 46,
3027         .vdisplay =  480,
3028         .vsync_start = 480 + 22,
3029         .vsync_end = 480 + 22 + 10,
3030         .vtotal = 480 + 22 + 10 + 23,
3031         .vrefresh = 60,
3032         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
3033 };
3034
3035 static const struct panel_desc vl050_8048nt_c01 = {
3036         .modes = &vl050_8048nt_c01_mode,
3037         .num_modes = 1,
3038         .bpc = 8,
3039         .size = {
3040                 .width = 120,
3041                 .height = 76,
3042         },
3043         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3044         .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
3045 };
3046
3047 static const struct drm_display_mode winstar_wf35ltiacd_mode = {
3048         .clock = 6410,
3049         .hdisplay = 320,
3050         .hsync_start = 320 + 20,
3051         .hsync_end = 320 + 20 + 30,
3052         .htotal = 320 + 20 + 30 + 38,
3053         .vdisplay = 240,
3054         .vsync_start = 240 + 4,
3055         .vsync_end = 240 + 4 + 3,
3056         .vtotal = 240 + 4 + 3 + 15,
3057         .vrefresh = 60,
3058         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3059 };
3060
3061 static const struct panel_desc winstar_wf35ltiacd = {
3062         .modes = &winstar_wf35ltiacd_mode,
3063         .num_modes = 1,
3064         .bpc = 8,
3065         .size = {
3066                 .width = 70,
3067                 .height = 53,
3068         },
3069         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3070 };
3071
3072 static const struct drm_display_mode arm_rtsm_mode[] = {
3073         {
3074                 .clock = 65000,
3075                 .hdisplay = 1024,
3076                 .hsync_start = 1024 + 24,
3077                 .hsync_end = 1024 + 24 + 136,
3078                 .htotal = 1024 + 24 + 136 + 160,
3079                 .vdisplay = 768,
3080                 .vsync_start = 768 + 3,
3081                 .vsync_end = 768 + 3 + 6,
3082                 .vtotal = 768 + 3 + 6 + 29,
3083                 .vrefresh = 60,
3084                 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3085         },
3086 };
3087
3088 static const struct panel_desc arm_rtsm = {
3089         .modes = arm_rtsm_mode,
3090         .num_modes = 1,
3091         .bpc = 8,
3092         .size = {
3093                 .width = 400,
3094                 .height = 300,
3095         },
3096         .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3097 };
3098
3099 static const struct of_device_id platform_of_match[] = {
3100         {
3101                 .compatible = "ampire,am-480272h3tmqw-t01h",
3102                 .data = &ampire_am_480272h3tmqw_t01h,
3103         }, {
3104                 .compatible = "ampire,am800480r3tmqwa1h",
3105                 .data = &ampire_am800480r3tmqwa1h,
3106         }, {
3107                 .compatible = "arm,rtsm-display",
3108                 .data = &arm_rtsm,
3109         }, {
3110                 .compatible = "armadeus,st0700-adapt",
3111                 .data = &armadeus_st0700_adapt,
3112         }, {
3113                 .compatible = "auo,b101aw03",
3114                 .data = &auo_b101aw03,
3115         }, {
3116                 .compatible = "auo,b101ean01",
3117                 .data = &auo_b101ean01,
3118         }, {
3119                 .compatible = "auo,b101xtn01",
3120                 .data = &auo_b101xtn01,
3121         }, {
3122                 .compatible = "auo,b116xw03",
3123                 .data = &auo_b116xw03,
3124         }, {
3125                 .compatible = "auo,b133htn01",
3126                 .data = &auo_b133htn01,
3127         }, {
3128                 .compatible = "auo,b133xtn01",
3129                 .data = &auo_b133xtn01,
3130         }, {
3131                 .compatible = "auo,g070vvn01",
3132                 .data = &auo_g070vvn01,
3133         }, {
3134                 .compatible = "auo,g101evn010",
3135                 .data = &auo_g101evn010,
3136         }, {
3137                 .compatible = "auo,g104sn02",
3138                 .data = &auo_g104sn02,
3139         }, {
3140                 .compatible = "auo,g133han01",
3141                 .data = &auo_g133han01,
3142         }, {
3143                 .compatible = "auo,g185han01",
3144                 .data = &auo_g185han01,
3145         }, {
3146                 .compatible = "auo,p320hvn03",
3147                 .data = &auo_p320hvn03,
3148         }, {
3149                 .compatible = "auo,t215hvn01",
3150                 .data = &auo_t215hvn01,
3151         }, {
3152                 .compatible = "avic,tm070ddh03",
3153                 .data = &avic_tm070ddh03,
3154         }, {
3155                 .compatible = "bananapi,s070wv20-ct16",
3156                 .data = &bananapi_s070wv20_ct16,
3157         }, {
3158                 .compatible = "boe,hv070wsa-100",
3159                 .data = &boe_hv070wsa
3160         }, {
3161                 .compatible = "boe,nv101wxmn51",
3162                 .data = &boe_nv101wxmn51,
3163         }, {
3164                 .compatible = "cdtech,s043wq26h-ct7",
3165                 .data = &cdtech_s043wq26h_ct7,
3166         }, {
3167                 .compatible = "cdtech,s070wv95-ct16",
3168                 .data = &cdtech_s070wv95_ct16,
3169         }, {
3170                 .compatible = "chunghwa,claa070wp03xg",
3171                 .data = &chunghwa_claa070wp03xg,
3172         }, {
3173                 .compatible = "chunghwa,claa101wa01a",
3174                 .data = &chunghwa_claa101wa01a
3175         }, {
3176                 .compatible = "chunghwa,claa101wb01",
3177                 .data = &chunghwa_claa101wb01
3178         }, {
3179                 .compatible = "dataimage,scf0700c48ggu18",
3180                 .data = &dataimage_scf0700c48ggu18,
3181         }, {
3182                 .compatible = "dlc,dlc0700yzg-1",
3183                 .data = &dlc_dlc0700yzg_1,
3184         }, {
3185                 .compatible = "dlc,dlc1010gig",
3186                 .data = &dlc_dlc1010gig,
3187         }, {
3188                 .compatible = "edt,et035012dm6",
3189                 .data = &edt_et035012dm6,
3190         }, {
3191                 .compatible = "edt,etm0430g0dh6",
3192                 .data = &edt_etm0430g0dh6,
3193         }, {
3194                 .compatible = "edt,et057090dhu",
3195                 .data = &edt_et057090dhu,
3196         }, {
3197                 .compatible = "edt,et070080dh6",
3198                 .data = &edt_etm0700g0dh6,
3199         }, {
3200                 .compatible = "edt,etm0700g0dh6",
3201                 .data = &edt_etm0700g0dh6,
3202         }, {
3203                 .compatible = "edt,etm0700g0bdh6",
3204                 .data = &edt_etm0700g0bdh6,
3205         }, {
3206                 .compatible = "edt,etm0700g0edh6",
3207                 .data = &edt_etm0700g0bdh6,
3208         }, {
3209                 .compatible = "evervision,vgg804821",
3210                 .data = &evervision_vgg804821,
3211         }, {
3212                 .compatible = "foxlink,fl500wvr00-a0t",
3213                 .data = &foxlink_fl500wvr00_a0t,
3214         }, {
3215                 .compatible = "friendlyarm,hd702e",
3216                 .data = &friendlyarm_hd702e,
3217         }, {
3218                 .compatible = "giantplus,gpg482739qs5",
3219                 .data = &giantplus_gpg482739qs5
3220         }, {
3221                 .compatible = "giantplus,gpm940b0",
3222                 .data = &giantplus_gpm940b0,
3223         }, {
3224                 .compatible = "hannstar,hsd070pww1",
3225                 .data = &hannstar_hsd070pww1,
3226         }, {
3227                 .compatible = "hannstar,hsd100pxn1",
3228                 .data = &hannstar_hsd100pxn1,
3229         }, {
3230                 .compatible = "hit,tx23d38vm0caa",
3231                 .data = &hitachi_tx23d38vm0caa
3232         }, {
3233                 .compatible = "innolux,at043tn24",
3234                 .data = &innolux_at043tn24,
3235         }, {
3236                 .compatible = "innolux,at070tn92",
3237                 .data = &innolux_at070tn92,
3238         }, {
3239                 .compatible = "innolux,g070y2-l01",
3240                 .data = &innolux_g070y2_l01,
3241         }, {
3242                 .compatible = "innolux,g101ice-l01",
3243                 .data = &innolux_g101ice_l01
3244         }, {
3245                 .compatible = "innolux,g121i1-l01",
3246                 .data = &innolux_g121i1_l01
3247         }, {
3248                 .compatible = "innolux,g121x1-l03",
3249                 .data = &innolux_g121x1_l03,
3250         }, {
3251                 .compatible = "innolux,n116bge",
3252                 .data = &innolux_n116bge,
3253         }, {
3254                 .compatible = "innolux,n156bge-l21",
3255                 .data = &innolux_n156bge_l21,
3256         }, {
3257                 .compatible = "innolux,p120zdg-bf1",
3258                 .data = &innolux_p120zdg_bf1,
3259         }, {
3260                 .compatible = "innolux,zj070na-01p",
3261                 .data = &innolux_zj070na_01p,
3262         }, {
3263                 .compatible = "koe,tx14d24vm1bpa",
3264                 .data = &koe_tx14d24vm1bpa,
3265         }, {
3266                 .compatible = "koe,tx31d200vm0baa",
3267                 .data = &koe_tx31d200vm0baa,
3268         }, {
3269                 .compatible = "kyo,tcg121xglp",
3270                 .data = &kyo_tcg121xglp,
3271         }, {
3272                 .compatible = "lemaker,bl035-rgb-002",
3273                 .data = &lemaker_bl035_rgb_002,
3274         }, {
3275                 .compatible = "lg,lb070wv8",
3276                 .data = &lg_lb070wv8,
3277         }, {
3278                 .compatible = "lg,lp079qx1-sp0v",
3279                 .data = &lg_lp079qx1_sp0v,
3280         }, {
3281                 .compatible = "lg,lp097qx1-spa1",
3282                 .data = &lg_lp097qx1_spa1,
3283         }, {
3284                 .compatible = "lg,lp120up1",
3285                 .data = &lg_lp120up1,
3286         }, {
3287                 .compatible = "lg,lp129qe",
3288                 .data = &lg_lp129qe,
3289         }, {
3290                 .compatible = "mitsubishi,aa070mc01-ca1",
3291                 .data = &mitsubishi_aa070mc01,
3292         }, {
3293                 .compatible = "nec,nl12880bc20-05",
3294                 .data = &nec_nl12880bc20_05,
3295         }, {
3296                 .compatible = "nec,nl4827hc19-05b",
3297                 .data = &nec_nl4827hc19_05b,
3298         }, {
3299                 .compatible = "netron-dy,e231732",
3300                 .data = &netron_dy_e231732,
3301         }, {
3302                 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
3303                 .data = &newhaven_nhd_43_480272ef_atxl,
3304         }, {
3305                 .compatible = "nlt,nl192108ac18-02d",
3306                 .data = &nlt_nl192108ac18_02d,
3307         }, {
3308                 .compatible = "nvd,9128",
3309                 .data = &nvd_9128,
3310         }, {
3311                 .compatible = "okaya,rs800480t-7x0gp",
3312                 .data = &okaya_rs800480t_7x0gp,
3313         }, {
3314                 .compatible = "olimex,lcd-olinuxino-43-ts",
3315                 .data = &olimex_lcd_olinuxino_43ts,
3316         }, {
3317                 .compatible = "ontat,yx700wv03",
3318                 .data = &ontat_yx700wv03,
3319         }, {
3320                 .compatible = "ortustech,com37h3m05dtc",
3321                 .data = &ortustech_com37h3m,
3322         }, {
3323                 .compatible = "ortustech,com37h3m99dtc",
3324                 .data = &ortustech_com37h3m,
3325         }, {
3326                 .compatible = "ortustech,com43h4m85ulc",
3327                 .data = &ortustech_com43h4m85ulc,
3328         }, {
3329                 .compatible = "osddisplays,osd070t1718-19ts",
3330                 .data = &osddisplays_osd070t1718_19ts,
3331         }, {
3332                 .compatible = "pda,91-00156-a0",
3333                 .data = &pda_91_00156_a0,
3334         }, {
3335                 .compatible = "qiaodian,qd43003c0-40",
3336                 .data = &qd43003c0_40,
3337         }, {
3338                 .compatible = "rocktech,rk070er9427",
3339                 .data = &rocktech_rk070er9427,
3340         }, {
3341                 .compatible = "samsung,lsn122dl01-c01",
3342                 .data = &samsung_lsn122dl01_c01,
3343         }, {
3344                 .compatible = "samsung,ltn101nt05",
3345                 .data = &samsung_ltn101nt05,
3346         }, {
3347                 .compatible = "samsung,ltn140at29-301",
3348                 .data = &samsung_ltn140at29_301,
3349         }, {
3350                 .compatible = "sharp,ld-d5116z01b",
3351                 .data = &sharp_ld_d5116z01b,
3352         }, {
3353                 .compatible = "sharp,lq035q7db03",
3354                 .data = &sharp_lq035q7db03,
3355         }, {
3356                 .compatible = "sharp,lq070y3dg3b",
3357                 .data = &sharp_lq070y3dg3b,
3358         }, {
3359                 .compatible = "sharp,lq101k1ly04",
3360                 .data = &sharp_lq101k1ly04,
3361         }, {
3362                 .compatible = "sharp,lq123p1jx31",
3363                 .data = &sharp_lq123p1jx31,
3364         }, {
3365                 .compatible = "sharp,lq150x1lg11",
3366                 .data = &sharp_lq150x1lg11,
3367         }, {
3368                 .compatible = "sharp,ls020b1dd01d",
3369                 .data = &sharp_ls020b1dd01d,
3370         }, {
3371                 .compatible = "shelly,sca07010-bfn-lnn",
3372                 .data = &shelly_sca07010_bfn_lnn,
3373         }, {
3374                 .compatible = "starry,kr122ea0sra",
3375                 .data = &starry_kr122ea0sra,
3376         }, {
3377                 .compatible = "tfc,s9700rtwv43tr-01b",
3378                 .data = &tfc_s9700rtwv43tr_01b,
3379         }, {
3380                 .compatible = "tianma,tm070jdhg30",
3381                 .data = &tianma_tm070jdhg30,
3382         }, {
3383                 .compatible = "tianma,tm070rvhg71",
3384                 .data = &tianma_tm070rvhg71,
3385         }, {
3386                 .compatible = "ti,nspire-cx-lcd-panel",
3387                 .data = &ti_nspire_cx_lcd_panel,
3388         }, {
3389                 .compatible = "ti,nspire-classic-lcd-panel",
3390                 .data = &ti_nspire_classic_lcd_panel,
3391         }, {
3392                 .compatible = "toshiba,lt089ac29000",
3393                 .data = &toshiba_lt089ac29000,
3394         }, {
3395                 .compatible = "tpk,f07a-0102",
3396                 .data = &tpk_f07a_0102,
3397         }, {
3398                 .compatible = "tpk,f10a-0102",
3399                 .data = &tpk_f10a_0102,
3400         }, {
3401                 .compatible = "urt,umsh-8596md-t",
3402                 .data = &urt_umsh_8596md_parallel,
3403         }, {
3404                 .compatible = "urt,umsh-8596md-1t",
3405                 .data = &urt_umsh_8596md_parallel,
3406         }, {
3407                 .compatible = "urt,umsh-8596md-7t",
3408                 .data = &urt_umsh_8596md_parallel,
3409         }, {
3410                 .compatible = "urt,umsh-8596md-11t",
3411                 .data = &urt_umsh_8596md_lvds,
3412         }, {
3413                 .compatible = "urt,umsh-8596md-19t",
3414                 .data = &urt_umsh_8596md_lvds,
3415         }, {
3416                 .compatible = "urt,umsh-8596md-20t",
3417                 .data = &urt_umsh_8596md_parallel,
3418         }, {
3419                 .compatible = "vxt,vl050-8048nt-c01",
3420                 .data = &vl050_8048nt_c01,
3421         }, {
3422                 .compatible = "winstar,wf35ltiacd",
3423                 .data = &winstar_wf35ltiacd,
3424         }, {
3425                 /* sentinel */
3426         }
3427 };
3428 MODULE_DEVICE_TABLE(of, platform_of_match);
3429
3430 static int panel_simple_platform_probe(struct platform_device *pdev)
3431 {
3432         const struct of_device_id *id;
3433
3434         id = of_match_node(platform_of_match, pdev->dev.of_node);
3435         if (!id)
3436                 return -ENODEV;
3437
3438         return panel_simple_probe(&pdev->dev, id->data);
3439 }
3440
3441 static int panel_simple_platform_remove(struct platform_device *pdev)
3442 {
3443         return panel_simple_remove(&pdev->dev);
3444 }
3445
3446 static void panel_simple_platform_shutdown(struct platform_device *pdev)
3447 {
3448         panel_simple_shutdown(&pdev->dev);
3449 }
3450
3451 static struct platform_driver panel_simple_platform_driver = {
3452         .driver = {
3453                 .name = "panel-simple",
3454                 .of_match_table = platform_of_match,
3455         },
3456         .probe = panel_simple_platform_probe,
3457         .remove = panel_simple_platform_remove,
3458         .shutdown = panel_simple_platform_shutdown,
3459 };
3460
3461 struct panel_desc_dsi {
3462         struct panel_desc desc;
3463
3464         unsigned long flags;
3465         enum mipi_dsi_pixel_format format;
3466         unsigned int lanes;
3467 };
3468
3469 static const struct drm_display_mode auo_b080uan01_mode = {
3470         .clock = 154500,
3471         .hdisplay = 1200,
3472         .hsync_start = 1200 + 62,
3473         .hsync_end = 1200 + 62 + 4,
3474         .htotal = 1200 + 62 + 4 + 62,
3475         .vdisplay = 1920,
3476         .vsync_start = 1920 + 9,
3477         .vsync_end = 1920 + 9 + 2,
3478         .vtotal = 1920 + 9 + 2 + 8,
3479         .vrefresh = 60,
3480 };
3481
3482 static const struct panel_desc_dsi auo_b080uan01 = {
3483         .desc = {
3484                 .modes = &auo_b080uan01_mode,
3485                 .num_modes = 1,
3486                 .bpc = 8,
3487                 .size = {
3488                         .width = 108,
3489                         .height = 272,
3490                 },
3491         },
3492         .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
3493         .format = MIPI_DSI_FMT_RGB888,
3494         .lanes = 4,
3495 };
3496
3497 static const struct drm_display_mode boe_tv080wum_nl0_mode = {
3498         .clock = 160000,
3499         .hdisplay = 1200,
3500         .hsync_start = 1200 + 120,
3501         .hsync_end = 1200 + 120 + 20,
3502         .htotal = 1200 + 120 + 20 + 21,
3503         .vdisplay = 1920,
3504         .vsync_start = 1920 + 21,
3505         .vsync_end = 1920 + 21 + 3,
3506         .vtotal = 1920 + 21 + 3 + 18,
3507         .vrefresh = 60,
3508         .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3509 };
3510
3511 static const struct panel_desc_dsi boe_tv080wum_nl0 = {
3512         .desc = {
3513                 .modes = &boe_tv080wum_nl0_mode,
3514                 .num_modes = 1,
3515                 .size = {
3516                         .width = 107,
3517                         .height = 172,
3518                 },
3519         },
3520         .flags = MIPI_DSI_MODE_VIDEO |
3521                  MIPI_DSI_MODE_VIDEO_BURST |
3522                  MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
3523         .format = MIPI_DSI_FMT_RGB888,
3524         .lanes = 4,
3525 };
3526
3527 static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
3528         .clock = 71000,
3529         .hdisplay = 800,
3530         .hsync_start = 800 + 32,
3531         .hsync_end = 800 + 32 + 1,
3532         .htotal = 800 + 32 + 1 + 57,
3533         .vdisplay = 1280,
3534         .vsync_start = 1280 + 28,
3535         .vsync_end = 1280 + 28 + 1,
3536         .vtotal = 1280 + 28 + 1 + 14,
3537         .vrefresh = 60,
3538 };
3539
3540 static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
3541         .desc = {
3542                 .modes = &lg_ld070wx3_sl01_mode,
3543                 .num_modes = 1,
3544                 .bpc = 8,
3545                 .size = {
3546                         .width = 94,
3547                         .height = 151,
3548                 },
3549         },
3550         .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
3551         .format = MIPI_DSI_FMT_RGB888,
3552         .lanes = 4,
3553 };
3554
3555 static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
3556         .clock = 67000,
3557         .hdisplay = 720,
3558         .hsync_start = 720 + 12,
3559         .hsync_end = 720 + 12 + 4,
3560         .htotal = 720 + 12 + 4 + 112,
3561         .vdisplay = 1280,
3562         .vsync_start = 1280 + 8,
3563         .vsync_end = 1280 + 8 + 4,
3564         .vtotal = 1280 + 8 + 4 + 12,
3565         .vrefresh = 60,
3566 };
3567
3568 static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
3569         .desc = {
3570                 .modes = &lg_lh500wx1_sd03_mode,
3571                 .num_modes = 1,
3572                 .bpc = 8,
3573                 .size = {
3574                         .width = 62,
3575                         .height = 110,
3576                 },
3577         },
3578         .flags = MIPI_DSI_MODE_VIDEO,
3579         .format = MIPI_DSI_FMT_RGB888,
3580         .lanes = 4,
3581 };
3582
3583 static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
3584         .clock = 157200,
3585         .hdisplay = 1920,
3586         .hsync_start = 1920 + 154,
3587         .hsync_end = 1920 + 154 + 16,
3588         .htotal = 1920 + 154 + 16 + 32,
3589         .vdisplay = 1200,
3590         .vsync_start = 1200 + 17,
3591         .vsync_end = 1200 + 17 + 2,
3592         .vtotal = 1200 + 17 + 2 + 16,
3593         .vrefresh = 60,
3594 };
3595
3596 static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
3597         .desc = {
3598                 .modes = &panasonic_vvx10f004b00_mode,
3599                 .num_modes = 1,
3600                 .bpc = 8,
3601                 .size = {
3602                         .width = 217,
3603                         .height = 136,
3604                 },
3605         },
3606         .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
3607                  MIPI_DSI_CLOCK_NON_CONTINUOUS,
3608         .format = MIPI_DSI_FMT_RGB888,
3609         .lanes = 4,
3610 };
3611
3612 static const struct drm_display_mode lg_acx467akm_7_mode = {
3613         .clock = 150000,
3614         .hdisplay = 1080,
3615         .hsync_start = 1080 + 2,
3616         .hsync_end = 1080 + 2 + 2,
3617         .htotal = 1080 + 2 + 2 + 2,
3618         .vdisplay = 1920,
3619         .vsync_start = 1920 + 2,
3620         .vsync_end = 1920 + 2 + 2,
3621         .vtotal = 1920 + 2 + 2 + 2,
3622         .vrefresh = 60,
3623 };
3624
3625 static const struct panel_desc_dsi lg_acx467akm_7 = {
3626         .desc = {
3627                 .modes = &lg_acx467akm_7_mode,
3628                 .num_modes = 1,
3629                 .bpc = 8,
3630                 .size = {
3631                         .width = 62,
3632                         .height = 110,
3633                 },
3634         },
3635         .flags = 0,
3636         .format = MIPI_DSI_FMT_RGB888,
3637         .lanes = 4,
3638 };
3639
3640 static const struct drm_display_mode osd101t2045_53ts_mode = {
3641         .clock = 154500,
3642         .hdisplay = 1920,
3643         .hsync_start = 1920 + 112,
3644         .hsync_end = 1920 + 112 + 16,
3645         .htotal = 1920 + 112 + 16 + 32,
3646         .vdisplay = 1200,
3647         .vsync_start = 1200 + 16,
3648         .vsync_end = 1200 + 16 + 2,
3649         .vtotal = 1200 + 16 + 2 + 16,
3650         .vrefresh = 60,
3651         .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
3652 };
3653
3654 static const struct panel_desc_dsi osd101t2045_53ts = {
3655         .desc = {
3656                 .modes = &osd101t2045_53ts_mode,
3657                 .num_modes = 1,
3658                 .bpc = 8,
3659                 .size = {
3660                         .width = 217,
3661                         .height = 136,
3662                 },
3663         },
3664         .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
3665                  MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
3666                  MIPI_DSI_MODE_EOT_PACKET,
3667         .format = MIPI_DSI_FMT_RGB888,
3668         .lanes = 4,
3669 };
3670
3671 static const struct of_device_id dsi_of_match[] = {
3672         {
3673                 .compatible = "auo,b080uan01",
3674                 .data = &auo_b080uan01
3675         }, {
3676                 .compatible = "boe,tv080wum-nl0",
3677                 .data = &boe_tv080wum_nl0
3678         }, {
3679                 .compatible = "lg,ld070wx3-sl01",
3680                 .data = &lg_ld070wx3_sl01
3681         }, {
3682                 .compatible = "lg,lh500wx1-sd03",
3683                 .data = &lg_lh500wx1_sd03
3684         }, {
3685                 .compatible = "panasonic,vvx10f004b00",
3686                 .data = &panasonic_vvx10f004b00
3687         }, {
3688                 .compatible = "lg,acx467akm-7",
3689                 .data = &lg_acx467akm_7
3690         }, {
3691                 .compatible = "osddisplays,osd101t2045-53ts",
3692                 .data = &osd101t2045_53ts
3693         }, {
3694                 /* sentinel */
3695         }
3696 };
3697 MODULE_DEVICE_TABLE(of, dsi_of_match);
3698
3699 static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
3700 {
3701         const struct panel_desc_dsi *desc;
3702         const struct of_device_id *id;
3703         int err;
3704
3705         id = of_match_node(dsi_of_match, dsi->dev.of_node);
3706         if (!id)
3707                 return -ENODEV;
3708
3709         desc = id->data;
3710
3711         err = panel_simple_probe(&dsi->dev, &desc->desc);
3712         if (err < 0)
3713                 return err;
3714
3715         dsi->mode_flags = desc->flags;
3716         dsi->format = desc->format;
3717         dsi->lanes = desc->lanes;
3718
3719         err = mipi_dsi_attach(dsi);
3720         if (err) {
3721                 struct panel_simple *panel = dev_get_drvdata(&dsi->dev);
3722
3723                 drm_panel_remove(&panel->base);
3724         }
3725
3726         return err;
3727 }
3728
3729 static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
3730 {
3731         int err;
3732
3733         err = mipi_dsi_detach(dsi);
3734         if (err < 0)
3735                 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
3736
3737         return panel_simple_remove(&dsi->dev);
3738 }
3739
3740 static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
3741 {
3742         panel_simple_shutdown(&dsi->dev);
3743 }
3744
3745 static struct mipi_dsi_driver panel_simple_dsi_driver = {
3746         .driver = {
3747                 .name = "panel-simple-dsi",
3748                 .of_match_table = dsi_of_match,
3749         },
3750         .probe = panel_simple_dsi_probe,
3751         .remove = panel_simple_dsi_remove,
3752         .shutdown = panel_simple_dsi_shutdown,
3753 };
3754
3755 static int __init panel_simple_init(void)
3756 {
3757         int err;
3758
3759         err = platform_driver_register(&panel_simple_platform_driver);
3760         if (err < 0)
3761                 return err;
3762
3763         if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
3764                 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
3765                 if (err < 0)
3766                         return err;
3767         }
3768
3769         return 0;
3770 }
3771 module_init(panel_simple_init);
3772
3773 static void __exit panel_simple_exit(void)
3774 {
3775         if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
3776                 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
3777
3778         platform_driver_unregister(&panel_simple_platform_driver);
3779 }
3780 module_exit(panel_simple_exit);
3781
3782 MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
3783 MODULE_DESCRIPTION("DRM Driver for Simple Panels");
3784 MODULE_LICENSE("GPL and additional rights");