blob: c56fb983311cb37dd03f5066e74534715f307651 [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
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
Lucas Stach697035c2016-11-30 14:09:55 +0100558static const struct display_timing auo_g133han01_timings = {
559 .pixelclock = { 134000000, 141200000, 149000000 },
560 .hactive = { 1920, 1920, 1920 },
561 .hfront_porch = { 39, 58, 77 },
562 .hback_porch = { 59, 88, 117 },
563 .hsync_len = { 28, 42, 56 },
564 .vactive = { 1080, 1080, 1080 },
565 .vfront_porch = { 3, 8, 11 },
566 .vback_porch = { 5, 14, 19 },
567 .vsync_len = { 4, 14, 19 },
568};
569
570static const struct panel_desc auo_g133han01 = {
571 .timings = &auo_g133han01_timings,
572 .num_timings = 1,
573 .bpc = 8,
574 .size = {
575 .width = 293,
576 .height = 165,
577 },
578 .delay = {
579 .prepare = 200,
580 .enable = 50,
581 .disable = 50,
582 .unprepare = 1000,
583 },
584 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
585};
586
Lucas Stach8c31f602016-11-30 14:09:56 +0100587static const struct display_timing auo_g185han01_timings = {
588 .pixelclock = { 120000000, 144000000, 175000000 },
589 .hactive = { 1920, 1920, 1920 },
590 .hfront_porch = { 18, 60, 74 },
591 .hback_porch = { 12, 44, 54 },
592 .hsync_len = { 10, 24, 32 },
593 .vactive = { 1080, 1080, 1080 },
594 .vfront_porch = { 6, 10, 40 },
595 .vback_porch = { 2, 5, 20 },
596 .vsync_len = { 2, 5, 20 },
597};
598
599static const struct panel_desc auo_g185han01 = {
600 .timings = &auo_g185han01_timings,
601 .num_timings = 1,
602 .bpc = 8,
603 .size = {
604 .width = 409,
605 .height = 230,
606 },
607 .delay = {
608 .prepare = 50,
609 .enable = 200,
610 .disable = 110,
611 .unprepare = 1000,
612 },
613 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
614};
615
Haixia Shi7ee933a2016-10-11 14:59:16 -0700616static const struct drm_display_mode auo_t215hvn01_mode = {
617 .clock = 148800,
618 .hdisplay = 1920,
619 .hsync_start = 1920 + 88,
620 .hsync_end = 1920 + 88 + 44,
621 .htotal = 1920 + 88 + 44 + 148,
622 .vdisplay = 1080,
623 .vsync_start = 1080 + 4,
624 .vsync_end = 1080 + 4 + 5,
625 .vtotal = 1080 + 4 + 5 + 36,
626 .vrefresh = 60,
627};
628
629static const struct panel_desc auo_t215hvn01 = {
630 .modes = &auo_t215hvn01_mode,
631 .num_modes = 1,
632 .bpc = 8,
633 .size = {
634 .width = 430,
635 .height = 270,
636 },
637 .delay = {
638 .disable = 5,
639 .unprepare = 1000,
640 }
641};
642
Philipp Zabeld47df632014-12-18 16:43:43 +0100643static const struct drm_display_mode avic_tm070ddh03_mode = {
644 .clock = 51200,
645 .hdisplay = 1024,
646 .hsync_start = 1024 + 160,
647 .hsync_end = 1024 + 160 + 4,
648 .htotal = 1024 + 160 + 4 + 156,
649 .vdisplay = 600,
650 .vsync_start = 600 + 17,
651 .vsync_end = 600 + 17 + 1,
652 .vtotal = 600 + 17 + 1 + 17,
653 .vrefresh = 60,
654};
655
656static const struct panel_desc avic_tm070ddh03 = {
657 .modes = &avic_tm070ddh03_mode,
658 .num_modes = 1,
659 .bpc = 8,
660 .size = {
661 .width = 154,
662 .height = 90,
663 },
664 .delay = {
665 .prepare = 20,
666 .enable = 200,
667 .disable = 200,
668 },
669};
670
Caesar Wangcac1a412016-12-14 11:19:56 +0800671static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
672 {
673 .clock = 71900,
674 .hdisplay = 1280,
675 .hsync_start = 1280 + 48,
676 .hsync_end = 1280 + 48 + 32,
677 .htotal = 1280 + 48 + 32 + 80,
678 .vdisplay = 800,
679 .vsync_start = 800 + 3,
680 .vsync_end = 800 + 3 + 5,
681 .vtotal = 800 + 3 + 5 + 24,
682 .vrefresh = 60,
683 },
684 {
685 .clock = 57500,
686 .hdisplay = 1280,
687 .hsync_start = 1280 + 48,
688 .hsync_end = 1280 + 48 + 32,
689 .htotal = 1280 + 48 + 32 + 80,
690 .vdisplay = 800,
691 .vsync_start = 800 + 3,
692 .vsync_end = 800 + 3 + 5,
693 .vtotal = 800 + 3 + 5 + 24,
694 .vrefresh = 48,
695 },
696};
697
698static const struct panel_desc boe_nv101wxmn51 = {
699 .modes = boe_nv101wxmn51_modes,
700 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
701 .bpc = 8,
702 .size = {
703 .width = 217,
704 .height = 136,
705 },
706 .delay = {
707 .prepare = 210,
708 .enable = 50,
709 .unprepare = 160,
710 },
711};
712
Randy Li2cb35c82016-09-20 03:02:51 +0800713static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
714 .clock = 66770,
715 .hdisplay = 800,
716 .hsync_start = 800 + 49,
717 .hsync_end = 800 + 49 + 33,
718 .htotal = 800 + 49 + 33 + 17,
719 .vdisplay = 1280,
720 .vsync_start = 1280 + 1,
721 .vsync_end = 1280 + 1 + 7,
722 .vtotal = 1280 + 1 + 7 + 15,
723 .vrefresh = 60,
724 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
725};
726
727static const struct panel_desc chunghwa_claa070wp03xg = {
728 .modes = &chunghwa_claa070wp03xg_mode,
729 .num_modes = 1,
730 .bpc = 6,
731 .size = {
732 .width = 94,
733 .height = 150,
734 },
735};
736
Stephen Warren4c930752014-01-07 16:46:26 -0700737static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
738 .clock = 72070,
739 .hdisplay = 1366,
740 .hsync_start = 1366 + 58,
741 .hsync_end = 1366 + 58 + 58,
742 .htotal = 1366 + 58 + 58 + 58,
743 .vdisplay = 768,
744 .vsync_start = 768 + 4,
745 .vsync_end = 768 + 4 + 4,
746 .vtotal = 768 + 4 + 4 + 4,
747 .vrefresh = 60,
748};
749
750static const struct panel_desc chunghwa_claa101wa01a = {
751 .modes = &chunghwa_claa101wa01a_mode,
752 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700753 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -0700754 .size = {
755 .width = 220,
756 .height = 120,
757 },
758};
759
Thierry Reding280921d2013-08-30 15:10:14 +0200760static const struct drm_display_mode chunghwa_claa101wb01_mode = {
761 .clock = 69300,
762 .hdisplay = 1366,
763 .hsync_start = 1366 + 48,
764 .hsync_end = 1366 + 48 + 32,
765 .htotal = 1366 + 48 + 32 + 20,
766 .vdisplay = 768,
767 .vsync_start = 768 + 16,
768 .vsync_end = 768 + 16 + 8,
769 .vtotal = 768 + 16 + 8 + 16,
770 .vrefresh = 60,
771};
772
773static const struct panel_desc chunghwa_claa101wb01 = {
774 .modes = &chunghwa_claa101wb01_mode,
775 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700776 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200777 .size = {
778 .width = 223,
779 .height = 125,
780 },
781};
782
Stefan Agner26ab0062014-05-15 11:38:45 +0200783static const struct drm_display_mode edt_et057090dhu_mode = {
784 .clock = 25175,
785 .hdisplay = 640,
786 .hsync_start = 640 + 16,
787 .hsync_end = 640 + 16 + 30,
788 .htotal = 640 + 16 + 30 + 114,
789 .vdisplay = 480,
790 .vsync_start = 480 + 10,
791 .vsync_end = 480 + 10 + 3,
792 .vtotal = 480 + 10 + 3 + 32,
793 .vrefresh = 60,
794 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
795};
796
797static const struct panel_desc edt_et057090dhu = {
798 .modes = &edt_et057090dhu_mode,
799 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700800 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +0200801 .size = {
802 .width = 115,
803 .height = 86,
804 },
805};
806
Philipp Zabelfff5de42014-05-15 12:25:47 +0200807static const struct drm_display_mode edt_etm0700g0dh6_mode = {
808 .clock = 33260,
809 .hdisplay = 800,
810 .hsync_start = 800 + 40,
811 .hsync_end = 800 + 40 + 128,
812 .htotal = 800 + 40 + 128 + 88,
813 .vdisplay = 480,
814 .vsync_start = 480 + 10,
815 .vsync_end = 480 + 10 + 2,
816 .vtotal = 480 + 10 + 2 + 33,
817 .vrefresh = 60,
818 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
819};
820
821static const struct panel_desc edt_etm0700g0dh6 = {
822 .modes = &edt_etm0700g0dh6_mode,
823 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700824 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +0200825 .size = {
826 .width = 152,
827 .height = 91,
828 },
829};
830
Boris BREZILLON102932b2014-06-05 15:53:32 +0200831static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
832 .clock = 32260,
833 .hdisplay = 800,
834 .hsync_start = 800 + 168,
835 .hsync_end = 800 + 168 + 64,
836 .htotal = 800 + 168 + 64 + 88,
837 .vdisplay = 480,
838 .vsync_start = 480 + 37,
839 .vsync_end = 480 + 37 + 2,
840 .vtotal = 480 + 37 + 2 + 8,
841 .vrefresh = 60,
842};
843
844static const struct panel_desc foxlink_fl500wvr00_a0t = {
845 .modes = &foxlink_fl500wvr00_a0t_mode,
846 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +0100847 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +0200848 .size = {
849 .width = 108,
850 .height = 65,
851 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +0200852 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +0200853};
854
Philipp Zabeld435a2a2014-11-19 10:29:55 +0100855static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
856 .clock = 9000,
857 .hdisplay = 480,
858 .hsync_start = 480 + 5,
859 .hsync_end = 480 + 5 + 1,
860 .htotal = 480 + 5 + 1 + 40,
861 .vdisplay = 272,
862 .vsync_start = 272 + 8,
863 .vsync_end = 272 + 8 + 1,
864 .vtotal = 272 + 8 + 1 + 8,
865 .vrefresh = 60,
866};
867
868static const struct panel_desc giantplus_gpg482739qs5 = {
869 .modes = &giantplus_gpg482739qs5_mode,
870 .num_modes = 1,
871 .bpc = 8,
872 .size = {
873 .width = 95,
874 .height = 54,
875 },
Philipp Zabel33536a02015-02-11 18:50:07 +0100876 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +0100877};
878
Philipp Zabelab077252014-12-11 18:32:46 +0100879static const struct display_timing hannstar_hsd070pww1_timing = {
880 .pixelclock = { 64300000, 71100000, 82000000 },
881 .hactive = { 1280, 1280, 1280 },
882 .hfront_porch = { 1, 1, 10 },
883 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +0200884 /*
885 * According to the data sheet, the minimum horizontal blanking interval
886 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
887 * minimum working horizontal blanking interval to be 60 clocks.
888 */
889 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +0100890 .vactive = { 800, 800, 800 },
891 .vfront_porch = { 1, 1, 10 },
892 .vback_porch = { 1, 1, 10 },
893 .vsync_len = { 1, 21, 203 },
894 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +0200895};
896
897static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +0100898 .timings = &hannstar_hsd070pww1_timing,
899 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +0200900 .bpc = 6,
901 .size = {
902 .width = 151,
903 .height = 94,
904 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +0200905 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Philipp Zabela8532052014-10-23 16:31:06 +0200906};
907
Eric Nelsonc0d607e2015-04-13 15:09:26 -0700908static const struct display_timing hannstar_hsd100pxn1_timing = {
909 .pixelclock = { 55000000, 65000000, 75000000 },
910 .hactive = { 1024, 1024, 1024 },
911 .hfront_porch = { 40, 40, 40 },
912 .hback_porch = { 220, 220, 220 },
913 .hsync_len = { 20, 60, 100 },
914 .vactive = { 768, 768, 768 },
915 .vfront_porch = { 7, 7, 7 },
916 .vback_porch = { 21, 21, 21 },
917 .vsync_len = { 10, 10, 10 },
918 .flags = DISPLAY_FLAGS_DE_HIGH,
919};
920
921static const struct panel_desc hannstar_hsd100pxn1 = {
922 .timings = &hannstar_hsd100pxn1_timing,
923 .num_timings = 1,
924 .bpc = 6,
925 .size = {
926 .width = 203,
927 .height = 152,
928 },
Philipp Zabel4946b042015-05-20 11:34:08 +0200929 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Eric Nelsonc0d607e2015-04-13 15:09:26 -0700930};
931
Lucas Stach61ac0bf2014-11-06 17:44:35 +0100932static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
933 .clock = 33333,
934 .hdisplay = 800,
935 .hsync_start = 800 + 85,
936 .hsync_end = 800 + 85 + 86,
937 .htotal = 800 + 85 + 86 + 85,
938 .vdisplay = 480,
939 .vsync_start = 480 + 16,
940 .vsync_end = 480 + 16 + 13,
941 .vtotal = 480 + 16 + 13 + 16,
942 .vrefresh = 60,
943};
944
945static const struct panel_desc hitachi_tx23d38vm0caa = {
946 .modes = &hitachi_tx23d38vm0caa_mode,
947 .num_modes = 1,
948 .bpc = 6,
949 .size = {
950 .width = 195,
951 .height = 117,
952 },
953};
954
Nicolas Ferre41bcceb2015-03-19 14:43:01 +0100955static const struct drm_display_mode innolux_at043tn24_mode = {
956 .clock = 9000,
957 .hdisplay = 480,
958 .hsync_start = 480 + 2,
959 .hsync_end = 480 + 2 + 41,
960 .htotal = 480 + 2 + 41 + 2,
961 .vdisplay = 272,
962 .vsync_start = 272 + 2,
963 .vsync_end = 272 + 2 + 11,
964 .vtotal = 272 + 2 + 11 + 2,
965 .vrefresh = 60,
966 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
967};
968
969static const struct panel_desc innolux_at043tn24 = {
970 .modes = &innolux_at043tn24_mode,
971 .num_modes = 1,
972 .bpc = 8,
973 .size = {
974 .width = 95,
975 .height = 54,
976 },
977 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
978};
979
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +0200980static const struct drm_display_mode innolux_at070tn92_mode = {
981 .clock = 33333,
982 .hdisplay = 800,
983 .hsync_start = 800 + 210,
984 .hsync_end = 800 + 210 + 20,
985 .htotal = 800 + 210 + 20 + 46,
986 .vdisplay = 480,
987 .vsync_start = 480 + 22,
988 .vsync_end = 480 + 22 + 10,
989 .vtotal = 480 + 22 + 23 + 10,
990 .vrefresh = 60,
991};
992
993static const struct panel_desc innolux_at070tn92 = {
994 .modes = &innolux_at070tn92_mode,
995 .num_modes = 1,
996 .size = {
997 .width = 154,
998 .height = 86,
999 },
1000 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1001};
1002
Michael Olbrich1e29b842016-08-15 14:32:02 +02001003static const struct display_timing innolux_g101ice_l01_timing = {
1004 .pixelclock = { 60400000, 71100000, 74700000 },
1005 .hactive = { 1280, 1280, 1280 },
1006 .hfront_porch = { 41, 80, 100 },
1007 .hback_porch = { 40, 79, 99 },
1008 .hsync_len = { 1, 1, 1 },
1009 .vactive = { 800, 800, 800 },
1010 .vfront_porch = { 5, 11, 14 },
1011 .vback_porch = { 4, 11, 14 },
1012 .vsync_len = { 1, 1, 1 },
1013 .flags = DISPLAY_FLAGS_DE_HIGH,
1014};
1015
1016static const struct panel_desc innolux_g101ice_l01 = {
1017 .timings = &innolux_g101ice_l01_timing,
1018 .num_timings = 1,
1019 .bpc = 8,
1020 .size = {
1021 .width = 217,
1022 .height = 135,
1023 },
1024 .delay = {
1025 .enable = 200,
1026 .disable = 200,
1027 },
1028 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1029};
1030
Lucas Stach4ae13e42016-11-30 14:09:54 +01001031static const struct display_timing innolux_g121i1_l01_timing = {
1032 .pixelclock = { 67450000, 71000000, 74550000 },
1033 .hactive = { 1280, 1280, 1280 },
1034 .hfront_porch = { 40, 80, 160 },
1035 .hback_porch = { 39, 79, 159 },
1036 .hsync_len = { 1, 1, 1 },
1037 .vactive = { 800, 800, 800 },
1038 .vfront_porch = { 5, 11, 100 },
1039 .vback_porch = { 4, 11, 99 },
1040 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01001041};
1042
1043static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01001044 .timings = &innolux_g121i1_l01_timing,
1045 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01001046 .bpc = 6,
1047 .size = {
1048 .width = 261,
1049 .height = 163,
1050 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01001051 .delay = {
1052 .enable = 200,
1053 .disable = 20,
1054 },
1055 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Lucas Stachd731f662014-11-06 17:44:33 +01001056};
1057
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001058static const struct drm_display_mode innolux_g121x1_l03_mode = {
1059 .clock = 65000,
1060 .hdisplay = 1024,
1061 .hsync_start = 1024 + 0,
1062 .hsync_end = 1024 + 1,
1063 .htotal = 1024 + 0 + 1 + 320,
1064 .vdisplay = 768,
1065 .vsync_start = 768 + 38,
1066 .vsync_end = 768 + 38 + 1,
1067 .vtotal = 768 + 38 + 1 + 0,
1068 .vrefresh = 60,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05001069 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001070};
1071
1072static const struct panel_desc innolux_g121x1_l03 = {
1073 .modes = &innolux_g121x1_l03_mode,
1074 .num_modes = 1,
1075 .bpc = 6,
1076 .size = {
1077 .width = 246,
1078 .height = 185,
1079 },
1080 .delay = {
1081 .enable = 200,
1082 .unprepare = 200,
1083 .disable = 400,
1084 },
1085};
1086
Thierry Reding0a2288c2014-07-03 14:02:59 +02001087static const struct drm_display_mode innolux_n116bge_mode = {
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001088 .clock = 76420,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001089 .hdisplay = 1366,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001090 .hsync_start = 1366 + 136,
1091 .hsync_end = 1366 + 136 + 30,
1092 .htotal = 1366 + 136 + 30 + 60,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001093 .vdisplay = 768,
1094 .vsync_start = 768 + 8,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001095 .vsync_end = 768 + 8 + 12,
1096 .vtotal = 768 + 8 + 12 + 12,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001097 .vrefresh = 60,
1098 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1099};
1100
1101static const struct panel_desc innolux_n116bge = {
1102 .modes = &innolux_n116bge_mode,
1103 .num_modes = 1,
1104 .bpc = 6,
1105 .size = {
1106 .width = 256,
1107 .height = 144,
1108 },
1109};
1110
Alban Bedelea447392014-07-22 08:38:55 +02001111static const struct drm_display_mode innolux_n156bge_l21_mode = {
1112 .clock = 69300,
1113 .hdisplay = 1366,
1114 .hsync_start = 1366 + 16,
1115 .hsync_end = 1366 + 16 + 34,
1116 .htotal = 1366 + 16 + 34 + 50,
1117 .vdisplay = 768,
1118 .vsync_start = 768 + 2,
1119 .vsync_end = 768 + 2 + 6,
1120 .vtotal = 768 + 2 + 6 + 12,
1121 .vrefresh = 60,
1122};
1123
1124static const struct panel_desc innolux_n156bge_l21 = {
1125 .modes = &innolux_n156bge_l21_mode,
1126 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001127 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02001128 .size = {
1129 .width = 344,
1130 .height = 193,
1131 },
1132};
1133
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001134static const struct drm_display_mode innolux_zj070na_01p_mode = {
1135 .clock = 51501,
1136 .hdisplay = 1024,
1137 .hsync_start = 1024 + 128,
1138 .hsync_end = 1024 + 128 + 64,
1139 .htotal = 1024 + 128 + 64 + 128,
1140 .vdisplay = 600,
1141 .vsync_start = 600 + 16,
1142 .vsync_end = 600 + 16 + 4,
1143 .vtotal = 600 + 16 + 4 + 16,
1144 .vrefresh = 60,
1145};
1146
1147static const struct panel_desc innolux_zj070na_01p = {
1148 .modes = &innolux_zj070na_01p_mode,
1149 .num_modes = 1,
1150 .bpc = 6,
1151 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001152 .width = 154,
1153 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001154 },
1155};
1156
Lucas Stach8def22e2015-12-02 19:41:11 +01001157static const struct display_timing kyo_tcg121xglp_timing = {
1158 .pixelclock = { 52000000, 65000000, 71000000 },
1159 .hactive = { 1024, 1024, 1024 },
1160 .hfront_porch = { 2, 2, 2 },
1161 .hback_porch = { 2, 2, 2 },
1162 .hsync_len = { 86, 124, 244 },
1163 .vactive = { 768, 768, 768 },
1164 .vfront_porch = { 2, 2, 2 },
1165 .vback_porch = { 2, 2, 2 },
1166 .vsync_len = { 6, 34, 73 },
1167 .flags = DISPLAY_FLAGS_DE_HIGH,
1168};
1169
1170static const struct panel_desc kyo_tcg121xglp = {
1171 .timings = &kyo_tcg121xglp_timing,
1172 .num_timings = 1,
1173 .bpc = 8,
1174 .size = {
1175 .width = 246,
1176 .height = 184,
1177 },
1178 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1179};
1180
Heiko Schocherdd015002015-05-22 10:25:57 +02001181static const struct drm_display_mode lg_lb070wv8_mode = {
1182 .clock = 33246,
1183 .hdisplay = 800,
1184 .hsync_start = 800 + 88,
1185 .hsync_end = 800 + 88 + 80,
1186 .htotal = 800 + 88 + 80 + 88,
1187 .vdisplay = 480,
1188 .vsync_start = 480 + 10,
1189 .vsync_end = 480 + 10 + 25,
1190 .vtotal = 480 + 10 + 25 + 10,
1191 .vrefresh = 60,
1192};
1193
1194static const struct panel_desc lg_lb070wv8 = {
1195 .modes = &lg_lb070wv8_mode,
1196 .num_modes = 1,
1197 .bpc = 16,
1198 .size = {
1199 .width = 151,
1200 .height = 91,
1201 },
1202 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1203};
1204
Yakir Yangc5ece402016-06-28 12:51:15 +08001205static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1206 .clock = 200000,
1207 .hdisplay = 1536,
1208 .hsync_start = 1536 + 12,
1209 .hsync_end = 1536 + 12 + 16,
1210 .htotal = 1536 + 12 + 16 + 48,
1211 .vdisplay = 2048,
1212 .vsync_start = 2048 + 8,
1213 .vsync_end = 2048 + 8 + 4,
1214 .vtotal = 2048 + 8 + 4 + 8,
1215 .vrefresh = 60,
1216 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1217};
1218
1219static const struct panel_desc lg_lp079qx1_sp0v = {
1220 .modes = &lg_lp079qx1_sp0v_mode,
1221 .num_modes = 1,
1222 .size = {
1223 .width = 129,
1224 .height = 171,
1225 },
1226};
1227
Yakir Yang0355dde2016-06-12 10:56:02 +08001228static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1229 .clock = 205210,
1230 .hdisplay = 2048,
1231 .hsync_start = 2048 + 150,
1232 .hsync_end = 2048 + 150 + 5,
1233 .htotal = 2048 + 150 + 5 + 5,
1234 .vdisplay = 1536,
1235 .vsync_start = 1536 + 3,
1236 .vsync_end = 1536 + 3 + 1,
1237 .vtotal = 1536 + 3 + 1 + 9,
1238 .vrefresh = 60,
1239};
1240
1241static const struct panel_desc lg_lp097qx1_spa1 = {
1242 .modes = &lg_lp097qx1_spa1_mode,
1243 .num_modes = 1,
1244 .size = {
1245 .width = 208,
1246 .height = 147,
1247 },
1248};
1249
Jitao Shi690d8fa2016-02-22 19:01:44 +08001250static const struct drm_display_mode lg_lp120up1_mode = {
1251 .clock = 162300,
1252 .hdisplay = 1920,
1253 .hsync_start = 1920 + 40,
1254 .hsync_end = 1920 + 40 + 40,
1255 .htotal = 1920 + 40 + 40+ 80,
1256 .vdisplay = 1280,
1257 .vsync_start = 1280 + 4,
1258 .vsync_end = 1280 + 4 + 4,
1259 .vtotal = 1280 + 4 + 4 + 12,
1260 .vrefresh = 60,
1261};
1262
1263static const struct panel_desc lg_lp120up1 = {
1264 .modes = &lg_lp120up1_mode,
1265 .num_modes = 1,
1266 .bpc = 8,
1267 .size = {
1268 .width = 267,
1269 .height = 183,
1270 },
1271};
1272
Thierry Redingec7c5652013-11-15 15:59:32 +01001273static const struct drm_display_mode lg_lp129qe_mode = {
1274 .clock = 285250,
1275 .hdisplay = 2560,
1276 .hsync_start = 2560 + 48,
1277 .hsync_end = 2560 + 48 + 32,
1278 .htotal = 2560 + 48 + 32 + 80,
1279 .vdisplay = 1700,
1280 .vsync_start = 1700 + 3,
1281 .vsync_end = 1700 + 3 + 10,
1282 .vtotal = 1700 + 3 + 10 + 36,
1283 .vrefresh = 60,
1284};
1285
1286static const struct panel_desc lg_lp129qe = {
1287 .modes = &lg_lp129qe_mode,
1288 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001289 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01001290 .size = {
1291 .width = 272,
1292 .height = 181,
1293 },
1294};
1295
jianwei wangc6e87f92015-07-29 16:30:02 +08001296static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
1297 .clock = 10870,
1298 .hdisplay = 480,
1299 .hsync_start = 480 + 2,
1300 .hsync_end = 480 + 2 + 41,
1301 .htotal = 480 + 2 + 41 + 2,
1302 .vdisplay = 272,
1303 .vsync_start = 272 + 2,
1304 .vsync_end = 272 + 2 + 4,
1305 .vtotal = 272 + 2 + 4 + 2,
1306 .vrefresh = 74,
Stefan Agner4bc390c2015-11-17 19:10:29 -08001307 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08001308};
1309
1310static const struct panel_desc nec_nl4827hc19_05b = {
1311 .modes = &nec_nl4827hc19_05b_mode,
1312 .num_modes = 1,
1313 .bpc = 8,
1314 .size = {
1315 .width = 95,
1316 .height = 54,
1317 },
Stefan Agner2c806612016-02-08 12:50:13 -08001318 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1319 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08001320};
1321
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02001322static const struct drm_display_mode nvd_9128_mode = {
1323 .clock = 29500,
1324 .hdisplay = 800,
1325 .hsync_start = 800 + 130,
1326 .hsync_end = 800 + 130 + 98,
1327 .htotal = 800 + 0 + 130 + 98,
1328 .vdisplay = 480,
1329 .vsync_start = 480 + 10,
1330 .vsync_end = 480 + 10 + 50,
1331 .vtotal = 480 + 0 + 10 + 50,
1332};
1333
1334static const struct panel_desc nvd_9128 = {
1335 .modes = &nvd_9128_mode,
1336 .num_modes = 1,
1337 .bpc = 8,
1338 .size = {
1339 .width = 156,
1340 .height = 88,
1341 },
1342 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1343};
1344
Gary Bissona99fb622015-06-10 18:44:23 +02001345static const struct display_timing okaya_rs800480t_7x0gp_timing = {
1346 .pixelclock = { 30000000, 30000000, 40000000 },
1347 .hactive = { 800, 800, 800 },
1348 .hfront_porch = { 40, 40, 40 },
1349 .hback_porch = { 40, 40, 40 },
1350 .hsync_len = { 1, 48, 48 },
1351 .vactive = { 480, 480, 480 },
1352 .vfront_porch = { 13, 13, 13 },
1353 .vback_porch = { 29, 29, 29 },
1354 .vsync_len = { 3, 3, 3 },
1355 .flags = DISPLAY_FLAGS_DE_HIGH,
1356};
1357
1358static const struct panel_desc okaya_rs800480t_7x0gp = {
1359 .timings = &okaya_rs800480t_7x0gp_timing,
1360 .num_timings = 1,
1361 .bpc = 6,
1362 .size = {
1363 .width = 154,
1364 .height = 87,
1365 },
1366 .delay = {
1367 .prepare = 41,
1368 .enable = 50,
1369 .unprepare = 41,
1370 .disable = 50,
1371 },
1372 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1373};
1374
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001375static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
1376 .clock = 9000,
1377 .hdisplay = 480,
1378 .hsync_start = 480 + 5,
1379 .hsync_end = 480 + 5 + 30,
1380 .htotal = 480 + 5 + 30 + 10,
1381 .vdisplay = 272,
1382 .vsync_start = 272 + 8,
1383 .vsync_end = 272 + 8 + 5,
1384 .vtotal = 272 + 8 + 5 + 3,
1385 .vrefresh = 60,
1386};
1387
1388static const struct panel_desc olimex_lcd_olinuxino_43ts = {
1389 .modes = &olimex_lcd_olinuxino_43ts_mode,
1390 .num_modes = 1,
1391 .size = {
1392 .width = 105,
1393 .height = 67,
1394 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10001395 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001396};
1397
Eric Anholte8b6f562016-03-24 17:23:48 -07001398/*
1399 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1400 * pixel clocks, but this is the timing that was being used in the Adafruit
1401 * installation instructions.
1402 */
1403static const struct drm_display_mode ontat_yx700wv03_mode = {
1404 .clock = 29500,
1405 .hdisplay = 800,
1406 .hsync_start = 824,
1407 .hsync_end = 896,
1408 .htotal = 992,
1409 .vdisplay = 480,
1410 .vsync_start = 483,
1411 .vsync_end = 493,
1412 .vtotal = 500,
1413 .vrefresh = 60,
1414 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1415};
1416
1417/*
1418 * Specification at:
1419 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1420 */
1421static const struct panel_desc ontat_yx700wv03 = {
1422 .modes = &ontat_yx700wv03_mode,
1423 .num_modes = 1,
1424 .bpc = 8,
1425 .size = {
1426 .width = 154,
1427 .height = 83,
1428 },
1429 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1430};
1431
Philipp Zabel725c9d42015-02-11 18:50:11 +01001432static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
1433 .clock = 25000,
1434 .hdisplay = 480,
1435 .hsync_start = 480 + 10,
1436 .hsync_end = 480 + 10 + 10,
1437 .htotal = 480 + 10 + 10 + 15,
1438 .vdisplay = 800,
1439 .vsync_start = 800 + 3,
1440 .vsync_end = 800 + 3 + 3,
1441 .vtotal = 800 + 3 + 3 + 3,
1442 .vrefresh = 60,
1443};
1444
1445static const struct panel_desc ortustech_com43h4m85ulc = {
1446 .modes = &ortustech_com43h4m85ulc_mode,
1447 .num_modes = 1,
1448 .bpc = 8,
1449 .size = {
1450 .width = 56,
1451 .height = 93,
1452 },
1453 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Marek Vasute0932f92016-08-26 18:26:00 +02001454 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
Philipp Zabel725c9d42015-02-11 18:50:11 +01001455};
1456
Josh Wud2a6f0f2015-10-08 17:42:41 +02001457static const struct drm_display_mode qd43003c0_40_mode = {
1458 .clock = 9000,
1459 .hdisplay = 480,
1460 .hsync_start = 480 + 8,
1461 .hsync_end = 480 + 8 + 4,
1462 .htotal = 480 + 8 + 4 + 39,
1463 .vdisplay = 272,
1464 .vsync_start = 272 + 4,
1465 .vsync_end = 272 + 4 + 10,
1466 .vtotal = 272 + 4 + 10 + 2,
1467 .vrefresh = 60,
1468};
1469
1470static const struct panel_desc qd43003c0_40 = {
1471 .modes = &qd43003c0_40_mode,
1472 .num_modes = 1,
1473 .bpc = 8,
1474 .size = {
1475 .width = 95,
1476 .height = 53,
1477 },
1478 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1479};
1480
Yakir Yang0330eaf2016-06-12 10:56:13 +08001481static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
1482 .clock = 271560,
1483 .hdisplay = 2560,
1484 .hsync_start = 2560 + 48,
1485 .hsync_end = 2560 + 48 + 32,
1486 .htotal = 2560 + 48 + 32 + 80,
1487 .vdisplay = 1600,
1488 .vsync_start = 1600 + 2,
1489 .vsync_end = 1600 + 2 + 5,
1490 .vtotal = 1600 + 2 + 5 + 57,
1491 .vrefresh = 60,
1492};
1493
1494static const struct panel_desc samsung_lsn122dl01_c01 = {
1495 .modes = &samsung_lsn122dl01_c01_mode,
1496 .num_modes = 1,
1497 .size = {
1498 .width = 263,
1499 .height = 164,
1500 },
1501};
1502
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001503static const struct drm_display_mode samsung_ltn101nt05_mode = {
1504 .clock = 54030,
1505 .hdisplay = 1024,
1506 .hsync_start = 1024 + 24,
1507 .hsync_end = 1024 + 24 + 136,
1508 .htotal = 1024 + 24 + 136 + 160,
1509 .vdisplay = 600,
1510 .vsync_start = 600 + 3,
1511 .vsync_end = 600 + 3 + 6,
1512 .vtotal = 600 + 3 + 6 + 61,
1513 .vrefresh = 60,
1514};
1515
1516static const struct panel_desc samsung_ltn101nt05 = {
1517 .modes = &samsung_ltn101nt05_mode,
1518 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001519 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001520 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001521 .width = 223,
1522 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001523 },
1524};
1525
Stéphane Marchesin0c934302015-03-18 10:52:18 +01001526static const struct drm_display_mode samsung_ltn140at29_301_mode = {
1527 .clock = 76300,
1528 .hdisplay = 1366,
1529 .hsync_start = 1366 + 64,
1530 .hsync_end = 1366 + 64 + 48,
1531 .htotal = 1366 + 64 + 48 + 128,
1532 .vdisplay = 768,
1533 .vsync_start = 768 + 2,
1534 .vsync_end = 768 + 2 + 5,
1535 .vtotal = 768 + 2 + 5 + 17,
1536 .vrefresh = 60,
1537};
1538
1539static const struct panel_desc samsung_ltn140at29_301 = {
1540 .modes = &samsung_ltn140at29_301_mode,
1541 .num_modes = 1,
1542 .bpc = 6,
1543 .size = {
1544 .width = 320,
1545 .height = 187,
1546 },
1547};
1548
Joshua Clayton592aa022016-07-06 15:59:16 -07001549static const struct display_timing sharp_lq101k1ly04_timing = {
1550 .pixelclock = { 60000000, 65000000, 80000000 },
1551 .hactive = { 1280, 1280, 1280 },
1552 .hfront_porch = { 20, 20, 20 },
1553 .hback_porch = { 20, 20, 20 },
1554 .hsync_len = { 10, 10, 10 },
1555 .vactive = { 800, 800, 800 },
1556 .vfront_porch = { 4, 4, 4 },
1557 .vback_porch = { 4, 4, 4 },
1558 .vsync_len = { 4, 4, 4 },
1559 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
1560};
1561
1562static const struct panel_desc sharp_lq101k1ly04 = {
1563 .timings = &sharp_lq101k1ly04_timing,
1564 .num_timings = 1,
1565 .bpc = 8,
1566 .size = {
1567 .width = 217,
1568 .height = 136,
1569 },
1570 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
1571};
1572
Yakir Yang739c7de2016-06-12 10:56:35 +08001573static const struct drm_display_mode sharp_lq123p1jx31_mode = {
1574 .clock = 252750,
1575 .hdisplay = 2400,
1576 .hsync_start = 2400 + 48,
1577 .hsync_end = 2400 + 48 + 32,
1578 .htotal = 2400 + 48 + 32 + 80,
1579 .vdisplay = 1600,
1580 .vsync_start = 1600 + 3,
1581 .vsync_end = 1600 + 3 + 10,
1582 .vtotal = 1600 + 3 + 10 + 33,
1583 .vrefresh = 60,
1584 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1585};
1586
1587static const struct panel_desc sharp_lq123p1jx31 = {
1588 .modes = &sharp_lq123p1jx31_mode,
1589 .num_modes = 1,
zain wang5466a632016-11-19 10:27:16 +08001590 .bpc = 8,
Yakir Yang739c7de2016-06-12 10:56:35 +08001591 .size = {
1592 .width = 259,
1593 .height = 173,
1594 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08001595 .delay = {
1596 .prepare = 110,
1597 .enable = 50,
1598 .unprepare = 550,
1599 },
Yakir Yang739c7de2016-06-12 10:56:35 +08001600};
1601
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02001602static const struct drm_display_mode sharp_lq150x1lg11_mode = {
1603 .clock = 71100,
1604 .hdisplay = 1024,
1605 .hsync_start = 1024 + 168,
1606 .hsync_end = 1024 + 168 + 64,
1607 .htotal = 1024 + 168 + 64 + 88,
1608 .vdisplay = 768,
1609 .vsync_start = 768 + 37,
1610 .vsync_end = 768 + 37 + 2,
1611 .vtotal = 768 + 37 + 2 + 8,
1612 .vrefresh = 60,
1613};
1614
1615static const struct panel_desc sharp_lq150x1lg11 = {
1616 .modes = &sharp_lq150x1lg11_mode,
1617 .num_modes = 1,
1618 .bpc = 6,
1619 .size = {
1620 .width = 304,
1621 .height = 228,
1622 },
1623 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
1624};
1625
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01001626static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
1627 .clock = 33300,
1628 .hdisplay = 800,
1629 .hsync_start = 800 + 1,
1630 .hsync_end = 800 + 1 + 64,
1631 .htotal = 800 + 1 + 64 + 64,
1632 .vdisplay = 480,
1633 .vsync_start = 480 + 1,
1634 .vsync_end = 480 + 1 + 23,
1635 .vtotal = 480 + 1 + 23 + 22,
1636 .vrefresh = 60,
1637};
1638
1639static const struct panel_desc shelly_sca07010_bfn_lnn = {
1640 .modes = &shelly_sca07010_bfn_lnn_mode,
1641 .num_modes = 1,
1642 .size = {
1643 .width = 152,
1644 .height = 91,
1645 },
1646 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1647};
1648
Douglas Anderson9bb34c42016-06-10 10:02:07 -07001649static const struct drm_display_mode starry_kr122ea0sra_mode = {
1650 .clock = 147000,
1651 .hdisplay = 1920,
1652 .hsync_start = 1920 + 16,
1653 .hsync_end = 1920 + 16 + 16,
1654 .htotal = 1920 + 16 + 16 + 32,
1655 .vdisplay = 1200,
1656 .vsync_start = 1200 + 15,
1657 .vsync_end = 1200 + 15 + 2,
1658 .vtotal = 1200 + 15 + 2 + 18,
1659 .vrefresh = 60,
1660 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1661};
1662
1663static const struct panel_desc starry_kr122ea0sra = {
1664 .modes = &starry_kr122ea0sra_mode,
1665 .num_modes = 1,
1666 .size = {
1667 .width = 263,
1668 .height = 164,
1669 },
Brian Norrisc46b9242016-08-26 14:32:14 -07001670 .delay = {
1671 .prepare = 10 + 200,
1672 .enable = 50,
1673 .unprepare = 10 + 500,
1674 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07001675};
1676
Gary Bissonadb973e2016-12-02 09:52:08 +01001677static const struct display_timing tianma_tm070jdhg30_timing = {
1678 .pixelclock = { 62600000, 68200000, 78100000 },
1679 .hactive = { 1280, 1280, 1280 },
1680 .hfront_porch = { 15, 64, 159 },
1681 .hback_porch = { 5, 5, 5 },
1682 .hsync_len = { 1, 1, 256 },
1683 .vactive = { 800, 800, 800 },
1684 .vfront_porch = { 3, 40, 99 },
1685 .vback_porch = { 2, 2, 2 },
1686 .vsync_len = { 1, 1, 128 },
1687 .flags = DISPLAY_FLAGS_DE_HIGH,
1688};
1689
1690static const struct panel_desc tianma_tm070jdhg30 = {
1691 .timings = &tianma_tm070jdhg30_timing,
1692 .num_timings = 1,
1693 .bpc = 8,
1694 .size = {
1695 .width = 151,
1696 .height = 95,
1697 },
1698 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1699};
1700
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05301701static const struct drm_display_mode tpk_f07a_0102_mode = {
1702 .clock = 33260,
1703 .hdisplay = 800,
1704 .hsync_start = 800 + 40,
1705 .hsync_end = 800 + 40 + 128,
1706 .htotal = 800 + 40 + 128 + 88,
1707 .vdisplay = 480,
1708 .vsync_start = 480 + 10,
1709 .vsync_end = 480 + 10 + 2,
1710 .vtotal = 480 + 10 + 2 + 33,
1711 .vrefresh = 60,
1712};
1713
1714static const struct panel_desc tpk_f07a_0102 = {
1715 .modes = &tpk_f07a_0102_mode,
1716 .num_modes = 1,
1717 .size = {
1718 .width = 152,
1719 .height = 91,
1720 },
1721 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
1722};
1723
1724static const struct drm_display_mode tpk_f10a_0102_mode = {
1725 .clock = 45000,
1726 .hdisplay = 1024,
1727 .hsync_start = 1024 + 176,
1728 .hsync_end = 1024 + 176 + 5,
1729 .htotal = 1024 + 176 + 5 + 88,
1730 .vdisplay = 600,
1731 .vsync_start = 600 + 20,
1732 .vsync_end = 600 + 20 + 5,
1733 .vtotal = 600 + 20 + 5 + 25,
1734 .vrefresh = 60,
1735};
1736
1737static const struct panel_desc tpk_f10a_0102 = {
1738 .modes = &tpk_f10a_0102_mode,
1739 .num_modes = 1,
1740 .size = {
1741 .width = 223,
1742 .height = 125,
1743 },
1744};
1745
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01001746static const struct display_timing urt_umsh_8596md_timing = {
1747 .pixelclock = { 33260000, 33260000, 33260000 },
1748 .hactive = { 800, 800, 800 },
1749 .hfront_porch = { 41, 41, 41 },
1750 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
1751 .hsync_len = { 71, 128, 128 },
1752 .vactive = { 480, 480, 480 },
1753 .vfront_porch = { 10, 10, 10 },
1754 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
1755 .vsync_len = { 2, 2, 2 },
1756 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
1757 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
1758};
1759
1760static const struct panel_desc urt_umsh_8596md_lvds = {
1761 .timings = &urt_umsh_8596md_timing,
1762 .num_timings = 1,
1763 .bpc = 6,
1764 .size = {
1765 .width = 152,
1766 .height = 91,
1767 },
1768 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1769};
1770
1771static const struct panel_desc urt_umsh_8596md_parallel = {
1772 .timings = &urt_umsh_8596md_timing,
1773 .num_timings = 1,
1774 .bpc = 6,
1775 .size = {
1776 .width = 152,
1777 .height = 91,
1778 },
1779 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1780};
1781
Thierry Reding280921d2013-08-30 15:10:14 +02001782static const struct of_device_id platform_of_match[] = {
1783 {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01001784 .compatible = "ampire,am800480r3tmqwa1h",
1785 .data = &ampire_am800480r3tmqwa1h,
1786 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001787 .compatible = "auo,b101aw03",
1788 .data = &auo_b101aw03,
1789 }, {
Huang Lina531bc32015-02-28 10:18:58 +08001790 .compatible = "auo,b101ean01",
1791 .data = &auo_b101ean01,
1792 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04001793 .compatible = "auo,b101xtn01",
1794 .data = &auo_b101xtn01,
1795 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05301796 .compatible = "auo,b116xw03",
1797 .data = &auo_b116xw03,
1798 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05301799 .compatible = "auo,b133htn01",
1800 .data = &auo_b133htn01,
1801 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07001802 .compatible = "auo,b133xtn01",
1803 .data = &auo_b133xtn01,
1804 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01001805 .compatible = "auo,g133han01",
1806 .data = &auo_g133han01,
1807 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01001808 .compatible = "auo,g185han01",
1809 .data = &auo_g185han01,
1810 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07001811 .compatible = "auo,t215hvn01",
1812 .data = &auo_t215hvn01,
1813 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01001814 .compatible = "avic,tm070ddh03",
1815 .data = &avic_tm070ddh03,
1816 }, {
Caesar Wangcac1a412016-12-14 11:19:56 +08001817 .compatible = "boe,nv101wxmn51",
1818 .data = &boe_nv101wxmn51,
1819 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08001820 .compatible = "chunghwa,claa070wp03xg",
1821 .data = &chunghwa_claa070wp03xg,
1822 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07001823 .compatible = "chunghwa,claa101wa01a",
1824 .data = &chunghwa_claa101wa01a
1825 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001826 .compatible = "chunghwa,claa101wb01",
1827 .data = &chunghwa_claa101wb01
1828 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02001829 .compatible = "edt,et057090dhu",
1830 .data = &edt_et057090dhu,
1831 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02001832 .compatible = "edt,et070080dh6",
1833 .data = &edt_etm0700g0dh6,
1834 }, {
1835 .compatible = "edt,etm0700g0dh6",
1836 .data = &edt_etm0700g0dh6,
1837 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02001838 .compatible = "foxlink,fl500wvr00-a0t",
1839 .data = &foxlink_fl500wvr00_a0t,
1840 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001841 .compatible = "giantplus,gpg482739qs5",
1842 .data = &giantplus_gpg482739qs5
1843 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02001844 .compatible = "hannstar,hsd070pww1",
1845 .data = &hannstar_hsd070pww1,
1846 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001847 .compatible = "hannstar,hsd100pxn1",
1848 .data = &hannstar_hsd100pxn1,
1849 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001850 .compatible = "hit,tx23d38vm0caa",
1851 .data = &hitachi_tx23d38vm0caa
1852 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001853 .compatible = "innolux,at043tn24",
1854 .data = &innolux_at043tn24,
1855 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02001856 .compatible = "innolux,at070tn92",
1857 .data = &innolux_at070tn92,
1858 }, {
Michael Olbrich1e29b842016-08-15 14:32:02 +02001859 .compatible ="innolux,g101ice-l01",
1860 .data = &innolux_g101ice_l01
1861 }, {
Lucas Stachd731f662014-11-06 17:44:33 +01001862 .compatible ="innolux,g121i1-l01",
1863 .data = &innolux_g121i1_l01
1864 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001865 .compatible = "innolux,g121x1-l03",
1866 .data = &innolux_g121x1_l03,
1867 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02001868 .compatible = "innolux,n116bge",
1869 .data = &innolux_n116bge,
1870 }, {
Alban Bedelea447392014-07-22 08:38:55 +02001871 .compatible = "innolux,n156bge-l21",
1872 .data = &innolux_n156bge_l21,
1873 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001874 .compatible = "innolux,zj070na-01p",
1875 .data = &innolux_zj070na_01p,
1876 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01001877 .compatible = "kyo,tcg121xglp",
1878 .data = &kyo_tcg121xglp,
1879 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02001880 .compatible = "lg,lb070wv8",
1881 .data = &lg_lb070wv8,
1882 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08001883 .compatible = "lg,lp079qx1-sp0v",
1884 .data = &lg_lp079qx1_sp0v,
1885 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08001886 .compatible = "lg,lp097qx1-spa1",
1887 .data = &lg_lp097qx1_spa1,
1888 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08001889 .compatible = "lg,lp120up1",
1890 .data = &lg_lp120up1,
1891 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01001892 .compatible = "lg,lp129qe",
1893 .data = &lg_lp129qe,
1894 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08001895 .compatible = "nec,nl4827hc19-05b",
1896 .data = &nec_nl4827hc19_05b,
1897 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02001898 .compatible = "nvd,9128",
1899 .data = &nvd_9128,
1900 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02001901 .compatible = "okaya,rs800480t-7x0gp",
1902 .data = &okaya_rs800480t_7x0gp,
1903 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001904 .compatible = "olimex,lcd-olinuxino-43-ts",
1905 .data = &olimex_lcd_olinuxino_43ts,
1906 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07001907 .compatible = "ontat,yx700wv03",
1908 .data = &ontat_yx700wv03,
1909 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01001910 .compatible = "ortustech,com43h4m85ulc",
1911 .data = &ortustech_com43h4m85ulc,
1912 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02001913 .compatible = "qiaodian,qd43003c0-40",
1914 .data = &qd43003c0_40,
1915 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08001916 .compatible = "samsung,lsn122dl01-c01",
1917 .data = &samsung_lsn122dl01_c01,
1918 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001919 .compatible = "samsung,ltn101nt05",
1920 .data = &samsung_ltn101nt05,
1921 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01001922 .compatible = "samsung,ltn140at29-301",
1923 .data = &samsung_ltn140at29_301,
1924 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07001925 .compatible = "sharp,lq101k1ly04",
1926 .data = &sharp_lq101k1ly04,
1927 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08001928 .compatible = "sharp,lq123p1jx31",
1929 .data = &sharp_lq123p1jx31,
1930 }, {
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02001931 .compatible = "sharp,lq150x1lg11",
1932 .data = &sharp_lq150x1lg11,
1933 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01001934 .compatible = "shelly,sca07010-bfn-lnn",
1935 .data = &shelly_sca07010_bfn_lnn,
1936 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07001937 .compatible = "starry,kr122ea0sra",
1938 .data = &starry_kr122ea0sra,
1939 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01001940 .compatible = "tianma,tm070jdhg30",
1941 .data = &tianma_tm070jdhg30,
1942 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05301943 .compatible = "tpk,f07a-0102",
1944 .data = &tpk_f07a_0102,
1945 }, {
1946 .compatible = "tpk,f10a-0102",
1947 .data = &tpk_f10a_0102,
1948 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01001949 .compatible = "urt,umsh-8596md-t",
1950 .data = &urt_umsh_8596md_parallel,
1951 }, {
1952 .compatible = "urt,umsh-8596md-1t",
1953 .data = &urt_umsh_8596md_parallel,
1954 }, {
1955 .compatible = "urt,umsh-8596md-7t",
1956 .data = &urt_umsh_8596md_parallel,
1957 }, {
1958 .compatible = "urt,umsh-8596md-11t",
1959 .data = &urt_umsh_8596md_lvds,
1960 }, {
1961 .compatible = "urt,umsh-8596md-19t",
1962 .data = &urt_umsh_8596md_lvds,
1963 }, {
1964 .compatible = "urt,umsh-8596md-20t",
1965 .data = &urt_umsh_8596md_parallel,
1966 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001967 /* sentinel */
1968 }
1969};
1970MODULE_DEVICE_TABLE(of, platform_of_match);
1971
1972static int panel_simple_platform_probe(struct platform_device *pdev)
1973{
1974 const struct of_device_id *id;
1975
1976 id = of_match_node(platform_of_match, pdev->dev.of_node);
1977 if (!id)
1978 return -ENODEV;
1979
1980 return panel_simple_probe(&pdev->dev, id->data);
1981}
1982
1983static int panel_simple_platform_remove(struct platform_device *pdev)
1984{
1985 return panel_simple_remove(&pdev->dev);
1986}
1987
Thierry Redingd02fd932014-04-29 17:21:21 +02001988static void panel_simple_platform_shutdown(struct platform_device *pdev)
1989{
1990 panel_simple_shutdown(&pdev->dev);
1991}
1992
Thierry Reding280921d2013-08-30 15:10:14 +02001993static struct platform_driver panel_simple_platform_driver = {
1994 .driver = {
1995 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02001996 .of_match_table = platform_of_match,
1997 },
1998 .probe = panel_simple_platform_probe,
1999 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002000 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002001};
2002
Thierry Reding210fcd92013-11-22 19:27:11 +01002003struct panel_desc_dsi {
2004 struct panel_desc desc;
2005
Thierry Reding462658b2014-03-14 11:24:57 +01002006 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01002007 enum mipi_dsi_pixel_format format;
2008 unsigned int lanes;
2009};
2010
Thierry Redingd718d792015-04-08 16:52:33 +02002011static const struct drm_display_mode auo_b080uan01_mode = {
2012 .clock = 154500,
2013 .hdisplay = 1200,
2014 .hsync_start = 1200 + 62,
2015 .hsync_end = 1200 + 62 + 4,
2016 .htotal = 1200 + 62 + 4 + 62,
2017 .vdisplay = 1920,
2018 .vsync_start = 1920 + 9,
2019 .vsync_end = 1920 + 9 + 2,
2020 .vtotal = 1920 + 9 + 2 + 8,
2021 .vrefresh = 60,
2022};
2023
2024static const struct panel_desc_dsi auo_b080uan01 = {
2025 .desc = {
2026 .modes = &auo_b080uan01_mode,
2027 .num_modes = 1,
2028 .bpc = 8,
2029 .size = {
2030 .width = 108,
2031 .height = 272,
2032 },
2033 },
2034 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2035 .format = MIPI_DSI_FMT_RGB888,
2036 .lanes = 4,
2037};
2038
Chris Zhongc8521962015-11-20 16:15:37 +08002039static const struct drm_display_mode boe_tv080wum_nl0_mode = {
2040 .clock = 160000,
2041 .hdisplay = 1200,
2042 .hsync_start = 1200 + 120,
2043 .hsync_end = 1200 + 120 + 20,
2044 .htotal = 1200 + 120 + 20 + 21,
2045 .vdisplay = 1920,
2046 .vsync_start = 1920 + 21,
2047 .vsync_end = 1920 + 21 + 3,
2048 .vtotal = 1920 + 21 + 3 + 18,
2049 .vrefresh = 60,
2050 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2051};
2052
2053static const struct panel_desc_dsi boe_tv080wum_nl0 = {
2054 .desc = {
2055 .modes = &boe_tv080wum_nl0_mode,
2056 .num_modes = 1,
2057 .size = {
2058 .width = 107,
2059 .height = 172,
2060 },
2061 },
2062 .flags = MIPI_DSI_MODE_VIDEO |
2063 MIPI_DSI_MODE_VIDEO_BURST |
2064 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
2065 .format = MIPI_DSI_FMT_RGB888,
2066 .lanes = 4,
2067};
2068
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002069static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
2070 .clock = 71000,
2071 .hdisplay = 800,
2072 .hsync_start = 800 + 32,
2073 .hsync_end = 800 + 32 + 1,
2074 .htotal = 800 + 32 + 1 + 57,
2075 .vdisplay = 1280,
2076 .vsync_start = 1280 + 28,
2077 .vsync_end = 1280 + 28 + 1,
2078 .vtotal = 1280 + 28 + 1 + 14,
2079 .vrefresh = 60,
2080};
2081
2082static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
2083 .desc = {
2084 .modes = &lg_ld070wx3_sl01_mode,
2085 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002086 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002087 .size = {
2088 .width = 94,
2089 .height = 151,
2090 },
2091 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09002092 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002093 .format = MIPI_DSI_FMT_RGB888,
2094 .lanes = 4,
2095};
2096
Alexandre Courbot499ce852014-01-21 18:57:09 +09002097static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
2098 .clock = 67000,
2099 .hdisplay = 720,
2100 .hsync_start = 720 + 12,
2101 .hsync_end = 720 + 12 + 4,
2102 .htotal = 720 + 12 + 4 + 112,
2103 .vdisplay = 1280,
2104 .vsync_start = 1280 + 8,
2105 .vsync_end = 1280 + 8 + 4,
2106 .vtotal = 1280 + 8 + 4 + 12,
2107 .vrefresh = 60,
2108};
2109
2110static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
2111 .desc = {
2112 .modes = &lg_lh500wx1_sd03_mode,
2113 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002114 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09002115 .size = {
2116 .width = 62,
2117 .height = 110,
2118 },
2119 },
2120 .flags = MIPI_DSI_MODE_VIDEO,
2121 .format = MIPI_DSI_FMT_RGB888,
2122 .lanes = 4,
2123};
2124
Thierry Reding280921d2013-08-30 15:10:14 +02002125static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
2126 .clock = 157200,
2127 .hdisplay = 1920,
2128 .hsync_start = 1920 + 154,
2129 .hsync_end = 1920 + 154 + 16,
2130 .htotal = 1920 + 154 + 16 + 32,
2131 .vdisplay = 1200,
2132 .vsync_start = 1200 + 17,
2133 .vsync_end = 1200 + 17 + 2,
2134 .vtotal = 1200 + 17 + 2 + 16,
2135 .vrefresh = 60,
2136};
2137
Thierry Reding210fcd92013-11-22 19:27:11 +01002138static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
2139 .desc = {
2140 .modes = &panasonic_vvx10f004b00_mode,
2141 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002142 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01002143 .size = {
2144 .width = 217,
2145 .height = 136,
2146 },
Thierry Reding280921d2013-08-30 15:10:14 +02002147 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09002148 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
2149 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01002150 .format = MIPI_DSI_FMT_RGB888,
2151 .lanes = 4,
2152};
2153
2154static const struct of_device_id dsi_of_match[] = {
2155 {
Thierry Redingd718d792015-04-08 16:52:33 +02002156 .compatible = "auo,b080uan01",
2157 .data = &auo_b080uan01
2158 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08002159 .compatible = "boe,tv080wum-nl0",
2160 .data = &boe_tv080wum_nl0
2161 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002162 .compatible = "lg,ld070wx3-sl01",
2163 .data = &lg_ld070wx3_sl01
2164 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09002165 .compatible = "lg,lh500wx1-sd03",
2166 .data = &lg_lh500wx1_sd03
2167 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01002168 .compatible = "panasonic,vvx10f004b00",
2169 .data = &panasonic_vvx10f004b00
2170 }, {
2171 /* sentinel */
2172 }
2173};
2174MODULE_DEVICE_TABLE(of, dsi_of_match);
2175
2176static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
2177{
2178 const struct panel_desc_dsi *desc;
2179 const struct of_device_id *id;
2180 int err;
2181
2182 id = of_match_node(dsi_of_match, dsi->dev.of_node);
2183 if (!id)
2184 return -ENODEV;
2185
2186 desc = id->data;
2187
2188 err = panel_simple_probe(&dsi->dev, &desc->desc);
2189 if (err < 0)
2190 return err;
2191
Thierry Reding462658b2014-03-14 11:24:57 +01002192 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01002193 dsi->format = desc->format;
2194 dsi->lanes = desc->lanes;
2195
2196 return mipi_dsi_attach(dsi);
2197}
2198
2199static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
2200{
2201 int err;
2202
2203 err = mipi_dsi_detach(dsi);
2204 if (err < 0)
2205 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
2206
2207 return panel_simple_remove(&dsi->dev);
2208}
2209
Thierry Redingd02fd932014-04-29 17:21:21 +02002210static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
2211{
2212 panel_simple_shutdown(&dsi->dev);
2213}
2214
Thierry Reding210fcd92013-11-22 19:27:11 +01002215static struct mipi_dsi_driver panel_simple_dsi_driver = {
2216 .driver = {
2217 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01002218 .of_match_table = dsi_of_match,
2219 },
2220 .probe = panel_simple_dsi_probe,
2221 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002222 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002223};
2224
2225static int __init panel_simple_init(void)
2226{
Thierry Reding210fcd92013-11-22 19:27:11 +01002227 int err;
2228
2229 err = platform_driver_register(&panel_simple_platform_driver);
2230 if (err < 0)
2231 return err;
2232
2233 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
2234 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
2235 if (err < 0)
2236 return err;
2237 }
2238
2239 return 0;
Thierry Reding280921d2013-08-30 15:10:14 +02002240}
2241module_init(panel_simple_init);
2242
2243static void __exit panel_simple_exit(void)
2244{
Thierry Reding210fcd92013-11-22 19:27:11 +01002245 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
2246 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
2247
Thierry Reding280921d2013-08-30 15:10:14 +02002248 platform_driver_unregister(&panel_simple_platform_driver);
2249}
2250module_exit(panel_simple_exit);
2251
2252MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
2253MODULE_DESCRIPTION("DRM Driver for Simple Panels");
2254MODULE_LICENSE("GPL and additional rights");