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