Linux Audio

Check our new training course

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