blob: 140a0bc013959ceeccdfcc399741289151de6ebc [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
123 if (panel->desc->num_modes == 1)
124 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
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100389static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
390 .clock = 33333,
391 .hdisplay = 800,
392 .hsync_start = 800 + 0,
393 .hsync_end = 800 + 0 + 255,
394 .htotal = 800 + 0 + 255 + 0,
395 .vdisplay = 480,
396 .vsync_start = 480 + 2,
397 .vsync_end = 480 + 2 + 45,
398 .vtotal = 480 + 2 + 45 + 0,
399 .vrefresh = 60,
400 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
401};
402
403static const struct panel_desc ampire_am800480r3tmqwa1h = {
404 .modes = &ampire_am800480r3tmqwa1h_mode,
405 .num_modes = 1,
406 .bpc = 6,
407 .size = {
408 .width = 152,
409 .height = 91,
410 },
411 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
412};
413
Thierry Reding280921d2013-08-30 15:10:14 +0200414static const struct drm_display_mode auo_b101aw03_mode = {
415 .clock = 51450,
416 .hdisplay = 1024,
417 .hsync_start = 1024 + 156,
418 .hsync_end = 1024 + 156 + 8,
419 .htotal = 1024 + 156 + 8 + 156,
420 .vdisplay = 600,
421 .vsync_start = 600 + 16,
422 .vsync_end = 600 + 16 + 6,
423 .vtotal = 600 + 16 + 6 + 16,
424 .vrefresh = 60,
425};
426
427static const struct panel_desc auo_b101aw03 = {
428 .modes = &auo_b101aw03_mode,
429 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700430 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200431 .size = {
432 .width = 223,
433 .height = 125,
434 },
435};
436
Huang Lina531bc32015-02-28 10:18:58 +0800437static const struct drm_display_mode auo_b101ean01_mode = {
438 .clock = 72500,
439 .hdisplay = 1280,
440 .hsync_start = 1280 + 119,
441 .hsync_end = 1280 + 119 + 32,
442 .htotal = 1280 + 119 + 32 + 21,
443 .vdisplay = 800,
444 .vsync_start = 800 + 4,
445 .vsync_end = 800 + 4 + 20,
446 .vtotal = 800 + 4 + 20 + 8,
447 .vrefresh = 60,
448};
449
450static const struct panel_desc auo_b101ean01 = {
451 .modes = &auo_b101ean01_mode,
452 .num_modes = 1,
453 .bpc = 6,
454 .size = {
455 .width = 217,
456 .height = 136,
457 },
458};
459
Rob Clarkdac746e2014-08-01 17:01:06 -0400460static const struct drm_display_mode auo_b101xtn01_mode = {
461 .clock = 72000,
462 .hdisplay = 1366,
463 .hsync_start = 1366 + 20,
464 .hsync_end = 1366 + 20 + 70,
465 .htotal = 1366 + 20 + 70,
466 .vdisplay = 768,
467 .vsync_start = 768 + 14,
468 .vsync_end = 768 + 14 + 42,
469 .vtotal = 768 + 14 + 42,
470 .vrefresh = 60,
471 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
472};
473
474static const struct panel_desc auo_b101xtn01 = {
475 .modes = &auo_b101xtn01_mode,
476 .num_modes = 1,
477 .bpc = 6,
478 .size = {
479 .width = 223,
480 .height = 125,
481 },
482};
483
Ajay Kumare35e3052014-09-01 15:40:02 +0530484static const struct drm_display_mode auo_b116xw03_mode = {
485 .clock = 70589,
486 .hdisplay = 1366,
487 .hsync_start = 1366 + 40,
488 .hsync_end = 1366 + 40 + 40,
489 .htotal = 1366 + 40 + 40 + 32,
490 .vdisplay = 768,
491 .vsync_start = 768 + 10,
492 .vsync_end = 768 + 10 + 12,
493 .vtotal = 768 + 10 + 12 + 6,
494 .vrefresh = 60,
495};
496
497static const struct panel_desc auo_b116xw03 = {
498 .modes = &auo_b116xw03_mode,
499 .num_modes = 1,
500 .bpc = 6,
501 .size = {
502 .width = 256,
503 .height = 144,
504 },
505};
506
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700507static const struct drm_display_mode auo_b133xtn01_mode = {
508 .clock = 69500,
509 .hdisplay = 1366,
510 .hsync_start = 1366 + 48,
511 .hsync_end = 1366 + 48 + 32,
512 .htotal = 1366 + 48 + 32 + 20,
513 .vdisplay = 768,
514 .vsync_start = 768 + 3,
515 .vsync_end = 768 + 3 + 6,
516 .vtotal = 768 + 3 + 6 + 13,
517 .vrefresh = 60,
518};
519
520static const struct panel_desc auo_b133xtn01 = {
521 .modes = &auo_b133xtn01_mode,
522 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700523 .bpc = 6,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700524 .size = {
525 .width = 293,
526 .height = 165,
527 },
528};
529
Ajay Kumar3e51d602014-07-31 23:12:12 +0530530static const struct drm_display_mode auo_b133htn01_mode = {
531 .clock = 150660,
532 .hdisplay = 1920,
533 .hsync_start = 1920 + 172,
534 .hsync_end = 1920 + 172 + 80,
535 .htotal = 1920 + 172 + 80 + 60,
536 .vdisplay = 1080,
537 .vsync_start = 1080 + 25,
538 .vsync_end = 1080 + 25 + 10,
539 .vtotal = 1080 + 25 + 10 + 10,
540 .vrefresh = 60,
541};
542
543static const struct panel_desc auo_b133htn01 = {
544 .modes = &auo_b133htn01_mode,
545 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +0100546 .bpc = 6,
Ajay Kumar3e51d602014-07-31 23:12:12 +0530547 .size = {
548 .width = 293,
549 .height = 165,
550 },
551 .delay = {
552 .prepare = 105,
553 .enable = 20,
554 .unprepare = 50,
555 },
556};
557
Haixia Shi7ee933a2016-10-11 14:59:16 -0700558static const struct drm_display_mode auo_t215hvn01_mode = {
559 .clock = 148800,
560 .hdisplay = 1920,
561 .hsync_start = 1920 + 88,
562 .hsync_end = 1920 + 88 + 44,
563 .htotal = 1920 + 88 + 44 + 148,
564 .vdisplay = 1080,
565 .vsync_start = 1080 + 4,
566 .vsync_end = 1080 + 4 + 5,
567 .vtotal = 1080 + 4 + 5 + 36,
568 .vrefresh = 60,
569};
570
571static const struct panel_desc auo_t215hvn01 = {
572 .modes = &auo_t215hvn01_mode,
573 .num_modes = 1,
574 .bpc = 8,
575 .size = {
576 .width = 430,
577 .height = 270,
578 },
579 .delay = {
580 .disable = 5,
581 .unprepare = 1000,
582 }
583};
584
Philipp Zabeld47df632014-12-18 16:43:43 +0100585static const struct drm_display_mode avic_tm070ddh03_mode = {
586 .clock = 51200,
587 .hdisplay = 1024,
588 .hsync_start = 1024 + 160,
589 .hsync_end = 1024 + 160 + 4,
590 .htotal = 1024 + 160 + 4 + 156,
591 .vdisplay = 600,
592 .vsync_start = 600 + 17,
593 .vsync_end = 600 + 17 + 1,
594 .vtotal = 600 + 17 + 1 + 17,
595 .vrefresh = 60,
596};
597
598static const struct panel_desc avic_tm070ddh03 = {
599 .modes = &avic_tm070ddh03_mode,
600 .num_modes = 1,
601 .bpc = 8,
602 .size = {
603 .width = 154,
604 .height = 90,
605 },
606 .delay = {
607 .prepare = 20,
608 .enable = 200,
609 .disable = 200,
610 },
611};
612
Stephen Warren4c930752014-01-07 16:46:26 -0700613static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
614 .clock = 72070,
615 .hdisplay = 1366,
616 .hsync_start = 1366 + 58,
617 .hsync_end = 1366 + 58 + 58,
618 .htotal = 1366 + 58 + 58 + 58,
619 .vdisplay = 768,
620 .vsync_start = 768 + 4,
621 .vsync_end = 768 + 4 + 4,
622 .vtotal = 768 + 4 + 4 + 4,
623 .vrefresh = 60,
624};
625
626static const struct panel_desc chunghwa_claa101wa01a = {
627 .modes = &chunghwa_claa101wa01a_mode,
628 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700629 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -0700630 .size = {
631 .width = 220,
632 .height = 120,
633 },
634};
635
Thierry Reding280921d2013-08-30 15:10:14 +0200636static const struct drm_display_mode chunghwa_claa101wb01_mode = {
637 .clock = 69300,
638 .hdisplay = 1366,
639 .hsync_start = 1366 + 48,
640 .hsync_end = 1366 + 48 + 32,
641 .htotal = 1366 + 48 + 32 + 20,
642 .vdisplay = 768,
643 .vsync_start = 768 + 16,
644 .vsync_end = 768 + 16 + 8,
645 .vtotal = 768 + 16 + 8 + 16,
646 .vrefresh = 60,
647};
648
649static const struct panel_desc chunghwa_claa101wb01 = {
650 .modes = &chunghwa_claa101wb01_mode,
651 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700652 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200653 .size = {
654 .width = 223,
655 .height = 125,
656 },
657};
658
Stefan Agner26ab0062014-05-15 11:38:45 +0200659static const struct drm_display_mode edt_et057090dhu_mode = {
660 .clock = 25175,
661 .hdisplay = 640,
662 .hsync_start = 640 + 16,
663 .hsync_end = 640 + 16 + 30,
664 .htotal = 640 + 16 + 30 + 114,
665 .vdisplay = 480,
666 .vsync_start = 480 + 10,
667 .vsync_end = 480 + 10 + 3,
668 .vtotal = 480 + 10 + 3 + 32,
669 .vrefresh = 60,
670 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
671};
672
673static const struct panel_desc edt_et057090dhu = {
674 .modes = &edt_et057090dhu_mode,
675 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700676 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +0200677 .size = {
678 .width = 115,
679 .height = 86,
680 },
681};
682
Philipp Zabelfff5de42014-05-15 12:25:47 +0200683static const struct drm_display_mode edt_etm0700g0dh6_mode = {
684 .clock = 33260,
685 .hdisplay = 800,
686 .hsync_start = 800 + 40,
687 .hsync_end = 800 + 40 + 128,
688 .htotal = 800 + 40 + 128 + 88,
689 .vdisplay = 480,
690 .vsync_start = 480 + 10,
691 .vsync_end = 480 + 10 + 2,
692 .vtotal = 480 + 10 + 2 + 33,
693 .vrefresh = 60,
694 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
695};
696
697static const struct panel_desc edt_etm0700g0dh6 = {
698 .modes = &edt_etm0700g0dh6_mode,
699 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700700 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +0200701 .size = {
702 .width = 152,
703 .height = 91,
704 },
705};
706
Boris BREZILLON102932b2014-06-05 15:53:32 +0200707static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
708 .clock = 32260,
709 .hdisplay = 800,
710 .hsync_start = 800 + 168,
711 .hsync_end = 800 + 168 + 64,
712 .htotal = 800 + 168 + 64 + 88,
713 .vdisplay = 480,
714 .vsync_start = 480 + 37,
715 .vsync_end = 480 + 37 + 2,
716 .vtotal = 480 + 37 + 2 + 8,
717 .vrefresh = 60,
718};
719
720static const struct panel_desc foxlink_fl500wvr00_a0t = {
721 .modes = &foxlink_fl500wvr00_a0t_mode,
722 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +0100723 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +0200724 .size = {
725 .width = 108,
726 .height = 65,
727 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +0200728 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +0200729};
730
Philipp Zabeld435a2a2014-11-19 10:29:55 +0100731static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
732 .clock = 9000,
733 .hdisplay = 480,
734 .hsync_start = 480 + 5,
735 .hsync_end = 480 + 5 + 1,
736 .htotal = 480 + 5 + 1 + 40,
737 .vdisplay = 272,
738 .vsync_start = 272 + 8,
739 .vsync_end = 272 + 8 + 1,
740 .vtotal = 272 + 8 + 1 + 8,
741 .vrefresh = 60,
742};
743
744static const struct panel_desc giantplus_gpg482739qs5 = {
745 .modes = &giantplus_gpg482739qs5_mode,
746 .num_modes = 1,
747 .bpc = 8,
748 .size = {
749 .width = 95,
750 .height = 54,
751 },
Philipp Zabel33536a02015-02-11 18:50:07 +0100752 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +0100753};
754
Philipp Zabelab077252014-12-11 18:32:46 +0100755static const struct display_timing hannstar_hsd070pww1_timing = {
756 .pixelclock = { 64300000, 71100000, 82000000 },
757 .hactive = { 1280, 1280, 1280 },
758 .hfront_porch = { 1, 1, 10 },
759 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +0200760 /*
761 * According to the data sheet, the minimum horizontal blanking interval
762 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
763 * minimum working horizontal blanking interval to be 60 clocks.
764 */
765 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +0100766 .vactive = { 800, 800, 800 },
767 .vfront_porch = { 1, 1, 10 },
768 .vback_porch = { 1, 1, 10 },
769 .vsync_len = { 1, 21, 203 },
770 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +0200771};
772
773static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +0100774 .timings = &hannstar_hsd070pww1_timing,
775 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +0200776 .bpc = 6,
777 .size = {
778 .width = 151,
779 .height = 94,
780 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +0200781 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Philipp Zabela8532052014-10-23 16:31:06 +0200782};
783
Eric Nelsonc0d607e2015-04-13 15:09:26 -0700784static const struct display_timing hannstar_hsd100pxn1_timing = {
785 .pixelclock = { 55000000, 65000000, 75000000 },
786 .hactive = { 1024, 1024, 1024 },
787 .hfront_porch = { 40, 40, 40 },
788 .hback_porch = { 220, 220, 220 },
789 .hsync_len = { 20, 60, 100 },
790 .vactive = { 768, 768, 768 },
791 .vfront_porch = { 7, 7, 7 },
792 .vback_porch = { 21, 21, 21 },
793 .vsync_len = { 10, 10, 10 },
794 .flags = DISPLAY_FLAGS_DE_HIGH,
795};
796
797static const struct panel_desc hannstar_hsd100pxn1 = {
798 .timings = &hannstar_hsd100pxn1_timing,
799 .num_timings = 1,
800 .bpc = 6,
801 .size = {
802 .width = 203,
803 .height = 152,
804 },
Philipp Zabel4946b042015-05-20 11:34:08 +0200805 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Eric Nelsonc0d607e2015-04-13 15:09:26 -0700806};
807
Lucas Stach61ac0bf2014-11-06 17:44:35 +0100808static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
809 .clock = 33333,
810 .hdisplay = 800,
811 .hsync_start = 800 + 85,
812 .hsync_end = 800 + 85 + 86,
813 .htotal = 800 + 85 + 86 + 85,
814 .vdisplay = 480,
815 .vsync_start = 480 + 16,
816 .vsync_end = 480 + 16 + 13,
817 .vtotal = 480 + 16 + 13 + 16,
818 .vrefresh = 60,
819};
820
821static const struct panel_desc hitachi_tx23d38vm0caa = {
822 .modes = &hitachi_tx23d38vm0caa_mode,
823 .num_modes = 1,
824 .bpc = 6,
825 .size = {
826 .width = 195,
827 .height = 117,
828 },
829};
830
Nicolas Ferre41bcceb2015-03-19 14:43:01 +0100831static const struct drm_display_mode innolux_at043tn24_mode = {
832 .clock = 9000,
833 .hdisplay = 480,
834 .hsync_start = 480 + 2,
835 .hsync_end = 480 + 2 + 41,
836 .htotal = 480 + 2 + 41 + 2,
837 .vdisplay = 272,
838 .vsync_start = 272 + 2,
839 .vsync_end = 272 + 2 + 11,
840 .vtotal = 272 + 2 + 11 + 2,
841 .vrefresh = 60,
842 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
843};
844
845static const struct panel_desc innolux_at043tn24 = {
846 .modes = &innolux_at043tn24_mode,
847 .num_modes = 1,
848 .bpc = 8,
849 .size = {
850 .width = 95,
851 .height = 54,
852 },
853 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
854};
855
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +0200856static const struct drm_display_mode innolux_at070tn92_mode = {
857 .clock = 33333,
858 .hdisplay = 800,
859 .hsync_start = 800 + 210,
860 .hsync_end = 800 + 210 + 20,
861 .htotal = 800 + 210 + 20 + 46,
862 .vdisplay = 480,
863 .vsync_start = 480 + 22,
864 .vsync_end = 480 + 22 + 10,
865 .vtotal = 480 + 22 + 23 + 10,
866 .vrefresh = 60,
867};
868
869static const struct panel_desc innolux_at070tn92 = {
870 .modes = &innolux_at070tn92_mode,
871 .num_modes = 1,
872 .size = {
873 .width = 154,
874 .height = 86,
875 },
876 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
877};
878
Michael Olbrich1e29b842016-08-15 14:32:02 +0200879static const struct display_timing innolux_g101ice_l01_timing = {
880 .pixelclock = { 60400000, 71100000, 74700000 },
881 .hactive = { 1280, 1280, 1280 },
882 .hfront_porch = { 41, 80, 100 },
883 .hback_porch = { 40, 79, 99 },
884 .hsync_len = { 1, 1, 1 },
885 .vactive = { 800, 800, 800 },
886 .vfront_porch = { 5, 11, 14 },
887 .vback_porch = { 4, 11, 14 },
888 .vsync_len = { 1, 1, 1 },
889 .flags = DISPLAY_FLAGS_DE_HIGH,
890};
891
892static const struct panel_desc innolux_g101ice_l01 = {
893 .timings = &innolux_g101ice_l01_timing,
894 .num_timings = 1,
895 .bpc = 8,
896 .size = {
897 .width = 217,
898 .height = 135,
899 },
900 .delay = {
901 .enable = 200,
902 .disable = 200,
903 },
904 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
905};
906
Lucas Stachd731f662014-11-06 17:44:33 +0100907static const struct drm_display_mode innolux_g121i1_l01_mode = {
Thierry Reding0a2288c2014-07-03 14:02:59 +0200908 .clock = 71000,
Lucas Stachd731f662014-11-06 17:44:33 +0100909 .hdisplay = 1280,
910 .hsync_start = 1280 + 64,
911 .hsync_end = 1280 + 64 + 32,
912 .htotal = 1280 + 64 + 32 + 64,
913 .vdisplay = 800,
914 .vsync_start = 800 + 9,
915 .vsync_end = 800 + 9 + 6,
916 .vtotal = 800 + 9 + 6 + 9,
917 .vrefresh = 60,
918};
919
920static const struct panel_desc innolux_g121i1_l01 = {
921 .modes = &innolux_g121i1_l01_mode,
922 .num_modes = 1,
923 .bpc = 6,
924 .size = {
925 .width = 261,
926 .height = 163,
927 },
928};
929
Akshay Bhatf8fa17b2015-11-18 15:57:47 -0500930static const struct drm_display_mode innolux_g121x1_l03_mode = {
931 .clock = 65000,
932 .hdisplay = 1024,
933 .hsync_start = 1024 + 0,
934 .hsync_end = 1024 + 1,
935 .htotal = 1024 + 0 + 1 + 320,
936 .vdisplay = 768,
937 .vsync_start = 768 + 38,
938 .vsync_end = 768 + 38 + 1,
939 .vtotal = 768 + 38 + 1 + 0,
940 .vrefresh = 60,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -0500941 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -0500942};
943
944static const struct panel_desc innolux_g121x1_l03 = {
945 .modes = &innolux_g121x1_l03_mode,
946 .num_modes = 1,
947 .bpc = 6,
948 .size = {
949 .width = 246,
950 .height = 185,
951 },
952 .delay = {
953 .enable = 200,
954 .unprepare = 200,
955 .disable = 400,
956 },
957};
958
Thierry Reding0a2288c2014-07-03 14:02:59 +0200959static const struct drm_display_mode innolux_n116bge_mode = {
Daniel Kurtz7fe8c772014-09-02 10:56:46 +0800960 .clock = 76420,
Thierry Reding0a2288c2014-07-03 14:02:59 +0200961 .hdisplay = 1366,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +0800962 .hsync_start = 1366 + 136,
963 .hsync_end = 1366 + 136 + 30,
964 .htotal = 1366 + 136 + 30 + 60,
Thierry Reding0a2288c2014-07-03 14:02:59 +0200965 .vdisplay = 768,
966 .vsync_start = 768 + 8,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +0800967 .vsync_end = 768 + 8 + 12,
968 .vtotal = 768 + 8 + 12 + 12,
Thierry Reding0a2288c2014-07-03 14:02:59 +0200969 .vrefresh = 60,
970 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
971};
972
973static const struct panel_desc innolux_n116bge = {
974 .modes = &innolux_n116bge_mode,
975 .num_modes = 1,
976 .bpc = 6,
977 .size = {
978 .width = 256,
979 .height = 144,
980 },
981};
982
Alban Bedelea447392014-07-22 08:38:55 +0200983static const struct drm_display_mode innolux_n156bge_l21_mode = {
984 .clock = 69300,
985 .hdisplay = 1366,
986 .hsync_start = 1366 + 16,
987 .hsync_end = 1366 + 16 + 34,
988 .htotal = 1366 + 16 + 34 + 50,
989 .vdisplay = 768,
990 .vsync_start = 768 + 2,
991 .vsync_end = 768 + 2 + 6,
992 .vtotal = 768 + 2 + 6 + 12,
993 .vrefresh = 60,
994};
995
996static const struct panel_desc innolux_n156bge_l21 = {
997 .modes = &innolux_n156bge_l21_mode,
998 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700999 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02001000 .size = {
1001 .width = 344,
1002 .height = 193,
1003 },
1004};
1005
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001006static const struct drm_display_mode innolux_zj070na_01p_mode = {
1007 .clock = 51501,
1008 .hdisplay = 1024,
1009 .hsync_start = 1024 + 128,
1010 .hsync_end = 1024 + 128 + 64,
1011 .htotal = 1024 + 128 + 64 + 128,
1012 .vdisplay = 600,
1013 .vsync_start = 600 + 16,
1014 .vsync_end = 600 + 16 + 4,
1015 .vtotal = 600 + 16 + 4 + 16,
1016 .vrefresh = 60,
1017};
1018
1019static const struct panel_desc innolux_zj070na_01p = {
1020 .modes = &innolux_zj070na_01p_mode,
1021 .num_modes = 1,
1022 .bpc = 6,
1023 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001024 .width = 154,
1025 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001026 },
1027};
1028
Lucas Stach8def22e2015-12-02 19:41:11 +01001029static const struct display_timing kyo_tcg121xglp_timing = {
1030 .pixelclock = { 52000000, 65000000, 71000000 },
1031 .hactive = { 1024, 1024, 1024 },
1032 .hfront_porch = { 2, 2, 2 },
1033 .hback_porch = { 2, 2, 2 },
1034 .hsync_len = { 86, 124, 244 },
1035 .vactive = { 768, 768, 768 },
1036 .vfront_porch = { 2, 2, 2 },
1037 .vback_porch = { 2, 2, 2 },
1038 .vsync_len = { 6, 34, 73 },
1039 .flags = DISPLAY_FLAGS_DE_HIGH,
1040};
1041
1042static const struct panel_desc kyo_tcg121xglp = {
1043 .timings = &kyo_tcg121xglp_timing,
1044 .num_timings = 1,
1045 .bpc = 8,
1046 .size = {
1047 .width = 246,
1048 .height = 184,
1049 },
1050 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1051};
1052
Heiko Schocherdd015002015-05-22 10:25:57 +02001053static const struct drm_display_mode lg_lb070wv8_mode = {
1054 .clock = 33246,
1055 .hdisplay = 800,
1056 .hsync_start = 800 + 88,
1057 .hsync_end = 800 + 88 + 80,
1058 .htotal = 800 + 88 + 80 + 88,
1059 .vdisplay = 480,
1060 .vsync_start = 480 + 10,
1061 .vsync_end = 480 + 10 + 25,
1062 .vtotal = 480 + 10 + 25 + 10,
1063 .vrefresh = 60,
1064};
1065
1066static const struct panel_desc lg_lb070wv8 = {
1067 .modes = &lg_lb070wv8_mode,
1068 .num_modes = 1,
1069 .bpc = 16,
1070 .size = {
1071 .width = 151,
1072 .height = 91,
1073 },
1074 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1075};
1076
Yakir Yangc5ece402016-06-28 12:51:15 +08001077static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1078 .clock = 200000,
1079 .hdisplay = 1536,
1080 .hsync_start = 1536 + 12,
1081 .hsync_end = 1536 + 12 + 16,
1082 .htotal = 1536 + 12 + 16 + 48,
1083 .vdisplay = 2048,
1084 .vsync_start = 2048 + 8,
1085 .vsync_end = 2048 + 8 + 4,
1086 .vtotal = 2048 + 8 + 4 + 8,
1087 .vrefresh = 60,
1088 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1089};
1090
1091static const struct panel_desc lg_lp079qx1_sp0v = {
1092 .modes = &lg_lp079qx1_sp0v_mode,
1093 .num_modes = 1,
1094 .size = {
1095 .width = 129,
1096 .height = 171,
1097 },
1098};
1099
Yakir Yang0355dde2016-06-12 10:56:02 +08001100static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1101 .clock = 205210,
1102 .hdisplay = 2048,
1103 .hsync_start = 2048 + 150,
1104 .hsync_end = 2048 + 150 + 5,
1105 .htotal = 2048 + 150 + 5 + 5,
1106 .vdisplay = 1536,
1107 .vsync_start = 1536 + 3,
1108 .vsync_end = 1536 + 3 + 1,
1109 .vtotal = 1536 + 3 + 1 + 9,
1110 .vrefresh = 60,
1111};
1112
1113static const struct panel_desc lg_lp097qx1_spa1 = {
1114 .modes = &lg_lp097qx1_spa1_mode,
1115 .num_modes = 1,
1116 .size = {
1117 .width = 208,
1118 .height = 147,
1119 },
1120};
1121
Jitao Shi690d8fa2016-02-22 19:01:44 +08001122static const struct drm_display_mode lg_lp120up1_mode = {
1123 .clock = 162300,
1124 .hdisplay = 1920,
1125 .hsync_start = 1920 + 40,
1126 .hsync_end = 1920 + 40 + 40,
1127 .htotal = 1920 + 40 + 40+ 80,
1128 .vdisplay = 1280,
1129 .vsync_start = 1280 + 4,
1130 .vsync_end = 1280 + 4 + 4,
1131 .vtotal = 1280 + 4 + 4 + 12,
1132 .vrefresh = 60,
1133};
1134
1135static const struct panel_desc lg_lp120up1 = {
1136 .modes = &lg_lp120up1_mode,
1137 .num_modes = 1,
1138 .bpc = 8,
1139 .size = {
1140 .width = 267,
1141 .height = 183,
1142 },
1143};
1144
Thierry Redingec7c5652013-11-15 15:59:32 +01001145static const struct drm_display_mode lg_lp129qe_mode = {
1146 .clock = 285250,
1147 .hdisplay = 2560,
1148 .hsync_start = 2560 + 48,
1149 .hsync_end = 2560 + 48 + 32,
1150 .htotal = 2560 + 48 + 32 + 80,
1151 .vdisplay = 1700,
1152 .vsync_start = 1700 + 3,
1153 .vsync_end = 1700 + 3 + 10,
1154 .vtotal = 1700 + 3 + 10 + 36,
1155 .vrefresh = 60,
1156};
1157
1158static const struct panel_desc lg_lp129qe = {
1159 .modes = &lg_lp129qe_mode,
1160 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001161 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01001162 .size = {
1163 .width = 272,
1164 .height = 181,
1165 },
1166};
1167
jianwei wangc6e87f92015-07-29 16:30:02 +08001168static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
1169 .clock = 10870,
1170 .hdisplay = 480,
1171 .hsync_start = 480 + 2,
1172 .hsync_end = 480 + 2 + 41,
1173 .htotal = 480 + 2 + 41 + 2,
1174 .vdisplay = 272,
1175 .vsync_start = 272 + 2,
1176 .vsync_end = 272 + 2 + 4,
1177 .vtotal = 272 + 2 + 4 + 2,
1178 .vrefresh = 74,
Stefan Agner4bc390c2015-11-17 19:10:29 -08001179 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08001180};
1181
1182static const struct panel_desc nec_nl4827hc19_05b = {
1183 .modes = &nec_nl4827hc19_05b_mode,
1184 .num_modes = 1,
1185 .bpc = 8,
1186 .size = {
1187 .width = 95,
1188 .height = 54,
1189 },
Stefan Agner2c806612016-02-08 12:50:13 -08001190 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1191 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08001192};
1193
Gary Bissona99fb622015-06-10 18:44:23 +02001194static const struct display_timing okaya_rs800480t_7x0gp_timing = {
1195 .pixelclock = { 30000000, 30000000, 40000000 },
1196 .hactive = { 800, 800, 800 },
1197 .hfront_porch = { 40, 40, 40 },
1198 .hback_porch = { 40, 40, 40 },
1199 .hsync_len = { 1, 48, 48 },
1200 .vactive = { 480, 480, 480 },
1201 .vfront_porch = { 13, 13, 13 },
1202 .vback_porch = { 29, 29, 29 },
1203 .vsync_len = { 3, 3, 3 },
1204 .flags = DISPLAY_FLAGS_DE_HIGH,
1205};
1206
1207static const struct panel_desc okaya_rs800480t_7x0gp = {
1208 .timings = &okaya_rs800480t_7x0gp_timing,
1209 .num_timings = 1,
1210 .bpc = 6,
1211 .size = {
1212 .width = 154,
1213 .height = 87,
1214 },
1215 .delay = {
1216 .prepare = 41,
1217 .enable = 50,
1218 .unprepare = 41,
1219 .disable = 50,
1220 },
1221 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1222};
1223
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001224static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
1225 .clock = 9000,
1226 .hdisplay = 480,
1227 .hsync_start = 480 + 5,
1228 .hsync_end = 480 + 5 + 30,
1229 .htotal = 480 + 5 + 30 + 10,
1230 .vdisplay = 272,
1231 .vsync_start = 272 + 8,
1232 .vsync_end = 272 + 8 + 5,
1233 .vtotal = 272 + 8 + 5 + 3,
1234 .vrefresh = 60,
1235};
1236
1237static const struct panel_desc olimex_lcd_olinuxino_43ts = {
1238 .modes = &olimex_lcd_olinuxino_43ts_mode,
1239 .num_modes = 1,
1240 .size = {
1241 .width = 105,
1242 .height = 67,
1243 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10001244 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001245};
1246
Eric Anholte8b6f562016-03-24 17:23:48 -07001247/*
1248 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1249 * pixel clocks, but this is the timing that was being used in the Adafruit
1250 * installation instructions.
1251 */
1252static const struct drm_display_mode ontat_yx700wv03_mode = {
1253 .clock = 29500,
1254 .hdisplay = 800,
1255 .hsync_start = 824,
1256 .hsync_end = 896,
1257 .htotal = 992,
1258 .vdisplay = 480,
1259 .vsync_start = 483,
1260 .vsync_end = 493,
1261 .vtotal = 500,
1262 .vrefresh = 60,
1263 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1264};
1265
1266/*
1267 * Specification at:
1268 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1269 */
1270static const struct panel_desc ontat_yx700wv03 = {
1271 .modes = &ontat_yx700wv03_mode,
1272 .num_modes = 1,
1273 .bpc = 8,
1274 .size = {
1275 .width = 154,
1276 .height = 83,
1277 },
1278 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1279};
1280
Philipp Zabel725c9d42015-02-11 18:50:11 +01001281static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
1282 .clock = 25000,
1283 .hdisplay = 480,
1284 .hsync_start = 480 + 10,
1285 .hsync_end = 480 + 10 + 10,
1286 .htotal = 480 + 10 + 10 + 15,
1287 .vdisplay = 800,
1288 .vsync_start = 800 + 3,
1289 .vsync_end = 800 + 3 + 3,
1290 .vtotal = 800 + 3 + 3 + 3,
1291 .vrefresh = 60,
1292};
1293
1294static const struct panel_desc ortustech_com43h4m85ulc = {
1295 .modes = &ortustech_com43h4m85ulc_mode,
1296 .num_modes = 1,
1297 .bpc = 8,
1298 .size = {
1299 .width = 56,
1300 .height = 93,
1301 },
1302 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Marek Vasute0932f92016-08-26 18:26:00 +02001303 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
Philipp Zabel725c9d42015-02-11 18:50:11 +01001304};
1305
Josh Wud2a6f0f2015-10-08 17:42:41 +02001306static const struct drm_display_mode qd43003c0_40_mode = {
1307 .clock = 9000,
1308 .hdisplay = 480,
1309 .hsync_start = 480 + 8,
1310 .hsync_end = 480 + 8 + 4,
1311 .htotal = 480 + 8 + 4 + 39,
1312 .vdisplay = 272,
1313 .vsync_start = 272 + 4,
1314 .vsync_end = 272 + 4 + 10,
1315 .vtotal = 272 + 4 + 10 + 2,
1316 .vrefresh = 60,
1317};
1318
1319static const struct panel_desc qd43003c0_40 = {
1320 .modes = &qd43003c0_40_mode,
1321 .num_modes = 1,
1322 .bpc = 8,
1323 .size = {
1324 .width = 95,
1325 .height = 53,
1326 },
1327 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1328};
1329
Yakir Yang0330eaf2016-06-12 10:56:13 +08001330static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
1331 .clock = 271560,
1332 .hdisplay = 2560,
1333 .hsync_start = 2560 + 48,
1334 .hsync_end = 2560 + 48 + 32,
1335 .htotal = 2560 + 48 + 32 + 80,
1336 .vdisplay = 1600,
1337 .vsync_start = 1600 + 2,
1338 .vsync_end = 1600 + 2 + 5,
1339 .vtotal = 1600 + 2 + 5 + 57,
1340 .vrefresh = 60,
1341};
1342
1343static const struct panel_desc samsung_lsn122dl01_c01 = {
1344 .modes = &samsung_lsn122dl01_c01_mode,
1345 .num_modes = 1,
1346 .size = {
1347 .width = 263,
1348 .height = 164,
1349 },
1350};
1351
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001352static const struct drm_display_mode samsung_ltn101nt05_mode = {
1353 .clock = 54030,
1354 .hdisplay = 1024,
1355 .hsync_start = 1024 + 24,
1356 .hsync_end = 1024 + 24 + 136,
1357 .htotal = 1024 + 24 + 136 + 160,
1358 .vdisplay = 600,
1359 .vsync_start = 600 + 3,
1360 .vsync_end = 600 + 3 + 6,
1361 .vtotal = 600 + 3 + 6 + 61,
1362 .vrefresh = 60,
1363};
1364
1365static const struct panel_desc samsung_ltn101nt05 = {
1366 .modes = &samsung_ltn101nt05_mode,
1367 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001368 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001369 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001370 .width = 223,
1371 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001372 },
1373};
1374
Stéphane Marchesin0c934302015-03-18 10:52:18 +01001375static const struct drm_display_mode samsung_ltn140at29_301_mode = {
1376 .clock = 76300,
1377 .hdisplay = 1366,
1378 .hsync_start = 1366 + 64,
1379 .hsync_end = 1366 + 64 + 48,
1380 .htotal = 1366 + 64 + 48 + 128,
1381 .vdisplay = 768,
1382 .vsync_start = 768 + 2,
1383 .vsync_end = 768 + 2 + 5,
1384 .vtotal = 768 + 2 + 5 + 17,
1385 .vrefresh = 60,
1386};
1387
1388static const struct panel_desc samsung_ltn140at29_301 = {
1389 .modes = &samsung_ltn140at29_301_mode,
1390 .num_modes = 1,
1391 .bpc = 6,
1392 .size = {
1393 .width = 320,
1394 .height = 187,
1395 },
1396};
1397
Joshua Clayton592aa022016-07-06 15:59:16 -07001398static const struct display_timing sharp_lq101k1ly04_timing = {
1399 .pixelclock = { 60000000, 65000000, 80000000 },
1400 .hactive = { 1280, 1280, 1280 },
1401 .hfront_porch = { 20, 20, 20 },
1402 .hback_porch = { 20, 20, 20 },
1403 .hsync_len = { 10, 10, 10 },
1404 .vactive = { 800, 800, 800 },
1405 .vfront_porch = { 4, 4, 4 },
1406 .vback_porch = { 4, 4, 4 },
1407 .vsync_len = { 4, 4, 4 },
1408 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
1409};
1410
1411static const struct panel_desc sharp_lq101k1ly04 = {
1412 .timings = &sharp_lq101k1ly04_timing,
1413 .num_timings = 1,
1414 .bpc = 8,
1415 .size = {
1416 .width = 217,
1417 .height = 136,
1418 },
1419 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
1420};
1421
Yakir Yang739c7de2016-06-12 10:56:35 +08001422static const struct drm_display_mode sharp_lq123p1jx31_mode = {
1423 .clock = 252750,
1424 .hdisplay = 2400,
1425 .hsync_start = 2400 + 48,
1426 .hsync_end = 2400 + 48 + 32,
1427 .htotal = 2400 + 48 + 32 + 80,
1428 .vdisplay = 1600,
1429 .vsync_start = 1600 + 3,
1430 .vsync_end = 1600 + 3 + 10,
1431 .vtotal = 1600 + 3 + 10 + 33,
1432 .vrefresh = 60,
1433 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1434};
1435
1436static const struct panel_desc sharp_lq123p1jx31 = {
1437 .modes = &sharp_lq123p1jx31_mode,
1438 .num_modes = 1,
1439 .size = {
1440 .width = 259,
1441 .height = 173,
1442 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08001443 .delay = {
1444 .prepare = 110,
1445 .enable = 50,
1446 .unprepare = 550,
1447 },
Yakir Yang739c7de2016-06-12 10:56:35 +08001448};
1449
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02001450static const struct drm_display_mode sharp_lq150x1lg11_mode = {
1451 .clock = 71100,
1452 .hdisplay = 1024,
1453 .hsync_start = 1024 + 168,
1454 .hsync_end = 1024 + 168 + 64,
1455 .htotal = 1024 + 168 + 64 + 88,
1456 .vdisplay = 768,
1457 .vsync_start = 768 + 37,
1458 .vsync_end = 768 + 37 + 2,
1459 .vtotal = 768 + 37 + 2 + 8,
1460 .vrefresh = 60,
1461};
1462
1463static const struct panel_desc sharp_lq150x1lg11 = {
1464 .modes = &sharp_lq150x1lg11_mode,
1465 .num_modes = 1,
1466 .bpc = 6,
1467 .size = {
1468 .width = 304,
1469 .height = 228,
1470 },
1471 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
1472};
1473
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01001474static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
1475 .clock = 33300,
1476 .hdisplay = 800,
1477 .hsync_start = 800 + 1,
1478 .hsync_end = 800 + 1 + 64,
1479 .htotal = 800 + 1 + 64 + 64,
1480 .vdisplay = 480,
1481 .vsync_start = 480 + 1,
1482 .vsync_end = 480 + 1 + 23,
1483 .vtotal = 480 + 1 + 23 + 22,
1484 .vrefresh = 60,
1485};
1486
1487static const struct panel_desc shelly_sca07010_bfn_lnn = {
1488 .modes = &shelly_sca07010_bfn_lnn_mode,
1489 .num_modes = 1,
1490 .size = {
1491 .width = 152,
1492 .height = 91,
1493 },
1494 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1495};
1496
Douglas Anderson9bb34c42016-06-10 10:02:07 -07001497static const struct drm_display_mode starry_kr122ea0sra_mode = {
1498 .clock = 147000,
1499 .hdisplay = 1920,
1500 .hsync_start = 1920 + 16,
1501 .hsync_end = 1920 + 16 + 16,
1502 .htotal = 1920 + 16 + 16 + 32,
1503 .vdisplay = 1200,
1504 .vsync_start = 1200 + 15,
1505 .vsync_end = 1200 + 15 + 2,
1506 .vtotal = 1200 + 15 + 2 + 18,
1507 .vrefresh = 60,
1508 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1509};
1510
1511static const struct panel_desc starry_kr122ea0sra = {
1512 .modes = &starry_kr122ea0sra_mode,
1513 .num_modes = 1,
1514 .size = {
1515 .width = 263,
1516 .height = 164,
1517 },
Brian Norrisc46b9242016-08-26 14:32:14 -07001518 .delay = {
1519 .prepare = 10 + 200,
1520 .enable = 50,
1521 .unprepare = 10 + 500,
1522 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07001523};
1524
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05301525static const struct drm_display_mode tpk_f07a_0102_mode = {
1526 .clock = 33260,
1527 .hdisplay = 800,
1528 .hsync_start = 800 + 40,
1529 .hsync_end = 800 + 40 + 128,
1530 .htotal = 800 + 40 + 128 + 88,
1531 .vdisplay = 480,
1532 .vsync_start = 480 + 10,
1533 .vsync_end = 480 + 10 + 2,
1534 .vtotal = 480 + 10 + 2 + 33,
1535 .vrefresh = 60,
1536};
1537
1538static const struct panel_desc tpk_f07a_0102 = {
1539 .modes = &tpk_f07a_0102_mode,
1540 .num_modes = 1,
1541 .size = {
1542 .width = 152,
1543 .height = 91,
1544 },
1545 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
1546};
1547
1548static const struct drm_display_mode tpk_f10a_0102_mode = {
1549 .clock = 45000,
1550 .hdisplay = 1024,
1551 .hsync_start = 1024 + 176,
1552 .hsync_end = 1024 + 176 + 5,
1553 .htotal = 1024 + 176 + 5 + 88,
1554 .vdisplay = 600,
1555 .vsync_start = 600 + 20,
1556 .vsync_end = 600 + 20 + 5,
1557 .vtotal = 600 + 20 + 5 + 25,
1558 .vrefresh = 60,
1559};
1560
1561static const struct panel_desc tpk_f10a_0102 = {
1562 .modes = &tpk_f10a_0102_mode,
1563 .num_modes = 1,
1564 .size = {
1565 .width = 223,
1566 .height = 125,
1567 },
1568};
1569
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01001570static const struct display_timing urt_umsh_8596md_timing = {
1571 .pixelclock = { 33260000, 33260000, 33260000 },
1572 .hactive = { 800, 800, 800 },
1573 .hfront_porch = { 41, 41, 41 },
1574 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
1575 .hsync_len = { 71, 128, 128 },
1576 .vactive = { 480, 480, 480 },
1577 .vfront_porch = { 10, 10, 10 },
1578 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
1579 .vsync_len = { 2, 2, 2 },
1580 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
1581 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
1582};
1583
1584static const struct panel_desc urt_umsh_8596md_lvds = {
1585 .timings = &urt_umsh_8596md_timing,
1586 .num_timings = 1,
1587 .bpc = 6,
1588 .size = {
1589 .width = 152,
1590 .height = 91,
1591 },
1592 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1593};
1594
1595static const struct panel_desc urt_umsh_8596md_parallel = {
1596 .timings = &urt_umsh_8596md_timing,
1597 .num_timings = 1,
1598 .bpc = 6,
1599 .size = {
1600 .width = 152,
1601 .height = 91,
1602 },
1603 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1604};
1605
Thierry Reding280921d2013-08-30 15:10:14 +02001606static const struct of_device_id platform_of_match[] = {
1607 {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01001608 .compatible = "ampire,am800480r3tmqwa1h",
1609 .data = &ampire_am800480r3tmqwa1h,
1610 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001611 .compatible = "auo,b101aw03",
1612 .data = &auo_b101aw03,
1613 }, {
Huang Lina531bc32015-02-28 10:18:58 +08001614 .compatible = "auo,b101ean01",
1615 .data = &auo_b101ean01,
1616 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04001617 .compatible = "auo,b101xtn01",
1618 .data = &auo_b101xtn01,
1619 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05301620 .compatible = "auo,b116xw03",
1621 .data = &auo_b116xw03,
1622 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05301623 .compatible = "auo,b133htn01",
1624 .data = &auo_b133htn01,
1625 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07001626 .compatible = "auo,b133xtn01",
1627 .data = &auo_b133xtn01,
1628 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07001629 .compatible = "auo,t215hvn01",
1630 .data = &auo_t215hvn01,
1631 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01001632 .compatible = "avic,tm070ddh03",
1633 .data = &avic_tm070ddh03,
1634 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07001635 .compatible = "chunghwa,claa101wa01a",
1636 .data = &chunghwa_claa101wa01a
1637 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001638 .compatible = "chunghwa,claa101wb01",
1639 .data = &chunghwa_claa101wb01
1640 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02001641 .compatible = "edt,et057090dhu",
1642 .data = &edt_et057090dhu,
1643 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02001644 .compatible = "edt,et070080dh6",
1645 .data = &edt_etm0700g0dh6,
1646 }, {
1647 .compatible = "edt,etm0700g0dh6",
1648 .data = &edt_etm0700g0dh6,
1649 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02001650 .compatible = "foxlink,fl500wvr00-a0t",
1651 .data = &foxlink_fl500wvr00_a0t,
1652 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001653 .compatible = "giantplus,gpg482739qs5",
1654 .data = &giantplus_gpg482739qs5
1655 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02001656 .compatible = "hannstar,hsd070pww1",
1657 .data = &hannstar_hsd070pww1,
1658 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001659 .compatible = "hannstar,hsd100pxn1",
1660 .data = &hannstar_hsd100pxn1,
1661 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001662 .compatible = "hit,tx23d38vm0caa",
1663 .data = &hitachi_tx23d38vm0caa
1664 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001665 .compatible = "innolux,at043tn24",
1666 .data = &innolux_at043tn24,
1667 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02001668 .compatible = "innolux,at070tn92",
1669 .data = &innolux_at070tn92,
1670 }, {
Michael Olbrich1e29b842016-08-15 14:32:02 +02001671 .compatible ="innolux,g101ice-l01",
1672 .data = &innolux_g101ice_l01
1673 }, {
Lucas Stachd731f662014-11-06 17:44:33 +01001674 .compatible ="innolux,g121i1-l01",
1675 .data = &innolux_g121i1_l01
1676 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001677 .compatible = "innolux,g121x1-l03",
1678 .data = &innolux_g121x1_l03,
1679 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02001680 .compatible = "innolux,n116bge",
1681 .data = &innolux_n116bge,
1682 }, {
Alban Bedelea447392014-07-22 08:38:55 +02001683 .compatible = "innolux,n156bge-l21",
1684 .data = &innolux_n156bge_l21,
1685 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001686 .compatible = "innolux,zj070na-01p",
1687 .data = &innolux_zj070na_01p,
1688 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01001689 .compatible = "kyo,tcg121xglp",
1690 .data = &kyo_tcg121xglp,
1691 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02001692 .compatible = "lg,lb070wv8",
1693 .data = &lg_lb070wv8,
1694 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08001695 .compatible = "lg,lp079qx1-sp0v",
1696 .data = &lg_lp079qx1_sp0v,
1697 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08001698 .compatible = "lg,lp097qx1-spa1",
1699 .data = &lg_lp097qx1_spa1,
1700 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08001701 .compatible = "lg,lp120up1",
1702 .data = &lg_lp120up1,
1703 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01001704 .compatible = "lg,lp129qe",
1705 .data = &lg_lp129qe,
1706 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08001707 .compatible = "nec,nl4827hc19-05b",
1708 .data = &nec_nl4827hc19_05b,
1709 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02001710 .compatible = "okaya,rs800480t-7x0gp",
1711 .data = &okaya_rs800480t_7x0gp,
1712 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001713 .compatible = "olimex,lcd-olinuxino-43-ts",
1714 .data = &olimex_lcd_olinuxino_43ts,
1715 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07001716 .compatible = "ontat,yx700wv03",
1717 .data = &ontat_yx700wv03,
1718 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01001719 .compatible = "ortustech,com43h4m85ulc",
1720 .data = &ortustech_com43h4m85ulc,
1721 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02001722 .compatible = "qiaodian,qd43003c0-40",
1723 .data = &qd43003c0_40,
1724 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08001725 .compatible = "samsung,lsn122dl01-c01",
1726 .data = &samsung_lsn122dl01_c01,
1727 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001728 .compatible = "samsung,ltn101nt05",
1729 .data = &samsung_ltn101nt05,
1730 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01001731 .compatible = "samsung,ltn140at29-301",
1732 .data = &samsung_ltn140at29_301,
1733 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07001734 .compatible = "sharp,lq101k1ly04",
1735 .data = &sharp_lq101k1ly04,
1736 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08001737 .compatible = "sharp,lq123p1jx31",
1738 .data = &sharp_lq123p1jx31,
1739 }, {
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02001740 .compatible = "sharp,lq150x1lg11",
1741 .data = &sharp_lq150x1lg11,
1742 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01001743 .compatible = "shelly,sca07010-bfn-lnn",
1744 .data = &shelly_sca07010_bfn_lnn,
1745 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07001746 .compatible = "starry,kr122ea0sra",
1747 .data = &starry_kr122ea0sra,
1748 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05301749 .compatible = "tpk,f07a-0102",
1750 .data = &tpk_f07a_0102,
1751 }, {
1752 .compatible = "tpk,f10a-0102",
1753 .data = &tpk_f10a_0102,
1754 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01001755 .compatible = "urt,umsh-8596md-t",
1756 .data = &urt_umsh_8596md_parallel,
1757 }, {
1758 .compatible = "urt,umsh-8596md-1t",
1759 .data = &urt_umsh_8596md_parallel,
1760 }, {
1761 .compatible = "urt,umsh-8596md-7t",
1762 .data = &urt_umsh_8596md_parallel,
1763 }, {
1764 .compatible = "urt,umsh-8596md-11t",
1765 .data = &urt_umsh_8596md_lvds,
1766 }, {
1767 .compatible = "urt,umsh-8596md-19t",
1768 .data = &urt_umsh_8596md_lvds,
1769 }, {
1770 .compatible = "urt,umsh-8596md-20t",
1771 .data = &urt_umsh_8596md_parallel,
1772 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001773 /* sentinel */
1774 }
1775};
1776MODULE_DEVICE_TABLE(of, platform_of_match);
1777
1778static int panel_simple_platform_probe(struct platform_device *pdev)
1779{
1780 const struct of_device_id *id;
1781
1782 id = of_match_node(platform_of_match, pdev->dev.of_node);
1783 if (!id)
1784 return -ENODEV;
1785
1786 return panel_simple_probe(&pdev->dev, id->data);
1787}
1788
1789static int panel_simple_platform_remove(struct platform_device *pdev)
1790{
1791 return panel_simple_remove(&pdev->dev);
1792}
1793
Thierry Redingd02fd932014-04-29 17:21:21 +02001794static void panel_simple_platform_shutdown(struct platform_device *pdev)
1795{
1796 panel_simple_shutdown(&pdev->dev);
1797}
1798
Thierry Reding280921d2013-08-30 15:10:14 +02001799static struct platform_driver panel_simple_platform_driver = {
1800 .driver = {
1801 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02001802 .of_match_table = platform_of_match,
1803 },
1804 .probe = panel_simple_platform_probe,
1805 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02001806 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02001807};
1808
Thierry Reding210fcd92013-11-22 19:27:11 +01001809struct panel_desc_dsi {
1810 struct panel_desc desc;
1811
Thierry Reding462658b2014-03-14 11:24:57 +01001812 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01001813 enum mipi_dsi_pixel_format format;
1814 unsigned int lanes;
1815};
1816
Thierry Redingd718d792015-04-08 16:52:33 +02001817static const struct drm_display_mode auo_b080uan01_mode = {
1818 .clock = 154500,
1819 .hdisplay = 1200,
1820 .hsync_start = 1200 + 62,
1821 .hsync_end = 1200 + 62 + 4,
1822 .htotal = 1200 + 62 + 4 + 62,
1823 .vdisplay = 1920,
1824 .vsync_start = 1920 + 9,
1825 .vsync_end = 1920 + 9 + 2,
1826 .vtotal = 1920 + 9 + 2 + 8,
1827 .vrefresh = 60,
1828};
1829
1830static const struct panel_desc_dsi auo_b080uan01 = {
1831 .desc = {
1832 .modes = &auo_b080uan01_mode,
1833 .num_modes = 1,
1834 .bpc = 8,
1835 .size = {
1836 .width = 108,
1837 .height = 272,
1838 },
1839 },
1840 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
1841 .format = MIPI_DSI_FMT_RGB888,
1842 .lanes = 4,
1843};
1844
Chris Zhongc8521962015-11-20 16:15:37 +08001845static const struct drm_display_mode boe_tv080wum_nl0_mode = {
1846 .clock = 160000,
1847 .hdisplay = 1200,
1848 .hsync_start = 1200 + 120,
1849 .hsync_end = 1200 + 120 + 20,
1850 .htotal = 1200 + 120 + 20 + 21,
1851 .vdisplay = 1920,
1852 .vsync_start = 1920 + 21,
1853 .vsync_end = 1920 + 21 + 3,
1854 .vtotal = 1920 + 21 + 3 + 18,
1855 .vrefresh = 60,
1856 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1857};
1858
1859static const struct panel_desc_dsi boe_tv080wum_nl0 = {
1860 .desc = {
1861 .modes = &boe_tv080wum_nl0_mode,
1862 .num_modes = 1,
1863 .size = {
1864 .width = 107,
1865 .height = 172,
1866 },
1867 },
1868 .flags = MIPI_DSI_MODE_VIDEO |
1869 MIPI_DSI_MODE_VIDEO_BURST |
1870 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
1871 .format = MIPI_DSI_FMT_RGB888,
1872 .lanes = 4,
1873};
1874
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09001875static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
1876 .clock = 71000,
1877 .hdisplay = 800,
1878 .hsync_start = 800 + 32,
1879 .hsync_end = 800 + 32 + 1,
1880 .htotal = 800 + 32 + 1 + 57,
1881 .vdisplay = 1280,
1882 .vsync_start = 1280 + 28,
1883 .vsync_end = 1280 + 28 + 1,
1884 .vtotal = 1280 + 28 + 1 + 14,
1885 .vrefresh = 60,
1886};
1887
1888static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
1889 .desc = {
1890 .modes = &lg_ld070wx3_sl01_mode,
1891 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001892 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09001893 .size = {
1894 .width = 94,
1895 .height = 151,
1896 },
1897 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09001898 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09001899 .format = MIPI_DSI_FMT_RGB888,
1900 .lanes = 4,
1901};
1902
Alexandre Courbot499ce852014-01-21 18:57:09 +09001903static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
1904 .clock = 67000,
1905 .hdisplay = 720,
1906 .hsync_start = 720 + 12,
1907 .hsync_end = 720 + 12 + 4,
1908 .htotal = 720 + 12 + 4 + 112,
1909 .vdisplay = 1280,
1910 .vsync_start = 1280 + 8,
1911 .vsync_end = 1280 + 8 + 4,
1912 .vtotal = 1280 + 8 + 4 + 12,
1913 .vrefresh = 60,
1914};
1915
1916static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
1917 .desc = {
1918 .modes = &lg_lh500wx1_sd03_mode,
1919 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001920 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09001921 .size = {
1922 .width = 62,
1923 .height = 110,
1924 },
1925 },
1926 .flags = MIPI_DSI_MODE_VIDEO,
1927 .format = MIPI_DSI_FMT_RGB888,
1928 .lanes = 4,
1929};
1930
Thierry Reding280921d2013-08-30 15:10:14 +02001931static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
1932 .clock = 157200,
1933 .hdisplay = 1920,
1934 .hsync_start = 1920 + 154,
1935 .hsync_end = 1920 + 154 + 16,
1936 .htotal = 1920 + 154 + 16 + 32,
1937 .vdisplay = 1200,
1938 .vsync_start = 1200 + 17,
1939 .vsync_end = 1200 + 17 + 2,
1940 .vtotal = 1200 + 17 + 2 + 16,
1941 .vrefresh = 60,
1942};
1943
Thierry Reding210fcd92013-11-22 19:27:11 +01001944static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
1945 .desc = {
1946 .modes = &panasonic_vvx10f004b00_mode,
1947 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001948 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01001949 .size = {
1950 .width = 217,
1951 .height = 136,
1952 },
Thierry Reding280921d2013-08-30 15:10:14 +02001953 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09001954 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
1955 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01001956 .format = MIPI_DSI_FMT_RGB888,
1957 .lanes = 4,
1958};
1959
1960static const struct of_device_id dsi_of_match[] = {
1961 {
Thierry Redingd718d792015-04-08 16:52:33 +02001962 .compatible = "auo,b080uan01",
1963 .data = &auo_b080uan01
1964 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08001965 .compatible = "boe,tv080wum-nl0",
1966 .data = &boe_tv080wum_nl0
1967 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09001968 .compatible = "lg,ld070wx3-sl01",
1969 .data = &lg_ld070wx3_sl01
1970 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09001971 .compatible = "lg,lh500wx1-sd03",
1972 .data = &lg_lh500wx1_sd03
1973 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01001974 .compatible = "panasonic,vvx10f004b00",
1975 .data = &panasonic_vvx10f004b00
1976 }, {
1977 /* sentinel */
1978 }
1979};
1980MODULE_DEVICE_TABLE(of, dsi_of_match);
1981
1982static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
1983{
1984 const struct panel_desc_dsi *desc;
1985 const struct of_device_id *id;
1986 int err;
1987
1988 id = of_match_node(dsi_of_match, dsi->dev.of_node);
1989 if (!id)
1990 return -ENODEV;
1991
1992 desc = id->data;
1993
1994 err = panel_simple_probe(&dsi->dev, &desc->desc);
1995 if (err < 0)
1996 return err;
1997
Thierry Reding462658b2014-03-14 11:24:57 +01001998 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01001999 dsi->format = desc->format;
2000 dsi->lanes = desc->lanes;
2001
2002 return mipi_dsi_attach(dsi);
2003}
2004
2005static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
2006{
2007 int err;
2008
2009 err = mipi_dsi_detach(dsi);
2010 if (err < 0)
2011 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
2012
2013 return panel_simple_remove(&dsi->dev);
2014}
2015
Thierry Redingd02fd932014-04-29 17:21:21 +02002016static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
2017{
2018 panel_simple_shutdown(&dsi->dev);
2019}
2020
Thierry Reding210fcd92013-11-22 19:27:11 +01002021static struct mipi_dsi_driver panel_simple_dsi_driver = {
2022 .driver = {
2023 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01002024 .of_match_table = dsi_of_match,
2025 },
2026 .probe = panel_simple_dsi_probe,
2027 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002028 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002029};
2030
2031static int __init panel_simple_init(void)
2032{
Thierry Reding210fcd92013-11-22 19:27:11 +01002033 int err;
2034
2035 err = platform_driver_register(&panel_simple_platform_driver);
2036 if (err < 0)
2037 return err;
2038
2039 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
2040 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
2041 if (err < 0)
2042 return err;
2043 }
2044
2045 return 0;
Thierry Reding280921d2013-08-30 15:10:14 +02002046}
2047module_init(panel_simple_init);
2048
2049static void __exit panel_simple_exit(void)
2050{
Thierry Reding210fcd92013-11-22 19:27:11 +01002051 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
2052 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
2053
Thierry Reding280921d2013-08-30 15:10:14 +02002054 platform_driver_unregister(&panel_simple_platform_driver);
2055}
2056module_exit(panel_simple_exit);
2057
2058MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
2059MODULE_DESCRIPTION("DRM Driver for Simple Panels");
2060MODULE_LICENSE("GPL and additional rights");