blob: 5e5547b42f5a78c8562f4b74ad6a1059b98d0e88 [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);
Daniel Vetterc555f022018-07-09 10:40:06 +0200255 drm_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
Andrzej Hajdaae8cf412018-06-19 10:19:26 +0200775static const struct drm_display_mode boe_hv070wsa_mode = {
Andrzej Hajdae077e2f2018-07-25 17:46:43 +0200776 .clock = 42105,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +0200777 .hdisplay = 1024,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +0200778 .hsync_start = 1024 + 30,
779 .hsync_end = 1024 + 30 + 30,
780 .htotal = 1024 + 30 + 30 + 30,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +0200781 .vdisplay = 600,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +0200782 .vsync_start = 600 + 10,
783 .vsync_end = 600 + 10 + 10,
784 .vtotal = 600 + 10 + 10 + 10,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +0200785 .vrefresh = 60,
786};
787
788static const struct panel_desc boe_hv070wsa = {
789 .modes = &boe_hv070wsa_mode,
790 .num_modes = 1,
791 .size = {
792 .width = 154,
793 .height = 90,
794 },
795};
796
Caesar Wangcac1a412016-12-14 11:19:56 +0800797static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
798 {
799 .clock = 71900,
800 .hdisplay = 1280,
801 .hsync_start = 1280 + 48,
802 .hsync_end = 1280 + 48 + 32,
803 .htotal = 1280 + 48 + 32 + 80,
804 .vdisplay = 800,
805 .vsync_start = 800 + 3,
806 .vsync_end = 800 + 3 + 5,
807 .vtotal = 800 + 3 + 5 + 24,
808 .vrefresh = 60,
809 },
810 {
811 .clock = 57500,
812 .hdisplay = 1280,
813 .hsync_start = 1280 + 48,
814 .hsync_end = 1280 + 48 + 32,
815 .htotal = 1280 + 48 + 32 + 80,
816 .vdisplay = 800,
817 .vsync_start = 800 + 3,
818 .vsync_end = 800 + 3 + 5,
819 .vtotal = 800 + 3 + 5 + 24,
820 .vrefresh = 48,
821 },
822};
823
824static const struct panel_desc boe_nv101wxmn51 = {
825 .modes = boe_nv101wxmn51_modes,
826 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
827 .bpc = 8,
828 .size = {
829 .width = 217,
830 .height = 136,
831 },
832 .delay = {
833 .prepare = 210,
834 .enable = 50,
835 .unprepare = 160,
836 },
837};
838
Giulio Benettie58edce2018-07-31 01:11:16 +0200839static const struct drm_display_mode cdtech_s043wq26h_ct7_mode = {
840 .clock = 9000,
841 .hdisplay = 480,
842 .hsync_start = 480 + 5,
843 .hsync_end = 480 + 5 + 5,
844 .htotal = 480 + 5 + 5 + 40,
845 .vdisplay = 272,
846 .vsync_start = 272 + 8,
847 .vsync_end = 272 + 8 + 8,
848 .vtotal = 272 + 8 + 8 + 8,
849 .vrefresh = 60,
850 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
851};
852
853static const struct panel_desc cdtech_s043wq26h_ct7 = {
854 .modes = &cdtech_s043wq26h_ct7_mode,
855 .num_modes = 1,
856 .bpc = 8,
857 .size = {
858 .width = 95,
859 .height = 54,
860 },
861 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
862};
863
Giulio Benetti982f9442018-07-31 01:11:14 +0200864static const struct drm_display_mode cdtech_s070wv95_ct16_mode = {
865 .clock = 35000,
866 .hdisplay = 800,
867 .hsync_start = 800 + 40,
868 .hsync_end = 800 + 40 + 40,
869 .htotal = 800 + 40 + 40 + 48,
870 .vdisplay = 480,
871 .vsync_start = 480 + 29,
872 .vsync_end = 480 + 29 + 13,
873 .vtotal = 480 + 29 + 13 + 3,
874 .vrefresh = 60,
875 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
876};
877
878static const struct panel_desc cdtech_s070wv95_ct16 = {
879 .modes = &cdtech_s070wv95_ct16_mode,
880 .num_modes = 1,
881 .bpc = 8,
882 .size = {
883 .width = 154,
884 .height = 85,
885 },
886};
887
Randy Li2cb35c82016-09-20 03:02:51 +0800888static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
889 .clock = 66770,
890 .hdisplay = 800,
891 .hsync_start = 800 + 49,
892 .hsync_end = 800 + 49 + 33,
893 .htotal = 800 + 49 + 33 + 17,
894 .vdisplay = 1280,
895 .vsync_start = 1280 + 1,
896 .vsync_end = 1280 + 1 + 7,
897 .vtotal = 1280 + 1 + 7 + 15,
898 .vrefresh = 60,
899 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
900};
901
902static const struct panel_desc chunghwa_claa070wp03xg = {
903 .modes = &chunghwa_claa070wp03xg_mode,
904 .num_modes = 1,
905 .bpc = 6,
906 .size = {
907 .width = 94,
908 .height = 150,
909 },
910};
911
Stephen Warren4c930752014-01-07 16:46:26 -0700912static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
913 .clock = 72070,
914 .hdisplay = 1366,
915 .hsync_start = 1366 + 58,
916 .hsync_end = 1366 + 58 + 58,
917 .htotal = 1366 + 58 + 58 + 58,
918 .vdisplay = 768,
919 .vsync_start = 768 + 4,
920 .vsync_end = 768 + 4 + 4,
921 .vtotal = 768 + 4 + 4 + 4,
922 .vrefresh = 60,
923};
924
925static const struct panel_desc chunghwa_claa101wa01a = {
926 .modes = &chunghwa_claa101wa01a_mode,
927 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700928 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -0700929 .size = {
930 .width = 220,
931 .height = 120,
932 },
933};
934
Thierry Reding280921d2013-08-30 15:10:14 +0200935static const struct drm_display_mode chunghwa_claa101wb01_mode = {
936 .clock = 69300,
937 .hdisplay = 1366,
938 .hsync_start = 1366 + 48,
939 .hsync_end = 1366 + 48 + 32,
940 .htotal = 1366 + 48 + 32 + 20,
941 .vdisplay = 768,
942 .vsync_start = 768 + 16,
943 .vsync_end = 768 + 16 + 8,
944 .vtotal = 768 + 16 + 8 + 16,
945 .vrefresh = 60,
946};
947
948static const struct panel_desc chunghwa_claa101wb01 = {
949 .modes = &chunghwa_claa101wb01_mode,
950 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700951 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200952 .size = {
953 .width = 223,
954 .height = 125,
955 },
956};
957
Michal Vokáč97ceb1f2018-06-25 14:41:30 +0200958static const struct drm_display_mode dataimage_scf0700c48ggu18_mode = {
959 .clock = 33260,
960 .hdisplay = 800,
961 .hsync_start = 800 + 40,
962 .hsync_end = 800 + 40 + 128,
963 .htotal = 800 + 40 + 128 + 88,
964 .vdisplay = 480,
965 .vsync_start = 480 + 10,
966 .vsync_end = 480 + 10 + 2,
967 .vtotal = 480 + 10 + 2 + 33,
968 .vrefresh = 60,
969 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
970};
971
972static const struct panel_desc dataimage_scf0700c48ggu18 = {
973 .modes = &dataimage_scf0700c48ggu18_mode,
974 .num_modes = 1,
975 .bpc = 8,
976 .size = {
977 .width = 152,
978 .height = 91,
979 },
980 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
981 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
982};
983
Philipp Zabel0ca0c822018-05-23 11:25:04 +0200984static const struct display_timing dlc_dlc0700yzg_1_timing = {
985 .pixelclock = { 45000000, 51200000, 57000000 },
986 .hactive = { 1024, 1024, 1024 },
987 .hfront_porch = { 100, 106, 113 },
988 .hback_porch = { 100, 106, 113 },
989 .hsync_len = { 100, 108, 114 },
990 .vactive = { 600, 600, 600 },
991 .vfront_porch = { 8, 11, 15 },
992 .vback_porch = { 8, 11, 15 },
993 .vsync_len = { 9, 13, 15 },
994 .flags = DISPLAY_FLAGS_DE_HIGH,
995};
996
997static const struct panel_desc dlc_dlc0700yzg_1 = {
998 .timings = &dlc_dlc0700yzg_1_timing,
999 .num_timings = 1,
1000 .bpc = 6,
1001 .size = {
1002 .width = 154,
1003 .height = 86,
1004 },
1005 .delay = {
1006 .prepare = 30,
1007 .enable = 200,
1008 .disable = 200,
1009 },
1010 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1011};
1012
Stefan Agner26ab0062014-05-15 11:38:45 +02001013static const struct drm_display_mode edt_et057090dhu_mode = {
1014 .clock = 25175,
1015 .hdisplay = 640,
1016 .hsync_start = 640 + 16,
1017 .hsync_end = 640 + 16 + 30,
1018 .htotal = 640 + 16 + 30 + 114,
1019 .vdisplay = 480,
1020 .vsync_start = 480 + 10,
1021 .vsync_end = 480 + 10 + 3,
1022 .vtotal = 480 + 10 + 3 + 32,
1023 .vrefresh = 60,
1024 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1025};
1026
1027static const struct panel_desc edt_et057090dhu = {
1028 .modes = &edt_et057090dhu_mode,
1029 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001030 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +02001031 .size = {
1032 .width = 115,
1033 .height = 86,
1034 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08001035 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1036 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
Stefan Agner26ab0062014-05-15 11:38:45 +02001037};
1038
Philipp Zabelfff5de42014-05-15 12:25:47 +02001039static const struct drm_display_mode edt_etm0700g0dh6_mode = {
1040 .clock = 33260,
1041 .hdisplay = 800,
1042 .hsync_start = 800 + 40,
1043 .hsync_end = 800 + 40 + 128,
1044 .htotal = 800 + 40 + 128 + 88,
1045 .vdisplay = 480,
1046 .vsync_start = 480 + 10,
1047 .vsync_end = 480 + 10 + 2,
1048 .vtotal = 480 + 10 + 2 + 33,
1049 .vrefresh = 60,
1050 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1051};
1052
1053static const struct panel_desc edt_etm0700g0dh6 = {
1054 .modes = &edt_etm0700g0dh6_mode,
1055 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001056 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001057 .size = {
1058 .width = 152,
1059 .height = 91,
1060 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08001061 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1062 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001063};
1064
Jan Tuerkaa7e6452018-06-19 11:55:44 +02001065static const struct panel_desc edt_etm0700g0bdh6 = {
1066 .modes = &edt_etm0700g0dh6_mode,
1067 .num_modes = 1,
1068 .bpc = 6,
1069 .size = {
1070 .width = 152,
1071 .height = 91,
1072 },
1073 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1074 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
1075};
1076
Boris BREZILLON102932b2014-06-05 15:53:32 +02001077static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
1078 .clock = 32260,
1079 .hdisplay = 800,
1080 .hsync_start = 800 + 168,
1081 .hsync_end = 800 + 168 + 64,
1082 .htotal = 800 + 168 + 64 + 88,
1083 .vdisplay = 480,
1084 .vsync_start = 480 + 37,
1085 .vsync_end = 480 + 37 + 2,
1086 .vtotal = 480 + 37 + 2 + 8,
1087 .vrefresh = 60,
1088};
1089
1090static const struct panel_desc foxlink_fl500wvr00_a0t = {
1091 .modes = &foxlink_fl500wvr00_a0t_mode,
1092 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001093 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001094 .size = {
1095 .width = 108,
1096 .height = 65,
1097 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +02001098 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001099};
1100
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001101static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
1102 .clock = 9000,
1103 .hdisplay = 480,
1104 .hsync_start = 480 + 5,
1105 .hsync_end = 480 + 5 + 1,
1106 .htotal = 480 + 5 + 1 + 40,
1107 .vdisplay = 272,
1108 .vsync_start = 272 + 8,
1109 .vsync_end = 272 + 8 + 1,
1110 .vtotal = 272 + 8 + 1 + 8,
1111 .vrefresh = 60,
1112};
1113
1114static const struct panel_desc giantplus_gpg482739qs5 = {
1115 .modes = &giantplus_gpg482739qs5_mode,
1116 .num_modes = 1,
1117 .bpc = 8,
1118 .size = {
1119 .width = 95,
1120 .height = 54,
1121 },
Philipp Zabel33536a02015-02-11 18:50:07 +01001122 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001123};
1124
Philipp Zabelab077252014-12-11 18:32:46 +01001125static const struct display_timing hannstar_hsd070pww1_timing = {
1126 .pixelclock = { 64300000, 71100000, 82000000 },
1127 .hactive = { 1280, 1280, 1280 },
1128 .hfront_porch = { 1, 1, 10 },
1129 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +02001130 /*
1131 * According to the data sheet, the minimum horizontal blanking interval
1132 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
1133 * minimum working horizontal blanking interval to be 60 clocks.
1134 */
1135 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +01001136 .vactive = { 800, 800, 800 },
1137 .vfront_porch = { 1, 1, 10 },
1138 .vback_porch = { 1, 1, 10 },
1139 .vsync_len = { 1, 21, 203 },
1140 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +02001141};
1142
1143static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +01001144 .timings = &hannstar_hsd070pww1_timing,
1145 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +02001146 .bpc = 6,
1147 .size = {
1148 .width = 151,
1149 .height = 94,
1150 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +02001151 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Philipp Zabela8532052014-10-23 16:31:06 +02001152};
1153
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001154static const struct display_timing hannstar_hsd100pxn1_timing = {
1155 .pixelclock = { 55000000, 65000000, 75000000 },
1156 .hactive = { 1024, 1024, 1024 },
1157 .hfront_porch = { 40, 40, 40 },
1158 .hback_porch = { 220, 220, 220 },
1159 .hsync_len = { 20, 60, 100 },
1160 .vactive = { 768, 768, 768 },
1161 .vfront_porch = { 7, 7, 7 },
1162 .vback_porch = { 21, 21, 21 },
1163 .vsync_len = { 10, 10, 10 },
1164 .flags = DISPLAY_FLAGS_DE_HIGH,
1165};
1166
1167static const struct panel_desc hannstar_hsd100pxn1 = {
1168 .timings = &hannstar_hsd100pxn1_timing,
1169 .num_timings = 1,
1170 .bpc = 6,
1171 .size = {
1172 .width = 203,
1173 .height = 152,
1174 },
Philipp Zabel4946b042015-05-20 11:34:08 +02001175 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001176};
1177
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001178static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
1179 .clock = 33333,
1180 .hdisplay = 800,
1181 .hsync_start = 800 + 85,
1182 .hsync_end = 800 + 85 + 86,
1183 .htotal = 800 + 85 + 86 + 85,
1184 .vdisplay = 480,
1185 .vsync_start = 480 + 16,
1186 .vsync_end = 480 + 16 + 13,
1187 .vtotal = 480 + 16 + 13 + 16,
1188 .vrefresh = 60,
1189};
1190
1191static const struct panel_desc hitachi_tx23d38vm0caa = {
1192 .modes = &hitachi_tx23d38vm0caa_mode,
1193 .num_modes = 1,
1194 .bpc = 6,
1195 .size = {
1196 .width = 195,
1197 .height = 117,
1198 },
Philipp Zabel6c684e32017-10-11 14:59:58 +02001199 .delay = {
1200 .enable = 160,
1201 .disable = 160,
1202 },
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001203};
1204
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001205static const struct drm_display_mode innolux_at043tn24_mode = {
1206 .clock = 9000,
1207 .hdisplay = 480,
1208 .hsync_start = 480 + 2,
1209 .hsync_end = 480 + 2 + 41,
1210 .htotal = 480 + 2 + 41 + 2,
1211 .vdisplay = 272,
1212 .vsync_start = 272 + 2,
Philipp Zabela4831592017-10-11 14:59:56 +02001213 .vsync_end = 272 + 2 + 10,
1214 .vtotal = 272 + 2 + 10 + 2,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001215 .vrefresh = 60,
1216 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1217};
1218
1219static const struct panel_desc innolux_at043tn24 = {
1220 .modes = &innolux_at043tn24_mode,
1221 .num_modes = 1,
1222 .bpc = 8,
1223 .size = {
1224 .width = 95,
1225 .height = 54,
1226 },
1227 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabel65602792017-10-11 14:59:57 +02001228 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001229};
1230
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02001231static const struct drm_display_mode innolux_at070tn92_mode = {
1232 .clock = 33333,
1233 .hdisplay = 800,
1234 .hsync_start = 800 + 210,
1235 .hsync_end = 800 + 210 + 20,
1236 .htotal = 800 + 210 + 20 + 46,
1237 .vdisplay = 480,
1238 .vsync_start = 480 + 22,
1239 .vsync_end = 480 + 22 + 10,
1240 .vtotal = 480 + 22 + 23 + 10,
1241 .vrefresh = 60,
1242};
1243
1244static const struct panel_desc innolux_at070tn92 = {
1245 .modes = &innolux_at070tn92_mode,
1246 .num_modes = 1,
1247 .size = {
1248 .width = 154,
1249 .height = 86,
1250 },
1251 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1252};
1253
Christoph Fritza5d2ade2018-06-04 13:16:48 +02001254static const struct display_timing innolux_g070y2_l01_timing = {
1255 .pixelclock = { 28000000, 29500000, 32000000 },
1256 .hactive = { 800, 800, 800 },
1257 .hfront_porch = { 61, 91, 141 },
1258 .hback_porch = { 60, 90, 140 },
1259 .hsync_len = { 12, 12, 12 },
1260 .vactive = { 480, 480, 480 },
1261 .vfront_porch = { 4, 9, 30 },
1262 .vback_porch = { 4, 8, 28 },
1263 .vsync_len = { 2, 2, 2 },
1264 .flags = DISPLAY_FLAGS_DE_HIGH,
1265};
1266
1267static const struct panel_desc innolux_g070y2_l01 = {
1268 .timings = &innolux_g070y2_l01_timing,
1269 .num_timings = 1,
1270 .bpc = 6,
1271 .size = {
1272 .width = 152,
1273 .height = 91,
1274 },
1275 .delay = {
1276 .prepare = 10,
1277 .enable = 100,
1278 .disable = 100,
1279 .unprepare = 800,
1280 },
1281 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1282};
1283
Michael Olbrich1e29b842016-08-15 14:32:02 +02001284static const struct display_timing innolux_g101ice_l01_timing = {
1285 .pixelclock = { 60400000, 71100000, 74700000 },
1286 .hactive = { 1280, 1280, 1280 },
1287 .hfront_porch = { 41, 80, 100 },
1288 .hback_porch = { 40, 79, 99 },
1289 .hsync_len = { 1, 1, 1 },
1290 .vactive = { 800, 800, 800 },
1291 .vfront_porch = { 5, 11, 14 },
1292 .vback_porch = { 4, 11, 14 },
1293 .vsync_len = { 1, 1, 1 },
1294 .flags = DISPLAY_FLAGS_DE_HIGH,
1295};
1296
1297static const struct panel_desc innolux_g101ice_l01 = {
1298 .timings = &innolux_g101ice_l01_timing,
1299 .num_timings = 1,
1300 .bpc = 8,
1301 .size = {
1302 .width = 217,
1303 .height = 135,
1304 },
1305 .delay = {
1306 .enable = 200,
1307 .disable = 200,
1308 },
1309 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1310};
1311
Lucas Stach4ae13e42016-11-30 14:09:54 +01001312static const struct display_timing innolux_g121i1_l01_timing = {
1313 .pixelclock = { 67450000, 71000000, 74550000 },
1314 .hactive = { 1280, 1280, 1280 },
1315 .hfront_porch = { 40, 80, 160 },
1316 .hback_porch = { 39, 79, 159 },
1317 .hsync_len = { 1, 1, 1 },
1318 .vactive = { 800, 800, 800 },
1319 .vfront_porch = { 5, 11, 100 },
1320 .vback_porch = { 4, 11, 99 },
1321 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01001322};
1323
1324static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01001325 .timings = &innolux_g121i1_l01_timing,
1326 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01001327 .bpc = 6,
1328 .size = {
1329 .width = 261,
1330 .height = 163,
1331 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01001332 .delay = {
1333 .enable = 200,
1334 .disable = 20,
1335 },
1336 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Lucas Stachd731f662014-11-06 17:44:33 +01001337};
1338
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001339static const struct drm_display_mode innolux_g121x1_l03_mode = {
1340 .clock = 65000,
1341 .hdisplay = 1024,
1342 .hsync_start = 1024 + 0,
1343 .hsync_end = 1024 + 1,
1344 .htotal = 1024 + 0 + 1 + 320,
1345 .vdisplay = 768,
1346 .vsync_start = 768 + 38,
1347 .vsync_end = 768 + 38 + 1,
1348 .vtotal = 768 + 38 + 1 + 0,
1349 .vrefresh = 60,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05001350 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001351};
1352
1353static const struct panel_desc innolux_g121x1_l03 = {
1354 .modes = &innolux_g121x1_l03_mode,
1355 .num_modes = 1,
1356 .bpc = 6,
1357 .size = {
1358 .width = 246,
1359 .height = 185,
1360 },
1361 .delay = {
1362 .enable = 200,
1363 .unprepare = 200,
1364 .disable = 400,
1365 },
1366};
1367
Thierry Reding0a2288c2014-07-03 14:02:59 +02001368static const struct drm_display_mode innolux_n116bge_mode = {
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001369 .clock = 76420,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001370 .hdisplay = 1366,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001371 .hsync_start = 1366 + 136,
1372 .hsync_end = 1366 + 136 + 30,
1373 .htotal = 1366 + 136 + 30 + 60,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001374 .vdisplay = 768,
1375 .vsync_start = 768 + 8,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001376 .vsync_end = 768 + 8 + 12,
1377 .vtotal = 768 + 8 + 12 + 12,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001378 .vrefresh = 60,
1379 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1380};
1381
1382static const struct panel_desc innolux_n116bge = {
1383 .modes = &innolux_n116bge_mode,
1384 .num_modes = 1,
1385 .bpc = 6,
1386 .size = {
1387 .width = 256,
1388 .height = 144,
1389 },
1390};
1391
Alban Bedelea447392014-07-22 08:38:55 +02001392static const struct drm_display_mode innolux_n156bge_l21_mode = {
1393 .clock = 69300,
1394 .hdisplay = 1366,
1395 .hsync_start = 1366 + 16,
1396 .hsync_end = 1366 + 16 + 34,
1397 .htotal = 1366 + 16 + 34 + 50,
1398 .vdisplay = 768,
1399 .vsync_start = 768 + 2,
1400 .vsync_end = 768 + 2 + 6,
1401 .vtotal = 768 + 2 + 6 + 12,
1402 .vrefresh = 60,
1403};
1404
1405static const struct panel_desc innolux_n156bge_l21 = {
1406 .modes = &innolux_n156bge_l21_mode,
1407 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001408 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02001409 .size = {
1410 .width = 344,
1411 .height = 193,
1412 },
1413};
1414
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05301415static const struct drm_display_mode innolux_tv123wam_mode = {
1416 .clock = 206016,
1417 .hdisplay = 2160,
1418 .hsync_start = 2160 + 48,
1419 .hsync_end = 2160 + 48 + 32,
1420 .htotal = 2160 + 48 + 32 + 80,
1421 .vdisplay = 1440,
1422 .vsync_start = 1440 + 3,
1423 .vsync_end = 1440 + 3 + 10,
1424 .vtotal = 1440 + 3 + 10 + 27,
1425 .vrefresh = 60,
1426 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
1427};
1428
1429static const struct panel_desc innolux_tv123wam = {
1430 .modes = &innolux_tv123wam_mode,
1431 .num_modes = 1,
1432 .bpc = 8,
1433 .size = {
1434 .width = 259,
1435 .height = 173,
1436 },
Sean Paul22fd99e2018-08-13 17:30:40 -04001437 .delay = {
1438 .unprepare = 500,
1439 },
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05301440};
1441
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001442static const struct drm_display_mode innolux_zj070na_01p_mode = {
1443 .clock = 51501,
1444 .hdisplay = 1024,
1445 .hsync_start = 1024 + 128,
1446 .hsync_end = 1024 + 128 + 64,
1447 .htotal = 1024 + 128 + 64 + 128,
1448 .vdisplay = 600,
1449 .vsync_start = 600 + 16,
1450 .vsync_end = 600 + 16 + 4,
1451 .vtotal = 600 + 16 + 4 + 16,
1452 .vrefresh = 60,
1453};
1454
1455static const struct panel_desc innolux_zj070na_01p = {
1456 .modes = &innolux_zj070na_01p_mode,
1457 .num_modes = 1,
1458 .bpc = 6,
1459 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001460 .width = 154,
1461 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001462 },
1463};
1464
Jagan Teki8cfe8342018-02-04 23:19:28 +05301465static const struct display_timing koe_tx31d200vm0baa_timing = {
1466 .pixelclock = { 39600000, 43200000, 48000000 },
1467 .hactive = { 1280, 1280, 1280 },
1468 .hfront_porch = { 16, 36, 56 },
1469 .hback_porch = { 16, 36, 56 },
1470 .hsync_len = { 8, 8, 8 },
1471 .vactive = { 480, 480, 480 },
Stefan Agnerc9b6be72018-04-19 23:20:03 +02001472 .vfront_porch = { 6, 21, 33 },
1473 .vback_porch = { 6, 21, 33 },
Jagan Teki8cfe8342018-02-04 23:19:28 +05301474 .vsync_len = { 8, 8, 8 },
1475 .flags = DISPLAY_FLAGS_DE_HIGH,
1476};
1477
1478static const struct panel_desc koe_tx31d200vm0baa = {
1479 .timings = &koe_tx31d200vm0baa_timing,
1480 .num_timings = 1,
1481 .bpc = 6,
1482 .size = {
1483 .width = 292,
1484 .height = 109,
1485 },
1486 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1487};
1488
Lucas Stach8def22e2015-12-02 19:41:11 +01001489static const struct display_timing kyo_tcg121xglp_timing = {
1490 .pixelclock = { 52000000, 65000000, 71000000 },
1491 .hactive = { 1024, 1024, 1024 },
1492 .hfront_porch = { 2, 2, 2 },
1493 .hback_porch = { 2, 2, 2 },
1494 .hsync_len = { 86, 124, 244 },
1495 .vactive = { 768, 768, 768 },
1496 .vfront_porch = { 2, 2, 2 },
1497 .vback_porch = { 2, 2, 2 },
1498 .vsync_len = { 6, 34, 73 },
1499 .flags = DISPLAY_FLAGS_DE_HIGH,
1500};
1501
1502static const struct panel_desc kyo_tcg121xglp = {
1503 .timings = &kyo_tcg121xglp_timing,
1504 .num_timings = 1,
1505 .bpc = 8,
1506 .size = {
1507 .width = 246,
1508 .height = 184,
1509 },
1510 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1511};
1512
Heiko Schocherdd015002015-05-22 10:25:57 +02001513static const struct drm_display_mode lg_lb070wv8_mode = {
1514 .clock = 33246,
1515 .hdisplay = 800,
1516 .hsync_start = 800 + 88,
1517 .hsync_end = 800 + 88 + 80,
1518 .htotal = 800 + 88 + 80 + 88,
1519 .vdisplay = 480,
1520 .vsync_start = 480 + 10,
1521 .vsync_end = 480 + 10 + 25,
1522 .vtotal = 480 + 10 + 25 + 10,
1523 .vrefresh = 60,
1524};
1525
1526static const struct panel_desc lg_lb070wv8 = {
1527 .modes = &lg_lb070wv8_mode,
1528 .num_modes = 1,
1529 .bpc = 16,
1530 .size = {
1531 .width = 151,
1532 .height = 91,
1533 },
1534 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1535};
1536
Yakir Yangc5ece402016-06-28 12:51:15 +08001537static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1538 .clock = 200000,
1539 .hdisplay = 1536,
1540 .hsync_start = 1536 + 12,
1541 .hsync_end = 1536 + 12 + 16,
1542 .htotal = 1536 + 12 + 16 + 48,
1543 .vdisplay = 2048,
1544 .vsync_start = 2048 + 8,
1545 .vsync_end = 2048 + 8 + 4,
1546 .vtotal = 2048 + 8 + 4 + 8,
1547 .vrefresh = 60,
1548 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1549};
1550
1551static const struct panel_desc lg_lp079qx1_sp0v = {
1552 .modes = &lg_lp079qx1_sp0v_mode,
1553 .num_modes = 1,
1554 .size = {
1555 .width = 129,
1556 .height = 171,
1557 },
1558};
1559
Yakir Yang0355dde2016-06-12 10:56:02 +08001560static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1561 .clock = 205210,
1562 .hdisplay = 2048,
1563 .hsync_start = 2048 + 150,
1564 .hsync_end = 2048 + 150 + 5,
1565 .htotal = 2048 + 150 + 5 + 5,
1566 .vdisplay = 1536,
1567 .vsync_start = 1536 + 3,
1568 .vsync_end = 1536 + 3 + 1,
1569 .vtotal = 1536 + 3 + 1 + 9,
1570 .vrefresh = 60,
1571};
1572
1573static const struct panel_desc lg_lp097qx1_spa1 = {
1574 .modes = &lg_lp097qx1_spa1_mode,
1575 .num_modes = 1,
1576 .size = {
1577 .width = 208,
1578 .height = 147,
1579 },
1580};
1581
Jitao Shi690d8fa2016-02-22 19:01:44 +08001582static const struct drm_display_mode lg_lp120up1_mode = {
1583 .clock = 162300,
1584 .hdisplay = 1920,
1585 .hsync_start = 1920 + 40,
1586 .hsync_end = 1920 + 40 + 40,
1587 .htotal = 1920 + 40 + 40+ 80,
1588 .vdisplay = 1280,
1589 .vsync_start = 1280 + 4,
1590 .vsync_end = 1280 + 4 + 4,
1591 .vtotal = 1280 + 4 + 4 + 12,
1592 .vrefresh = 60,
1593};
1594
1595static const struct panel_desc lg_lp120up1 = {
1596 .modes = &lg_lp120up1_mode,
1597 .num_modes = 1,
1598 .bpc = 8,
1599 .size = {
1600 .width = 267,
1601 .height = 183,
1602 },
1603};
1604
Thierry Redingec7c5652013-11-15 15:59:32 +01001605static const struct drm_display_mode lg_lp129qe_mode = {
1606 .clock = 285250,
1607 .hdisplay = 2560,
1608 .hsync_start = 2560 + 48,
1609 .hsync_end = 2560 + 48 + 32,
1610 .htotal = 2560 + 48 + 32 + 80,
1611 .vdisplay = 1700,
1612 .vsync_start = 1700 + 3,
1613 .vsync_end = 1700 + 3 + 10,
1614 .vtotal = 1700 + 3 + 10 + 36,
1615 .vrefresh = 60,
1616};
1617
1618static const struct panel_desc lg_lp129qe = {
1619 .modes = &lg_lp129qe_mode,
1620 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001621 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01001622 .size = {
1623 .width = 272,
1624 .height = 181,
1625 },
1626};
1627
Lukasz Majewski65c766c2017-10-21 00:18:37 +02001628static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
1629 .clock = 30400,
1630 .hdisplay = 800,
1631 .hsync_start = 800 + 0,
1632 .hsync_end = 800 + 1,
1633 .htotal = 800 + 0 + 1 + 160,
1634 .vdisplay = 480,
1635 .vsync_start = 480 + 0,
1636 .vsync_end = 480 + 48 + 1,
1637 .vtotal = 480 + 48 + 1 + 0,
1638 .vrefresh = 60,
1639 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1640};
1641
1642static const struct panel_desc mitsubishi_aa070mc01 = {
1643 .modes = &mitsubishi_aa070mc01_mode,
1644 .num_modes = 1,
1645 .bpc = 8,
1646 .size = {
1647 .width = 152,
1648 .height = 91,
1649 },
1650
1651 .delay = {
1652 .enable = 200,
1653 .unprepare = 200,
1654 .disable = 400,
1655 },
1656 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1657 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1658};
1659
Lucas Stach01bacc132017-06-08 20:07:55 +02001660static const struct display_timing nec_nl12880bc20_05_timing = {
1661 .pixelclock = { 67000000, 71000000, 75000000 },
1662 .hactive = { 1280, 1280, 1280 },
1663 .hfront_porch = { 2, 30, 30 },
1664 .hback_porch = { 6, 100, 100 },
1665 .hsync_len = { 2, 30, 30 },
1666 .vactive = { 800, 800, 800 },
1667 .vfront_porch = { 5, 5, 5 },
1668 .vback_porch = { 11, 11, 11 },
1669 .vsync_len = { 7, 7, 7 },
1670};
1671
1672static const struct panel_desc nec_nl12880bc20_05 = {
1673 .timings = &nec_nl12880bc20_05_timing,
1674 .num_timings = 1,
1675 .bpc = 8,
1676 .size = {
1677 .width = 261,
1678 .height = 163,
1679 },
1680 .delay = {
1681 .enable = 50,
1682 .disable = 50,
1683 },
1684 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1685};
1686
jianwei wangc6e87f92015-07-29 16:30:02 +08001687static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
1688 .clock = 10870,
1689 .hdisplay = 480,
1690 .hsync_start = 480 + 2,
1691 .hsync_end = 480 + 2 + 41,
1692 .htotal = 480 + 2 + 41 + 2,
1693 .vdisplay = 272,
1694 .vsync_start = 272 + 2,
1695 .vsync_end = 272 + 2 + 4,
1696 .vtotal = 272 + 2 + 4 + 2,
1697 .vrefresh = 74,
Stefan Agner4bc390c2015-11-17 19:10:29 -08001698 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08001699};
1700
1701static const struct panel_desc nec_nl4827hc19_05b = {
1702 .modes = &nec_nl4827hc19_05b_mode,
1703 .num_modes = 1,
1704 .bpc = 8,
1705 .size = {
1706 .width = 95,
1707 .height = 54,
1708 },
Stefan Agner2c806612016-02-08 12:50:13 -08001709 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1710 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08001711};
1712
Maxime Riparde6c2f062016-09-06 16:46:17 +02001713static const struct drm_display_mode netron_dy_e231732_mode = {
1714 .clock = 66000,
1715 .hdisplay = 1024,
1716 .hsync_start = 1024 + 160,
1717 .hsync_end = 1024 + 160 + 70,
1718 .htotal = 1024 + 160 + 70 + 90,
1719 .vdisplay = 600,
1720 .vsync_start = 600 + 127,
1721 .vsync_end = 600 + 127 + 20,
1722 .vtotal = 600 + 127 + 20 + 3,
1723 .vrefresh = 60,
1724};
1725
1726static const struct panel_desc netron_dy_e231732 = {
1727 .modes = &netron_dy_e231732_mode,
1728 .num_modes = 1,
1729 .size = {
1730 .width = 154,
1731 .height = 87,
1732 },
1733 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1734};
1735
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03001736static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
1737 .clock = 9000,
1738 .hdisplay = 480,
1739 .hsync_start = 480 + 2,
1740 .hsync_end = 480 + 2 + 41,
1741 .htotal = 480 + 2 + 41 + 2,
1742 .vdisplay = 272,
1743 .vsync_start = 272 + 2,
1744 .vsync_end = 272 + 2 + 10,
1745 .vtotal = 272 + 2 + 10 + 2,
1746 .vrefresh = 60,
1747 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1748};
1749
1750static const struct panel_desc newhaven_nhd_43_480272ef_atxl = {
1751 .modes = &newhaven_nhd_43_480272ef_atxl_mode,
1752 .num_modes = 1,
1753 .bpc = 8,
1754 .size = {
1755 .width = 95,
1756 .height = 54,
1757 },
1758 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1759 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE |
1760 DRM_BUS_FLAG_SYNC_POSEDGE,
1761};
1762
Lucas Stach4177fa62017-06-08 20:07:57 +02001763static const struct display_timing nlt_nl192108ac18_02d_timing = {
1764 .pixelclock = { 130000000, 148350000, 163000000 },
1765 .hactive = { 1920, 1920, 1920 },
1766 .hfront_porch = { 80, 100, 100 },
1767 .hback_porch = { 100, 120, 120 },
1768 .hsync_len = { 50, 60, 60 },
1769 .vactive = { 1080, 1080, 1080 },
1770 .vfront_porch = { 12, 30, 30 },
1771 .vback_porch = { 4, 10, 10 },
1772 .vsync_len = { 4, 5, 5 },
1773};
1774
1775static const struct panel_desc nlt_nl192108ac18_02d = {
1776 .timings = &nlt_nl192108ac18_02d_timing,
1777 .num_timings = 1,
1778 .bpc = 8,
1779 .size = {
1780 .width = 344,
1781 .height = 194,
1782 },
1783 .delay = {
1784 .unprepare = 500,
1785 },
1786 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1787};
1788
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02001789static const struct drm_display_mode nvd_9128_mode = {
1790 .clock = 29500,
1791 .hdisplay = 800,
1792 .hsync_start = 800 + 130,
1793 .hsync_end = 800 + 130 + 98,
1794 .htotal = 800 + 0 + 130 + 98,
1795 .vdisplay = 480,
1796 .vsync_start = 480 + 10,
1797 .vsync_end = 480 + 10 + 50,
1798 .vtotal = 480 + 0 + 10 + 50,
1799};
1800
1801static const struct panel_desc nvd_9128 = {
1802 .modes = &nvd_9128_mode,
1803 .num_modes = 1,
1804 .bpc = 8,
1805 .size = {
1806 .width = 156,
1807 .height = 88,
1808 },
1809 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1810};
1811
Gary Bissona99fb622015-06-10 18:44:23 +02001812static const struct display_timing okaya_rs800480t_7x0gp_timing = {
1813 .pixelclock = { 30000000, 30000000, 40000000 },
1814 .hactive = { 800, 800, 800 },
1815 .hfront_porch = { 40, 40, 40 },
1816 .hback_porch = { 40, 40, 40 },
1817 .hsync_len = { 1, 48, 48 },
1818 .vactive = { 480, 480, 480 },
1819 .vfront_porch = { 13, 13, 13 },
1820 .vback_porch = { 29, 29, 29 },
1821 .vsync_len = { 3, 3, 3 },
1822 .flags = DISPLAY_FLAGS_DE_HIGH,
1823};
1824
1825static const struct panel_desc okaya_rs800480t_7x0gp = {
1826 .timings = &okaya_rs800480t_7x0gp_timing,
1827 .num_timings = 1,
1828 .bpc = 6,
1829 .size = {
1830 .width = 154,
1831 .height = 87,
1832 },
1833 .delay = {
1834 .prepare = 41,
1835 .enable = 50,
1836 .unprepare = 41,
1837 .disable = 50,
1838 },
1839 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1840};
1841
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001842static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
1843 .clock = 9000,
1844 .hdisplay = 480,
1845 .hsync_start = 480 + 5,
1846 .hsync_end = 480 + 5 + 30,
1847 .htotal = 480 + 5 + 30 + 10,
1848 .vdisplay = 272,
1849 .vsync_start = 272 + 8,
1850 .vsync_end = 272 + 8 + 5,
1851 .vtotal = 272 + 8 + 5 + 3,
1852 .vrefresh = 60,
1853};
1854
1855static const struct panel_desc olimex_lcd_olinuxino_43ts = {
1856 .modes = &olimex_lcd_olinuxino_43ts_mode,
1857 .num_modes = 1,
1858 .size = {
Jonathan Liu30c6d7ab92017-07-20 20:29:43 +10001859 .width = 95,
1860 .height = 54,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001861 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10001862 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001863};
1864
Eric Anholte8b6f562016-03-24 17:23:48 -07001865/*
1866 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1867 * pixel clocks, but this is the timing that was being used in the Adafruit
1868 * installation instructions.
1869 */
1870static const struct drm_display_mode ontat_yx700wv03_mode = {
1871 .clock = 29500,
1872 .hdisplay = 800,
1873 .hsync_start = 824,
1874 .hsync_end = 896,
1875 .htotal = 992,
1876 .vdisplay = 480,
1877 .vsync_start = 483,
1878 .vsync_end = 493,
1879 .vtotal = 500,
1880 .vrefresh = 60,
1881 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1882};
1883
1884/*
1885 * Specification at:
1886 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1887 */
1888static const struct panel_desc ontat_yx700wv03 = {
1889 .modes = &ontat_yx700wv03_mode,
1890 .num_modes = 1,
1891 .bpc = 8,
1892 .size = {
1893 .width = 154,
1894 .height = 83,
1895 },
Eric Anholt5651e5e2018-03-09 15:33:32 -08001896 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Eric Anholte8b6f562016-03-24 17:23:48 -07001897};
1898
Philipp Zabel725c9d42015-02-11 18:50:11 +01001899static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
1900 .clock = 25000,
1901 .hdisplay = 480,
1902 .hsync_start = 480 + 10,
1903 .hsync_end = 480 + 10 + 10,
1904 .htotal = 480 + 10 + 10 + 15,
1905 .vdisplay = 800,
1906 .vsync_start = 800 + 3,
1907 .vsync_end = 800 + 3 + 3,
1908 .vtotal = 800 + 3 + 3 + 3,
1909 .vrefresh = 60,
1910};
1911
1912static const struct panel_desc ortustech_com43h4m85ulc = {
1913 .modes = &ortustech_com43h4m85ulc_mode,
1914 .num_modes = 1,
1915 .bpc = 8,
1916 .size = {
1917 .width = 56,
1918 .height = 93,
1919 },
1920 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Marek Vasute0932f92016-08-26 18:26:00 +02001921 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
Philipp Zabel725c9d42015-02-11 18:50:11 +01001922};
1923
Josh Wud2a6f0f2015-10-08 17:42:41 +02001924static const struct drm_display_mode qd43003c0_40_mode = {
1925 .clock = 9000,
1926 .hdisplay = 480,
1927 .hsync_start = 480 + 8,
1928 .hsync_end = 480 + 8 + 4,
1929 .htotal = 480 + 8 + 4 + 39,
1930 .vdisplay = 272,
1931 .vsync_start = 272 + 4,
1932 .vsync_end = 272 + 4 + 10,
1933 .vtotal = 272 + 4 + 10 + 2,
1934 .vrefresh = 60,
1935};
1936
1937static const struct panel_desc qd43003c0_40 = {
1938 .modes = &qd43003c0_40_mode,
1939 .num_modes = 1,
1940 .bpc = 8,
1941 .size = {
1942 .width = 95,
1943 .height = 53,
1944 },
1945 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1946};
1947
Jagan Teki23167fa2018-06-07 19:16:48 +05301948static const struct display_timing rocktech_rk070er9427_timing = {
1949 .pixelclock = { 26400000, 33300000, 46800000 },
1950 .hactive = { 800, 800, 800 },
1951 .hfront_porch = { 16, 210, 354 },
1952 .hback_porch = { 46, 46, 46 },
1953 .hsync_len = { 1, 1, 1 },
1954 .vactive = { 480, 480, 480 },
1955 .vfront_porch = { 7, 22, 147 },
1956 .vback_porch = { 23, 23, 23 },
1957 .vsync_len = { 1, 1, 1 },
1958 .flags = DISPLAY_FLAGS_DE_HIGH,
1959};
1960
1961static const struct panel_desc rocktech_rk070er9427 = {
1962 .timings = &rocktech_rk070er9427_timing,
1963 .num_timings = 1,
1964 .bpc = 6,
1965 .size = {
1966 .width = 154,
1967 .height = 86,
1968 },
1969 .delay = {
1970 .prepare = 41,
1971 .enable = 50,
1972 .unprepare = 41,
1973 .disable = 50,
1974 },
1975 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1976};
1977
Yakir Yang0330eaf2016-06-12 10:56:13 +08001978static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
1979 .clock = 271560,
1980 .hdisplay = 2560,
1981 .hsync_start = 2560 + 48,
1982 .hsync_end = 2560 + 48 + 32,
1983 .htotal = 2560 + 48 + 32 + 80,
1984 .vdisplay = 1600,
1985 .vsync_start = 1600 + 2,
1986 .vsync_end = 1600 + 2 + 5,
1987 .vtotal = 1600 + 2 + 5 + 57,
1988 .vrefresh = 60,
1989};
1990
1991static const struct panel_desc samsung_lsn122dl01_c01 = {
1992 .modes = &samsung_lsn122dl01_c01_mode,
1993 .num_modes = 1,
1994 .size = {
1995 .width = 263,
1996 .height = 164,
1997 },
1998};
1999
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01002000static const struct drm_display_mode samsung_ltn101nt05_mode = {
2001 .clock = 54030,
2002 .hdisplay = 1024,
2003 .hsync_start = 1024 + 24,
2004 .hsync_end = 1024 + 24 + 136,
2005 .htotal = 1024 + 24 + 136 + 160,
2006 .vdisplay = 600,
2007 .vsync_start = 600 + 3,
2008 .vsync_end = 600 + 3 + 6,
2009 .vtotal = 600 + 3 + 6 + 61,
2010 .vrefresh = 60,
2011};
2012
2013static const struct panel_desc samsung_ltn101nt05 = {
2014 .modes = &samsung_ltn101nt05_mode,
2015 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002016 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01002017 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02002018 .width = 223,
2019 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01002020 },
2021};
2022
Stéphane Marchesin0c934302015-03-18 10:52:18 +01002023static const struct drm_display_mode samsung_ltn140at29_301_mode = {
2024 .clock = 76300,
2025 .hdisplay = 1366,
2026 .hsync_start = 1366 + 64,
2027 .hsync_end = 1366 + 64 + 48,
2028 .htotal = 1366 + 64 + 48 + 128,
2029 .vdisplay = 768,
2030 .vsync_start = 768 + 2,
2031 .vsync_end = 768 + 2 + 5,
2032 .vtotal = 768 + 2 + 5 + 17,
2033 .vrefresh = 60,
2034};
2035
2036static const struct panel_desc samsung_ltn140at29_301 = {
2037 .modes = &samsung_ltn140at29_301_mode,
2038 .num_modes = 1,
2039 .bpc = 6,
2040 .size = {
2041 .width = 320,
2042 .height = 187,
2043 },
2044};
2045
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03002046static const struct drm_display_mode sharp_lq035q7db03_mode = {
2047 .clock = 5500,
2048 .hdisplay = 240,
2049 .hsync_start = 240 + 16,
2050 .hsync_end = 240 + 16 + 7,
2051 .htotal = 240 + 16 + 7 + 5,
2052 .vdisplay = 320,
2053 .vsync_start = 320 + 9,
2054 .vsync_end = 320 + 9 + 1,
2055 .vtotal = 320 + 9 + 1 + 7,
2056 .vrefresh = 60,
2057};
2058
2059static const struct panel_desc sharp_lq035q7db03 = {
2060 .modes = &sharp_lq035q7db03_mode,
2061 .num_modes = 1,
2062 .bpc = 6,
2063 .size = {
2064 .width = 54,
2065 .height = 72,
2066 },
2067 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2068};
2069
Joshua Clayton592aa022016-07-06 15:59:16 -07002070static const struct display_timing sharp_lq101k1ly04_timing = {
2071 .pixelclock = { 60000000, 65000000, 80000000 },
2072 .hactive = { 1280, 1280, 1280 },
2073 .hfront_porch = { 20, 20, 20 },
2074 .hback_porch = { 20, 20, 20 },
2075 .hsync_len = { 10, 10, 10 },
2076 .vactive = { 800, 800, 800 },
2077 .vfront_porch = { 4, 4, 4 },
2078 .vback_porch = { 4, 4, 4 },
2079 .vsync_len = { 4, 4, 4 },
2080 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
2081};
2082
2083static const struct panel_desc sharp_lq101k1ly04 = {
2084 .timings = &sharp_lq101k1ly04_timing,
2085 .num_timings = 1,
2086 .bpc = 8,
2087 .size = {
2088 .width = 217,
2089 .height = 136,
2090 },
2091 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
2092};
2093
Sean Paul9f7bae22018-02-08 12:48:52 -05002094static const struct display_timing sharp_lq123p1jx31_timing = {
2095 .pixelclock = { 252750000, 252750000, 266604720 },
2096 .hactive = { 2400, 2400, 2400 },
2097 .hfront_porch = { 48, 48, 48 },
2098 .hback_porch = { 80, 80, 84 },
2099 .hsync_len = { 32, 32, 32 },
2100 .vactive = { 1600, 1600, 1600 },
2101 .vfront_porch = { 3, 3, 3 },
2102 .vback_porch = { 33, 33, 120 },
2103 .vsync_len = { 10, 10, 10 },
2104 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Yakir Yang739c7de2016-06-12 10:56:35 +08002105};
2106
2107static const struct panel_desc sharp_lq123p1jx31 = {
Sean Paul9f7bae22018-02-08 12:48:52 -05002108 .timings = &sharp_lq123p1jx31_timing,
2109 .num_timings = 1,
zain wang5466a632016-11-19 10:27:16 +08002110 .bpc = 8,
Yakir Yang739c7de2016-06-12 10:56:35 +08002111 .size = {
2112 .width = 259,
2113 .height = 173,
2114 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08002115 .delay = {
2116 .prepare = 110,
2117 .enable = 50,
2118 .unprepare = 550,
2119 },
Yakir Yang739c7de2016-06-12 10:56:35 +08002120};
2121
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02002122static const struct drm_display_mode sharp_lq150x1lg11_mode = {
2123 .clock = 71100,
2124 .hdisplay = 1024,
2125 .hsync_start = 1024 + 168,
2126 .hsync_end = 1024 + 168 + 64,
2127 .htotal = 1024 + 168 + 64 + 88,
2128 .vdisplay = 768,
2129 .vsync_start = 768 + 37,
2130 .vsync_end = 768 + 37 + 2,
2131 .vtotal = 768 + 37 + 2 + 8,
2132 .vrefresh = 60,
2133};
2134
2135static const struct panel_desc sharp_lq150x1lg11 = {
2136 .modes = &sharp_lq150x1lg11_mode,
2137 .num_modes = 1,
2138 .bpc = 6,
2139 .size = {
2140 .width = 304,
2141 .height = 228,
2142 },
2143 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
2144};
2145
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01002146static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
2147 .clock = 33300,
2148 .hdisplay = 800,
2149 .hsync_start = 800 + 1,
2150 .hsync_end = 800 + 1 + 64,
2151 .htotal = 800 + 1 + 64 + 64,
2152 .vdisplay = 480,
2153 .vsync_start = 480 + 1,
2154 .vsync_end = 480 + 1 + 23,
2155 .vtotal = 480 + 1 + 23 + 22,
2156 .vrefresh = 60,
2157};
2158
2159static const struct panel_desc shelly_sca07010_bfn_lnn = {
2160 .modes = &shelly_sca07010_bfn_lnn_mode,
2161 .num_modes = 1,
2162 .size = {
2163 .width = 152,
2164 .height = 91,
2165 },
2166 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2167};
2168
Douglas Anderson9bb34c42016-06-10 10:02:07 -07002169static const struct drm_display_mode starry_kr122ea0sra_mode = {
2170 .clock = 147000,
2171 .hdisplay = 1920,
2172 .hsync_start = 1920 + 16,
2173 .hsync_end = 1920 + 16 + 16,
2174 .htotal = 1920 + 16 + 16 + 32,
2175 .vdisplay = 1200,
2176 .vsync_start = 1200 + 15,
2177 .vsync_end = 1200 + 15 + 2,
2178 .vtotal = 1200 + 15 + 2 + 18,
2179 .vrefresh = 60,
2180 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2181};
2182
2183static const struct panel_desc starry_kr122ea0sra = {
2184 .modes = &starry_kr122ea0sra_mode,
2185 .num_modes = 1,
2186 .size = {
2187 .width = 263,
2188 .height = 164,
2189 },
Brian Norrisc46b9242016-08-26 14:32:14 -07002190 .delay = {
2191 .prepare = 10 + 200,
2192 .enable = 50,
2193 .unprepare = 10 + 500,
2194 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07002195};
2196
Gary Bissonadb973e2016-12-02 09:52:08 +01002197static const struct display_timing tianma_tm070jdhg30_timing = {
2198 .pixelclock = { 62600000, 68200000, 78100000 },
2199 .hactive = { 1280, 1280, 1280 },
2200 .hfront_porch = { 15, 64, 159 },
2201 .hback_porch = { 5, 5, 5 },
2202 .hsync_len = { 1, 1, 256 },
2203 .vactive = { 800, 800, 800 },
2204 .vfront_porch = { 3, 40, 99 },
2205 .vback_porch = { 2, 2, 2 },
2206 .vsync_len = { 1, 1, 128 },
2207 .flags = DISPLAY_FLAGS_DE_HIGH,
2208};
2209
2210static const struct panel_desc tianma_tm070jdhg30 = {
2211 .timings = &tianma_tm070jdhg30_timing,
2212 .num_timings = 1,
2213 .bpc = 8,
2214 .size = {
2215 .width = 151,
2216 .height = 95,
2217 },
2218 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2219};
2220
Lukasz Majewski870a0b12017-11-07 16:30:58 +01002221static const struct display_timing tianma_tm070rvhg71_timing = {
2222 .pixelclock = { 27700000, 29200000, 39600000 },
2223 .hactive = { 800, 800, 800 },
2224 .hfront_porch = { 12, 40, 212 },
2225 .hback_porch = { 88, 88, 88 },
2226 .hsync_len = { 1, 1, 40 },
2227 .vactive = { 480, 480, 480 },
2228 .vfront_porch = { 1, 13, 88 },
2229 .vback_porch = { 32, 32, 32 },
2230 .vsync_len = { 1, 1, 3 },
2231 .flags = DISPLAY_FLAGS_DE_HIGH,
2232};
2233
2234static const struct panel_desc tianma_tm070rvhg71 = {
2235 .timings = &tianma_tm070rvhg71_timing,
2236 .num_timings = 1,
2237 .bpc = 8,
2238 .size = {
2239 .width = 154,
2240 .height = 86,
2241 },
2242 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2243};
2244
Lucas Stach06e733e2017-10-18 19:22:40 +02002245static const struct drm_display_mode toshiba_lt089ac29000_mode = {
2246 .clock = 79500,
2247 .hdisplay = 1280,
2248 .hsync_start = 1280 + 192,
2249 .hsync_end = 1280 + 192 + 128,
2250 .htotal = 1280 + 192 + 128 + 64,
2251 .vdisplay = 768,
2252 .vsync_start = 768 + 20,
2253 .vsync_end = 768 + 20 + 7,
2254 .vtotal = 768 + 20 + 7 + 3,
2255 .vrefresh = 60,
2256};
2257
2258static const struct panel_desc toshiba_lt089ac29000 = {
2259 .modes = &toshiba_lt089ac29000_mode,
2260 .num_modes = 1,
2261 .size = {
2262 .width = 194,
2263 .height = 116,
2264 },
2265 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2266 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
2267};
2268
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05302269static const struct drm_display_mode tpk_f07a_0102_mode = {
2270 .clock = 33260,
2271 .hdisplay = 800,
2272 .hsync_start = 800 + 40,
2273 .hsync_end = 800 + 40 + 128,
2274 .htotal = 800 + 40 + 128 + 88,
2275 .vdisplay = 480,
2276 .vsync_start = 480 + 10,
2277 .vsync_end = 480 + 10 + 2,
2278 .vtotal = 480 + 10 + 2 + 33,
2279 .vrefresh = 60,
2280};
2281
2282static const struct panel_desc tpk_f07a_0102 = {
2283 .modes = &tpk_f07a_0102_mode,
2284 .num_modes = 1,
2285 .size = {
2286 .width = 152,
2287 .height = 91,
2288 },
2289 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
2290};
2291
2292static const struct drm_display_mode tpk_f10a_0102_mode = {
2293 .clock = 45000,
2294 .hdisplay = 1024,
2295 .hsync_start = 1024 + 176,
2296 .hsync_end = 1024 + 176 + 5,
2297 .htotal = 1024 + 176 + 5 + 88,
2298 .vdisplay = 600,
2299 .vsync_start = 600 + 20,
2300 .vsync_end = 600 + 20 + 5,
2301 .vtotal = 600 + 20 + 5 + 25,
2302 .vrefresh = 60,
2303};
2304
2305static const struct panel_desc tpk_f10a_0102 = {
2306 .modes = &tpk_f10a_0102_mode,
2307 .num_modes = 1,
2308 .size = {
2309 .width = 223,
2310 .height = 125,
2311 },
2312};
2313
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01002314static const struct display_timing urt_umsh_8596md_timing = {
2315 .pixelclock = { 33260000, 33260000, 33260000 },
2316 .hactive = { 800, 800, 800 },
2317 .hfront_porch = { 41, 41, 41 },
2318 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
2319 .hsync_len = { 71, 128, 128 },
2320 .vactive = { 480, 480, 480 },
2321 .vfront_porch = { 10, 10, 10 },
2322 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
2323 .vsync_len = { 2, 2, 2 },
2324 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
2325 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
2326};
2327
2328static const struct panel_desc urt_umsh_8596md_lvds = {
2329 .timings = &urt_umsh_8596md_timing,
2330 .num_timings = 1,
2331 .bpc = 6,
2332 .size = {
2333 .width = 152,
2334 .height = 91,
2335 },
2336 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
2337};
2338
2339static const struct panel_desc urt_umsh_8596md_parallel = {
2340 .timings = &urt_umsh_8596md_timing,
2341 .num_timings = 1,
2342 .bpc = 6,
2343 .size = {
2344 .width = 152,
2345 .height = 91,
2346 },
2347 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2348};
2349
Richard Genoude4bac402017-03-27 12:33:23 +02002350static const struct drm_display_mode winstar_wf35ltiacd_mode = {
2351 .clock = 6410,
2352 .hdisplay = 320,
2353 .hsync_start = 320 + 20,
2354 .hsync_end = 320 + 20 + 30,
2355 .htotal = 320 + 20 + 30 + 38,
2356 .vdisplay = 240,
2357 .vsync_start = 240 + 4,
2358 .vsync_end = 240 + 4 + 3,
2359 .vtotal = 240 + 4 + 3 + 15,
2360 .vrefresh = 60,
2361 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2362};
2363
2364static const struct panel_desc winstar_wf35ltiacd = {
2365 .modes = &winstar_wf35ltiacd_mode,
2366 .num_modes = 1,
2367 .bpc = 8,
2368 .size = {
2369 .width = 70,
2370 .height = 53,
2371 },
2372 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2373};
2374
Thierry Reding280921d2013-08-30 15:10:14 +02002375static const struct of_device_id platform_of_match[] = {
2376 {
Yannick Fertre966fea72017-03-28 11:44:49 +02002377 .compatible = "ampire,am-480272h3tmqw-t01h",
2378 .data = &ampire_am_480272h3tmqw_t01h,
2379 }, {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01002380 .compatible = "ampire,am800480r3tmqwa1h",
2381 .data = &ampire_am800480r3tmqwa1h,
2382 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02002383 .compatible = "auo,b101aw03",
2384 .data = &auo_b101aw03,
2385 }, {
Huang Lina531bc32015-02-28 10:18:58 +08002386 .compatible = "auo,b101ean01",
2387 .data = &auo_b101ean01,
2388 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04002389 .compatible = "auo,b101xtn01",
2390 .data = &auo_b101xtn01,
2391 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05302392 .compatible = "auo,b116xw03",
2393 .data = &auo_b116xw03,
2394 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05302395 .compatible = "auo,b133htn01",
2396 .data = &auo_b133htn01,
2397 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07002398 .compatible = "auo,b133xtn01",
2399 .data = &auo_b133xtn01,
2400 }, {
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02002401 .compatible = "auo,g070vvn01",
2402 .data = &auo_g070vvn01,
2403 }, {
Christoph Fritz4451c282017-12-16 14:13:36 +01002404 .compatible = "auo,g104sn02",
2405 .data = &auo_g104sn02,
2406 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01002407 .compatible = "auo,g133han01",
2408 .data = &auo_g133han01,
2409 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01002410 .compatible = "auo,g185han01",
2411 .data = &auo_g185han01,
2412 }, {
Lucas Stach70c0d5b2017-06-08 20:07:58 +02002413 .compatible = "auo,p320hvn03",
2414 .data = &auo_p320hvn03,
2415 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07002416 .compatible = "auo,t215hvn01",
2417 .data = &auo_t215hvn01,
2418 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01002419 .compatible = "avic,tm070ddh03",
2420 .data = &avic_tm070ddh03,
2421 }, {
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02002422 .compatible = "boe,hv070wsa-100",
2423 .data = &boe_hv070wsa
2424 }, {
Caesar Wangcac1a412016-12-14 11:19:56 +08002425 .compatible = "boe,nv101wxmn51",
2426 .data = &boe_nv101wxmn51,
2427 }, {
Giulio Benettie58edce2018-07-31 01:11:16 +02002428 .compatible = "cdtech,s043wq26h-ct7",
2429 .data = &cdtech_s043wq26h_ct7,
2430 }, {
Giulio Benetti982f9442018-07-31 01:11:14 +02002431 .compatible = "cdtech,s070wv95-ct16",
2432 .data = &cdtech_s070wv95_ct16,
2433 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08002434 .compatible = "chunghwa,claa070wp03xg",
2435 .data = &chunghwa_claa070wp03xg,
2436 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07002437 .compatible = "chunghwa,claa101wa01a",
2438 .data = &chunghwa_claa101wa01a
2439 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02002440 .compatible = "chunghwa,claa101wb01",
2441 .data = &chunghwa_claa101wb01
2442 }, {
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02002443 .compatible = "dataimage,scf0700c48ggu18",
2444 .data = &dataimage_scf0700c48ggu18,
2445 }, {
Philipp Zabel0ca0c822018-05-23 11:25:04 +02002446 .compatible = "dlc,dlc0700yzg-1",
2447 .data = &dlc_dlc0700yzg_1,
2448 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02002449 .compatible = "edt,et057090dhu",
2450 .data = &edt_et057090dhu,
2451 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02002452 .compatible = "edt,et070080dh6",
2453 .data = &edt_etm0700g0dh6,
2454 }, {
2455 .compatible = "edt,etm0700g0dh6",
2456 .data = &edt_etm0700g0dh6,
2457 }, {
Jan Tuerkaa7e6452018-06-19 11:55:44 +02002458 .compatible = "edt,etm0700g0bdh6",
2459 .data = &edt_etm0700g0bdh6,
2460 }, {
Jan Tuerkaad34de2018-06-19 11:55:45 +02002461 .compatible = "edt,etm0700g0edh6",
2462 .data = &edt_etm0700g0bdh6,
2463 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02002464 .compatible = "foxlink,fl500wvr00-a0t",
2465 .data = &foxlink_fl500wvr00_a0t,
2466 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002467 .compatible = "giantplus,gpg482739qs5",
2468 .data = &giantplus_gpg482739qs5
2469 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02002470 .compatible = "hannstar,hsd070pww1",
2471 .data = &hannstar_hsd070pww1,
2472 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002473 .compatible = "hannstar,hsd100pxn1",
2474 .data = &hannstar_hsd100pxn1,
2475 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002476 .compatible = "hit,tx23d38vm0caa",
2477 .data = &hitachi_tx23d38vm0caa
2478 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002479 .compatible = "innolux,at043tn24",
2480 .data = &innolux_at043tn24,
2481 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002482 .compatible = "innolux,at070tn92",
2483 .data = &innolux_at070tn92,
2484 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002485 .compatible = "innolux,g070y2-l01",
2486 .data = &innolux_g070y2_l01,
2487 }, {
2488 .compatible = "innolux,g101ice-l01",
Michael Olbrich1e29b842016-08-15 14:32:02 +02002489 .data = &innolux_g101ice_l01
2490 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002491 .compatible = "innolux,g121i1-l01",
Lucas Stachd731f662014-11-06 17:44:33 +01002492 .data = &innolux_g121i1_l01
2493 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002494 .compatible = "innolux,g121x1-l03",
2495 .data = &innolux_g121x1_l03,
2496 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02002497 .compatible = "innolux,n116bge",
2498 .data = &innolux_n116bge,
2499 }, {
Alban Bedelea447392014-07-22 08:38:55 +02002500 .compatible = "innolux,n156bge-l21",
2501 .data = &innolux_n156bge_l21,
2502 }, {
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302503 .compatible = "innolux,tv123wam",
2504 .data = &innolux_tv123wam,
2505 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002506 .compatible = "innolux,zj070na-01p",
2507 .data = &innolux_zj070na_01p,
2508 }, {
Jagan Teki8cfe8342018-02-04 23:19:28 +05302509 .compatible = "koe,tx31d200vm0baa",
2510 .data = &koe_tx31d200vm0baa,
2511 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01002512 .compatible = "kyo,tcg121xglp",
2513 .data = &kyo_tcg121xglp,
2514 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02002515 .compatible = "lg,lb070wv8",
2516 .data = &lg_lb070wv8,
2517 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08002518 .compatible = "lg,lp079qx1-sp0v",
2519 .data = &lg_lp079qx1_sp0v,
2520 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08002521 .compatible = "lg,lp097qx1-spa1",
2522 .data = &lg_lp097qx1_spa1,
2523 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08002524 .compatible = "lg,lp120up1",
2525 .data = &lg_lp120up1,
2526 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01002527 .compatible = "lg,lp129qe",
2528 .data = &lg_lp129qe,
2529 }, {
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002530 .compatible = "mitsubishi,aa070mc01-ca1",
2531 .data = &mitsubishi_aa070mc01,
2532 }, {
Lucas Stach01bacc132017-06-08 20:07:55 +02002533 .compatible = "nec,nl12880bc20-05",
2534 .data = &nec_nl12880bc20_05,
2535 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08002536 .compatible = "nec,nl4827hc19-05b",
2537 .data = &nec_nl4827hc19_05b,
2538 }, {
Maxime Riparde6c2f062016-09-06 16:46:17 +02002539 .compatible = "netron-dy,e231732",
2540 .data = &netron_dy_e231732,
2541 }, {
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03002542 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
2543 .data = &newhaven_nhd_43_480272ef_atxl,
2544 }, {
Lucas Stach4177fa62017-06-08 20:07:57 +02002545 .compatible = "nlt,nl192108ac18-02d",
2546 .data = &nlt_nl192108ac18_02d,
2547 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02002548 .compatible = "nvd,9128",
2549 .data = &nvd_9128,
2550 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02002551 .compatible = "okaya,rs800480t-7x0gp",
2552 .data = &okaya_rs800480t_7x0gp,
2553 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002554 .compatible = "olimex,lcd-olinuxino-43-ts",
2555 .data = &olimex_lcd_olinuxino_43ts,
2556 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07002557 .compatible = "ontat,yx700wv03",
2558 .data = &ontat_yx700wv03,
2559 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01002560 .compatible = "ortustech,com43h4m85ulc",
2561 .data = &ortustech_com43h4m85ulc,
2562 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02002563 .compatible = "qiaodian,qd43003c0-40",
2564 .data = &qd43003c0_40,
2565 }, {
Jagan Teki23167fa2018-06-07 19:16:48 +05302566 .compatible = "rocktech,rk070er9427",
2567 .data = &rocktech_rk070er9427,
2568 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08002569 .compatible = "samsung,lsn122dl01-c01",
2570 .data = &samsung_lsn122dl01_c01,
2571 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01002572 .compatible = "samsung,ltn101nt05",
2573 .data = &samsung_ltn101nt05,
2574 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01002575 .compatible = "samsung,ltn140at29-301",
2576 .data = &samsung_ltn140at29_301,
2577 }, {
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03002578 .compatible = "sharp,lq035q7db03",
2579 .data = &sharp_lq035q7db03,
2580 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07002581 .compatible = "sharp,lq101k1ly04",
2582 .data = &sharp_lq101k1ly04,
2583 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08002584 .compatible = "sharp,lq123p1jx31",
2585 .data = &sharp_lq123p1jx31,
2586 }, {
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02002587 .compatible = "sharp,lq150x1lg11",
2588 .data = &sharp_lq150x1lg11,
2589 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01002590 .compatible = "shelly,sca07010-bfn-lnn",
2591 .data = &shelly_sca07010_bfn_lnn,
2592 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07002593 .compatible = "starry,kr122ea0sra",
2594 .data = &starry_kr122ea0sra,
2595 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01002596 .compatible = "tianma,tm070jdhg30",
2597 .data = &tianma_tm070jdhg30,
2598 }, {
Lukasz Majewski870a0b12017-11-07 16:30:58 +01002599 .compatible = "tianma,tm070rvhg71",
2600 .data = &tianma_tm070rvhg71,
2601 }, {
Lucas Stach06e733e2017-10-18 19:22:40 +02002602 .compatible = "toshiba,lt089ac29000",
2603 .data = &toshiba_lt089ac29000,
2604 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05302605 .compatible = "tpk,f07a-0102",
2606 .data = &tpk_f07a_0102,
2607 }, {
2608 .compatible = "tpk,f10a-0102",
2609 .data = &tpk_f10a_0102,
2610 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01002611 .compatible = "urt,umsh-8596md-t",
2612 .data = &urt_umsh_8596md_parallel,
2613 }, {
2614 .compatible = "urt,umsh-8596md-1t",
2615 .data = &urt_umsh_8596md_parallel,
2616 }, {
2617 .compatible = "urt,umsh-8596md-7t",
2618 .data = &urt_umsh_8596md_parallel,
2619 }, {
2620 .compatible = "urt,umsh-8596md-11t",
2621 .data = &urt_umsh_8596md_lvds,
2622 }, {
2623 .compatible = "urt,umsh-8596md-19t",
2624 .data = &urt_umsh_8596md_lvds,
2625 }, {
2626 .compatible = "urt,umsh-8596md-20t",
2627 .data = &urt_umsh_8596md_parallel,
2628 }, {
Richard Genoude4bac402017-03-27 12:33:23 +02002629 .compatible = "winstar,wf35ltiacd",
2630 .data = &winstar_wf35ltiacd,
2631 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02002632 /* sentinel */
2633 }
2634};
2635MODULE_DEVICE_TABLE(of, platform_of_match);
2636
2637static int panel_simple_platform_probe(struct platform_device *pdev)
2638{
2639 const struct of_device_id *id;
2640
2641 id = of_match_node(platform_of_match, pdev->dev.of_node);
2642 if (!id)
2643 return -ENODEV;
2644
2645 return panel_simple_probe(&pdev->dev, id->data);
2646}
2647
2648static int panel_simple_platform_remove(struct platform_device *pdev)
2649{
2650 return panel_simple_remove(&pdev->dev);
2651}
2652
Thierry Redingd02fd932014-04-29 17:21:21 +02002653static void panel_simple_platform_shutdown(struct platform_device *pdev)
2654{
2655 panel_simple_shutdown(&pdev->dev);
2656}
2657
Thierry Reding280921d2013-08-30 15:10:14 +02002658static struct platform_driver panel_simple_platform_driver = {
2659 .driver = {
2660 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02002661 .of_match_table = platform_of_match,
2662 },
2663 .probe = panel_simple_platform_probe,
2664 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002665 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002666};
2667
Thierry Reding210fcd92013-11-22 19:27:11 +01002668struct panel_desc_dsi {
2669 struct panel_desc desc;
2670
Thierry Reding462658b2014-03-14 11:24:57 +01002671 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01002672 enum mipi_dsi_pixel_format format;
2673 unsigned int lanes;
2674};
2675
Thierry Redingd718d792015-04-08 16:52:33 +02002676static const struct drm_display_mode auo_b080uan01_mode = {
2677 .clock = 154500,
2678 .hdisplay = 1200,
2679 .hsync_start = 1200 + 62,
2680 .hsync_end = 1200 + 62 + 4,
2681 .htotal = 1200 + 62 + 4 + 62,
2682 .vdisplay = 1920,
2683 .vsync_start = 1920 + 9,
2684 .vsync_end = 1920 + 9 + 2,
2685 .vtotal = 1920 + 9 + 2 + 8,
2686 .vrefresh = 60,
2687};
2688
2689static const struct panel_desc_dsi auo_b080uan01 = {
2690 .desc = {
2691 .modes = &auo_b080uan01_mode,
2692 .num_modes = 1,
2693 .bpc = 8,
2694 .size = {
2695 .width = 108,
2696 .height = 272,
2697 },
2698 },
2699 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2700 .format = MIPI_DSI_FMT_RGB888,
2701 .lanes = 4,
2702};
2703
Chris Zhongc8521962015-11-20 16:15:37 +08002704static const struct drm_display_mode boe_tv080wum_nl0_mode = {
2705 .clock = 160000,
2706 .hdisplay = 1200,
2707 .hsync_start = 1200 + 120,
2708 .hsync_end = 1200 + 120 + 20,
2709 .htotal = 1200 + 120 + 20 + 21,
2710 .vdisplay = 1920,
2711 .vsync_start = 1920 + 21,
2712 .vsync_end = 1920 + 21 + 3,
2713 .vtotal = 1920 + 21 + 3 + 18,
2714 .vrefresh = 60,
2715 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2716};
2717
2718static const struct panel_desc_dsi boe_tv080wum_nl0 = {
2719 .desc = {
2720 .modes = &boe_tv080wum_nl0_mode,
2721 .num_modes = 1,
2722 .size = {
2723 .width = 107,
2724 .height = 172,
2725 },
2726 },
2727 .flags = MIPI_DSI_MODE_VIDEO |
2728 MIPI_DSI_MODE_VIDEO_BURST |
2729 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
2730 .format = MIPI_DSI_FMT_RGB888,
2731 .lanes = 4,
2732};
2733
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002734static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
2735 .clock = 71000,
2736 .hdisplay = 800,
2737 .hsync_start = 800 + 32,
2738 .hsync_end = 800 + 32 + 1,
2739 .htotal = 800 + 32 + 1 + 57,
2740 .vdisplay = 1280,
2741 .vsync_start = 1280 + 28,
2742 .vsync_end = 1280 + 28 + 1,
2743 .vtotal = 1280 + 28 + 1 + 14,
2744 .vrefresh = 60,
2745};
2746
2747static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
2748 .desc = {
2749 .modes = &lg_ld070wx3_sl01_mode,
2750 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002751 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002752 .size = {
2753 .width = 94,
2754 .height = 151,
2755 },
2756 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09002757 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002758 .format = MIPI_DSI_FMT_RGB888,
2759 .lanes = 4,
2760};
2761
Alexandre Courbot499ce852014-01-21 18:57:09 +09002762static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
2763 .clock = 67000,
2764 .hdisplay = 720,
2765 .hsync_start = 720 + 12,
2766 .hsync_end = 720 + 12 + 4,
2767 .htotal = 720 + 12 + 4 + 112,
2768 .vdisplay = 1280,
2769 .vsync_start = 1280 + 8,
2770 .vsync_end = 1280 + 8 + 4,
2771 .vtotal = 1280 + 8 + 4 + 12,
2772 .vrefresh = 60,
2773};
2774
2775static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
2776 .desc = {
2777 .modes = &lg_lh500wx1_sd03_mode,
2778 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002779 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09002780 .size = {
2781 .width = 62,
2782 .height = 110,
2783 },
2784 },
2785 .flags = MIPI_DSI_MODE_VIDEO,
2786 .format = MIPI_DSI_FMT_RGB888,
2787 .lanes = 4,
2788};
2789
Thierry Reding280921d2013-08-30 15:10:14 +02002790static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
2791 .clock = 157200,
2792 .hdisplay = 1920,
2793 .hsync_start = 1920 + 154,
2794 .hsync_end = 1920 + 154 + 16,
2795 .htotal = 1920 + 154 + 16 + 32,
2796 .vdisplay = 1200,
2797 .vsync_start = 1200 + 17,
2798 .vsync_end = 1200 + 17 + 2,
2799 .vtotal = 1200 + 17 + 2 + 16,
2800 .vrefresh = 60,
2801};
2802
Thierry Reding210fcd92013-11-22 19:27:11 +01002803static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
2804 .desc = {
2805 .modes = &panasonic_vvx10f004b00_mode,
2806 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002807 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01002808 .size = {
2809 .width = 217,
2810 .height = 136,
2811 },
Thierry Reding280921d2013-08-30 15:10:14 +02002812 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09002813 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
2814 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01002815 .format = MIPI_DSI_FMT_RGB888,
2816 .lanes = 4,
2817};
2818
2819static const struct of_device_id dsi_of_match[] = {
2820 {
Thierry Redingd718d792015-04-08 16:52:33 +02002821 .compatible = "auo,b080uan01",
2822 .data = &auo_b080uan01
2823 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08002824 .compatible = "boe,tv080wum-nl0",
2825 .data = &boe_tv080wum_nl0
2826 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002827 .compatible = "lg,ld070wx3-sl01",
2828 .data = &lg_ld070wx3_sl01
2829 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09002830 .compatible = "lg,lh500wx1-sd03",
2831 .data = &lg_lh500wx1_sd03
2832 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01002833 .compatible = "panasonic,vvx10f004b00",
2834 .data = &panasonic_vvx10f004b00
2835 }, {
2836 /* sentinel */
2837 }
2838};
2839MODULE_DEVICE_TABLE(of, dsi_of_match);
2840
2841static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
2842{
2843 const struct panel_desc_dsi *desc;
2844 const struct of_device_id *id;
2845 int err;
2846
2847 id = of_match_node(dsi_of_match, dsi->dev.of_node);
2848 if (!id)
2849 return -ENODEV;
2850
2851 desc = id->data;
2852
2853 err = panel_simple_probe(&dsi->dev, &desc->desc);
2854 if (err < 0)
2855 return err;
2856
Thierry Reding462658b2014-03-14 11:24:57 +01002857 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01002858 dsi->format = desc->format;
2859 dsi->lanes = desc->lanes;
2860
2861 return mipi_dsi_attach(dsi);
2862}
2863
2864static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
2865{
2866 int err;
2867
2868 err = mipi_dsi_detach(dsi);
2869 if (err < 0)
2870 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
2871
2872 return panel_simple_remove(&dsi->dev);
2873}
2874
Thierry Redingd02fd932014-04-29 17:21:21 +02002875static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
2876{
2877 panel_simple_shutdown(&dsi->dev);
2878}
2879
Thierry Reding210fcd92013-11-22 19:27:11 +01002880static struct mipi_dsi_driver panel_simple_dsi_driver = {
2881 .driver = {
2882 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01002883 .of_match_table = dsi_of_match,
2884 },
2885 .probe = panel_simple_dsi_probe,
2886 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002887 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002888};
2889
2890static int __init panel_simple_init(void)
2891{
Thierry Reding210fcd92013-11-22 19:27:11 +01002892 int err;
2893
2894 err = platform_driver_register(&panel_simple_platform_driver);
2895 if (err < 0)
2896 return err;
2897
2898 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
2899 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
2900 if (err < 0)
2901 return err;
2902 }
2903
2904 return 0;
Thierry Reding280921d2013-08-30 15:10:14 +02002905}
2906module_init(panel_simple_init);
2907
2908static void __exit panel_simple_exit(void)
2909{
Thierry Reding210fcd92013-11-22 19:27:11 +01002910 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
2911 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
2912
Thierry Reding280921d2013-08-30 15:10:14 +02002913 platform_driver_unregister(&panel_simple_platform_driver);
2914}
2915module_exit(panel_simple_exit);
2916
2917MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
2918MODULE_DESCRIPTION("DRM Driver for Simple Panels");
2919MODULE_LICENSE("GPL and additional rights");