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