blob: 585b37f9171adb455947b68428e2315c7ad8fe6e [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
190 if (p->enable_gpio)
191 gpiod_set_value_cansleep(p->enable_gpio, 0);
192
193 regulator_disable(p->supply);
194
Ajay Kumarf673c372014-07-31 23:12:11 +0530195 if (p->desc->delay.unprepare)
196 msleep(p->desc->delay.unprepare);
197
Ajay Kumar613a6332014-07-31 23:12:10 +0530198 p->prepared = false;
199
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530200 return 0;
201}
202
203static int panel_simple_prepare(struct drm_panel *panel)
204{
Thierry Reding280921d2013-08-30 15:10:14 +0200205 struct panel_simple *p = to_panel_simple(panel);
206 int err;
207
Ajay Kumar613a6332014-07-31 23:12:10 +0530208 if (p->prepared)
Thierry Reding280921d2013-08-30 15:10:14 +0200209 return 0;
210
211 err = regulator_enable(p->supply);
212 if (err < 0) {
213 dev_err(panel->dev, "failed to enable supply: %d\n", err);
214 return err;
215 }
216
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900217 if (p->enable_gpio)
Thierry Reding15c1a912014-03-14 12:03:47 +0100218 gpiod_set_value_cansleep(p->enable_gpio, 1);
Thierry Reding280921d2013-08-30 15:10:14 +0200219
Ajay Kumarf673c372014-07-31 23:12:11 +0530220 if (p->desc->delay.prepare)
221 msleep(p->desc->delay.prepare);
222
Ajay Kumar613a6332014-07-31 23:12:10 +0530223 p->prepared = true;
224
225 return 0;
226}
227
228static int panel_simple_enable(struct drm_panel *panel)
229{
230 struct panel_simple *p = to_panel_simple(panel);
231
232 if (p->enabled)
233 return 0;
234
Ajay Kumarf673c372014-07-31 23:12:11 +0530235 if (p->desc->delay.enable)
236 msleep(p->desc->delay.enable);
237
Thierry Reding280921d2013-08-30 15:10:14 +0200238 if (p->backlight) {
Thierry Redinge4aa3422016-06-17 19:11:53 +0200239 p->backlight->props.state &= ~BL_CORE_FBBLANK;
Thierry Reding280921d2013-08-30 15:10:14 +0200240 p->backlight->props.power = FB_BLANK_UNBLANK;
241 backlight_update_status(p->backlight);
242 }
243
244 p->enabled = true;
245
246 return 0;
247}
248
249static int panel_simple_get_modes(struct drm_panel *panel)
250{
251 struct panel_simple *p = to_panel_simple(panel);
252 int num = 0;
253
254 /* probe EDID if a DDC bus is available */
255 if (p->ddc) {
256 struct edid *edid = drm_get_edid(panel->connector, p->ddc);
Stephen Warren70bf6872014-01-09 11:37:34 -0700257 drm_mode_connector_update_edid_property(panel->connector, edid);
Thierry Reding280921d2013-08-30 15:10:14 +0200258 if (edid) {
259 num += drm_add_edid_modes(panel->connector, edid);
260 kfree(edid);
261 }
262 }
263
264 /* add hard-coded panel modes */
265 num += panel_simple_get_fixed_modes(p);
266
267 return num;
268}
269
Philipp Zabela5d3e622014-12-11 18:32:45 +0100270static int panel_simple_get_timings(struct drm_panel *panel,
271 unsigned int num_timings,
272 struct display_timing *timings)
273{
274 struct panel_simple *p = to_panel_simple(panel);
275 unsigned int i;
276
277 if (p->desc->num_timings < num_timings)
278 num_timings = p->desc->num_timings;
279
280 if (timings)
281 for (i = 0; i < num_timings; i++)
282 timings[i] = p->desc->timings[i];
283
284 return p->desc->num_timings;
285}
286
Thierry Reding280921d2013-08-30 15:10:14 +0200287static const struct drm_panel_funcs panel_simple_funcs = {
288 .disable = panel_simple_disable,
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530289 .unprepare = panel_simple_unprepare,
290 .prepare = panel_simple_prepare,
Thierry Reding280921d2013-08-30 15:10:14 +0200291 .enable = panel_simple_enable,
292 .get_modes = panel_simple_get_modes,
Philipp Zabela5d3e622014-12-11 18:32:45 +0100293 .get_timings = panel_simple_get_timings,
Thierry Reding280921d2013-08-30 15:10:14 +0200294};
295
296static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
297{
298 struct device_node *backlight, *ddc;
299 struct panel_simple *panel;
Thierry Reding280921d2013-08-30 15:10:14 +0200300 int err;
301
302 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
303 if (!panel)
304 return -ENOMEM;
305
306 panel->enabled = false;
Ajay Kumar613a6332014-07-31 23:12:10 +0530307 panel->prepared = false;
Thierry Reding280921d2013-08-30 15:10:14 +0200308 panel->desc = desc;
309
310 panel->supply = devm_regulator_get(dev, "power");
311 if (IS_ERR(panel->supply))
312 return PTR_ERR(panel->supply);
313
Alexandre Courbota61400d2014-10-23 17:16:58 +0900314 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
315 GPIOD_OUT_LOW);
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900316 if (IS_ERR(panel->enable_gpio)) {
317 err = PTR_ERR(panel->enable_gpio);
Alexandre Courbot9746c612014-07-25 23:47:25 +0900318 dev_err(dev, "failed to request GPIO: %d\n", err);
319 return err;
320 }
Thierry Reding280921d2013-08-30 15:10:14 +0200321
Thierry Reding280921d2013-08-30 15:10:14 +0200322 backlight = of_parse_phandle(dev->of_node, "backlight", 0);
323 if (backlight) {
324 panel->backlight = of_find_backlight_by_node(backlight);
325 of_node_put(backlight);
326
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900327 if (!panel->backlight)
328 return -EPROBE_DEFER;
Thierry Reding280921d2013-08-30 15:10:14 +0200329 }
330
331 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
332 if (ddc) {
333 panel->ddc = of_find_i2c_adapter_by_node(ddc);
334 of_node_put(ddc);
335
336 if (!panel->ddc) {
337 err = -EPROBE_DEFER;
338 goto free_backlight;
339 }
340 }
341
342 drm_panel_init(&panel->base);
343 panel->base.dev = dev;
344 panel->base.funcs = &panel_simple_funcs;
345
346 err = drm_panel_add(&panel->base);
347 if (err < 0)
348 goto free_ddc;
349
350 dev_set_drvdata(dev, panel);
351
352 return 0;
353
354free_ddc:
355 if (panel->ddc)
356 put_device(&panel->ddc->dev);
357free_backlight:
358 if (panel->backlight)
359 put_device(&panel->backlight->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200360
361 return err;
362}
363
364static int panel_simple_remove(struct device *dev)
365{
366 struct panel_simple *panel = dev_get_drvdata(dev);
367
368 drm_panel_detach(&panel->base);
369 drm_panel_remove(&panel->base);
370
371 panel_simple_disable(&panel->base);
372
373 if (panel->ddc)
374 put_device(&panel->ddc->dev);
375
376 if (panel->backlight)
377 put_device(&panel->backlight->dev);
378
Thierry Reding280921d2013-08-30 15:10:14 +0200379 return 0;
380}
381
Thierry Redingd02fd932014-04-29 17:21:21 +0200382static void panel_simple_shutdown(struct device *dev)
383{
384 struct panel_simple *panel = dev_get_drvdata(dev);
385
386 panel_simple_disable(&panel->base);
387}
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
Lucas Stach697035c2016-11-30 14:09:55 +0100583static const struct display_timing auo_g133han01_timings = {
584 .pixelclock = { 134000000, 141200000, 149000000 },
585 .hactive = { 1920, 1920, 1920 },
586 .hfront_porch = { 39, 58, 77 },
587 .hback_porch = { 59, 88, 117 },
588 .hsync_len = { 28, 42, 56 },
589 .vactive = { 1080, 1080, 1080 },
590 .vfront_porch = { 3, 8, 11 },
591 .vback_porch = { 5, 14, 19 },
592 .vsync_len = { 4, 14, 19 },
593};
594
595static const struct panel_desc auo_g133han01 = {
596 .timings = &auo_g133han01_timings,
597 .num_timings = 1,
598 .bpc = 8,
599 .size = {
600 .width = 293,
601 .height = 165,
602 },
603 .delay = {
604 .prepare = 200,
605 .enable = 50,
606 .disable = 50,
607 .unprepare = 1000,
608 },
609 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
610};
611
Lucas Stach8c31f602016-11-30 14:09:56 +0100612static const struct display_timing auo_g185han01_timings = {
613 .pixelclock = { 120000000, 144000000, 175000000 },
614 .hactive = { 1920, 1920, 1920 },
615 .hfront_porch = { 18, 60, 74 },
616 .hback_porch = { 12, 44, 54 },
617 .hsync_len = { 10, 24, 32 },
618 .vactive = { 1080, 1080, 1080 },
619 .vfront_porch = { 6, 10, 40 },
620 .vback_porch = { 2, 5, 20 },
621 .vsync_len = { 2, 5, 20 },
622};
623
624static const struct panel_desc auo_g185han01 = {
625 .timings = &auo_g185han01_timings,
626 .num_timings = 1,
627 .bpc = 8,
628 .size = {
629 .width = 409,
630 .height = 230,
631 },
632 .delay = {
633 .prepare = 50,
634 .enable = 200,
635 .disable = 110,
636 .unprepare = 1000,
637 },
638 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
639};
640
Haixia Shi7ee933a2016-10-11 14:59:16 -0700641static const struct drm_display_mode auo_t215hvn01_mode = {
642 .clock = 148800,
643 .hdisplay = 1920,
644 .hsync_start = 1920 + 88,
645 .hsync_end = 1920 + 88 + 44,
646 .htotal = 1920 + 88 + 44 + 148,
647 .vdisplay = 1080,
648 .vsync_start = 1080 + 4,
649 .vsync_end = 1080 + 4 + 5,
650 .vtotal = 1080 + 4 + 5 + 36,
651 .vrefresh = 60,
652};
653
654static const struct panel_desc auo_t215hvn01 = {
655 .modes = &auo_t215hvn01_mode,
656 .num_modes = 1,
657 .bpc = 8,
658 .size = {
659 .width = 430,
660 .height = 270,
661 },
662 .delay = {
663 .disable = 5,
664 .unprepare = 1000,
665 }
666};
667
Philipp Zabeld47df632014-12-18 16:43:43 +0100668static const struct drm_display_mode avic_tm070ddh03_mode = {
669 .clock = 51200,
670 .hdisplay = 1024,
671 .hsync_start = 1024 + 160,
672 .hsync_end = 1024 + 160 + 4,
673 .htotal = 1024 + 160 + 4 + 156,
674 .vdisplay = 600,
675 .vsync_start = 600 + 17,
676 .vsync_end = 600 + 17 + 1,
677 .vtotal = 600 + 17 + 1 + 17,
678 .vrefresh = 60,
679};
680
681static const struct panel_desc avic_tm070ddh03 = {
682 .modes = &avic_tm070ddh03_mode,
683 .num_modes = 1,
684 .bpc = 8,
685 .size = {
686 .width = 154,
687 .height = 90,
688 },
689 .delay = {
690 .prepare = 20,
691 .enable = 200,
692 .disable = 200,
693 },
694};
695
Caesar Wangcac1a412016-12-14 11:19:56 +0800696static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
697 {
698 .clock = 71900,
699 .hdisplay = 1280,
700 .hsync_start = 1280 + 48,
701 .hsync_end = 1280 + 48 + 32,
702 .htotal = 1280 + 48 + 32 + 80,
703 .vdisplay = 800,
704 .vsync_start = 800 + 3,
705 .vsync_end = 800 + 3 + 5,
706 .vtotal = 800 + 3 + 5 + 24,
707 .vrefresh = 60,
708 },
709 {
710 .clock = 57500,
711 .hdisplay = 1280,
712 .hsync_start = 1280 + 48,
713 .hsync_end = 1280 + 48 + 32,
714 .htotal = 1280 + 48 + 32 + 80,
715 .vdisplay = 800,
716 .vsync_start = 800 + 3,
717 .vsync_end = 800 + 3 + 5,
718 .vtotal = 800 + 3 + 5 + 24,
719 .vrefresh = 48,
720 },
721};
722
723static const struct panel_desc boe_nv101wxmn51 = {
724 .modes = boe_nv101wxmn51_modes,
725 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
726 .bpc = 8,
727 .size = {
728 .width = 217,
729 .height = 136,
730 },
731 .delay = {
732 .prepare = 210,
733 .enable = 50,
734 .unprepare = 160,
735 },
736};
737
Randy Li2cb35c82016-09-20 03:02:51 +0800738static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
739 .clock = 66770,
740 .hdisplay = 800,
741 .hsync_start = 800 + 49,
742 .hsync_end = 800 + 49 + 33,
743 .htotal = 800 + 49 + 33 + 17,
744 .vdisplay = 1280,
745 .vsync_start = 1280 + 1,
746 .vsync_end = 1280 + 1 + 7,
747 .vtotal = 1280 + 1 + 7 + 15,
748 .vrefresh = 60,
749 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
750};
751
752static const struct panel_desc chunghwa_claa070wp03xg = {
753 .modes = &chunghwa_claa070wp03xg_mode,
754 .num_modes = 1,
755 .bpc = 6,
756 .size = {
757 .width = 94,
758 .height = 150,
759 },
760};
761
Stephen Warren4c930752014-01-07 16:46:26 -0700762static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
763 .clock = 72070,
764 .hdisplay = 1366,
765 .hsync_start = 1366 + 58,
766 .hsync_end = 1366 + 58 + 58,
767 .htotal = 1366 + 58 + 58 + 58,
768 .vdisplay = 768,
769 .vsync_start = 768 + 4,
770 .vsync_end = 768 + 4 + 4,
771 .vtotal = 768 + 4 + 4 + 4,
772 .vrefresh = 60,
773};
774
775static const struct panel_desc chunghwa_claa101wa01a = {
776 .modes = &chunghwa_claa101wa01a_mode,
777 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700778 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -0700779 .size = {
780 .width = 220,
781 .height = 120,
782 },
783};
784
Thierry Reding280921d2013-08-30 15:10:14 +0200785static const struct drm_display_mode chunghwa_claa101wb01_mode = {
786 .clock = 69300,
787 .hdisplay = 1366,
788 .hsync_start = 1366 + 48,
789 .hsync_end = 1366 + 48 + 32,
790 .htotal = 1366 + 48 + 32 + 20,
791 .vdisplay = 768,
792 .vsync_start = 768 + 16,
793 .vsync_end = 768 + 16 + 8,
794 .vtotal = 768 + 16 + 8 + 16,
795 .vrefresh = 60,
796};
797
798static const struct panel_desc chunghwa_claa101wb01 = {
799 .modes = &chunghwa_claa101wb01_mode,
800 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700801 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200802 .size = {
803 .width = 223,
804 .height = 125,
805 },
806};
807
Stefan Agner26ab0062014-05-15 11:38:45 +0200808static const struct drm_display_mode edt_et057090dhu_mode = {
809 .clock = 25175,
810 .hdisplay = 640,
811 .hsync_start = 640 + 16,
812 .hsync_end = 640 + 16 + 30,
813 .htotal = 640 + 16 + 30 + 114,
814 .vdisplay = 480,
815 .vsync_start = 480 + 10,
816 .vsync_end = 480 + 10 + 3,
817 .vtotal = 480 + 10 + 3 + 32,
818 .vrefresh = 60,
819 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
820};
821
822static const struct panel_desc edt_et057090dhu = {
823 .modes = &edt_et057090dhu_mode,
824 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700825 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +0200826 .size = {
827 .width = 115,
828 .height = 86,
829 },
Stefan Agnereaeebff2016-12-08 14:54:31 -0800830 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
831 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
Stefan Agner26ab0062014-05-15 11:38:45 +0200832};
833
Philipp Zabelfff5de42014-05-15 12:25:47 +0200834static const struct drm_display_mode edt_etm0700g0dh6_mode = {
835 .clock = 33260,
836 .hdisplay = 800,
837 .hsync_start = 800 + 40,
838 .hsync_end = 800 + 40 + 128,
839 .htotal = 800 + 40 + 128 + 88,
840 .vdisplay = 480,
841 .vsync_start = 480 + 10,
842 .vsync_end = 480 + 10 + 2,
843 .vtotal = 480 + 10 + 2 + 33,
844 .vrefresh = 60,
845 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
846};
847
848static const struct panel_desc edt_etm0700g0dh6 = {
849 .modes = &edt_etm0700g0dh6_mode,
850 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700851 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +0200852 .size = {
853 .width = 152,
854 .height = 91,
855 },
Stefan Agnereaeebff2016-12-08 14:54:31 -0800856 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
857 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
Philipp Zabelfff5de42014-05-15 12:25:47 +0200858};
859
Boris BREZILLON102932b2014-06-05 15:53:32 +0200860static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
861 .clock = 32260,
862 .hdisplay = 800,
863 .hsync_start = 800 + 168,
864 .hsync_end = 800 + 168 + 64,
865 .htotal = 800 + 168 + 64 + 88,
866 .vdisplay = 480,
867 .vsync_start = 480 + 37,
868 .vsync_end = 480 + 37 + 2,
869 .vtotal = 480 + 37 + 2 + 8,
870 .vrefresh = 60,
871};
872
873static const struct panel_desc foxlink_fl500wvr00_a0t = {
874 .modes = &foxlink_fl500wvr00_a0t_mode,
875 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +0100876 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +0200877 .size = {
878 .width = 108,
879 .height = 65,
880 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +0200881 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +0200882};
883
Philipp Zabeld435a2a2014-11-19 10:29:55 +0100884static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
885 .clock = 9000,
886 .hdisplay = 480,
887 .hsync_start = 480 + 5,
888 .hsync_end = 480 + 5 + 1,
889 .htotal = 480 + 5 + 1 + 40,
890 .vdisplay = 272,
891 .vsync_start = 272 + 8,
892 .vsync_end = 272 + 8 + 1,
893 .vtotal = 272 + 8 + 1 + 8,
894 .vrefresh = 60,
895};
896
897static const struct panel_desc giantplus_gpg482739qs5 = {
898 .modes = &giantplus_gpg482739qs5_mode,
899 .num_modes = 1,
900 .bpc = 8,
901 .size = {
902 .width = 95,
903 .height = 54,
904 },
Philipp Zabel33536a02015-02-11 18:50:07 +0100905 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +0100906};
907
Philipp Zabelab077252014-12-11 18:32:46 +0100908static const struct display_timing hannstar_hsd070pww1_timing = {
909 .pixelclock = { 64300000, 71100000, 82000000 },
910 .hactive = { 1280, 1280, 1280 },
911 .hfront_porch = { 1, 1, 10 },
912 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +0200913 /*
914 * According to the data sheet, the minimum horizontal blanking interval
915 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
916 * minimum working horizontal blanking interval to be 60 clocks.
917 */
918 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +0100919 .vactive = { 800, 800, 800 },
920 .vfront_porch = { 1, 1, 10 },
921 .vback_porch = { 1, 1, 10 },
922 .vsync_len = { 1, 21, 203 },
923 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +0200924};
925
926static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +0100927 .timings = &hannstar_hsd070pww1_timing,
928 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +0200929 .bpc = 6,
930 .size = {
931 .width = 151,
932 .height = 94,
933 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +0200934 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Philipp Zabela8532052014-10-23 16:31:06 +0200935};
936
Eric Nelsonc0d607e2015-04-13 15:09:26 -0700937static const struct display_timing hannstar_hsd100pxn1_timing = {
938 .pixelclock = { 55000000, 65000000, 75000000 },
939 .hactive = { 1024, 1024, 1024 },
940 .hfront_porch = { 40, 40, 40 },
941 .hback_porch = { 220, 220, 220 },
942 .hsync_len = { 20, 60, 100 },
943 .vactive = { 768, 768, 768 },
944 .vfront_porch = { 7, 7, 7 },
945 .vback_porch = { 21, 21, 21 },
946 .vsync_len = { 10, 10, 10 },
947 .flags = DISPLAY_FLAGS_DE_HIGH,
948};
949
950static const struct panel_desc hannstar_hsd100pxn1 = {
951 .timings = &hannstar_hsd100pxn1_timing,
952 .num_timings = 1,
953 .bpc = 6,
954 .size = {
955 .width = 203,
956 .height = 152,
957 },
Philipp Zabel4946b042015-05-20 11:34:08 +0200958 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Eric Nelsonc0d607e2015-04-13 15:09:26 -0700959};
960
Lucas Stach61ac0bf2014-11-06 17:44:35 +0100961static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
962 .clock = 33333,
963 .hdisplay = 800,
964 .hsync_start = 800 + 85,
965 .hsync_end = 800 + 85 + 86,
966 .htotal = 800 + 85 + 86 + 85,
967 .vdisplay = 480,
968 .vsync_start = 480 + 16,
969 .vsync_end = 480 + 16 + 13,
970 .vtotal = 480 + 16 + 13 + 16,
971 .vrefresh = 60,
972};
973
974static const struct panel_desc hitachi_tx23d38vm0caa = {
975 .modes = &hitachi_tx23d38vm0caa_mode,
976 .num_modes = 1,
977 .bpc = 6,
978 .size = {
979 .width = 195,
980 .height = 117,
981 },
982};
983
Nicolas Ferre41bcceb2015-03-19 14:43:01 +0100984static const struct drm_display_mode innolux_at043tn24_mode = {
985 .clock = 9000,
986 .hdisplay = 480,
987 .hsync_start = 480 + 2,
988 .hsync_end = 480 + 2 + 41,
989 .htotal = 480 + 2 + 41 + 2,
990 .vdisplay = 272,
991 .vsync_start = 272 + 2,
992 .vsync_end = 272 + 2 + 11,
993 .vtotal = 272 + 2 + 11 + 2,
994 .vrefresh = 60,
995 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
996};
997
998static const struct panel_desc innolux_at043tn24 = {
999 .modes = &innolux_at043tn24_mode,
1000 .num_modes = 1,
1001 .bpc = 8,
1002 .size = {
1003 .width = 95,
1004 .height = 54,
1005 },
1006 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1007};
1008
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02001009static const struct drm_display_mode innolux_at070tn92_mode = {
1010 .clock = 33333,
1011 .hdisplay = 800,
1012 .hsync_start = 800 + 210,
1013 .hsync_end = 800 + 210 + 20,
1014 .htotal = 800 + 210 + 20 + 46,
1015 .vdisplay = 480,
1016 .vsync_start = 480 + 22,
1017 .vsync_end = 480 + 22 + 10,
1018 .vtotal = 480 + 22 + 23 + 10,
1019 .vrefresh = 60,
1020};
1021
1022static const struct panel_desc innolux_at070tn92 = {
1023 .modes = &innolux_at070tn92_mode,
1024 .num_modes = 1,
1025 .size = {
1026 .width = 154,
1027 .height = 86,
1028 },
1029 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1030};
1031
Michael Olbrich1e29b842016-08-15 14:32:02 +02001032static const struct display_timing innolux_g101ice_l01_timing = {
1033 .pixelclock = { 60400000, 71100000, 74700000 },
1034 .hactive = { 1280, 1280, 1280 },
1035 .hfront_porch = { 41, 80, 100 },
1036 .hback_porch = { 40, 79, 99 },
1037 .hsync_len = { 1, 1, 1 },
1038 .vactive = { 800, 800, 800 },
1039 .vfront_porch = { 5, 11, 14 },
1040 .vback_porch = { 4, 11, 14 },
1041 .vsync_len = { 1, 1, 1 },
1042 .flags = DISPLAY_FLAGS_DE_HIGH,
1043};
1044
1045static const struct panel_desc innolux_g101ice_l01 = {
1046 .timings = &innolux_g101ice_l01_timing,
1047 .num_timings = 1,
1048 .bpc = 8,
1049 .size = {
1050 .width = 217,
1051 .height = 135,
1052 },
1053 .delay = {
1054 .enable = 200,
1055 .disable = 200,
1056 },
1057 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1058};
1059
Lucas Stach4ae13e42016-11-30 14:09:54 +01001060static const struct display_timing innolux_g121i1_l01_timing = {
1061 .pixelclock = { 67450000, 71000000, 74550000 },
1062 .hactive = { 1280, 1280, 1280 },
1063 .hfront_porch = { 40, 80, 160 },
1064 .hback_porch = { 39, 79, 159 },
1065 .hsync_len = { 1, 1, 1 },
1066 .vactive = { 800, 800, 800 },
1067 .vfront_porch = { 5, 11, 100 },
1068 .vback_porch = { 4, 11, 99 },
1069 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01001070};
1071
1072static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01001073 .timings = &innolux_g121i1_l01_timing,
1074 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01001075 .bpc = 6,
1076 .size = {
1077 .width = 261,
1078 .height = 163,
1079 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01001080 .delay = {
1081 .enable = 200,
1082 .disable = 20,
1083 },
1084 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Lucas Stachd731f662014-11-06 17:44:33 +01001085};
1086
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001087static const struct drm_display_mode innolux_g121x1_l03_mode = {
1088 .clock = 65000,
1089 .hdisplay = 1024,
1090 .hsync_start = 1024 + 0,
1091 .hsync_end = 1024 + 1,
1092 .htotal = 1024 + 0 + 1 + 320,
1093 .vdisplay = 768,
1094 .vsync_start = 768 + 38,
1095 .vsync_end = 768 + 38 + 1,
1096 .vtotal = 768 + 38 + 1 + 0,
1097 .vrefresh = 60,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05001098 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001099};
1100
1101static const struct panel_desc innolux_g121x1_l03 = {
1102 .modes = &innolux_g121x1_l03_mode,
1103 .num_modes = 1,
1104 .bpc = 6,
1105 .size = {
1106 .width = 246,
1107 .height = 185,
1108 },
1109 .delay = {
1110 .enable = 200,
1111 .unprepare = 200,
1112 .disable = 400,
1113 },
1114};
1115
Thierry Reding0a2288c2014-07-03 14:02:59 +02001116static const struct drm_display_mode innolux_n116bge_mode = {
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001117 .clock = 76420,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001118 .hdisplay = 1366,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001119 .hsync_start = 1366 + 136,
1120 .hsync_end = 1366 + 136 + 30,
1121 .htotal = 1366 + 136 + 30 + 60,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001122 .vdisplay = 768,
1123 .vsync_start = 768 + 8,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001124 .vsync_end = 768 + 8 + 12,
1125 .vtotal = 768 + 8 + 12 + 12,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001126 .vrefresh = 60,
1127 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1128};
1129
1130static const struct panel_desc innolux_n116bge = {
1131 .modes = &innolux_n116bge_mode,
1132 .num_modes = 1,
1133 .bpc = 6,
1134 .size = {
1135 .width = 256,
1136 .height = 144,
1137 },
1138};
1139
Alban Bedelea447392014-07-22 08:38:55 +02001140static const struct drm_display_mode innolux_n156bge_l21_mode = {
1141 .clock = 69300,
1142 .hdisplay = 1366,
1143 .hsync_start = 1366 + 16,
1144 .hsync_end = 1366 + 16 + 34,
1145 .htotal = 1366 + 16 + 34 + 50,
1146 .vdisplay = 768,
1147 .vsync_start = 768 + 2,
1148 .vsync_end = 768 + 2 + 6,
1149 .vtotal = 768 + 2 + 6 + 12,
1150 .vrefresh = 60,
1151};
1152
1153static const struct panel_desc innolux_n156bge_l21 = {
1154 .modes = &innolux_n156bge_l21_mode,
1155 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001156 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02001157 .size = {
1158 .width = 344,
1159 .height = 193,
1160 },
1161};
1162
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001163static const struct drm_display_mode innolux_zj070na_01p_mode = {
1164 .clock = 51501,
1165 .hdisplay = 1024,
1166 .hsync_start = 1024 + 128,
1167 .hsync_end = 1024 + 128 + 64,
1168 .htotal = 1024 + 128 + 64 + 128,
1169 .vdisplay = 600,
1170 .vsync_start = 600 + 16,
1171 .vsync_end = 600 + 16 + 4,
1172 .vtotal = 600 + 16 + 4 + 16,
1173 .vrefresh = 60,
1174};
1175
1176static const struct panel_desc innolux_zj070na_01p = {
1177 .modes = &innolux_zj070na_01p_mode,
1178 .num_modes = 1,
1179 .bpc = 6,
1180 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001181 .width = 154,
1182 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001183 },
1184};
1185
Lucas Stach8def22e2015-12-02 19:41:11 +01001186static const struct display_timing kyo_tcg121xglp_timing = {
1187 .pixelclock = { 52000000, 65000000, 71000000 },
1188 .hactive = { 1024, 1024, 1024 },
1189 .hfront_porch = { 2, 2, 2 },
1190 .hback_porch = { 2, 2, 2 },
1191 .hsync_len = { 86, 124, 244 },
1192 .vactive = { 768, 768, 768 },
1193 .vfront_porch = { 2, 2, 2 },
1194 .vback_porch = { 2, 2, 2 },
1195 .vsync_len = { 6, 34, 73 },
1196 .flags = DISPLAY_FLAGS_DE_HIGH,
1197};
1198
1199static const struct panel_desc kyo_tcg121xglp = {
1200 .timings = &kyo_tcg121xglp_timing,
1201 .num_timings = 1,
1202 .bpc = 8,
1203 .size = {
1204 .width = 246,
1205 .height = 184,
1206 },
1207 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1208};
1209
Heiko Schocherdd015002015-05-22 10:25:57 +02001210static const struct drm_display_mode lg_lb070wv8_mode = {
1211 .clock = 33246,
1212 .hdisplay = 800,
1213 .hsync_start = 800 + 88,
1214 .hsync_end = 800 + 88 + 80,
1215 .htotal = 800 + 88 + 80 + 88,
1216 .vdisplay = 480,
1217 .vsync_start = 480 + 10,
1218 .vsync_end = 480 + 10 + 25,
1219 .vtotal = 480 + 10 + 25 + 10,
1220 .vrefresh = 60,
1221};
1222
1223static const struct panel_desc lg_lb070wv8 = {
1224 .modes = &lg_lb070wv8_mode,
1225 .num_modes = 1,
1226 .bpc = 16,
1227 .size = {
1228 .width = 151,
1229 .height = 91,
1230 },
1231 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1232};
1233
Yakir Yangc5ece402016-06-28 12:51:15 +08001234static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1235 .clock = 200000,
1236 .hdisplay = 1536,
1237 .hsync_start = 1536 + 12,
1238 .hsync_end = 1536 + 12 + 16,
1239 .htotal = 1536 + 12 + 16 + 48,
1240 .vdisplay = 2048,
1241 .vsync_start = 2048 + 8,
1242 .vsync_end = 2048 + 8 + 4,
1243 .vtotal = 2048 + 8 + 4 + 8,
1244 .vrefresh = 60,
1245 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1246};
1247
1248static const struct panel_desc lg_lp079qx1_sp0v = {
1249 .modes = &lg_lp079qx1_sp0v_mode,
1250 .num_modes = 1,
1251 .size = {
1252 .width = 129,
1253 .height = 171,
1254 },
1255};
1256
Yakir Yang0355dde2016-06-12 10:56:02 +08001257static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1258 .clock = 205210,
1259 .hdisplay = 2048,
1260 .hsync_start = 2048 + 150,
1261 .hsync_end = 2048 + 150 + 5,
1262 .htotal = 2048 + 150 + 5 + 5,
1263 .vdisplay = 1536,
1264 .vsync_start = 1536 + 3,
1265 .vsync_end = 1536 + 3 + 1,
1266 .vtotal = 1536 + 3 + 1 + 9,
1267 .vrefresh = 60,
1268};
1269
1270static const struct panel_desc lg_lp097qx1_spa1 = {
1271 .modes = &lg_lp097qx1_spa1_mode,
1272 .num_modes = 1,
1273 .size = {
1274 .width = 208,
1275 .height = 147,
1276 },
1277};
1278
Jitao Shi690d8fa2016-02-22 19:01:44 +08001279static const struct drm_display_mode lg_lp120up1_mode = {
1280 .clock = 162300,
1281 .hdisplay = 1920,
1282 .hsync_start = 1920 + 40,
1283 .hsync_end = 1920 + 40 + 40,
1284 .htotal = 1920 + 40 + 40+ 80,
1285 .vdisplay = 1280,
1286 .vsync_start = 1280 + 4,
1287 .vsync_end = 1280 + 4 + 4,
1288 .vtotal = 1280 + 4 + 4 + 12,
1289 .vrefresh = 60,
1290};
1291
1292static const struct panel_desc lg_lp120up1 = {
1293 .modes = &lg_lp120up1_mode,
1294 .num_modes = 1,
1295 .bpc = 8,
1296 .size = {
1297 .width = 267,
1298 .height = 183,
1299 },
1300};
1301
Thierry Redingec7c5652013-11-15 15:59:32 +01001302static const struct drm_display_mode lg_lp129qe_mode = {
1303 .clock = 285250,
1304 .hdisplay = 2560,
1305 .hsync_start = 2560 + 48,
1306 .hsync_end = 2560 + 48 + 32,
1307 .htotal = 2560 + 48 + 32 + 80,
1308 .vdisplay = 1700,
1309 .vsync_start = 1700 + 3,
1310 .vsync_end = 1700 + 3 + 10,
1311 .vtotal = 1700 + 3 + 10 + 36,
1312 .vrefresh = 60,
1313};
1314
1315static const struct panel_desc lg_lp129qe = {
1316 .modes = &lg_lp129qe_mode,
1317 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001318 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01001319 .size = {
1320 .width = 272,
1321 .height = 181,
1322 },
1323};
1324
Lucas Stach01bacc132017-06-08 20:07:55 +02001325static const struct display_timing nec_nl12880bc20_05_timing = {
1326 .pixelclock = { 67000000, 71000000, 75000000 },
1327 .hactive = { 1280, 1280, 1280 },
1328 .hfront_porch = { 2, 30, 30 },
1329 .hback_porch = { 6, 100, 100 },
1330 .hsync_len = { 2, 30, 30 },
1331 .vactive = { 800, 800, 800 },
1332 .vfront_porch = { 5, 5, 5 },
1333 .vback_porch = { 11, 11, 11 },
1334 .vsync_len = { 7, 7, 7 },
1335};
1336
1337static const struct panel_desc nec_nl12880bc20_05 = {
1338 .timings = &nec_nl12880bc20_05_timing,
1339 .num_timings = 1,
1340 .bpc = 8,
1341 .size = {
1342 .width = 261,
1343 .height = 163,
1344 },
1345 .delay = {
1346 .enable = 50,
1347 .disable = 50,
1348 },
1349 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1350};
1351
jianwei wangc6e87f92015-07-29 16:30:02 +08001352static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
1353 .clock = 10870,
1354 .hdisplay = 480,
1355 .hsync_start = 480 + 2,
1356 .hsync_end = 480 + 2 + 41,
1357 .htotal = 480 + 2 + 41 + 2,
1358 .vdisplay = 272,
1359 .vsync_start = 272 + 2,
1360 .vsync_end = 272 + 2 + 4,
1361 .vtotal = 272 + 2 + 4 + 2,
1362 .vrefresh = 74,
Stefan Agner4bc390c2015-11-17 19:10:29 -08001363 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08001364};
1365
1366static const struct panel_desc nec_nl4827hc19_05b = {
1367 .modes = &nec_nl4827hc19_05b_mode,
1368 .num_modes = 1,
1369 .bpc = 8,
1370 .size = {
1371 .width = 95,
1372 .height = 54,
1373 },
Stefan Agner2c806612016-02-08 12:50:13 -08001374 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1375 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08001376};
1377
Maxime Riparde6c2f062016-09-06 16:46:17 +02001378static const struct drm_display_mode netron_dy_e231732_mode = {
1379 .clock = 66000,
1380 .hdisplay = 1024,
1381 .hsync_start = 1024 + 160,
1382 .hsync_end = 1024 + 160 + 70,
1383 .htotal = 1024 + 160 + 70 + 90,
1384 .vdisplay = 600,
1385 .vsync_start = 600 + 127,
1386 .vsync_end = 600 + 127 + 20,
1387 .vtotal = 600 + 127 + 20 + 3,
1388 .vrefresh = 60,
1389};
1390
1391static const struct panel_desc netron_dy_e231732 = {
1392 .modes = &netron_dy_e231732_mode,
1393 .num_modes = 1,
1394 .size = {
1395 .width = 154,
1396 .height = 87,
1397 },
1398 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1399};
1400
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02001401static const struct drm_display_mode nvd_9128_mode = {
1402 .clock = 29500,
1403 .hdisplay = 800,
1404 .hsync_start = 800 + 130,
1405 .hsync_end = 800 + 130 + 98,
1406 .htotal = 800 + 0 + 130 + 98,
1407 .vdisplay = 480,
1408 .vsync_start = 480 + 10,
1409 .vsync_end = 480 + 10 + 50,
1410 .vtotal = 480 + 0 + 10 + 50,
1411};
1412
1413static const struct panel_desc nvd_9128 = {
1414 .modes = &nvd_9128_mode,
1415 .num_modes = 1,
1416 .bpc = 8,
1417 .size = {
1418 .width = 156,
1419 .height = 88,
1420 },
1421 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1422};
1423
Gary Bissona99fb622015-06-10 18:44:23 +02001424static const struct display_timing okaya_rs800480t_7x0gp_timing = {
1425 .pixelclock = { 30000000, 30000000, 40000000 },
1426 .hactive = { 800, 800, 800 },
1427 .hfront_porch = { 40, 40, 40 },
1428 .hback_porch = { 40, 40, 40 },
1429 .hsync_len = { 1, 48, 48 },
1430 .vactive = { 480, 480, 480 },
1431 .vfront_porch = { 13, 13, 13 },
1432 .vback_porch = { 29, 29, 29 },
1433 .vsync_len = { 3, 3, 3 },
1434 .flags = DISPLAY_FLAGS_DE_HIGH,
1435};
1436
1437static const struct panel_desc okaya_rs800480t_7x0gp = {
1438 .timings = &okaya_rs800480t_7x0gp_timing,
1439 .num_timings = 1,
1440 .bpc = 6,
1441 .size = {
1442 .width = 154,
1443 .height = 87,
1444 },
1445 .delay = {
1446 .prepare = 41,
1447 .enable = 50,
1448 .unprepare = 41,
1449 .disable = 50,
1450 },
1451 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1452};
1453
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001454static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
1455 .clock = 9000,
1456 .hdisplay = 480,
1457 .hsync_start = 480 + 5,
1458 .hsync_end = 480 + 5 + 30,
1459 .htotal = 480 + 5 + 30 + 10,
1460 .vdisplay = 272,
1461 .vsync_start = 272 + 8,
1462 .vsync_end = 272 + 8 + 5,
1463 .vtotal = 272 + 8 + 5 + 3,
1464 .vrefresh = 60,
1465};
1466
1467static const struct panel_desc olimex_lcd_olinuxino_43ts = {
1468 .modes = &olimex_lcd_olinuxino_43ts_mode,
1469 .num_modes = 1,
1470 .size = {
1471 .width = 105,
1472 .height = 67,
1473 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10001474 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001475};
1476
Eric Anholte8b6f562016-03-24 17:23:48 -07001477/*
1478 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1479 * pixel clocks, but this is the timing that was being used in the Adafruit
1480 * installation instructions.
1481 */
1482static const struct drm_display_mode ontat_yx700wv03_mode = {
1483 .clock = 29500,
1484 .hdisplay = 800,
1485 .hsync_start = 824,
1486 .hsync_end = 896,
1487 .htotal = 992,
1488 .vdisplay = 480,
1489 .vsync_start = 483,
1490 .vsync_end = 493,
1491 .vtotal = 500,
1492 .vrefresh = 60,
1493 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1494};
1495
1496/*
1497 * Specification at:
1498 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1499 */
1500static const struct panel_desc ontat_yx700wv03 = {
1501 .modes = &ontat_yx700wv03_mode,
1502 .num_modes = 1,
1503 .bpc = 8,
1504 .size = {
1505 .width = 154,
1506 .height = 83,
1507 },
1508 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1509};
1510
Philipp Zabel725c9d42015-02-11 18:50:11 +01001511static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
1512 .clock = 25000,
1513 .hdisplay = 480,
1514 .hsync_start = 480 + 10,
1515 .hsync_end = 480 + 10 + 10,
1516 .htotal = 480 + 10 + 10 + 15,
1517 .vdisplay = 800,
1518 .vsync_start = 800 + 3,
1519 .vsync_end = 800 + 3 + 3,
1520 .vtotal = 800 + 3 + 3 + 3,
1521 .vrefresh = 60,
1522};
1523
1524static const struct panel_desc ortustech_com43h4m85ulc = {
1525 .modes = &ortustech_com43h4m85ulc_mode,
1526 .num_modes = 1,
1527 .bpc = 8,
1528 .size = {
1529 .width = 56,
1530 .height = 93,
1531 },
1532 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Marek Vasute0932f92016-08-26 18:26:00 +02001533 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
Philipp Zabel725c9d42015-02-11 18:50:11 +01001534};
1535
Josh Wud2a6f0f2015-10-08 17:42:41 +02001536static const struct drm_display_mode qd43003c0_40_mode = {
1537 .clock = 9000,
1538 .hdisplay = 480,
1539 .hsync_start = 480 + 8,
1540 .hsync_end = 480 + 8 + 4,
1541 .htotal = 480 + 8 + 4 + 39,
1542 .vdisplay = 272,
1543 .vsync_start = 272 + 4,
1544 .vsync_end = 272 + 4 + 10,
1545 .vtotal = 272 + 4 + 10 + 2,
1546 .vrefresh = 60,
1547};
1548
1549static const struct panel_desc qd43003c0_40 = {
1550 .modes = &qd43003c0_40_mode,
1551 .num_modes = 1,
1552 .bpc = 8,
1553 .size = {
1554 .width = 95,
1555 .height = 53,
1556 },
1557 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1558};
1559
Yakir Yang0330eaf2016-06-12 10:56:13 +08001560static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
1561 .clock = 271560,
1562 .hdisplay = 2560,
1563 .hsync_start = 2560 + 48,
1564 .hsync_end = 2560 + 48 + 32,
1565 .htotal = 2560 + 48 + 32 + 80,
1566 .vdisplay = 1600,
1567 .vsync_start = 1600 + 2,
1568 .vsync_end = 1600 + 2 + 5,
1569 .vtotal = 1600 + 2 + 5 + 57,
1570 .vrefresh = 60,
1571};
1572
1573static const struct panel_desc samsung_lsn122dl01_c01 = {
1574 .modes = &samsung_lsn122dl01_c01_mode,
1575 .num_modes = 1,
1576 .size = {
1577 .width = 263,
1578 .height = 164,
1579 },
1580};
1581
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001582static const struct drm_display_mode samsung_ltn101nt05_mode = {
1583 .clock = 54030,
1584 .hdisplay = 1024,
1585 .hsync_start = 1024 + 24,
1586 .hsync_end = 1024 + 24 + 136,
1587 .htotal = 1024 + 24 + 136 + 160,
1588 .vdisplay = 600,
1589 .vsync_start = 600 + 3,
1590 .vsync_end = 600 + 3 + 6,
1591 .vtotal = 600 + 3 + 6 + 61,
1592 .vrefresh = 60,
1593};
1594
1595static const struct panel_desc samsung_ltn101nt05 = {
1596 .modes = &samsung_ltn101nt05_mode,
1597 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001598 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001599 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001600 .width = 223,
1601 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001602 },
1603};
1604
Stéphane Marchesin0c934302015-03-18 10:52:18 +01001605static const struct drm_display_mode samsung_ltn140at29_301_mode = {
1606 .clock = 76300,
1607 .hdisplay = 1366,
1608 .hsync_start = 1366 + 64,
1609 .hsync_end = 1366 + 64 + 48,
1610 .htotal = 1366 + 64 + 48 + 128,
1611 .vdisplay = 768,
1612 .vsync_start = 768 + 2,
1613 .vsync_end = 768 + 2 + 5,
1614 .vtotal = 768 + 2 + 5 + 17,
1615 .vrefresh = 60,
1616};
1617
1618static const struct panel_desc samsung_ltn140at29_301 = {
1619 .modes = &samsung_ltn140at29_301_mode,
1620 .num_modes = 1,
1621 .bpc = 6,
1622 .size = {
1623 .width = 320,
1624 .height = 187,
1625 },
1626};
1627
Joshua Clayton592aa022016-07-06 15:59:16 -07001628static const struct display_timing sharp_lq101k1ly04_timing = {
1629 .pixelclock = { 60000000, 65000000, 80000000 },
1630 .hactive = { 1280, 1280, 1280 },
1631 .hfront_porch = { 20, 20, 20 },
1632 .hback_porch = { 20, 20, 20 },
1633 .hsync_len = { 10, 10, 10 },
1634 .vactive = { 800, 800, 800 },
1635 .vfront_porch = { 4, 4, 4 },
1636 .vback_porch = { 4, 4, 4 },
1637 .vsync_len = { 4, 4, 4 },
1638 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
1639};
1640
1641static const struct panel_desc sharp_lq101k1ly04 = {
1642 .timings = &sharp_lq101k1ly04_timing,
1643 .num_timings = 1,
1644 .bpc = 8,
1645 .size = {
1646 .width = 217,
1647 .height = 136,
1648 },
1649 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
1650};
1651
Yakir Yang739c7de2016-06-12 10:56:35 +08001652static const struct drm_display_mode sharp_lq123p1jx31_mode = {
1653 .clock = 252750,
1654 .hdisplay = 2400,
1655 .hsync_start = 2400 + 48,
1656 .hsync_end = 2400 + 48 + 32,
1657 .htotal = 2400 + 48 + 32 + 80,
1658 .vdisplay = 1600,
1659 .vsync_start = 1600 + 3,
1660 .vsync_end = 1600 + 3 + 10,
1661 .vtotal = 1600 + 3 + 10 + 33,
1662 .vrefresh = 60,
1663 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1664};
1665
1666static const struct panel_desc sharp_lq123p1jx31 = {
1667 .modes = &sharp_lq123p1jx31_mode,
1668 .num_modes = 1,
zain wang5466a632016-11-19 10:27:16 +08001669 .bpc = 8,
Yakir Yang739c7de2016-06-12 10:56:35 +08001670 .size = {
1671 .width = 259,
1672 .height = 173,
1673 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08001674 .delay = {
1675 .prepare = 110,
1676 .enable = 50,
1677 .unprepare = 550,
1678 },
Yakir Yang739c7de2016-06-12 10:56:35 +08001679};
1680
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02001681static const struct drm_display_mode sharp_lq150x1lg11_mode = {
1682 .clock = 71100,
1683 .hdisplay = 1024,
1684 .hsync_start = 1024 + 168,
1685 .hsync_end = 1024 + 168 + 64,
1686 .htotal = 1024 + 168 + 64 + 88,
1687 .vdisplay = 768,
1688 .vsync_start = 768 + 37,
1689 .vsync_end = 768 + 37 + 2,
1690 .vtotal = 768 + 37 + 2 + 8,
1691 .vrefresh = 60,
1692};
1693
1694static const struct panel_desc sharp_lq150x1lg11 = {
1695 .modes = &sharp_lq150x1lg11_mode,
1696 .num_modes = 1,
1697 .bpc = 6,
1698 .size = {
1699 .width = 304,
1700 .height = 228,
1701 },
1702 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
1703};
1704
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01001705static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
1706 .clock = 33300,
1707 .hdisplay = 800,
1708 .hsync_start = 800 + 1,
1709 .hsync_end = 800 + 1 + 64,
1710 .htotal = 800 + 1 + 64 + 64,
1711 .vdisplay = 480,
1712 .vsync_start = 480 + 1,
1713 .vsync_end = 480 + 1 + 23,
1714 .vtotal = 480 + 1 + 23 + 22,
1715 .vrefresh = 60,
1716};
1717
1718static const struct panel_desc shelly_sca07010_bfn_lnn = {
1719 .modes = &shelly_sca07010_bfn_lnn_mode,
1720 .num_modes = 1,
1721 .size = {
1722 .width = 152,
1723 .height = 91,
1724 },
1725 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1726};
1727
Douglas Anderson9bb34c42016-06-10 10:02:07 -07001728static const struct drm_display_mode starry_kr122ea0sra_mode = {
1729 .clock = 147000,
1730 .hdisplay = 1920,
1731 .hsync_start = 1920 + 16,
1732 .hsync_end = 1920 + 16 + 16,
1733 .htotal = 1920 + 16 + 16 + 32,
1734 .vdisplay = 1200,
1735 .vsync_start = 1200 + 15,
1736 .vsync_end = 1200 + 15 + 2,
1737 .vtotal = 1200 + 15 + 2 + 18,
1738 .vrefresh = 60,
1739 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1740};
1741
1742static const struct panel_desc starry_kr122ea0sra = {
1743 .modes = &starry_kr122ea0sra_mode,
1744 .num_modes = 1,
1745 .size = {
1746 .width = 263,
1747 .height = 164,
1748 },
Brian Norrisc46b9242016-08-26 14:32:14 -07001749 .delay = {
1750 .prepare = 10 + 200,
1751 .enable = 50,
1752 .unprepare = 10 + 500,
1753 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07001754};
1755
Gary Bissonadb973e2016-12-02 09:52:08 +01001756static const struct display_timing tianma_tm070jdhg30_timing = {
1757 .pixelclock = { 62600000, 68200000, 78100000 },
1758 .hactive = { 1280, 1280, 1280 },
1759 .hfront_porch = { 15, 64, 159 },
1760 .hback_porch = { 5, 5, 5 },
1761 .hsync_len = { 1, 1, 256 },
1762 .vactive = { 800, 800, 800 },
1763 .vfront_porch = { 3, 40, 99 },
1764 .vback_porch = { 2, 2, 2 },
1765 .vsync_len = { 1, 1, 128 },
1766 .flags = DISPLAY_FLAGS_DE_HIGH,
1767};
1768
1769static const struct panel_desc tianma_tm070jdhg30 = {
1770 .timings = &tianma_tm070jdhg30_timing,
1771 .num_timings = 1,
1772 .bpc = 8,
1773 .size = {
1774 .width = 151,
1775 .height = 95,
1776 },
1777 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1778};
1779
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05301780static const struct drm_display_mode tpk_f07a_0102_mode = {
1781 .clock = 33260,
1782 .hdisplay = 800,
1783 .hsync_start = 800 + 40,
1784 .hsync_end = 800 + 40 + 128,
1785 .htotal = 800 + 40 + 128 + 88,
1786 .vdisplay = 480,
1787 .vsync_start = 480 + 10,
1788 .vsync_end = 480 + 10 + 2,
1789 .vtotal = 480 + 10 + 2 + 33,
1790 .vrefresh = 60,
1791};
1792
1793static const struct panel_desc tpk_f07a_0102 = {
1794 .modes = &tpk_f07a_0102_mode,
1795 .num_modes = 1,
1796 .size = {
1797 .width = 152,
1798 .height = 91,
1799 },
1800 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
1801};
1802
1803static const struct drm_display_mode tpk_f10a_0102_mode = {
1804 .clock = 45000,
1805 .hdisplay = 1024,
1806 .hsync_start = 1024 + 176,
1807 .hsync_end = 1024 + 176 + 5,
1808 .htotal = 1024 + 176 + 5 + 88,
1809 .vdisplay = 600,
1810 .vsync_start = 600 + 20,
1811 .vsync_end = 600 + 20 + 5,
1812 .vtotal = 600 + 20 + 5 + 25,
1813 .vrefresh = 60,
1814};
1815
1816static const struct panel_desc tpk_f10a_0102 = {
1817 .modes = &tpk_f10a_0102_mode,
1818 .num_modes = 1,
1819 .size = {
1820 .width = 223,
1821 .height = 125,
1822 },
1823};
1824
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01001825static const struct display_timing urt_umsh_8596md_timing = {
1826 .pixelclock = { 33260000, 33260000, 33260000 },
1827 .hactive = { 800, 800, 800 },
1828 .hfront_porch = { 41, 41, 41 },
1829 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
1830 .hsync_len = { 71, 128, 128 },
1831 .vactive = { 480, 480, 480 },
1832 .vfront_porch = { 10, 10, 10 },
1833 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
1834 .vsync_len = { 2, 2, 2 },
1835 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
1836 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
1837};
1838
1839static const struct panel_desc urt_umsh_8596md_lvds = {
1840 .timings = &urt_umsh_8596md_timing,
1841 .num_timings = 1,
1842 .bpc = 6,
1843 .size = {
1844 .width = 152,
1845 .height = 91,
1846 },
1847 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1848};
1849
1850static const struct panel_desc urt_umsh_8596md_parallel = {
1851 .timings = &urt_umsh_8596md_timing,
1852 .num_timings = 1,
1853 .bpc = 6,
1854 .size = {
1855 .width = 152,
1856 .height = 91,
1857 },
1858 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1859};
1860
Richard Genoude4bac402017-03-27 12:33:23 +02001861static const struct drm_display_mode winstar_wf35ltiacd_mode = {
1862 .clock = 6410,
1863 .hdisplay = 320,
1864 .hsync_start = 320 + 20,
1865 .hsync_end = 320 + 20 + 30,
1866 .htotal = 320 + 20 + 30 + 38,
1867 .vdisplay = 240,
1868 .vsync_start = 240 + 4,
1869 .vsync_end = 240 + 4 + 3,
1870 .vtotal = 240 + 4 + 3 + 15,
1871 .vrefresh = 60,
1872 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1873};
1874
1875static const struct panel_desc winstar_wf35ltiacd = {
1876 .modes = &winstar_wf35ltiacd_mode,
1877 .num_modes = 1,
1878 .bpc = 8,
1879 .size = {
1880 .width = 70,
1881 .height = 53,
1882 },
1883 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1884};
1885
Thierry Reding280921d2013-08-30 15:10:14 +02001886static const struct of_device_id platform_of_match[] = {
1887 {
Yannick Fertre966fea72017-03-28 11:44:49 +02001888 .compatible = "ampire,am-480272h3tmqw-t01h",
1889 .data = &ampire_am_480272h3tmqw_t01h,
1890 }, {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01001891 .compatible = "ampire,am800480r3tmqwa1h",
1892 .data = &ampire_am800480r3tmqwa1h,
1893 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001894 .compatible = "auo,b101aw03",
1895 .data = &auo_b101aw03,
1896 }, {
Huang Lina531bc32015-02-28 10:18:58 +08001897 .compatible = "auo,b101ean01",
1898 .data = &auo_b101ean01,
1899 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04001900 .compatible = "auo,b101xtn01",
1901 .data = &auo_b101xtn01,
1902 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05301903 .compatible = "auo,b116xw03",
1904 .data = &auo_b116xw03,
1905 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05301906 .compatible = "auo,b133htn01",
1907 .data = &auo_b133htn01,
1908 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07001909 .compatible = "auo,b133xtn01",
1910 .data = &auo_b133xtn01,
1911 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01001912 .compatible = "auo,g133han01",
1913 .data = &auo_g133han01,
1914 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01001915 .compatible = "auo,g185han01",
1916 .data = &auo_g185han01,
1917 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07001918 .compatible = "auo,t215hvn01",
1919 .data = &auo_t215hvn01,
1920 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01001921 .compatible = "avic,tm070ddh03",
1922 .data = &avic_tm070ddh03,
1923 }, {
Caesar Wangcac1a412016-12-14 11:19:56 +08001924 .compatible = "boe,nv101wxmn51",
1925 .data = &boe_nv101wxmn51,
1926 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08001927 .compatible = "chunghwa,claa070wp03xg",
1928 .data = &chunghwa_claa070wp03xg,
1929 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07001930 .compatible = "chunghwa,claa101wa01a",
1931 .data = &chunghwa_claa101wa01a
1932 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001933 .compatible = "chunghwa,claa101wb01",
1934 .data = &chunghwa_claa101wb01
1935 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02001936 .compatible = "edt,et057090dhu",
1937 .data = &edt_et057090dhu,
1938 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02001939 .compatible = "edt,et070080dh6",
1940 .data = &edt_etm0700g0dh6,
1941 }, {
1942 .compatible = "edt,etm0700g0dh6",
1943 .data = &edt_etm0700g0dh6,
1944 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02001945 .compatible = "foxlink,fl500wvr00-a0t",
1946 .data = &foxlink_fl500wvr00_a0t,
1947 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001948 .compatible = "giantplus,gpg482739qs5",
1949 .data = &giantplus_gpg482739qs5
1950 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02001951 .compatible = "hannstar,hsd070pww1",
1952 .data = &hannstar_hsd070pww1,
1953 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001954 .compatible = "hannstar,hsd100pxn1",
1955 .data = &hannstar_hsd100pxn1,
1956 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001957 .compatible = "hit,tx23d38vm0caa",
1958 .data = &hitachi_tx23d38vm0caa
1959 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001960 .compatible = "innolux,at043tn24",
1961 .data = &innolux_at043tn24,
1962 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02001963 .compatible = "innolux,at070tn92",
1964 .data = &innolux_at070tn92,
1965 }, {
Michael Olbrich1e29b842016-08-15 14:32:02 +02001966 .compatible ="innolux,g101ice-l01",
1967 .data = &innolux_g101ice_l01
1968 }, {
Lucas Stachd731f662014-11-06 17:44:33 +01001969 .compatible ="innolux,g121i1-l01",
1970 .data = &innolux_g121i1_l01
1971 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001972 .compatible = "innolux,g121x1-l03",
1973 .data = &innolux_g121x1_l03,
1974 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02001975 .compatible = "innolux,n116bge",
1976 .data = &innolux_n116bge,
1977 }, {
Alban Bedelea447392014-07-22 08:38:55 +02001978 .compatible = "innolux,n156bge-l21",
1979 .data = &innolux_n156bge_l21,
1980 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001981 .compatible = "innolux,zj070na-01p",
1982 .data = &innolux_zj070na_01p,
1983 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01001984 .compatible = "kyo,tcg121xglp",
1985 .data = &kyo_tcg121xglp,
1986 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02001987 .compatible = "lg,lb070wv8",
1988 .data = &lg_lb070wv8,
1989 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08001990 .compatible = "lg,lp079qx1-sp0v",
1991 .data = &lg_lp079qx1_sp0v,
1992 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08001993 .compatible = "lg,lp097qx1-spa1",
1994 .data = &lg_lp097qx1_spa1,
1995 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08001996 .compatible = "lg,lp120up1",
1997 .data = &lg_lp120up1,
1998 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01001999 .compatible = "lg,lp129qe",
2000 .data = &lg_lp129qe,
2001 }, {
Lucas Stach01bacc132017-06-08 20:07:55 +02002002 .compatible = "nec,nl12880bc20-05",
2003 .data = &nec_nl12880bc20_05,
2004 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08002005 .compatible = "nec,nl4827hc19-05b",
2006 .data = &nec_nl4827hc19_05b,
2007 }, {
Maxime Riparde6c2f062016-09-06 16:46:17 +02002008 .compatible = "netron-dy,e231732",
2009 .data = &netron_dy_e231732,
2010 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02002011 .compatible = "nvd,9128",
2012 .data = &nvd_9128,
2013 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02002014 .compatible = "okaya,rs800480t-7x0gp",
2015 .data = &okaya_rs800480t_7x0gp,
2016 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002017 .compatible = "olimex,lcd-olinuxino-43-ts",
2018 .data = &olimex_lcd_olinuxino_43ts,
2019 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07002020 .compatible = "ontat,yx700wv03",
2021 .data = &ontat_yx700wv03,
2022 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01002023 .compatible = "ortustech,com43h4m85ulc",
2024 .data = &ortustech_com43h4m85ulc,
2025 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02002026 .compatible = "qiaodian,qd43003c0-40",
2027 .data = &qd43003c0_40,
2028 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08002029 .compatible = "samsung,lsn122dl01-c01",
2030 .data = &samsung_lsn122dl01_c01,
2031 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01002032 .compatible = "samsung,ltn101nt05",
2033 .data = &samsung_ltn101nt05,
2034 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01002035 .compatible = "samsung,ltn140at29-301",
2036 .data = &samsung_ltn140at29_301,
2037 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07002038 .compatible = "sharp,lq101k1ly04",
2039 .data = &sharp_lq101k1ly04,
2040 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08002041 .compatible = "sharp,lq123p1jx31",
2042 .data = &sharp_lq123p1jx31,
2043 }, {
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02002044 .compatible = "sharp,lq150x1lg11",
2045 .data = &sharp_lq150x1lg11,
2046 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01002047 .compatible = "shelly,sca07010-bfn-lnn",
2048 .data = &shelly_sca07010_bfn_lnn,
2049 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07002050 .compatible = "starry,kr122ea0sra",
2051 .data = &starry_kr122ea0sra,
2052 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01002053 .compatible = "tianma,tm070jdhg30",
2054 .data = &tianma_tm070jdhg30,
2055 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05302056 .compatible = "tpk,f07a-0102",
2057 .data = &tpk_f07a_0102,
2058 }, {
2059 .compatible = "tpk,f10a-0102",
2060 .data = &tpk_f10a_0102,
2061 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01002062 .compatible = "urt,umsh-8596md-t",
2063 .data = &urt_umsh_8596md_parallel,
2064 }, {
2065 .compatible = "urt,umsh-8596md-1t",
2066 .data = &urt_umsh_8596md_parallel,
2067 }, {
2068 .compatible = "urt,umsh-8596md-7t",
2069 .data = &urt_umsh_8596md_parallel,
2070 }, {
2071 .compatible = "urt,umsh-8596md-11t",
2072 .data = &urt_umsh_8596md_lvds,
2073 }, {
2074 .compatible = "urt,umsh-8596md-19t",
2075 .data = &urt_umsh_8596md_lvds,
2076 }, {
2077 .compatible = "urt,umsh-8596md-20t",
2078 .data = &urt_umsh_8596md_parallel,
2079 }, {
Richard Genoude4bac402017-03-27 12:33:23 +02002080 .compatible = "winstar,wf35ltiacd",
2081 .data = &winstar_wf35ltiacd,
2082 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02002083 /* sentinel */
2084 }
2085};
2086MODULE_DEVICE_TABLE(of, platform_of_match);
2087
2088static int panel_simple_platform_probe(struct platform_device *pdev)
2089{
2090 const struct of_device_id *id;
2091
2092 id = of_match_node(platform_of_match, pdev->dev.of_node);
2093 if (!id)
2094 return -ENODEV;
2095
2096 return panel_simple_probe(&pdev->dev, id->data);
2097}
2098
2099static int panel_simple_platform_remove(struct platform_device *pdev)
2100{
2101 return panel_simple_remove(&pdev->dev);
2102}
2103
Thierry Redingd02fd932014-04-29 17:21:21 +02002104static void panel_simple_platform_shutdown(struct platform_device *pdev)
2105{
2106 panel_simple_shutdown(&pdev->dev);
2107}
2108
Thierry Reding280921d2013-08-30 15:10:14 +02002109static struct platform_driver panel_simple_platform_driver = {
2110 .driver = {
2111 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02002112 .of_match_table = platform_of_match,
2113 },
2114 .probe = panel_simple_platform_probe,
2115 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002116 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002117};
2118
Thierry Reding210fcd92013-11-22 19:27:11 +01002119struct panel_desc_dsi {
2120 struct panel_desc desc;
2121
Thierry Reding462658b2014-03-14 11:24:57 +01002122 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01002123 enum mipi_dsi_pixel_format format;
2124 unsigned int lanes;
2125};
2126
Thierry Redingd718d792015-04-08 16:52:33 +02002127static const struct drm_display_mode auo_b080uan01_mode = {
2128 .clock = 154500,
2129 .hdisplay = 1200,
2130 .hsync_start = 1200 + 62,
2131 .hsync_end = 1200 + 62 + 4,
2132 .htotal = 1200 + 62 + 4 + 62,
2133 .vdisplay = 1920,
2134 .vsync_start = 1920 + 9,
2135 .vsync_end = 1920 + 9 + 2,
2136 .vtotal = 1920 + 9 + 2 + 8,
2137 .vrefresh = 60,
2138};
2139
2140static const struct panel_desc_dsi auo_b080uan01 = {
2141 .desc = {
2142 .modes = &auo_b080uan01_mode,
2143 .num_modes = 1,
2144 .bpc = 8,
2145 .size = {
2146 .width = 108,
2147 .height = 272,
2148 },
2149 },
2150 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2151 .format = MIPI_DSI_FMT_RGB888,
2152 .lanes = 4,
2153};
2154
Chris Zhongc8521962015-11-20 16:15:37 +08002155static const struct drm_display_mode boe_tv080wum_nl0_mode = {
2156 .clock = 160000,
2157 .hdisplay = 1200,
2158 .hsync_start = 1200 + 120,
2159 .hsync_end = 1200 + 120 + 20,
2160 .htotal = 1200 + 120 + 20 + 21,
2161 .vdisplay = 1920,
2162 .vsync_start = 1920 + 21,
2163 .vsync_end = 1920 + 21 + 3,
2164 .vtotal = 1920 + 21 + 3 + 18,
2165 .vrefresh = 60,
2166 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2167};
2168
2169static const struct panel_desc_dsi boe_tv080wum_nl0 = {
2170 .desc = {
2171 .modes = &boe_tv080wum_nl0_mode,
2172 .num_modes = 1,
2173 .size = {
2174 .width = 107,
2175 .height = 172,
2176 },
2177 },
2178 .flags = MIPI_DSI_MODE_VIDEO |
2179 MIPI_DSI_MODE_VIDEO_BURST |
2180 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
2181 .format = MIPI_DSI_FMT_RGB888,
2182 .lanes = 4,
2183};
2184
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002185static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
2186 .clock = 71000,
2187 .hdisplay = 800,
2188 .hsync_start = 800 + 32,
2189 .hsync_end = 800 + 32 + 1,
2190 .htotal = 800 + 32 + 1 + 57,
2191 .vdisplay = 1280,
2192 .vsync_start = 1280 + 28,
2193 .vsync_end = 1280 + 28 + 1,
2194 .vtotal = 1280 + 28 + 1 + 14,
2195 .vrefresh = 60,
2196};
2197
2198static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
2199 .desc = {
2200 .modes = &lg_ld070wx3_sl01_mode,
2201 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002202 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002203 .size = {
2204 .width = 94,
2205 .height = 151,
2206 },
2207 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09002208 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002209 .format = MIPI_DSI_FMT_RGB888,
2210 .lanes = 4,
2211};
2212
Alexandre Courbot499ce852014-01-21 18:57:09 +09002213static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
2214 .clock = 67000,
2215 .hdisplay = 720,
2216 .hsync_start = 720 + 12,
2217 .hsync_end = 720 + 12 + 4,
2218 .htotal = 720 + 12 + 4 + 112,
2219 .vdisplay = 1280,
2220 .vsync_start = 1280 + 8,
2221 .vsync_end = 1280 + 8 + 4,
2222 .vtotal = 1280 + 8 + 4 + 12,
2223 .vrefresh = 60,
2224};
2225
2226static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
2227 .desc = {
2228 .modes = &lg_lh500wx1_sd03_mode,
2229 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002230 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09002231 .size = {
2232 .width = 62,
2233 .height = 110,
2234 },
2235 },
2236 .flags = MIPI_DSI_MODE_VIDEO,
2237 .format = MIPI_DSI_FMT_RGB888,
2238 .lanes = 4,
2239};
2240
Thierry Reding280921d2013-08-30 15:10:14 +02002241static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
2242 .clock = 157200,
2243 .hdisplay = 1920,
2244 .hsync_start = 1920 + 154,
2245 .hsync_end = 1920 + 154 + 16,
2246 .htotal = 1920 + 154 + 16 + 32,
2247 .vdisplay = 1200,
2248 .vsync_start = 1200 + 17,
2249 .vsync_end = 1200 + 17 + 2,
2250 .vtotal = 1200 + 17 + 2 + 16,
2251 .vrefresh = 60,
2252};
2253
Thierry Reding210fcd92013-11-22 19:27:11 +01002254static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
2255 .desc = {
2256 .modes = &panasonic_vvx10f004b00_mode,
2257 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002258 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01002259 .size = {
2260 .width = 217,
2261 .height = 136,
2262 },
Thierry Reding280921d2013-08-30 15:10:14 +02002263 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09002264 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
2265 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01002266 .format = MIPI_DSI_FMT_RGB888,
2267 .lanes = 4,
2268};
2269
2270static const struct of_device_id dsi_of_match[] = {
2271 {
Thierry Redingd718d792015-04-08 16:52:33 +02002272 .compatible = "auo,b080uan01",
2273 .data = &auo_b080uan01
2274 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08002275 .compatible = "boe,tv080wum-nl0",
2276 .data = &boe_tv080wum_nl0
2277 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002278 .compatible = "lg,ld070wx3-sl01",
2279 .data = &lg_ld070wx3_sl01
2280 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09002281 .compatible = "lg,lh500wx1-sd03",
2282 .data = &lg_lh500wx1_sd03
2283 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01002284 .compatible = "panasonic,vvx10f004b00",
2285 .data = &panasonic_vvx10f004b00
2286 }, {
2287 /* sentinel */
2288 }
2289};
2290MODULE_DEVICE_TABLE(of, dsi_of_match);
2291
2292static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
2293{
2294 const struct panel_desc_dsi *desc;
2295 const struct of_device_id *id;
2296 int err;
2297
2298 id = of_match_node(dsi_of_match, dsi->dev.of_node);
2299 if (!id)
2300 return -ENODEV;
2301
2302 desc = id->data;
2303
2304 err = panel_simple_probe(&dsi->dev, &desc->desc);
2305 if (err < 0)
2306 return err;
2307
Thierry Reding462658b2014-03-14 11:24:57 +01002308 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01002309 dsi->format = desc->format;
2310 dsi->lanes = desc->lanes;
2311
2312 return mipi_dsi_attach(dsi);
2313}
2314
2315static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
2316{
2317 int err;
2318
2319 err = mipi_dsi_detach(dsi);
2320 if (err < 0)
2321 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
2322
2323 return panel_simple_remove(&dsi->dev);
2324}
2325
Thierry Redingd02fd932014-04-29 17:21:21 +02002326static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
2327{
2328 panel_simple_shutdown(&dsi->dev);
2329}
2330
Thierry Reding210fcd92013-11-22 19:27:11 +01002331static struct mipi_dsi_driver panel_simple_dsi_driver = {
2332 .driver = {
2333 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01002334 .of_match_table = dsi_of_match,
2335 },
2336 .probe = panel_simple_dsi_probe,
2337 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002338 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002339};
2340
2341static int __init panel_simple_init(void)
2342{
Thierry Reding210fcd92013-11-22 19:27:11 +01002343 int err;
2344
2345 err = platform_driver_register(&panel_simple_platform_driver);
2346 if (err < 0)
2347 return err;
2348
2349 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
2350 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
2351 if (err < 0)
2352 return err;
2353 }
2354
2355 return 0;
Thierry Reding280921d2013-08-30 15:10:14 +02002356}
2357module_init(panel_simple_init);
2358
2359static void __exit panel_simple_exit(void)
2360{
Thierry Reding210fcd92013-11-22 19:27:11 +01002361 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
2362 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
2363
Thierry Reding280921d2013-08-30 15:10:14 +02002364 platform_driver_unregister(&panel_simple_platform_driver);
2365}
2366module_exit(panel_simple_exit);
2367
2368MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
2369MODULE_DESCRIPTION("DRM Driver for Simple Panels");
2370MODULE_LICENSE("GPL and additional rights");