blob: e05321d3442aa7db2d14104d372c99800ef46c91 [file] [log] [blame]
Thierry Reding280921d2013-08-30 15:10:14 +02001/*
2 * Copyright (C) 2013, NVIDIA Corporation. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sub license,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the
12 * next paragraph) shall be included in all copies or substantial portions
13 * of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24#include <linux/backlight.h>
Alexandre Courbotcfdf0542014-03-01 14:00:58 +090025#include <linux/gpio/consumer.h>
Thierry Reding280921d2013-08-30 15:10:14 +020026#include <linux/module.h>
Thierry Reding280921d2013-08-30 15:10:14 +020027#include <linux/of_platform.h>
28#include <linux/platform_device.h>
29#include <linux/regulator/consumer.h>
30
31#include <drm/drmP.h>
32#include <drm/drm_crtc.h>
Thierry Reding210fcd92013-11-22 19:27:11 +010033#include <drm/drm_mipi_dsi.h>
Thierry Reding280921d2013-08-30 15:10:14 +020034#include <drm/drm_panel.h>
35
Philipp Zabela5d3e622014-12-11 18:32:45 +010036#include <video/display_timing.h>
37#include <video/videomode.h>
38
Thierry Reding280921d2013-08-30 15:10:14 +020039struct panel_desc {
40 const struct drm_display_mode *modes;
41 unsigned int num_modes;
Philipp Zabela5d3e622014-12-11 18:32:45 +010042 const struct display_timing *timings;
43 unsigned int num_timings;
Thierry Reding280921d2013-08-30 15:10:14 +020044
Stéphane Marchesin0208d512014-06-19 18:18:28 -070045 unsigned int bpc;
46
Ulrich Ölmann85533e32015-12-04 12:31:28 +010047 /**
48 * @width: width (in millimeters) of the panel's active display area
49 * @height: height (in millimeters) of the panel's active display area
50 */
Thierry Reding280921d2013-08-30 15:10:14 +020051 struct {
52 unsigned int width;
53 unsigned int height;
54 } size;
Ajay Kumarf673c372014-07-31 23:12:11 +053055
56 /**
57 * @prepare: the time (in milliseconds) that it takes for the panel to
58 * become ready and start receiving video data
59 * @enable: the time (in milliseconds) that it takes for the panel to
60 * display the first valid frame after starting to receive
61 * video data
62 * @disable: the time (in milliseconds) that it takes for the panel to
63 * turn the display off (no content is visible)
64 * @unprepare: the time (in milliseconds) that it takes for the panel
65 * to power itself down completely
66 */
67 struct {
68 unsigned int prepare;
69 unsigned int enable;
70 unsigned int disable;
71 unsigned int unprepare;
72 } delay;
Boris Brezillon795f7ab2014-07-22 13:33:59 +020073
74 u32 bus_format;
Stefan Agnerf0aa0832016-02-08 11:38:14 -080075 u32 bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +020076};
77
Thierry Reding280921d2013-08-30 15:10:14 +020078struct panel_simple {
79 struct drm_panel base;
Ajay Kumar613a6332014-07-31 23:12:10 +053080 bool prepared;
Thierry Reding280921d2013-08-30 15:10:14 +020081 bool enabled;
82
83 const struct panel_desc *desc;
84
85 struct backlight_device *backlight;
86 struct regulator *supply;
87 struct i2c_adapter *ddc;
88
Alexandre Courbotcfdf0542014-03-01 14:00:58 +090089 struct gpio_desc *enable_gpio;
Thierry Reding280921d2013-08-30 15:10:14 +020090};
91
92static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
93{
94 return container_of(panel, struct panel_simple, base);
95}
96
97static int panel_simple_get_fixed_modes(struct panel_simple *panel)
98{
99 struct drm_connector *connector = panel->base.connector;
100 struct drm_device *drm = panel->base.drm;
101 struct drm_display_mode *mode;
102 unsigned int i, num = 0;
103
104 if (!panel->desc)
105 return 0;
106
Philipp Zabela5d3e622014-12-11 18:32:45 +0100107 for (i = 0; i < panel->desc->num_timings; i++) {
108 const struct display_timing *dt = &panel->desc->timings[i];
109 struct videomode vm;
110
111 videomode_from_timing(dt, &vm);
112 mode = drm_mode_create(drm);
113 if (!mode) {
114 dev_err(drm->dev, "failed to add mode %ux%u\n",
115 dt->hactive.typ, dt->vactive.typ);
116 continue;
117 }
118
119 drm_display_mode_from_videomode(&vm, mode);
Boris Brezilloncda55372016-04-15 18:23:33 +0200120
121 mode->type |= DRM_MODE_TYPE_DRIVER;
122
Chen-Yu Tsai230c5b42016-10-24 21:21:15 +0800123 if (panel->desc->num_timings == 1)
Boris Brezilloncda55372016-04-15 18:23:33 +0200124 mode->type |= DRM_MODE_TYPE_PREFERRED;
125
Philipp Zabela5d3e622014-12-11 18:32:45 +0100126 drm_mode_probed_add(connector, mode);
127 num++;
128 }
129
Thierry Reding280921d2013-08-30 15:10:14 +0200130 for (i = 0; i < panel->desc->num_modes; i++) {
131 const struct drm_display_mode *m = &panel->desc->modes[i];
132
133 mode = drm_mode_duplicate(drm, m);
134 if (!mode) {
135 dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
136 m->hdisplay, m->vdisplay, m->vrefresh);
137 continue;
138 }
139
Boris Brezilloncda55372016-04-15 18:23:33 +0200140 mode->type |= DRM_MODE_TYPE_DRIVER;
141
142 if (panel->desc->num_modes == 1)
143 mode->type |= DRM_MODE_TYPE_PREFERRED;
144
Thierry Reding280921d2013-08-30 15:10:14 +0200145 drm_mode_set_name(mode);
146
147 drm_mode_probed_add(connector, mode);
148 num++;
149 }
150
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700151 connector->display_info.bpc = panel->desc->bpc;
Thierry Reding280921d2013-08-30 15:10:14 +0200152 connector->display_info.width_mm = panel->desc->size.width;
153 connector->display_info.height_mm = panel->desc->size.height;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200154 if (panel->desc->bus_format)
155 drm_display_info_set_bus_formats(&connector->display_info,
156 &panel->desc->bus_format, 1);
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800157 connector->display_info.bus_flags = panel->desc->bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200158
159 return num;
160}
161
162static int panel_simple_disable(struct drm_panel *panel)
163{
164 struct panel_simple *p = to_panel_simple(panel);
165
166 if (!p->enabled)
167 return 0;
168
169 if (p->backlight) {
170 p->backlight->props.power = FB_BLANK_POWERDOWN;
Thierry Redinge4aa3422016-06-17 19:11:53 +0200171 p->backlight->props.state |= BL_CORE_FBBLANK;
Thierry Reding280921d2013-08-30 15:10:14 +0200172 backlight_update_status(p->backlight);
173 }
174
Ajay Kumarf673c372014-07-31 23:12:11 +0530175 if (p->desc->delay.disable)
176 msleep(p->desc->delay.disable);
177
Thierry Reding280921d2013-08-30 15:10:14 +0200178 p->enabled = false;
179
180 return 0;
181}
182
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530183static int panel_simple_unprepare(struct drm_panel *panel)
184{
Ajay Kumar613a6332014-07-31 23:12:10 +0530185 struct panel_simple *p = to_panel_simple(panel);
186
187 if (!p->prepared)
188 return 0;
189
Fabio Estevam756b9182017-07-16 21:05:39 -0300190 gpiod_set_value_cansleep(p->enable_gpio, 0);
Ajay Kumar613a6332014-07-31 23:12:10 +0530191
192 regulator_disable(p->supply);
193
Ajay Kumarf673c372014-07-31 23:12:11 +0530194 if (p->desc->delay.unprepare)
195 msleep(p->desc->delay.unprepare);
196
Ajay Kumar613a6332014-07-31 23:12:10 +0530197 p->prepared = false;
198
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530199 return 0;
200}
201
202static int panel_simple_prepare(struct drm_panel *panel)
203{
Thierry Reding280921d2013-08-30 15:10:14 +0200204 struct panel_simple *p = to_panel_simple(panel);
205 int err;
206
Ajay Kumar613a6332014-07-31 23:12:10 +0530207 if (p->prepared)
Thierry Reding280921d2013-08-30 15:10:14 +0200208 return 0;
209
210 err = regulator_enable(p->supply);
211 if (err < 0) {
212 dev_err(panel->dev, "failed to enable supply: %d\n", err);
213 return err;
214 }
215
Fabio Estevam756b9182017-07-16 21:05:39 -0300216 gpiod_set_value_cansleep(p->enable_gpio, 1);
Thierry Reding280921d2013-08-30 15:10:14 +0200217
Ajay Kumarf673c372014-07-31 23:12:11 +0530218 if (p->desc->delay.prepare)
219 msleep(p->desc->delay.prepare);
220
Ajay Kumar613a6332014-07-31 23:12:10 +0530221 p->prepared = true;
222
223 return 0;
224}
225
226static int panel_simple_enable(struct drm_panel *panel)
227{
228 struct panel_simple *p = to_panel_simple(panel);
229
230 if (p->enabled)
231 return 0;
232
Ajay Kumarf673c372014-07-31 23:12:11 +0530233 if (p->desc->delay.enable)
234 msleep(p->desc->delay.enable);
235
Thierry Reding280921d2013-08-30 15:10:14 +0200236 if (p->backlight) {
Thierry Redinge4aa3422016-06-17 19:11:53 +0200237 p->backlight->props.state &= ~BL_CORE_FBBLANK;
Thierry Reding280921d2013-08-30 15:10:14 +0200238 p->backlight->props.power = FB_BLANK_UNBLANK;
239 backlight_update_status(p->backlight);
240 }
241
242 p->enabled = true;
243
244 return 0;
245}
246
247static int panel_simple_get_modes(struct drm_panel *panel)
248{
249 struct panel_simple *p = to_panel_simple(panel);
250 int num = 0;
251
252 /* probe EDID if a DDC bus is available */
253 if (p->ddc) {
254 struct edid *edid = drm_get_edid(panel->connector, p->ddc);
Stephen Warren70bf6872014-01-09 11:37:34 -0700255 drm_mode_connector_update_edid_property(panel->connector, edid);
Thierry Reding280921d2013-08-30 15:10:14 +0200256 if (edid) {
257 num += drm_add_edid_modes(panel->connector, edid);
258 kfree(edid);
259 }
260 }
261
262 /* add hard-coded panel modes */
263 num += panel_simple_get_fixed_modes(p);
264
265 return num;
266}
267
Philipp Zabela5d3e622014-12-11 18:32:45 +0100268static int panel_simple_get_timings(struct drm_panel *panel,
269 unsigned int num_timings,
270 struct display_timing *timings)
271{
272 struct panel_simple *p = to_panel_simple(panel);
273 unsigned int i;
274
275 if (p->desc->num_timings < num_timings)
276 num_timings = p->desc->num_timings;
277
278 if (timings)
279 for (i = 0; i < num_timings; i++)
280 timings[i] = p->desc->timings[i];
281
282 return p->desc->num_timings;
283}
284
Thierry Reding280921d2013-08-30 15:10:14 +0200285static const struct drm_panel_funcs panel_simple_funcs = {
286 .disable = panel_simple_disable,
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530287 .unprepare = panel_simple_unprepare,
288 .prepare = panel_simple_prepare,
Thierry Reding280921d2013-08-30 15:10:14 +0200289 .enable = panel_simple_enable,
290 .get_modes = panel_simple_get_modes,
Philipp Zabela5d3e622014-12-11 18:32:45 +0100291 .get_timings = panel_simple_get_timings,
Thierry Reding280921d2013-08-30 15:10:14 +0200292};
293
294static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
295{
296 struct device_node *backlight, *ddc;
297 struct panel_simple *panel;
Thierry Reding280921d2013-08-30 15:10:14 +0200298 int err;
299
300 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
301 if (!panel)
302 return -ENOMEM;
303
304 panel->enabled = false;
Ajay Kumar613a6332014-07-31 23:12:10 +0530305 panel->prepared = false;
Thierry Reding280921d2013-08-30 15:10:14 +0200306 panel->desc = desc;
307
308 panel->supply = devm_regulator_get(dev, "power");
309 if (IS_ERR(panel->supply))
310 return PTR_ERR(panel->supply);
311
Alexandre Courbota61400d2014-10-23 17:16:58 +0900312 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
313 GPIOD_OUT_LOW);
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900314 if (IS_ERR(panel->enable_gpio)) {
315 err = PTR_ERR(panel->enable_gpio);
Fabio Estevamb8e93802017-06-30 18:14:46 -0300316 if (err != -EPROBE_DEFER)
317 dev_err(dev, "failed to request GPIO: %d\n", err);
Alexandre Courbot9746c612014-07-25 23:47:25 +0900318 return err;
319 }
Thierry Reding280921d2013-08-30 15:10:14 +0200320
Thierry Reding280921d2013-08-30 15:10:14 +0200321 backlight = of_parse_phandle(dev->of_node, "backlight", 0);
322 if (backlight) {
323 panel->backlight = of_find_backlight_by_node(backlight);
324 of_node_put(backlight);
325
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900326 if (!panel->backlight)
327 return -EPROBE_DEFER;
Thierry Reding280921d2013-08-30 15:10:14 +0200328 }
329
330 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
331 if (ddc) {
332 panel->ddc = of_find_i2c_adapter_by_node(ddc);
333 of_node_put(ddc);
334
335 if (!panel->ddc) {
336 err = -EPROBE_DEFER;
337 goto free_backlight;
338 }
339 }
340
341 drm_panel_init(&panel->base);
342 panel->base.dev = dev;
343 panel->base.funcs = &panel_simple_funcs;
344
345 err = drm_panel_add(&panel->base);
346 if (err < 0)
347 goto free_ddc;
348
349 dev_set_drvdata(dev, panel);
350
351 return 0;
352
353free_ddc:
354 if (panel->ddc)
355 put_device(&panel->ddc->dev);
356free_backlight:
357 if (panel->backlight)
358 put_device(&panel->backlight->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200359
360 return err;
361}
362
363static int panel_simple_remove(struct device *dev)
364{
365 struct panel_simple *panel = dev_get_drvdata(dev);
366
Thierry Reding280921d2013-08-30 15:10:14 +0200367 drm_panel_remove(&panel->base);
368
369 panel_simple_disable(&panel->base);
Jonathan Liuf3621a82017-08-07 21:55:45 +1000370 panel_simple_unprepare(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200371
372 if (panel->ddc)
373 put_device(&panel->ddc->dev);
374
375 if (panel->backlight)
376 put_device(&panel->backlight->dev);
377
Thierry Reding280921d2013-08-30 15:10:14 +0200378 return 0;
379}
380
Thierry Redingd02fd932014-04-29 17:21:21 +0200381static void panel_simple_shutdown(struct device *dev)
382{
383 struct panel_simple *panel = dev_get_drvdata(dev);
384
385 panel_simple_disable(&panel->base);
Jonathan Liuf3621a82017-08-07 21:55:45 +1000386 panel_simple_unprepare(&panel->base);
Thierry Redingd02fd932014-04-29 17:21:21 +0200387}
388
Yannick Fertre966fea72017-03-28 11:44:49 +0200389static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
390 .clock = 9000,
391 .hdisplay = 480,
392 .hsync_start = 480 + 2,
393 .hsync_end = 480 + 2 + 41,
394 .htotal = 480 + 2 + 41 + 2,
395 .vdisplay = 272,
396 .vsync_start = 272 + 2,
397 .vsync_end = 272 + 2 + 10,
398 .vtotal = 272 + 2 + 10 + 2,
399 .vrefresh = 60,
400 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
401};
402
403static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
404 .modes = &ampire_am_480272h3tmqw_t01h_mode,
405 .num_modes = 1,
406 .bpc = 8,
407 .size = {
408 .width = 105,
409 .height = 67,
410 },
411 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
412};
413
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100414static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
415 .clock = 33333,
416 .hdisplay = 800,
417 .hsync_start = 800 + 0,
418 .hsync_end = 800 + 0 + 255,
419 .htotal = 800 + 0 + 255 + 0,
420 .vdisplay = 480,
421 .vsync_start = 480 + 2,
422 .vsync_end = 480 + 2 + 45,
423 .vtotal = 480 + 2 + 45 + 0,
424 .vrefresh = 60,
425 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
426};
427
428static const struct panel_desc ampire_am800480r3tmqwa1h = {
429 .modes = &ampire_am800480r3tmqwa1h_mode,
430 .num_modes = 1,
431 .bpc = 6,
432 .size = {
433 .width = 152,
434 .height = 91,
435 },
436 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
437};
438
Thierry Reding280921d2013-08-30 15:10:14 +0200439static const struct drm_display_mode auo_b101aw03_mode = {
440 .clock = 51450,
441 .hdisplay = 1024,
442 .hsync_start = 1024 + 156,
443 .hsync_end = 1024 + 156 + 8,
444 .htotal = 1024 + 156 + 8 + 156,
445 .vdisplay = 600,
446 .vsync_start = 600 + 16,
447 .vsync_end = 600 + 16 + 6,
448 .vtotal = 600 + 16 + 6 + 16,
449 .vrefresh = 60,
450};
451
452static const struct panel_desc auo_b101aw03 = {
453 .modes = &auo_b101aw03_mode,
454 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700455 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200456 .size = {
457 .width = 223,
458 .height = 125,
459 },
460};
461
Huang Lina531bc32015-02-28 10:18:58 +0800462static const struct drm_display_mode auo_b101ean01_mode = {
463 .clock = 72500,
464 .hdisplay = 1280,
465 .hsync_start = 1280 + 119,
466 .hsync_end = 1280 + 119 + 32,
467 .htotal = 1280 + 119 + 32 + 21,
468 .vdisplay = 800,
469 .vsync_start = 800 + 4,
470 .vsync_end = 800 + 4 + 20,
471 .vtotal = 800 + 4 + 20 + 8,
472 .vrefresh = 60,
473};
474
475static const struct panel_desc auo_b101ean01 = {
476 .modes = &auo_b101ean01_mode,
477 .num_modes = 1,
478 .bpc = 6,
479 .size = {
480 .width = 217,
481 .height = 136,
482 },
483};
484
Rob Clarkdac746e2014-08-01 17:01:06 -0400485static const struct drm_display_mode auo_b101xtn01_mode = {
486 .clock = 72000,
487 .hdisplay = 1366,
488 .hsync_start = 1366 + 20,
489 .hsync_end = 1366 + 20 + 70,
490 .htotal = 1366 + 20 + 70,
491 .vdisplay = 768,
492 .vsync_start = 768 + 14,
493 .vsync_end = 768 + 14 + 42,
494 .vtotal = 768 + 14 + 42,
495 .vrefresh = 60,
496 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
497};
498
499static const struct panel_desc auo_b101xtn01 = {
500 .modes = &auo_b101xtn01_mode,
501 .num_modes = 1,
502 .bpc = 6,
503 .size = {
504 .width = 223,
505 .height = 125,
506 },
507};
508
Ajay Kumare35e3052014-09-01 15:40:02 +0530509static const struct drm_display_mode auo_b116xw03_mode = {
510 .clock = 70589,
511 .hdisplay = 1366,
512 .hsync_start = 1366 + 40,
513 .hsync_end = 1366 + 40 + 40,
514 .htotal = 1366 + 40 + 40 + 32,
515 .vdisplay = 768,
516 .vsync_start = 768 + 10,
517 .vsync_end = 768 + 10 + 12,
518 .vtotal = 768 + 10 + 12 + 6,
519 .vrefresh = 60,
520};
521
522static const struct panel_desc auo_b116xw03 = {
523 .modes = &auo_b116xw03_mode,
524 .num_modes = 1,
525 .bpc = 6,
526 .size = {
527 .width = 256,
528 .height = 144,
529 },
530};
531
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700532static const struct drm_display_mode auo_b133xtn01_mode = {
533 .clock = 69500,
534 .hdisplay = 1366,
535 .hsync_start = 1366 + 48,
536 .hsync_end = 1366 + 48 + 32,
537 .htotal = 1366 + 48 + 32 + 20,
538 .vdisplay = 768,
539 .vsync_start = 768 + 3,
540 .vsync_end = 768 + 3 + 6,
541 .vtotal = 768 + 3 + 6 + 13,
542 .vrefresh = 60,
543};
544
545static const struct panel_desc auo_b133xtn01 = {
546 .modes = &auo_b133xtn01_mode,
547 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700548 .bpc = 6,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700549 .size = {
550 .width = 293,
551 .height = 165,
552 },
553};
554
Ajay Kumar3e51d602014-07-31 23:12:12 +0530555static const struct drm_display_mode auo_b133htn01_mode = {
556 .clock = 150660,
557 .hdisplay = 1920,
558 .hsync_start = 1920 + 172,
559 .hsync_end = 1920 + 172 + 80,
560 .htotal = 1920 + 172 + 80 + 60,
561 .vdisplay = 1080,
562 .vsync_start = 1080 + 25,
563 .vsync_end = 1080 + 25 + 10,
564 .vtotal = 1080 + 25 + 10 + 10,
565 .vrefresh = 60,
566};
567
568static const struct panel_desc auo_b133htn01 = {
569 .modes = &auo_b133htn01_mode,
570 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +0100571 .bpc = 6,
Ajay Kumar3e51d602014-07-31 23:12:12 +0530572 .size = {
573 .width = 293,
574 .height = 165,
575 },
576 .delay = {
577 .prepare = 105,
578 .enable = 20,
579 .unprepare = 50,
580 },
581};
582
Lukasz Majewskibccfaff2018-05-14 21:08:49 +0200583static const struct display_timing auo_g070vvn01_timings = {
584 .pixelclock = { 33300000, 34209000, 45000000 },
585 .hactive = { 800, 800, 800 },
586 .hfront_porch = { 20, 40, 200 },
587 .hback_porch = { 87, 40, 1 },
588 .hsync_len = { 1, 48, 87 },
589 .vactive = { 480, 480, 480 },
590 .vfront_porch = { 5, 13, 200 },
591 .vback_porch = { 31, 31, 29 },
592 .vsync_len = { 1, 1, 3 },
593};
594
595static const struct panel_desc auo_g070vvn01 = {
596 .timings = &auo_g070vvn01_timings,
597 .num_timings = 1,
598 .bpc = 8,
599 .size = {
600 .width = 152,
601 .height = 91,
602 },
603 .delay = {
604 .prepare = 200,
605 .enable = 50,
606 .disable = 50,
607 .unprepare = 1000,
608 },
609};
610
Christoph Fritz4451c282017-12-16 14:13:36 +0100611static const struct drm_display_mode auo_g104sn02_mode = {
612 .clock = 40000,
613 .hdisplay = 800,
614 .hsync_start = 800 + 40,
615 .hsync_end = 800 + 40 + 216,
616 .htotal = 800 + 40 + 216 + 128,
617 .vdisplay = 600,
618 .vsync_start = 600 + 10,
619 .vsync_end = 600 + 10 + 35,
620 .vtotal = 600 + 10 + 35 + 2,
621 .vrefresh = 60,
622};
623
624static const struct panel_desc auo_g104sn02 = {
625 .modes = &auo_g104sn02_mode,
626 .num_modes = 1,
627 .bpc = 8,
628 .size = {
629 .width = 211,
630 .height = 158,
631 },
632};
633
Lucas Stach697035c2016-11-30 14:09:55 +0100634static const struct display_timing auo_g133han01_timings = {
635 .pixelclock = { 134000000, 141200000, 149000000 },
636 .hactive = { 1920, 1920, 1920 },
637 .hfront_porch = { 39, 58, 77 },
638 .hback_porch = { 59, 88, 117 },
639 .hsync_len = { 28, 42, 56 },
640 .vactive = { 1080, 1080, 1080 },
641 .vfront_porch = { 3, 8, 11 },
642 .vback_porch = { 5, 14, 19 },
643 .vsync_len = { 4, 14, 19 },
644};
645
646static const struct panel_desc auo_g133han01 = {
647 .timings = &auo_g133han01_timings,
648 .num_timings = 1,
649 .bpc = 8,
650 .size = {
651 .width = 293,
652 .height = 165,
653 },
654 .delay = {
655 .prepare = 200,
656 .enable = 50,
657 .disable = 50,
658 .unprepare = 1000,
659 },
660 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
661};
662
Lucas Stach8c31f602016-11-30 14:09:56 +0100663static const struct display_timing auo_g185han01_timings = {
664 .pixelclock = { 120000000, 144000000, 175000000 },
665 .hactive = { 1920, 1920, 1920 },
666 .hfront_porch = { 18, 60, 74 },
667 .hback_porch = { 12, 44, 54 },
668 .hsync_len = { 10, 24, 32 },
669 .vactive = { 1080, 1080, 1080 },
670 .vfront_porch = { 6, 10, 40 },
671 .vback_porch = { 2, 5, 20 },
672 .vsync_len = { 2, 5, 20 },
673};
674
675static const struct panel_desc auo_g185han01 = {
676 .timings = &auo_g185han01_timings,
677 .num_timings = 1,
678 .bpc = 8,
679 .size = {
680 .width = 409,
681 .height = 230,
682 },
683 .delay = {
684 .prepare = 50,
685 .enable = 200,
686 .disable = 110,
687 .unprepare = 1000,
688 },
689 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
690};
691
Lucas Stach70c0d5b2017-06-08 20:07:58 +0200692static const struct display_timing auo_p320hvn03_timings = {
693 .pixelclock = { 106000000, 148500000, 164000000 },
694 .hactive = { 1920, 1920, 1920 },
695 .hfront_porch = { 25, 50, 130 },
696 .hback_porch = { 25, 50, 130 },
697 .hsync_len = { 20, 40, 105 },
698 .vactive = { 1080, 1080, 1080 },
699 .vfront_porch = { 8, 17, 150 },
700 .vback_porch = { 8, 17, 150 },
701 .vsync_len = { 4, 11, 100 },
702};
703
704static const struct panel_desc auo_p320hvn03 = {
705 .timings = &auo_p320hvn03_timings,
706 .num_timings = 1,
707 .bpc = 8,
708 .size = {
709 .width = 698,
710 .height = 393,
711 },
712 .delay = {
713 .prepare = 1,
714 .enable = 450,
715 .unprepare = 500,
716 },
Lucas Stach2554f152018-04-11 17:27:41 +0200717 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Lucas Stach70c0d5b2017-06-08 20:07:58 +0200718};
719
Haixia Shi7ee933a2016-10-11 14:59:16 -0700720static const struct drm_display_mode auo_t215hvn01_mode = {
721 .clock = 148800,
722 .hdisplay = 1920,
723 .hsync_start = 1920 + 88,
724 .hsync_end = 1920 + 88 + 44,
725 .htotal = 1920 + 88 + 44 + 148,
726 .vdisplay = 1080,
727 .vsync_start = 1080 + 4,
728 .vsync_end = 1080 + 4 + 5,
729 .vtotal = 1080 + 4 + 5 + 36,
730 .vrefresh = 60,
731};
732
733static const struct panel_desc auo_t215hvn01 = {
734 .modes = &auo_t215hvn01_mode,
735 .num_modes = 1,
736 .bpc = 8,
737 .size = {
738 .width = 430,
739 .height = 270,
740 },
741 .delay = {
742 .disable = 5,
743 .unprepare = 1000,
744 }
745};
746
Philipp Zabeld47df632014-12-18 16:43:43 +0100747static const struct drm_display_mode avic_tm070ddh03_mode = {
748 .clock = 51200,
749 .hdisplay = 1024,
750 .hsync_start = 1024 + 160,
751 .hsync_end = 1024 + 160 + 4,
752 .htotal = 1024 + 160 + 4 + 156,
753 .vdisplay = 600,
754 .vsync_start = 600 + 17,
755 .vsync_end = 600 + 17 + 1,
756 .vtotal = 600 + 17 + 1 + 17,
757 .vrefresh = 60,
758};
759
760static const struct panel_desc avic_tm070ddh03 = {
761 .modes = &avic_tm070ddh03_mode,
762 .num_modes = 1,
763 .bpc = 8,
764 .size = {
765 .width = 154,
766 .height = 90,
767 },
768 .delay = {
769 .prepare = 20,
770 .enable = 200,
771 .disable = 200,
772 },
773};
774
Caesar Wangcac1a412016-12-14 11:19:56 +0800775static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
776 {
777 .clock = 71900,
778 .hdisplay = 1280,
779 .hsync_start = 1280 + 48,
780 .hsync_end = 1280 + 48 + 32,
781 .htotal = 1280 + 48 + 32 + 80,
782 .vdisplay = 800,
783 .vsync_start = 800 + 3,
784 .vsync_end = 800 + 3 + 5,
785 .vtotal = 800 + 3 + 5 + 24,
786 .vrefresh = 60,
787 },
788 {
789 .clock = 57500,
790 .hdisplay = 1280,
791 .hsync_start = 1280 + 48,
792 .hsync_end = 1280 + 48 + 32,
793 .htotal = 1280 + 48 + 32 + 80,
794 .vdisplay = 800,
795 .vsync_start = 800 + 3,
796 .vsync_end = 800 + 3 + 5,
797 .vtotal = 800 + 3 + 5 + 24,
798 .vrefresh = 48,
799 },
800};
801
802static const struct panel_desc boe_nv101wxmn51 = {
803 .modes = boe_nv101wxmn51_modes,
804 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
805 .bpc = 8,
806 .size = {
807 .width = 217,
808 .height = 136,
809 },
810 .delay = {
811 .prepare = 210,
812 .enable = 50,
813 .unprepare = 160,
814 },
815};
816
Randy Li2cb35c82016-09-20 03:02:51 +0800817static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
818 .clock = 66770,
819 .hdisplay = 800,
820 .hsync_start = 800 + 49,
821 .hsync_end = 800 + 49 + 33,
822 .htotal = 800 + 49 + 33 + 17,
823 .vdisplay = 1280,
824 .vsync_start = 1280 + 1,
825 .vsync_end = 1280 + 1 + 7,
826 .vtotal = 1280 + 1 + 7 + 15,
827 .vrefresh = 60,
828 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
829};
830
831static const struct panel_desc chunghwa_claa070wp03xg = {
832 .modes = &chunghwa_claa070wp03xg_mode,
833 .num_modes = 1,
834 .bpc = 6,
835 .size = {
836 .width = 94,
837 .height = 150,
838 },
839};
840
Stephen Warren4c930752014-01-07 16:46:26 -0700841static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
842 .clock = 72070,
843 .hdisplay = 1366,
844 .hsync_start = 1366 + 58,
845 .hsync_end = 1366 + 58 + 58,
846 .htotal = 1366 + 58 + 58 + 58,
847 .vdisplay = 768,
848 .vsync_start = 768 + 4,
849 .vsync_end = 768 + 4 + 4,
850 .vtotal = 768 + 4 + 4 + 4,
851 .vrefresh = 60,
852};
853
854static const struct panel_desc chunghwa_claa101wa01a = {
855 .modes = &chunghwa_claa101wa01a_mode,
856 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700857 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -0700858 .size = {
859 .width = 220,
860 .height = 120,
861 },
862};
863
Thierry Reding280921d2013-08-30 15:10:14 +0200864static const struct drm_display_mode chunghwa_claa101wb01_mode = {
865 .clock = 69300,
866 .hdisplay = 1366,
867 .hsync_start = 1366 + 48,
868 .hsync_end = 1366 + 48 + 32,
869 .htotal = 1366 + 48 + 32 + 20,
870 .vdisplay = 768,
871 .vsync_start = 768 + 16,
872 .vsync_end = 768 + 16 + 8,
873 .vtotal = 768 + 16 + 8 + 16,
874 .vrefresh = 60,
875};
876
877static const struct panel_desc chunghwa_claa101wb01 = {
878 .modes = &chunghwa_claa101wb01_mode,
879 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700880 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200881 .size = {
882 .width = 223,
883 .height = 125,
884 },
885};
886
Stefan Agner26ab0062014-05-15 11:38:45 +0200887static const struct drm_display_mode edt_et057090dhu_mode = {
888 .clock = 25175,
889 .hdisplay = 640,
890 .hsync_start = 640 + 16,
891 .hsync_end = 640 + 16 + 30,
892 .htotal = 640 + 16 + 30 + 114,
893 .vdisplay = 480,
894 .vsync_start = 480 + 10,
895 .vsync_end = 480 + 10 + 3,
896 .vtotal = 480 + 10 + 3 + 32,
897 .vrefresh = 60,
898 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
899};
900
901static const struct panel_desc edt_et057090dhu = {
902 .modes = &edt_et057090dhu_mode,
903 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700904 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +0200905 .size = {
906 .width = 115,
907 .height = 86,
908 },
Stefan Agnereaeebff2016-12-08 14:54:31 -0800909 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
910 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
Stefan Agner26ab0062014-05-15 11:38:45 +0200911};
912
Philipp Zabelfff5de42014-05-15 12:25:47 +0200913static const struct drm_display_mode edt_etm0700g0dh6_mode = {
914 .clock = 33260,
915 .hdisplay = 800,
916 .hsync_start = 800 + 40,
917 .hsync_end = 800 + 40 + 128,
918 .htotal = 800 + 40 + 128 + 88,
919 .vdisplay = 480,
920 .vsync_start = 480 + 10,
921 .vsync_end = 480 + 10 + 2,
922 .vtotal = 480 + 10 + 2 + 33,
923 .vrefresh = 60,
924 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
925};
926
927static const struct panel_desc edt_etm0700g0dh6 = {
928 .modes = &edt_etm0700g0dh6_mode,
929 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700930 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +0200931 .size = {
932 .width = 152,
933 .height = 91,
934 },
Stefan Agnereaeebff2016-12-08 14:54:31 -0800935 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
936 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
Philipp Zabelfff5de42014-05-15 12:25:47 +0200937};
938
Jan Tuerkaa7e6452018-06-19 11:55:44 +0200939static const struct panel_desc edt_etm0700g0bdh6 = {
940 .modes = &edt_etm0700g0dh6_mode,
941 .num_modes = 1,
942 .bpc = 6,
943 .size = {
944 .width = 152,
945 .height = 91,
946 },
947 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
948 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
949};
950
Boris BREZILLON102932b2014-06-05 15:53:32 +0200951static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
952 .clock = 32260,
953 .hdisplay = 800,
954 .hsync_start = 800 + 168,
955 .hsync_end = 800 + 168 + 64,
956 .htotal = 800 + 168 + 64 + 88,
957 .vdisplay = 480,
958 .vsync_start = 480 + 37,
959 .vsync_end = 480 + 37 + 2,
960 .vtotal = 480 + 37 + 2 + 8,
961 .vrefresh = 60,
962};
963
964static const struct panel_desc foxlink_fl500wvr00_a0t = {
965 .modes = &foxlink_fl500wvr00_a0t_mode,
966 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +0100967 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +0200968 .size = {
969 .width = 108,
970 .height = 65,
971 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +0200972 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +0200973};
974
Philipp Zabeld435a2a2014-11-19 10:29:55 +0100975static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
976 .clock = 9000,
977 .hdisplay = 480,
978 .hsync_start = 480 + 5,
979 .hsync_end = 480 + 5 + 1,
980 .htotal = 480 + 5 + 1 + 40,
981 .vdisplay = 272,
982 .vsync_start = 272 + 8,
983 .vsync_end = 272 + 8 + 1,
984 .vtotal = 272 + 8 + 1 + 8,
985 .vrefresh = 60,
986};
987
988static const struct panel_desc giantplus_gpg482739qs5 = {
989 .modes = &giantplus_gpg482739qs5_mode,
990 .num_modes = 1,
991 .bpc = 8,
992 .size = {
993 .width = 95,
994 .height = 54,
995 },
Philipp Zabel33536a02015-02-11 18:50:07 +0100996 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +0100997};
998
Philipp Zabelab077252014-12-11 18:32:46 +0100999static const struct display_timing hannstar_hsd070pww1_timing = {
1000 .pixelclock = { 64300000, 71100000, 82000000 },
1001 .hactive = { 1280, 1280, 1280 },
1002 .hfront_porch = { 1, 1, 10 },
1003 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +02001004 /*
1005 * According to the data sheet, the minimum horizontal blanking interval
1006 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
1007 * minimum working horizontal blanking interval to be 60 clocks.
1008 */
1009 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +01001010 .vactive = { 800, 800, 800 },
1011 .vfront_porch = { 1, 1, 10 },
1012 .vback_porch = { 1, 1, 10 },
1013 .vsync_len = { 1, 21, 203 },
1014 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +02001015};
1016
1017static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +01001018 .timings = &hannstar_hsd070pww1_timing,
1019 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +02001020 .bpc = 6,
1021 .size = {
1022 .width = 151,
1023 .height = 94,
1024 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +02001025 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Philipp Zabela8532052014-10-23 16:31:06 +02001026};
1027
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001028static const struct display_timing hannstar_hsd100pxn1_timing = {
1029 .pixelclock = { 55000000, 65000000, 75000000 },
1030 .hactive = { 1024, 1024, 1024 },
1031 .hfront_porch = { 40, 40, 40 },
1032 .hback_porch = { 220, 220, 220 },
1033 .hsync_len = { 20, 60, 100 },
1034 .vactive = { 768, 768, 768 },
1035 .vfront_porch = { 7, 7, 7 },
1036 .vback_porch = { 21, 21, 21 },
1037 .vsync_len = { 10, 10, 10 },
1038 .flags = DISPLAY_FLAGS_DE_HIGH,
1039};
1040
1041static const struct panel_desc hannstar_hsd100pxn1 = {
1042 .timings = &hannstar_hsd100pxn1_timing,
1043 .num_timings = 1,
1044 .bpc = 6,
1045 .size = {
1046 .width = 203,
1047 .height = 152,
1048 },
Philipp Zabel4946b042015-05-20 11:34:08 +02001049 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001050};
1051
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001052static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
1053 .clock = 33333,
1054 .hdisplay = 800,
1055 .hsync_start = 800 + 85,
1056 .hsync_end = 800 + 85 + 86,
1057 .htotal = 800 + 85 + 86 + 85,
1058 .vdisplay = 480,
1059 .vsync_start = 480 + 16,
1060 .vsync_end = 480 + 16 + 13,
1061 .vtotal = 480 + 16 + 13 + 16,
1062 .vrefresh = 60,
1063};
1064
1065static const struct panel_desc hitachi_tx23d38vm0caa = {
1066 .modes = &hitachi_tx23d38vm0caa_mode,
1067 .num_modes = 1,
1068 .bpc = 6,
1069 .size = {
1070 .width = 195,
1071 .height = 117,
1072 },
Philipp Zabel6c684e32017-10-11 14:59:58 +02001073 .delay = {
1074 .enable = 160,
1075 .disable = 160,
1076 },
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001077};
1078
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001079static const struct drm_display_mode innolux_at043tn24_mode = {
1080 .clock = 9000,
1081 .hdisplay = 480,
1082 .hsync_start = 480 + 2,
1083 .hsync_end = 480 + 2 + 41,
1084 .htotal = 480 + 2 + 41 + 2,
1085 .vdisplay = 272,
1086 .vsync_start = 272 + 2,
Philipp Zabela4831592017-10-11 14:59:56 +02001087 .vsync_end = 272 + 2 + 10,
1088 .vtotal = 272 + 2 + 10 + 2,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001089 .vrefresh = 60,
1090 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1091};
1092
1093static const struct panel_desc innolux_at043tn24 = {
1094 .modes = &innolux_at043tn24_mode,
1095 .num_modes = 1,
1096 .bpc = 8,
1097 .size = {
1098 .width = 95,
1099 .height = 54,
1100 },
1101 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabel65602792017-10-11 14:59:57 +02001102 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001103};
1104
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02001105static const struct drm_display_mode innolux_at070tn92_mode = {
1106 .clock = 33333,
1107 .hdisplay = 800,
1108 .hsync_start = 800 + 210,
1109 .hsync_end = 800 + 210 + 20,
1110 .htotal = 800 + 210 + 20 + 46,
1111 .vdisplay = 480,
1112 .vsync_start = 480 + 22,
1113 .vsync_end = 480 + 22 + 10,
1114 .vtotal = 480 + 22 + 23 + 10,
1115 .vrefresh = 60,
1116};
1117
1118static const struct panel_desc innolux_at070tn92 = {
1119 .modes = &innolux_at070tn92_mode,
1120 .num_modes = 1,
1121 .size = {
1122 .width = 154,
1123 .height = 86,
1124 },
1125 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1126};
1127
Michael Olbrich1e29b842016-08-15 14:32:02 +02001128static const struct display_timing innolux_g101ice_l01_timing = {
1129 .pixelclock = { 60400000, 71100000, 74700000 },
1130 .hactive = { 1280, 1280, 1280 },
1131 .hfront_porch = { 41, 80, 100 },
1132 .hback_porch = { 40, 79, 99 },
1133 .hsync_len = { 1, 1, 1 },
1134 .vactive = { 800, 800, 800 },
1135 .vfront_porch = { 5, 11, 14 },
1136 .vback_porch = { 4, 11, 14 },
1137 .vsync_len = { 1, 1, 1 },
1138 .flags = DISPLAY_FLAGS_DE_HIGH,
1139};
1140
1141static const struct panel_desc innolux_g101ice_l01 = {
1142 .timings = &innolux_g101ice_l01_timing,
1143 .num_timings = 1,
1144 .bpc = 8,
1145 .size = {
1146 .width = 217,
1147 .height = 135,
1148 },
1149 .delay = {
1150 .enable = 200,
1151 .disable = 200,
1152 },
1153 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1154};
1155
Lucas Stach4ae13e42016-11-30 14:09:54 +01001156static const struct display_timing innolux_g121i1_l01_timing = {
1157 .pixelclock = { 67450000, 71000000, 74550000 },
1158 .hactive = { 1280, 1280, 1280 },
1159 .hfront_porch = { 40, 80, 160 },
1160 .hback_porch = { 39, 79, 159 },
1161 .hsync_len = { 1, 1, 1 },
1162 .vactive = { 800, 800, 800 },
1163 .vfront_porch = { 5, 11, 100 },
1164 .vback_porch = { 4, 11, 99 },
1165 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01001166};
1167
1168static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01001169 .timings = &innolux_g121i1_l01_timing,
1170 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01001171 .bpc = 6,
1172 .size = {
1173 .width = 261,
1174 .height = 163,
1175 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01001176 .delay = {
1177 .enable = 200,
1178 .disable = 20,
1179 },
1180 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Lucas Stachd731f662014-11-06 17:44:33 +01001181};
1182
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001183static const struct drm_display_mode innolux_g121x1_l03_mode = {
1184 .clock = 65000,
1185 .hdisplay = 1024,
1186 .hsync_start = 1024 + 0,
1187 .hsync_end = 1024 + 1,
1188 .htotal = 1024 + 0 + 1 + 320,
1189 .vdisplay = 768,
1190 .vsync_start = 768 + 38,
1191 .vsync_end = 768 + 38 + 1,
1192 .vtotal = 768 + 38 + 1 + 0,
1193 .vrefresh = 60,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05001194 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001195};
1196
1197static const struct panel_desc innolux_g121x1_l03 = {
1198 .modes = &innolux_g121x1_l03_mode,
1199 .num_modes = 1,
1200 .bpc = 6,
1201 .size = {
1202 .width = 246,
1203 .height = 185,
1204 },
1205 .delay = {
1206 .enable = 200,
1207 .unprepare = 200,
1208 .disable = 400,
1209 },
1210};
1211
Thierry Reding0a2288c2014-07-03 14:02:59 +02001212static const struct drm_display_mode innolux_n116bge_mode = {
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001213 .clock = 76420,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001214 .hdisplay = 1366,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001215 .hsync_start = 1366 + 136,
1216 .hsync_end = 1366 + 136 + 30,
1217 .htotal = 1366 + 136 + 30 + 60,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001218 .vdisplay = 768,
1219 .vsync_start = 768 + 8,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001220 .vsync_end = 768 + 8 + 12,
1221 .vtotal = 768 + 8 + 12 + 12,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001222 .vrefresh = 60,
1223 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1224};
1225
1226static const struct panel_desc innolux_n116bge = {
1227 .modes = &innolux_n116bge_mode,
1228 .num_modes = 1,
1229 .bpc = 6,
1230 .size = {
1231 .width = 256,
1232 .height = 144,
1233 },
1234};
1235
Alban Bedelea447392014-07-22 08:38:55 +02001236static const struct drm_display_mode innolux_n156bge_l21_mode = {
1237 .clock = 69300,
1238 .hdisplay = 1366,
1239 .hsync_start = 1366 + 16,
1240 .hsync_end = 1366 + 16 + 34,
1241 .htotal = 1366 + 16 + 34 + 50,
1242 .vdisplay = 768,
1243 .vsync_start = 768 + 2,
1244 .vsync_end = 768 + 2 + 6,
1245 .vtotal = 768 + 2 + 6 + 12,
1246 .vrefresh = 60,
1247};
1248
1249static const struct panel_desc innolux_n156bge_l21 = {
1250 .modes = &innolux_n156bge_l21_mode,
1251 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001252 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02001253 .size = {
1254 .width = 344,
1255 .height = 193,
1256 },
1257};
1258
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05301259static const struct drm_display_mode innolux_tv123wam_mode = {
1260 .clock = 206016,
1261 .hdisplay = 2160,
1262 .hsync_start = 2160 + 48,
1263 .hsync_end = 2160 + 48 + 32,
1264 .htotal = 2160 + 48 + 32 + 80,
1265 .vdisplay = 1440,
1266 .vsync_start = 1440 + 3,
1267 .vsync_end = 1440 + 3 + 10,
1268 .vtotal = 1440 + 3 + 10 + 27,
1269 .vrefresh = 60,
1270 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
1271};
1272
1273static const struct panel_desc innolux_tv123wam = {
1274 .modes = &innolux_tv123wam_mode,
1275 .num_modes = 1,
1276 .bpc = 8,
1277 .size = {
1278 .width = 259,
1279 .height = 173,
1280 },
1281};
1282
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001283static const struct drm_display_mode innolux_zj070na_01p_mode = {
1284 .clock = 51501,
1285 .hdisplay = 1024,
1286 .hsync_start = 1024 + 128,
1287 .hsync_end = 1024 + 128 + 64,
1288 .htotal = 1024 + 128 + 64 + 128,
1289 .vdisplay = 600,
1290 .vsync_start = 600 + 16,
1291 .vsync_end = 600 + 16 + 4,
1292 .vtotal = 600 + 16 + 4 + 16,
1293 .vrefresh = 60,
1294};
1295
1296static const struct panel_desc innolux_zj070na_01p = {
1297 .modes = &innolux_zj070na_01p_mode,
1298 .num_modes = 1,
1299 .bpc = 6,
1300 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001301 .width = 154,
1302 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001303 },
1304};
1305
Jagan Teki8cfe8342018-02-04 23:19:28 +05301306static const struct display_timing koe_tx31d200vm0baa_timing = {
1307 .pixelclock = { 39600000, 43200000, 48000000 },
1308 .hactive = { 1280, 1280, 1280 },
1309 .hfront_porch = { 16, 36, 56 },
1310 .hback_porch = { 16, 36, 56 },
1311 .hsync_len = { 8, 8, 8 },
1312 .vactive = { 480, 480, 480 },
Stefan Agnerc9b6be72018-04-19 23:20:03 +02001313 .vfront_porch = { 6, 21, 33 },
1314 .vback_porch = { 6, 21, 33 },
Jagan Teki8cfe8342018-02-04 23:19:28 +05301315 .vsync_len = { 8, 8, 8 },
1316 .flags = DISPLAY_FLAGS_DE_HIGH,
1317};
1318
1319static const struct panel_desc koe_tx31d200vm0baa = {
1320 .timings = &koe_tx31d200vm0baa_timing,
1321 .num_timings = 1,
1322 .bpc = 6,
1323 .size = {
1324 .width = 292,
1325 .height = 109,
1326 },
1327 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1328};
1329
Lucas Stach8def22e2015-12-02 19:41:11 +01001330static const struct display_timing kyo_tcg121xglp_timing = {
1331 .pixelclock = { 52000000, 65000000, 71000000 },
1332 .hactive = { 1024, 1024, 1024 },
1333 .hfront_porch = { 2, 2, 2 },
1334 .hback_porch = { 2, 2, 2 },
1335 .hsync_len = { 86, 124, 244 },
1336 .vactive = { 768, 768, 768 },
1337 .vfront_porch = { 2, 2, 2 },
1338 .vback_porch = { 2, 2, 2 },
1339 .vsync_len = { 6, 34, 73 },
1340 .flags = DISPLAY_FLAGS_DE_HIGH,
1341};
1342
1343static const struct panel_desc kyo_tcg121xglp = {
1344 .timings = &kyo_tcg121xglp_timing,
1345 .num_timings = 1,
1346 .bpc = 8,
1347 .size = {
1348 .width = 246,
1349 .height = 184,
1350 },
1351 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1352};
1353
Heiko Schocherdd015002015-05-22 10:25:57 +02001354static const struct drm_display_mode lg_lb070wv8_mode = {
1355 .clock = 33246,
1356 .hdisplay = 800,
1357 .hsync_start = 800 + 88,
1358 .hsync_end = 800 + 88 + 80,
1359 .htotal = 800 + 88 + 80 + 88,
1360 .vdisplay = 480,
1361 .vsync_start = 480 + 10,
1362 .vsync_end = 480 + 10 + 25,
1363 .vtotal = 480 + 10 + 25 + 10,
1364 .vrefresh = 60,
1365};
1366
1367static const struct panel_desc lg_lb070wv8 = {
1368 .modes = &lg_lb070wv8_mode,
1369 .num_modes = 1,
1370 .bpc = 16,
1371 .size = {
1372 .width = 151,
1373 .height = 91,
1374 },
1375 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1376};
1377
Yakir Yangc5ece402016-06-28 12:51:15 +08001378static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1379 .clock = 200000,
1380 .hdisplay = 1536,
1381 .hsync_start = 1536 + 12,
1382 .hsync_end = 1536 + 12 + 16,
1383 .htotal = 1536 + 12 + 16 + 48,
1384 .vdisplay = 2048,
1385 .vsync_start = 2048 + 8,
1386 .vsync_end = 2048 + 8 + 4,
1387 .vtotal = 2048 + 8 + 4 + 8,
1388 .vrefresh = 60,
1389 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1390};
1391
1392static const struct panel_desc lg_lp079qx1_sp0v = {
1393 .modes = &lg_lp079qx1_sp0v_mode,
1394 .num_modes = 1,
1395 .size = {
1396 .width = 129,
1397 .height = 171,
1398 },
1399};
1400
Yakir Yang0355dde2016-06-12 10:56:02 +08001401static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1402 .clock = 205210,
1403 .hdisplay = 2048,
1404 .hsync_start = 2048 + 150,
1405 .hsync_end = 2048 + 150 + 5,
1406 .htotal = 2048 + 150 + 5 + 5,
1407 .vdisplay = 1536,
1408 .vsync_start = 1536 + 3,
1409 .vsync_end = 1536 + 3 + 1,
1410 .vtotal = 1536 + 3 + 1 + 9,
1411 .vrefresh = 60,
1412};
1413
1414static const struct panel_desc lg_lp097qx1_spa1 = {
1415 .modes = &lg_lp097qx1_spa1_mode,
1416 .num_modes = 1,
1417 .size = {
1418 .width = 208,
1419 .height = 147,
1420 },
1421};
1422
Jitao Shi690d8fa2016-02-22 19:01:44 +08001423static const struct drm_display_mode lg_lp120up1_mode = {
1424 .clock = 162300,
1425 .hdisplay = 1920,
1426 .hsync_start = 1920 + 40,
1427 .hsync_end = 1920 + 40 + 40,
1428 .htotal = 1920 + 40 + 40+ 80,
1429 .vdisplay = 1280,
1430 .vsync_start = 1280 + 4,
1431 .vsync_end = 1280 + 4 + 4,
1432 .vtotal = 1280 + 4 + 4 + 12,
1433 .vrefresh = 60,
1434};
1435
1436static const struct panel_desc lg_lp120up1 = {
1437 .modes = &lg_lp120up1_mode,
1438 .num_modes = 1,
1439 .bpc = 8,
1440 .size = {
1441 .width = 267,
1442 .height = 183,
1443 },
1444};
1445
Thierry Redingec7c5652013-11-15 15:59:32 +01001446static const struct drm_display_mode lg_lp129qe_mode = {
1447 .clock = 285250,
1448 .hdisplay = 2560,
1449 .hsync_start = 2560 + 48,
1450 .hsync_end = 2560 + 48 + 32,
1451 .htotal = 2560 + 48 + 32 + 80,
1452 .vdisplay = 1700,
1453 .vsync_start = 1700 + 3,
1454 .vsync_end = 1700 + 3 + 10,
1455 .vtotal = 1700 + 3 + 10 + 36,
1456 .vrefresh = 60,
1457};
1458
1459static const struct panel_desc lg_lp129qe = {
1460 .modes = &lg_lp129qe_mode,
1461 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001462 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01001463 .size = {
1464 .width = 272,
1465 .height = 181,
1466 },
1467};
1468
Lukasz Majewski65c766c2017-10-21 00:18:37 +02001469static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
1470 .clock = 30400,
1471 .hdisplay = 800,
1472 .hsync_start = 800 + 0,
1473 .hsync_end = 800 + 1,
1474 .htotal = 800 + 0 + 1 + 160,
1475 .vdisplay = 480,
1476 .vsync_start = 480 + 0,
1477 .vsync_end = 480 + 48 + 1,
1478 .vtotal = 480 + 48 + 1 + 0,
1479 .vrefresh = 60,
1480 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1481};
1482
1483static const struct panel_desc mitsubishi_aa070mc01 = {
1484 .modes = &mitsubishi_aa070mc01_mode,
1485 .num_modes = 1,
1486 .bpc = 8,
1487 .size = {
1488 .width = 152,
1489 .height = 91,
1490 },
1491
1492 .delay = {
1493 .enable = 200,
1494 .unprepare = 200,
1495 .disable = 400,
1496 },
1497 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1498 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1499};
1500
Lucas Stach01bacc132017-06-08 20:07:55 +02001501static const struct display_timing nec_nl12880bc20_05_timing = {
1502 .pixelclock = { 67000000, 71000000, 75000000 },
1503 .hactive = { 1280, 1280, 1280 },
1504 .hfront_porch = { 2, 30, 30 },
1505 .hback_porch = { 6, 100, 100 },
1506 .hsync_len = { 2, 30, 30 },
1507 .vactive = { 800, 800, 800 },
1508 .vfront_porch = { 5, 5, 5 },
1509 .vback_porch = { 11, 11, 11 },
1510 .vsync_len = { 7, 7, 7 },
1511};
1512
1513static const struct panel_desc nec_nl12880bc20_05 = {
1514 .timings = &nec_nl12880bc20_05_timing,
1515 .num_timings = 1,
1516 .bpc = 8,
1517 .size = {
1518 .width = 261,
1519 .height = 163,
1520 },
1521 .delay = {
1522 .enable = 50,
1523 .disable = 50,
1524 },
1525 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1526};
1527
jianwei wangc6e87f92015-07-29 16:30:02 +08001528static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
1529 .clock = 10870,
1530 .hdisplay = 480,
1531 .hsync_start = 480 + 2,
1532 .hsync_end = 480 + 2 + 41,
1533 .htotal = 480 + 2 + 41 + 2,
1534 .vdisplay = 272,
1535 .vsync_start = 272 + 2,
1536 .vsync_end = 272 + 2 + 4,
1537 .vtotal = 272 + 2 + 4 + 2,
1538 .vrefresh = 74,
Stefan Agner4bc390c2015-11-17 19:10:29 -08001539 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08001540};
1541
1542static const struct panel_desc nec_nl4827hc19_05b = {
1543 .modes = &nec_nl4827hc19_05b_mode,
1544 .num_modes = 1,
1545 .bpc = 8,
1546 .size = {
1547 .width = 95,
1548 .height = 54,
1549 },
Stefan Agner2c806612016-02-08 12:50:13 -08001550 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1551 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08001552};
1553
Maxime Riparde6c2f062016-09-06 16:46:17 +02001554static const struct drm_display_mode netron_dy_e231732_mode = {
1555 .clock = 66000,
1556 .hdisplay = 1024,
1557 .hsync_start = 1024 + 160,
1558 .hsync_end = 1024 + 160 + 70,
1559 .htotal = 1024 + 160 + 70 + 90,
1560 .vdisplay = 600,
1561 .vsync_start = 600 + 127,
1562 .vsync_end = 600 + 127 + 20,
1563 .vtotal = 600 + 127 + 20 + 3,
1564 .vrefresh = 60,
1565};
1566
1567static const struct panel_desc netron_dy_e231732 = {
1568 .modes = &netron_dy_e231732_mode,
1569 .num_modes = 1,
1570 .size = {
1571 .width = 154,
1572 .height = 87,
1573 },
1574 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1575};
1576
Lucas Stach4177fa62017-06-08 20:07:57 +02001577static const struct display_timing nlt_nl192108ac18_02d_timing = {
1578 .pixelclock = { 130000000, 148350000, 163000000 },
1579 .hactive = { 1920, 1920, 1920 },
1580 .hfront_porch = { 80, 100, 100 },
1581 .hback_porch = { 100, 120, 120 },
1582 .hsync_len = { 50, 60, 60 },
1583 .vactive = { 1080, 1080, 1080 },
1584 .vfront_porch = { 12, 30, 30 },
1585 .vback_porch = { 4, 10, 10 },
1586 .vsync_len = { 4, 5, 5 },
1587};
1588
1589static const struct panel_desc nlt_nl192108ac18_02d = {
1590 .timings = &nlt_nl192108ac18_02d_timing,
1591 .num_timings = 1,
1592 .bpc = 8,
1593 .size = {
1594 .width = 344,
1595 .height = 194,
1596 },
1597 .delay = {
1598 .unprepare = 500,
1599 },
1600 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1601};
1602
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02001603static const struct drm_display_mode nvd_9128_mode = {
1604 .clock = 29500,
1605 .hdisplay = 800,
1606 .hsync_start = 800 + 130,
1607 .hsync_end = 800 + 130 + 98,
1608 .htotal = 800 + 0 + 130 + 98,
1609 .vdisplay = 480,
1610 .vsync_start = 480 + 10,
1611 .vsync_end = 480 + 10 + 50,
1612 .vtotal = 480 + 0 + 10 + 50,
1613};
1614
1615static const struct panel_desc nvd_9128 = {
1616 .modes = &nvd_9128_mode,
1617 .num_modes = 1,
1618 .bpc = 8,
1619 .size = {
1620 .width = 156,
1621 .height = 88,
1622 },
1623 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1624};
1625
Gary Bissona99fb622015-06-10 18:44:23 +02001626static const struct display_timing okaya_rs800480t_7x0gp_timing = {
1627 .pixelclock = { 30000000, 30000000, 40000000 },
1628 .hactive = { 800, 800, 800 },
1629 .hfront_porch = { 40, 40, 40 },
1630 .hback_porch = { 40, 40, 40 },
1631 .hsync_len = { 1, 48, 48 },
1632 .vactive = { 480, 480, 480 },
1633 .vfront_porch = { 13, 13, 13 },
1634 .vback_porch = { 29, 29, 29 },
1635 .vsync_len = { 3, 3, 3 },
1636 .flags = DISPLAY_FLAGS_DE_HIGH,
1637};
1638
1639static const struct panel_desc okaya_rs800480t_7x0gp = {
1640 .timings = &okaya_rs800480t_7x0gp_timing,
1641 .num_timings = 1,
1642 .bpc = 6,
1643 .size = {
1644 .width = 154,
1645 .height = 87,
1646 },
1647 .delay = {
1648 .prepare = 41,
1649 .enable = 50,
1650 .unprepare = 41,
1651 .disable = 50,
1652 },
1653 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1654};
1655
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001656static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
1657 .clock = 9000,
1658 .hdisplay = 480,
1659 .hsync_start = 480 + 5,
1660 .hsync_end = 480 + 5 + 30,
1661 .htotal = 480 + 5 + 30 + 10,
1662 .vdisplay = 272,
1663 .vsync_start = 272 + 8,
1664 .vsync_end = 272 + 8 + 5,
1665 .vtotal = 272 + 8 + 5 + 3,
1666 .vrefresh = 60,
1667};
1668
1669static const struct panel_desc olimex_lcd_olinuxino_43ts = {
1670 .modes = &olimex_lcd_olinuxino_43ts_mode,
1671 .num_modes = 1,
1672 .size = {
Jonathan Liu30c6d7ab92017-07-20 20:29:43 +10001673 .width = 95,
1674 .height = 54,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001675 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10001676 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001677};
1678
Eric Anholte8b6f562016-03-24 17:23:48 -07001679/*
1680 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1681 * pixel clocks, but this is the timing that was being used in the Adafruit
1682 * installation instructions.
1683 */
1684static const struct drm_display_mode ontat_yx700wv03_mode = {
1685 .clock = 29500,
1686 .hdisplay = 800,
1687 .hsync_start = 824,
1688 .hsync_end = 896,
1689 .htotal = 992,
1690 .vdisplay = 480,
1691 .vsync_start = 483,
1692 .vsync_end = 493,
1693 .vtotal = 500,
1694 .vrefresh = 60,
1695 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1696};
1697
1698/*
1699 * Specification at:
1700 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1701 */
1702static const struct panel_desc ontat_yx700wv03 = {
1703 .modes = &ontat_yx700wv03_mode,
1704 .num_modes = 1,
1705 .bpc = 8,
1706 .size = {
1707 .width = 154,
1708 .height = 83,
1709 },
Eric Anholt5651e5e2018-03-09 15:33:32 -08001710 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Eric Anholte8b6f562016-03-24 17:23:48 -07001711};
1712
Philipp Zabel725c9d42015-02-11 18:50:11 +01001713static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
1714 .clock = 25000,
1715 .hdisplay = 480,
1716 .hsync_start = 480 + 10,
1717 .hsync_end = 480 + 10 + 10,
1718 .htotal = 480 + 10 + 10 + 15,
1719 .vdisplay = 800,
1720 .vsync_start = 800 + 3,
1721 .vsync_end = 800 + 3 + 3,
1722 .vtotal = 800 + 3 + 3 + 3,
1723 .vrefresh = 60,
1724};
1725
1726static const struct panel_desc ortustech_com43h4m85ulc = {
1727 .modes = &ortustech_com43h4m85ulc_mode,
1728 .num_modes = 1,
1729 .bpc = 8,
1730 .size = {
1731 .width = 56,
1732 .height = 93,
1733 },
1734 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Marek Vasute0932f92016-08-26 18:26:00 +02001735 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
Philipp Zabel725c9d42015-02-11 18:50:11 +01001736};
1737
Josh Wud2a6f0f2015-10-08 17:42:41 +02001738static const struct drm_display_mode qd43003c0_40_mode = {
1739 .clock = 9000,
1740 .hdisplay = 480,
1741 .hsync_start = 480 + 8,
1742 .hsync_end = 480 + 8 + 4,
1743 .htotal = 480 + 8 + 4 + 39,
1744 .vdisplay = 272,
1745 .vsync_start = 272 + 4,
1746 .vsync_end = 272 + 4 + 10,
1747 .vtotal = 272 + 4 + 10 + 2,
1748 .vrefresh = 60,
1749};
1750
1751static const struct panel_desc qd43003c0_40 = {
1752 .modes = &qd43003c0_40_mode,
1753 .num_modes = 1,
1754 .bpc = 8,
1755 .size = {
1756 .width = 95,
1757 .height = 53,
1758 },
1759 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1760};
1761
Jagan Teki23167fa2018-06-07 19:16:48 +05301762static const struct display_timing rocktech_rk070er9427_timing = {
1763 .pixelclock = { 26400000, 33300000, 46800000 },
1764 .hactive = { 800, 800, 800 },
1765 .hfront_porch = { 16, 210, 354 },
1766 .hback_porch = { 46, 46, 46 },
1767 .hsync_len = { 1, 1, 1 },
1768 .vactive = { 480, 480, 480 },
1769 .vfront_porch = { 7, 22, 147 },
1770 .vback_porch = { 23, 23, 23 },
1771 .vsync_len = { 1, 1, 1 },
1772 .flags = DISPLAY_FLAGS_DE_HIGH,
1773};
1774
1775static const struct panel_desc rocktech_rk070er9427 = {
1776 .timings = &rocktech_rk070er9427_timing,
1777 .num_timings = 1,
1778 .bpc = 6,
1779 .size = {
1780 .width = 154,
1781 .height = 86,
1782 },
1783 .delay = {
1784 .prepare = 41,
1785 .enable = 50,
1786 .unprepare = 41,
1787 .disable = 50,
1788 },
1789 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1790};
1791
Yakir Yang0330eaf2016-06-12 10:56:13 +08001792static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
1793 .clock = 271560,
1794 .hdisplay = 2560,
1795 .hsync_start = 2560 + 48,
1796 .hsync_end = 2560 + 48 + 32,
1797 .htotal = 2560 + 48 + 32 + 80,
1798 .vdisplay = 1600,
1799 .vsync_start = 1600 + 2,
1800 .vsync_end = 1600 + 2 + 5,
1801 .vtotal = 1600 + 2 + 5 + 57,
1802 .vrefresh = 60,
1803};
1804
1805static const struct panel_desc samsung_lsn122dl01_c01 = {
1806 .modes = &samsung_lsn122dl01_c01_mode,
1807 .num_modes = 1,
1808 .size = {
1809 .width = 263,
1810 .height = 164,
1811 },
1812};
1813
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001814static const struct drm_display_mode samsung_ltn101nt05_mode = {
1815 .clock = 54030,
1816 .hdisplay = 1024,
1817 .hsync_start = 1024 + 24,
1818 .hsync_end = 1024 + 24 + 136,
1819 .htotal = 1024 + 24 + 136 + 160,
1820 .vdisplay = 600,
1821 .vsync_start = 600 + 3,
1822 .vsync_end = 600 + 3 + 6,
1823 .vtotal = 600 + 3 + 6 + 61,
1824 .vrefresh = 60,
1825};
1826
1827static const struct panel_desc samsung_ltn101nt05 = {
1828 .modes = &samsung_ltn101nt05_mode,
1829 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001830 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001831 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001832 .width = 223,
1833 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001834 },
1835};
1836
Stéphane Marchesin0c934302015-03-18 10:52:18 +01001837static const struct drm_display_mode samsung_ltn140at29_301_mode = {
1838 .clock = 76300,
1839 .hdisplay = 1366,
1840 .hsync_start = 1366 + 64,
1841 .hsync_end = 1366 + 64 + 48,
1842 .htotal = 1366 + 64 + 48 + 128,
1843 .vdisplay = 768,
1844 .vsync_start = 768 + 2,
1845 .vsync_end = 768 + 2 + 5,
1846 .vtotal = 768 + 2 + 5 + 17,
1847 .vrefresh = 60,
1848};
1849
1850static const struct panel_desc samsung_ltn140at29_301 = {
1851 .modes = &samsung_ltn140at29_301_mode,
1852 .num_modes = 1,
1853 .bpc = 6,
1854 .size = {
1855 .width = 320,
1856 .height = 187,
1857 },
1858};
1859
Joshua Clayton592aa022016-07-06 15:59:16 -07001860static const struct display_timing sharp_lq101k1ly04_timing = {
1861 .pixelclock = { 60000000, 65000000, 80000000 },
1862 .hactive = { 1280, 1280, 1280 },
1863 .hfront_porch = { 20, 20, 20 },
1864 .hback_porch = { 20, 20, 20 },
1865 .hsync_len = { 10, 10, 10 },
1866 .vactive = { 800, 800, 800 },
1867 .vfront_porch = { 4, 4, 4 },
1868 .vback_porch = { 4, 4, 4 },
1869 .vsync_len = { 4, 4, 4 },
1870 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
1871};
1872
1873static const struct panel_desc sharp_lq101k1ly04 = {
1874 .timings = &sharp_lq101k1ly04_timing,
1875 .num_timings = 1,
1876 .bpc = 8,
1877 .size = {
1878 .width = 217,
1879 .height = 136,
1880 },
1881 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
1882};
1883
Sean Paul9f7bae22018-02-08 12:48:52 -05001884static const struct display_timing sharp_lq123p1jx31_timing = {
1885 .pixelclock = { 252750000, 252750000, 266604720 },
1886 .hactive = { 2400, 2400, 2400 },
1887 .hfront_porch = { 48, 48, 48 },
1888 .hback_porch = { 80, 80, 84 },
1889 .hsync_len = { 32, 32, 32 },
1890 .vactive = { 1600, 1600, 1600 },
1891 .vfront_porch = { 3, 3, 3 },
1892 .vback_porch = { 33, 33, 120 },
1893 .vsync_len = { 10, 10, 10 },
1894 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Yakir Yang739c7de2016-06-12 10:56:35 +08001895};
1896
1897static const struct panel_desc sharp_lq123p1jx31 = {
Sean Paul9f7bae22018-02-08 12:48:52 -05001898 .timings = &sharp_lq123p1jx31_timing,
1899 .num_timings = 1,
zain wang5466a632016-11-19 10:27:16 +08001900 .bpc = 8,
Yakir Yang739c7de2016-06-12 10:56:35 +08001901 .size = {
1902 .width = 259,
1903 .height = 173,
1904 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08001905 .delay = {
1906 .prepare = 110,
1907 .enable = 50,
1908 .unprepare = 550,
1909 },
Yakir Yang739c7de2016-06-12 10:56:35 +08001910};
1911
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02001912static const struct drm_display_mode sharp_lq150x1lg11_mode = {
1913 .clock = 71100,
1914 .hdisplay = 1024,
1915 .hsync_start = 1024 + 168,
1916 .hsync_end = 1024 + 168 + 64,
1917 .htotal = 1024 + 168 + 64 + 88,
1918 .vdisplay = 768,
1919 .vsync_start = 768 + 37,
1920 .vsync_end = 768 + 37 + 2,
1921 .vtotal = 768 + 37 + 2 + 8,
1922 .vrefresh = 60,
1923};
1924
1925static const struct panel_desc sharp_lq150x1lg11 = {
1926 .modes = &sharp_lq150x1lg11_mode,
1927 .num_modes = 1,
1928 .bpc = 6,
1929 .size = {
1930 .width = 304,
1931 .height = 228,
1932 },
1933 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
1934};
1935
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01001936static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
1937 .clock = 33300,
1938 .hdisplay = 800,
1939 .hsync_start = 800 + 1,
1940 .hsync_end = 800 + 1 + 64,
1941 .htotal = 800 + 1 + 64 + 64,
1942 .vdisplay = 480,
1943 .vsync_start = 480 + 1,
1944 .vsync_end = 480 + 1 + 23,
1945 .vtotal = 480 + 1 + 23 + 22,
1946 .vrefresh = 60,
1947};
1948
1949static const struct panel_desc shelly_sca07010_bfn_lnn = {
1950 .modes = &shelly_sca07010_bfn_lnn_mode,
1951 .num_modes = 1,
1952 .size = {
1953 .width = 152,
1954 .height = 91,
1955 },
1956 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1957};
1958
Douglas Anderson9bb34c42016-06-10 10:02:07 -07001959static const struct drm_display_mode starry_kr122ea0sra_mode = {
1960 .clock = 147000,
1961 .hdisplay = 1920,
1962 .hsync_start = 1920 + 16,
1963 .hsync_end = 1920 + 16 + 16,
1964 .htotal = 1920 + 16 + 16 + 32,
1965 .vdisplay = 1200,
1966 .vsync_start = 1200 + 15,
1967 .vsync_end = 1200 + 15 + 2,
1968 .vtotal = 1200 + 15 + 2 + 18,
1969 .vrefresh = 60,
1970 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1971};
1972
1973static const struct panel_desc starry_kr122ea0sra = {
1974 .modes = &starry_kr122ea0sra_mode,
1975 .num_modes = 1,
1976 .size = {
1977 .width = 263,
1978 .height = 164,
1979 },
Brian Norrisc46b9242016-08-26 14:32:14 -07001980 .delay = {
1981 .prepare = 10 + 200,
1982 .enable = 50,
1983 .unprepare = 10 + 500,
1984 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07001985};
1986
Gary Bissonadb973e2016-12-02 09:52:08 +01001987static const struct display_timing tianma_tm070jdhg30_timing = {
1988 .pixelclock = { 62600000, 68200000, 78100000 },
1989 .hactive = { 1280, 1280, 1280 },
1990 .hfront_porch = { 15, 64, 159 },
1991 .hback_porch = { 5, 5, 5 },
1992 .hsync_len = { 1, 1, 256 },
1993 .vactive = { 800, 800, 800 },
1994 .vfront_porch = { 3, 40, 99 },
1995 .vback_porch = { 2, 2, 2 },
1996 .vsync_len = { 1, 1, 128 },
1997 .flags = DISPLAY_FLAGS_DE_HIGH,
1998};
1999
2000static const struct panel_desc tianma_tm070jdhg30 = {
2001 .timings = &tianma_tm070jdhg30_timing,
2002 .num_timings = 1,
2003 .bpc = 8,
2004 .size = {
2005 .width = 151,
2006 .height = 95,
2007 },
2008 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2009};
2010
Lukasz Majewski870a0b12017-11-07 16:30:58 +01002011static const struct display_timing tianma_tm070rvhg71_timing = {
2012 .pixelclock = { 27700000, 29200000, 39600000 },
2013 .hactive = { 800, 800, 800 },
2014 .hfront_porch = { 12, 40, 212 },
2015 .hback_porch = { 88, 88, 88 },
2016 .hsync_len = { 1, 1, 40 },
2017 .vactive = { 480, 480, 480 },
2018 .vfront_porch = { 1, 13, 88 },
2019 .vback_porch = { 32, 32, 32 },
2020 .vsync_len = { 1, 1, 3 },
2021 .flags = DISPLAY_FLAGS_DE_HIGH,
2022};
2023
2024static const struct panel_desc tianma_tm070rvhg71 = {
2025 .timings = &tianma_tm070rvhg71_timing,
2026 .num_timings = 1,
2027 .bpc = 8,
2028 .size = {
2029 .width = 154,
2030 .height = 86,
2031 },
2032 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2033};
2034
Lucas Stach06e733e2017-10-18 19:22:40 +02002035static const struct drm_display_mode toshiba_lt089ac29000_mode = {
2036 .clock = 79500,
2037 .hdisplay = 1280,
2038 .hsync_start = 1280 + 192,
2039 .hsync_end = 1280 + 192 + 128,
2040 .htotal = 1280 + 192 + 128 + 64,
2041 .vdisplay = 768,
2042 .vsync_start = 768 + 20,
2043 .vsync_end = 768 + 20 + 7,
2044 .vtotal = 768 + 20 + 7 + 3,
2045 .vrefresh = 60,
2046};
2047
2048static const struct panel_desc toshiba_lt089ac29000 = {
2049 .modes = &toshiba_lt089ac29000_mode,
2050 .num_modes = 1,
2051 .size = {
2052 .width = 194,
2053 .height = 116,
2054 },
2055 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2056 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
2057};
2058
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05302059static const struct drm_display_mode tpk_f07a_0102_mode = {
2060 .clock = 33260,
2061 .hdisplay = 800,
2062 .hsync_start = 800 + 40,
2063 .hsync_end = 800 + 40 + 128,
2064 .htotal = 800 + 40 + 128 + 88,
2065 .vdisplay = 480,
2066 .vsync_start = 480 + 10,
2067 .vsync_end = 480 + 10 + 2,
2068 .vtotal = 480 + 10 + 2 + 33,
2069 .vrefresh = 60,
2070};
2071
2072static const struct panel_desc tpk_f07a_0102 = {
2073 .modes = &tpk_f07a_0102_mode,
2074 .num_modes = 1,
2075 .size = {
2076 .width = 152,
2077 .height = 91,
2078 },
2079 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
2080};
2081
2082static const struct drm_display_mode tpk_f10a_0102_mode = {
2083 .clock = 45000,
2084 .hdisplay = 1024,
2085 .hsync_start = 1024 + 176,
2086 .hsync_end = 1024 + 176 + 5,
2087 .htotal = 1024 + 176 + 5 + 88,
2088 .vdisplay = 600,
2089 .vsync_start = 600 + 20,
2090 .vsync_end = 600 + 20 + 5,
2091 .vtotal = 600 + 20 + 5 + 25,
2092 .vrefresh = 60,
2093};
2094
2095static const struct panel_desc tpk_f10a_0102 = {
2096 .modes = &tpk_f10a_0102_mode,
2097 .num_modes = 1,
2098 .size = {
2099 .width = 223,
2100 .height = 125,
2101 },
2102};
2103
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01002104static const struct display_timing urt_umsh_8596md_timing = {
2105 .pixelclock = { 33260000, 33260000, 33260000 },
2106 .hactive = { 800, 800, 800 },
2107 .hfront_porch = { 41, 41, 41 },
2108 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
2109 .hsync_len = { 71, 128, 128 },
2110 .vactive = { 480, 480, 480 },
2111 .vfront_porch = { 10, 10, 10 },
2112 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
2113 .vsync_len = { 2, 2, 2 },
2114 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
2115 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
2116};
2117
2118static const struct panel_desc urt_umsh_8596md_lvds = {
2119 .timings = &urt_umsh_8596md_timing,
2120 .num_timings = 1,
2121 .bpc = 6,
2122 .size = {
2123 .width = 152,
2124 .height = 91,
2125 },
2126 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
2127};
2128
2129static const struct panel_desc urt_umsh_8596md_parallel = {
2130 .timings = &urt_umsh_8596md_timing,
2131 .num_timings = 1,
2132 .bpc = 6,
2133 .size = {
2134 .width = 152,
2135 .height = 91,
2136 },
2137 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2138};
2139
Richard Genoude4bac402017-03-27 12:33:23 +02002140static const struct drm_display_mode winstar_wf35ltiacd_mode = {
2141 .clock = 6410,
2142 .hdisplay = 320,
2143 .hsync_start = 320 + 20,
2144 .hsync_end = 320 + 20 + 30,
2145 .htotal = 320 + 20 + 30 + 38,
2146 .vdisplay = 240,
2147 .vsync_start = 240 + 4,
2148 .vsync_end = 240 + 4 + 3,
2149 .vtotal = 240 + 4 + 3 + 15,
2150 .vrefresh = 60,
2151 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2152};
2153
2154static const struct panel_desc winstar_wf35ltiacd = {
2155 .modes = &winstar_wf35ltiacd_mode,
2156 .num_modes = 1,
2157 .bpc = 8,
2158 .size = {
2159 .width = 70,
2160 .height = 53,
2161 },
2162 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2163};
2164
Thierry Reding280921d2013-08-30 15:10:14 +02002165static const struct of_device_id platform_of_match[] = {
2166 {
Yannick Fertre966fea72017-03-28 11:44:49 +02002167 .compatible = "ampire,am-480272h3tmqw-t01h",
2168 .data = &ampire_am_480272h3tmqw_t01h,
2169 }, {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01002170 .compatible = "ampire,am800480r3tmqwa1h",
2171 .data = &ampire_am800480r3tmqwa1h,
2172 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02002173 .compatible = "auo,b101aw03",
2174 .data = &auo_b101aw03,
2175 }, {
Huang Lina531bc32015-02-28 10:18:58 +08002176 .compatible = "auo,b101ean01",
2177 .data = &auo_b101ean01,
2178 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04002179 .compatible = "auo,b101xtn01",
2180 .data = &auo_b101xtn01,
2181 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05302182 .compatible = "auo,b116xw03",
2183 .data = &auo_b116xw03,
2184 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05302185 .compatible = "auo,b133htn01",
2186 .data = &auo_b133htn01,
2187 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07002188 .compatible = "auo,b133xtn01",
2189 .data = &auo_b133xtn01,
2190 }, {
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02002191 .compatible = "auo,g070vvn01",
2192 .data = &auo_g070vvn01,
2193 }, {
Christoph Fritz4451c282017-12-16 14:13:36 +01002194 .compatible = "auo,g104sn02",
2195 .data = &auo_g104sn02,
2196 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01002197 .compatible = "auo,g133han01",
2198 .data = &auo_g133han01,
2199 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01002200 .compatible = "auo,g185han01",
2201 .data = &auo_g185han01,
2202 }, {
Lucas Stach70c0d5b2017-06-08 20:07:58 +02002203 .compatible = "auo,p320hvn03",
2204 .data = &auo_p320hvn03,
2205 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07002206 .compatible = "auo,t215hvn01",
2207 .data = &auo_t215hvn01,
2208 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01002209 .compatible = "avic,tm070ddh03",
2210 .data = &avic_tm070ddh03,
2211 }, {
Caesar Wangcac1a412016-12-14 11:19:56 +08002212 .compatible = "boe,nv101wxmn51",
2213 .data = &boe_nv101wxmn51,
2214 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08002215 .compatible = "chunghwa,claa070wp03xg",
2216 .data = &chunghwa_claa070wp03xg,
2217 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07002218 .compatible = "chunghwa,claa101wa01a",
2219 .data = &chunghwa_claa101wa01a
2220 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02002221 .compatible = "chunghwa,claa101wb01",
2222 .data = &chunghwa_claa101wb01
2223 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02002224 .compatible = "edt,et057090dhu",
2225 .data = &edt_et057090dhu,
2226 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02002227 .compatible = "edt,et070080dh6",
2228 .data = &edt_etm0700g0dh6,
2229 }, {
2230 .compatible = "edt,etm0700g0dh6",
2231 .data = &edt_etm0700g0dh6,
2232 }, {
Jan Tuerkaa7e6452018-06-19 11:55:44 +02002233 .compatible = "edt,etm0700g0bdh6",
2234 .data = &edt_etm0700g0bdh6,
2235 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02002236 .compatible = "foxlink,fl500wvr00-a0t",
2237 .data = &foxlink_fl500wvr00_a0t,
2238 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002239 .compatible = "giantplus,gpg482739qs5",
2240 .data = &giantplus_gpg482739qs5
2241 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02002242 .compatible = "hannstar,hsd070pww1",
2243 .data = &hannstar_hsd070pww1,
2244 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002245 .compatible = "hannstar,hsd100pxn1",
2246 .data = &hannstar_hsd100pxn1,
2247 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002248 .compatible = "hit,tx23d38vm0caa",
2249 .data = &hitachi_tx23d38vm0caa
2250 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002251 .compatible = "innolux,at043tn24",
2252 .data = &innolux_at043tn24,
2253 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002254 .compatible = "innolux,at070tn92",
2255 .data = &innolux_at070tn92,
2256 }, {
Michael Olbrich1e29b842016-08-15 14:32:02 +02002257 .compatible ="innolux,g101ice-l01",
2258 .data = &innolux_g101ice_l01
2259 }, {
Lucas Stachd731f662014-11-06 17:44:33 +01002260 .compatible ="innolux,g121i1-l01",
2261 .data = &innolux_g121i1_l01
2262 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002263 .compatible = "innolux,g121x1-l03",
2264 .data = &innolux_g121x1_l03,
2265 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02002266 .compatible = "innolux,n116bge",
2267 .data = &innolux_n116bge,
2268 }, {
Alban Bedelea447392014-07-22 08:38:55 +02002269 .compatible = "innolux,n156bge-l21",
2270 .data = &innolux_n156bge_l21,
2271 }, {
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302272 .compatible = "innolux,tv123wam",
2273 .data = &innolux_tv123wam,
2274 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002275 .compatible = "innolux,zj070na-01p",
2276 .data = &innolux_zj070na_01p,
2277 }, {
Jagan Teki8cfe8342018-02-04 23:19:28 +05302278 .compatible = "koe,tx31d200vm0baa",
2279 .data = &koe_tx31d200vm0baa,
2280 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01002281 .compatible = "kyo,tcg121xglp",
2282 .data = &kyo_tcg121xglp,
2283 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02002284 .compatible = "lg,lb070wv8",
2285 .data = &lg_lb070wv8,
2286 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08002287 .compatible = "lg,lp079qx1-sp0v",
2288 .data = &lg_lp079qx1_sp0v,
2289 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08002290 .compatible = "lg,lp097qx1-spa1",
2291 .data = &lg_lp097qx1_spa1,
2292 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08002293 .compatible = "lg,lp120up1",
2294 .data = &lg_lp120up1,
2295 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01002296 .compatible = "lg,lp129qe",
2297 .data = &lg_lp129qe,
2298 }, {
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002299 .compatible = "mitsubishi,aa070mc01-ca1",
2300 .data = &mitsubishi_aa070mc01,
2301 }, {
Lucas Stach01bacc132017-06-08 20:07:55 +02002302 .compatible = "nec,nl12880bc20-05",
2303 .data = &nec_nl12880bc20_05,
2304 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08002305 .compatible = "nec,nl4827hc19-05b",
2306 .data = &nec_nl4827hc19_05b,
2307 }, {
Maxime Riparde6c2f062016-09-06 16:46:17 +02002308 .compatible = "netron-dy,e231732",
2309 .data = &netron_dy_e231732,
2310 }, {
Lucas Stach4177fa62017-06-08 20:07:57 +02002311 .compatible = "nlt,nl192108ac18-02d",
2312 .data = &nlt_nl192108ac18_02d,
2313 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02002314 .compatible = "nvd,9128",
2315 .data = &nvd_9128,
2316 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02002317 .compatible = "okaya,rs800480t-7x0gp",
2318 .data = &okaya_rs800480t_7x0gp,
2319 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002320 .compatible = "olimex,lcd-olinuxino-43-ts",
2321 .data = &olimex_lcd_olinuxino_43ts,
2322 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07002323 .compatible = "ontat,yx700wv03",
2324 .data = &ontat_yx700wv03,
2325 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01002326 .compatible = "ortustech,com43h4m85ulc",
2327 .data = &ortustech_com43h4m85ulc,
2328 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02002329 .compatible = "qiaodian,qd43003c0-40",
2330 .data = &qd43003c0_40,
2331 }, {
Jagan Teki23167fa2018-06-07 19:16:48 +05302332 .compatible = "rocktech,rk070er9427",
2333 .data = &rocktech_rk070er9427,
2334 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08002335 .compatible = "samsung,lsn122dl01-c01",
2336 .data = &samsung_lsn122dl01_c01,
2337 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01002338 .compatible = "samsung,ltn101nt05",
2339 .data = &samsung_ltn101nt05,
2340 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01002341 .compatible = "samsung,ltn140at29-301",
2342 .data = &samsung_ltn140at29_301,
2343 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07002344 .compatible = "sharp,lq101k1ly04",
2345 .data = &sharp_lq101k1ly04,
2346 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08002347 .compatible = "sharp,lq123p1jx31",
2348 .data = &sharp_lq123p1jx31,
2349 }, {
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02002350 .compatible = "sharp,lq150x1lg11",
2351 .data = &sharp_lq150x1lg11,
2352 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01002353 .compatible = "shelly,sca07010-bfn-lnn",
2354 .data = &shelly_sca07010_bfn_lnn,
2355 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07002356 .compatible = "starry,kr122ea0sra",
2357 .data = &starry_kr122ea0sra,
2358 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01002359 .compatible = "tianma,tm070jdhg30",
2360 .data = &tianma_tm070jdhg30,
2361 }, {
Lukasz Majewski870a0b12017-11-07 16:30:58 +01002362 .compatible = "tianma,tm070rvhg71",
2363 .data = &tianma_tm070rvhg71,
2364 }, {
Lucas Stach06e733e2017-10-18 19:22:40 +02002365 .compatible = "toshiba,lt089ac29000",
2366 .data = &toshiba_lt089ac29000,
2367 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05302368 .compatible = "tpk,f07a-0102",
2369 .data = &tpk_f07a_0102,
2370 }, {
2371 .compatible = "tpk,f10a-0102",
2372 .data = &tpk_f10a_0102,
2373 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01002374 .compatible = "urt,umsh-8596md-t",
2375 .data = &urt_umsh_8596md_parallel,
2376 }, {
2377 .compatible = "urt,umsh-8596md-1t",
2378 .data = &urt_umsh_8596md_parallel,
2379 }, {
2380 .compatible = "urt,umsh-8596md-7t",
2381 .data = &urt_umsh_8596md_parallel,
2382 }, {
2383 .compatible = "urt,umsh-8596md-11t",
2384 .data = &urt_umsh_8596md_lvds,
2385 }, {
2386 .compatible = "urt,umsh-8596md-19t",
2387 .data = &urt_umsh_8596md_lvds,
2388 }, {
2389 .compatible = "urt,umsh-8596md-20t",
2390 .data = &urt_umsh_8596md_parallel,
2391 }, {
Richard Genoude4bac402017-03-27 12:33:23 +02002392 .compatible = "winstar,wf35ltiacd",
2393 .data = &winstar_wf35ltiacd,
2394 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02002395 /* sentinel */
2396 }
2397};
2398MODULE_DEVICE_TABLE(of, platform_of_match);
2399
2400static int panel_simple_platform_probe(struct platform_device *pdev)
2401{
2402 const struct of_device_id *id;
2403
2404 id = of_match_node(platform_of_match, pdev->dev.of_node);
2405 if (!id)
2406 return -ENODEV;
2407
2408 return panel_simple_probe(&pdev->dev, id->data);
2409}
2410
2411static int panel_simple_platform_remove(struct platform_device *pdev)
2412{
2413 return panel_simple_remove(&pdev->dev);
2414}
2415
Thierry Redingd02fd932014-04-29 17:21:21 +02002416static void panel_simple_platform_shutdown(struct platform_device *pdev)
2417{
2418 panel_simple_shutdown(&pdev->dev);
2419}
2420
Thierry Reding280921d2013-08-30 15:10:14 +02002421static struct platform_driver panel_simple_platform_driver = {
2422 .driver = {
2423 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02002424 .of_match_table = platform_of_match,
2425 },
2426 .probe = panel_simple_platform_probe,
2427 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002428 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002429};
2430
Thierry Reding210fcd92013-11-22 19:27:11 +01002431struct panel_desc_dsi {
2432 struct panel_desc desc;
2433
Thierry Reding462658b2014-03-14 11:24:57 +01002434 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01002435 enum mipi_dsi_pixel_format format;
2436 unsigned int lanes;
2437};
2438
Thierry Redingd718d792015-04-08 16:52:33 +02002439static const struct drm_display_mode auo_b080uan01_mode = {
2440 .clock = 154500,
2441 .hdisplay = 1200,
2442 .hsync_start = 1200 + 62,
2443 .hsync_end = 1200 + 62 + 4,
2444 .htotal = 1200 + 62 + 4 + 62,
2445 .vdisplay = 1920,
2446 .vsync_start = 1920 + 9,
2447 .vsync_end = 1920 + 9 + 2,
2448 .vtotal = 1920 + 9 + 2 + 8,
2449 .vrefresh = 60,
2450};
2451
2452static const struct panel_desc_dsi auo_b080uan01 = {
2453 .desc = {
2454 .modes = &auo_b080uan01_mode,
2455 .num_modes = 1,
2456 .bpc = 8,
2457 .size = {
2458 .width = 108,
2459 .height = 272,
2460 },
2461 },
2462 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2463 .format = MIPI_DSI_FMT_RGB888,
2464 .lanes = 4,
2465};
2466
Chris Zhongc8521962015-11-20 16:15:37 +08002467static const struct drm_display_mode boe_tv080wum_nl0_mode = {
2468 .clock = 160000,
2469 .hdisplay = 1200,
2470 .hsync_start = 1200 + 120,
2471 .hsync_end = 1200 + 120 + 20,
2472 .htotal = 1200 + 120 + 20 + 21,
2473 .vdisplay = 1920,
2474 .vsync_start = 1920 + 21,
2475 .vsync_end = 1920 + 21 + 3,
2476 .vtotal = 1920 + 21 + 3 + 18,
2477 .vrefresh = 60,
2478 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2479};
2480
2481static const struct panel_desc_dsi boe_tv080wum_nl0 = {
2482 .desc = {
2483 .modes = &boe_tv080wum_nl0_mode,
2484 .num_modes = 1,
2485 .size = {
2486 .width = 107,
2487 .height = 172,
2488 },
2489 },
2490 .flags = MIPI_DSI_MODE_VIDEO |
2491 MIPI_DSI_MODE_VIDEO_BURST |
2492 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
2493 .format = MIPI_DSI_FMT_RGB888,
2494 .lanes = 4,
2495};
2496
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002497static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
2498 .clock = 71000,
2499 .hdisplay = 800,
2500 .hsync_start = 800 + 32,
2501 .hsync_end = 800 + 32 + 1,
2502 .htotal = 800 + 32 + 1 + 57,
2503 .vdisplay = 1280,
2504 .vsync_start = 1280 + 28,
2505 .vsync_end = 1280 + 28 + 1,
2506 .vtotal = 1280 + 28 + 1 + 14,
2507 .vrefresh = 60,
2508};
2509
2510static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
2511 .desc = {
2512 .modes = &lg_ld070wx3_sl01_mode,
2513 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002514 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002515 .size = {
2516 .width = 94,
2517 .height = 151,
2518 },
2519 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09002520 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002521 .format = MIPI_DSI_FMT_RGB888,
2522 .lanes = 4,
2523};
2524
Alexandre Courbot499ce852014-01-21 18:57:09 +09002525static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
2526 .clock = 67000,
2527 .hdisplay = 720,
2528 .hsync_start = 720 + 12,
2529 .hsync_end = 720 + 12 + 4,
2530 .htotal = 720 + 12 + 4 + 112,
2531 .vdisplay = 1280,
2532 .vsync_start = 1280 + 8,
2533 .vsync_end = 1280 + 8 + 4,
2534 .vtotal = 1280 + 8 + 4 + 12,
2535 .vrefresh = 60,
2536};
2537
2538static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
2539 .desc = {
2540 .modes = &lg_lh500wx1_sd03_mode,
2541 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002542 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09002543 .size = {
2544 .width = 62,
2545 .height = 110,
2546 },
2547 },
2548 .flags = MIPI_DSI_MODE_VIDEO,
2549 .format = MIPI_DSI_FMT_RGB888,
2550 .lanes = 4,
2551};
2552
Thierry Reding280921d2013-08-30 15:10:14 +02002553static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
2554 .clock = 157200,
2555 .hdisplay = 1920,
2556 .hsync_start = 1920 + 154,
2557 .hsync_end = 1920 + 154 + 16,
2558 .htotal = 1920 + 154 + 16 + 32,
2559 .vdisplay = 1200,
2560 .vsync_start = 1200 + 17,
2561 .vsync_end = 1200 + 17 + 2,
2562 .vtotal = 1200 + 17 + 2 + 16,
2563 .vrefresh = 60,
2564};
2565
Thierry Reding210fcd92013-11-22 19:27:11 +01002566static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
2567 .desc = {
2568 .modes = &panasonic_vvx10f004b00_mode,
2569 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002570 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01002571 .size = {
2572 .width = 217,
2573 .height = 136,
2574 },
Thierry Reding280921d2013-08-30 15:10:14 +02002575 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09002576 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
2577 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01002578 .format = MIPI_DSI_FMT_RGB888,
2579 .lanes = 4,
2580};
2581
2582static const struct of_device_id dsi_of_match[] = {
2583 {
Thierry Redingd718d792015-04-08 16:52:33 +02002584 .compatible = "auo,b080uan01",
2585 .data = &auo_b080uan01
2586 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08002587 .compatible = "boe,tv080wum-nl0",
2588 .data = &boe_tv080wum_nl0
2589 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002590 .compatible = "lg,ld070wx3-sl01",
2591 .data = &lg_ld070wx3_sl01
2592 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09002593 .compatible = "lg,lh500wx1-sd03",
2594 .data = &lg_lh500wx1_sd03
2595 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01002596 .compatible = "panasonic,vvx10f004b00",
2597 .data = &panasonic_vvx10f004b00
2598 }, {
2599 /* sentinel */
2600 }
2601};
2602MODULE_DEVICE_TABLE(of, dsi_of_match);
2603
2604static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
2605{
2606 const struct panel_desc_dsi *desc;
2607 const struct of_device_id *id;
2608 int err;
2609
2610 id = of_match_node(dsi_of_match, dsi->dev.of_node);
2611 if (!id)
2612 return -ENODEV;
2613
2614 desc = id->data;
2615
2616 err = panel_simple_probe(&dsi->dev, &desc->desc);
2617 if (err < 0)
2618 return err;
2619
Thierry Reding462658b2014-03-14 11:24:57 +01002620 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01002621 dsi->format = desc->format;
2622 dsi->lanes = desc->lanes;
2623
2624 return mipi_dsi_attach(dsi);
2625}
2626
2627static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
2628{
2629 int err;
2630
2631 err = mipi_dsi_detach(dsi);
2632 if (err < 0)
2633 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
2634
2635 return panel_simple_remove(&dsi->dev);
2636}
2637
Thierry Redingd02fd932014-04-29 17:21:21 +02002638static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
2639{
2640 panel_simple_shutdown(&dsi->dev);
2641}
2642
Thierry Reding210fcd92013-11-22 19:27:11 +01002643static struct mipi_dsi_driver panel_simple_dsi_driver = {
2644 .driver = {
2645 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01002646 .of_match_table = dsi_of_match,
2647 },
2648 .probe = panel_simple_dsi_probe,
2649 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002650 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002651};
2652
2653static int __init panel_simple_init(void)
2654{
Thierry Reding210fcd92013-11-22 19:27:11 +01002655 int err;
2656
2657 err = platform_driver_register(&panel_simple_platform_driver);
2658 if (err < 0)
2659 return err;
2660
2661 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
2662 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
2663 if (err < 0)
2664 return err;
2665 }
2666
2667 return 0;
Thierry Reding280921d2013-08-30 15:10:14 +02002668}
2669module_init(panel_simple_init);
2670
2671static void __exit panel_simple_exit(void)
2672{
Thierry Reding210fcd92013-11-22 19:27:11 +01002673 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
2674 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
2675
Thierry Reding280921d2013-08-30 15:10:14 +02002676 platform_driver_unregister(&panel_simple_platform_driver);
2677}
2678module_exit(panel_simple_exit);
2679
2680MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
2681MODULE_DESCRIPTION("DRM Driver for Simple Panels");
2682MODULE_LICENSE("GPL and additional rights");