blob: f503d12b39309dec7c98c959bf8ed5e52bdf83a3 [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
Philipp Zabeld47df632014-12-18 16:43:43 +0100558static const struct drm_display_mode avic_tm070ddh03_mode = {
559 .clock = 51200,
560 .hdisplay = 1024,
561 .hsync_start = 1024 + 160,
562 .hsync_end = 1024 + 160 + 4,
563 .htotal = 1024 + 160 + 4 + 156,
564 .vdisplay = 600,
565 .vsync_start = 600 + 17,
566 .vsync_end = 600 + 17 + 1,
567 .vtotal = 600 + 17 + 1 + 17,
568 .vrefresh = 60,
569};
570
571static const struct panel_desc avic_tm070ddh03 = {
572 .modes = &avic_tm070ddh03_mode,
573 .num_modes = 1,
574 .bpc = 8,
575 .size = {
576 .width = 154,
577 .height = 90,
578 },
579 .delay = {
580 .prepare = 20,
581 .enable = 200,
582 .disable = 200,
583 },
584};
585
Stephen Warren4c930752014-01-07 16:46:26 -0700586static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
587 .clock = 72070,
588 .hdisplay = 1366,
589 .hsync_start = 1366 + 58,
590 .hsync_end = 1366 + 58 + 58,
591 .htotal = 1366 + 58 + 58 + 58,
592 .vdisplay = 768,
593 .vsync_start = 768 + 4,
594 .vsync_end = 768 + 4 + 4,
595 .vtotal = 768 + 4 + 4 + 4,
596 .vrefresh = 60,
597};
598
599static const struct panel_desc chunghwa_claa101wa01a = {
600 .modes = &chunghwa_claa101wa01a_mode,
601 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700602 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -0700603 .size = {
604 .width = 220,
605 .height = 120,
606 },
607};
608
Thierry Reding280921d2013-08-30 15:10:14 +0200609static const struct drm_display_mode chunghwa_claa101wb01_mode = {
610 .clock = 69300,
611 .hdisplay = 1366,
612 .hsync_start = 1366 + 48,
613 .hsync_end = 1366 + 48 + 32,
614 .htotal = 1366 + 48 + 32 + 20,
615 .vdisplay = 768,
616 .vsync_start = 768 + 16,
617 .vsync_end = 768 + 16 + 8,
618 .vtotal = 768 + 16 + 8 + 16,
619 .vrefresh = 60,
620};
621
622static const struct panel_desc chunghwa_claa101wb01 = {
623 .modes = &chunghwa_claa101wb01_mode,
624 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700625 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200626 .size = {
627 .width = 223,
628 .height = 125,
629 },
630};
631
Stefan Agner26ab0062014-05-15 11:38:45 +0200632static const struct drm_display_mode edt_et057090dhu_mode = {
633 .clock = 25175,
634 .hdisplay = 640,
635 .hsync_start = 640 + 16,
636 .hsync_end = 640 + 16 + 30,
637 .htotal = 640 + 16 + 30 + 114,
638 .vdisplay = 480,
639 .vsync_start = 480 + 10,
640 .vsync_end = 480 + 10 + 3,
641 .vtotal = 480 + 10 + 3 + 32,
642 .vrefresh = 60,
643 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
644};
645
646static const struct panel_desc edt_et057090dhu = {
647 .modes = &edt_et057090dhu_mode,
648 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700649 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +0200650 .size = {
651 .width = 115,
652 .height = 86,
653 },
654};
655
Philipp Zabelfff5de42014-05-15 12:25:47 +0200656static const struct drm_display_mode edt_etm0700g0dh6_mode = {
657 .clock = 33260,
658 .hdisplay = 800,
659 .hsync_start = 800 + 40,
660 .hsync_end = 800 + 40 + 128,
661 .htotal = 800 + 40 + 128 + 88,
662 .vdisplay = 480,
663 .vsync_start = 480 + 10,
664 .vsync_end = 480 + 10 + 2,
665 .vtotal = 480 + 10 + 2 + 33,
666 .vrefresh = 60,
667 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
668};
669
670static const struct panel_desc edt_etm0700g0dh6 = {
671 .modes = &edt_etm0700g0dh6_mode,
672 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700673 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +0200674 .size = {
675 .width = 152,
676 .height = 91,
677 },
678};
679
Boris BREZILLON102932b2014-06-05 15:53:32 +0200680static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
681 .clock = 32260,
682 .hdisplay = 800,
683 .hsync_start = 800 + 168,
684 .hsync_end = 800 + 168 + 64,
685 .htotal = 800 + 168 + 64 + 88,
686 .vdisplay = 480,
687 .vsync_start = 480 + 37,
688 .vsync_end = 480 + 37 + 2,
689 .vtotal = 480 + 37 + 2 + 8,
690 .vrefresh = 60,
691};
692
693static const struct panel_desc foxlink_fl500wvr00_a0t = {
694 .modes = &foxlink_fl500wvr00_a0t_mode,
695 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +0100696 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +0200697 .size = {
698 .width = 108,
699 .height = 65,
700 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +0200701 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +0200702};
703
Philipp Zabeld435a2a2014-11-19 10:29:55 +0100704static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
705 .clock = 9000,
706 .hdisplay = 480,
707 .hsync_start = 480 + 5,
708 .hsync_end = 480 + 5 + 1,
709 .htotal = 480 + 5 + 1 + 40,
710 .vdisplay = 272,
711 .vsync_start = 272 + 8,
712 .vsync_end = 272 + 8 + 1,
713 .vtotal = 272 + 8 + 1 + 8,
714 .vrefresh = 60,
715};
716
717static const struct panel_desc giantplus_gpg482739qs5 = {
718 .modes = &giantplus_gpg482739qs5_mode,
719 .num_modes = 1,
720 .bpc = 8,
721 .size = {
722 .width = 95,
723 .height = 54,
724 },
Philipp Zabel33536a02015-02-11 18:50:07 +0100725 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +0100726};
727
Philipp Zabelab077252014-12-11 18:32:46 +0100728static const struct display_timing hannstar_hsd070pww1_timing = {
729 .pixelclock = { 64300000, 71100000, 82000000 },
730 .hactive = { 1280, 1280, 1280 },
731 .hfront_porch = { 1, 1, 10 },
732 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +0200733 /*
734 * According to the data sheet, the minimum horizontal blanking interval
735 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
736 * minimum working horizontal blanking interval to be 60 clocks.
737 */
738 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +0100739 .vactive = { 800, 800, 800 },
740 .vfront_porch = { 1, 1, 10 },
741 .vback_porch = { 1, 1, 10 },
742 .vsync_len = { 1, 21, 203 },
743 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +0200744};
745
746static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +0100747 .timings = &hannstar_hsd070pww1_timing,
748 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +0200749 .bpc = 6,
750 .size = {
751 .width = 151,
752 .height = 94,
753 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +0200754 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Philipp Zabela8532052014-10-23 16:31:06 +0200755};
756
Eric Nelsonc0d607e2015-04-13 15:09:26 -0700757static const struct display_timing hannstar_hsd100pxn1_timing = {
758 .pixelclock = { 55000000, 65000000, 75000000 },
759 .hactive = { 1024, 1024, 1024 },
760 .hfront_porch = { 40, 40, 40 },
761 .hback_porch = { 220, 220, 220 },
762 .hsync_len = { 20, 60, 100 },
763 .vactive = { 768, 768, 768 },
764 .vfront_porch = { 7, 7, 7 },
765 .vback_porch = { 21, 21, 21 },
766 .vsync_len = { 10, 10, 10 },
767 .flags = DISPLAY_FLAGS_DE_HIGH,
768};
769
770static const struct panel_desc hannstar_hsd100pxn1 = {
771 .timings = &hannstar_hsd100pxn1_timing,
772 .num_timings = 1,
773 .bpc = 6,
774 .size = {
775 .width = 203,
776 .height = 152,
777 },
Philipp Zabel4946b042015-05-20 11:34:08 +0200778 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Eric Nelsonc0d607e2015-04-13 15:09:26 -0700779};
780
Lucas Stach61ac0bf2014-11-06 17:44:35 +0100781static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
782 .clock = 33333,
783 .hdisplay = 800,
784 .hsync_start = 800 + 85,
785 .hsync_end = 800 + 85 + 86,
786 .htotal = 800 + 85 + 86 + 85,
787 .vdisplay = 480,
788 .vsync_start = 480 + 16,
789 .vsync_end = 480 + 16 + 13,
790 .vtotal = 480 + 16 + 13 + 16,
791 .vrefresh = 60,
792};
793
794static const struct panel_desc hitachi_tx23d38vm0caa = {
795 .modes = &hitachi_tx23d38vm0caa_mode,
796 .num_modes = 1,
797 .bpc = 6,
798 .size = {
799 .width = 195,
800 .height = 117,
801 },
802};
803
Nicolas Ferre41bcceb2015-03-19 14:43:01 +0100804static const struct drm_display_mode innolux_at043tn24_mode = {
805 .clock = 9000,
806 .hdisplay = 480,
807 .hsync_start = 480 + 2,
808 .hsync_end = 480 + 2 + 41,
809 .htotal = 480 + 2 + 41 + 2,
810 .vdisplay = 272,
811 .vsync_start = 272 + 2,
812 .vsync_end = 272 + 2 + 11,
813 .vtotal = 272 + 2 + 11 + 2,
814 .vrefresh = 60,
815 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
816};
817
818static const struct panel_desc innolux_at043tn24 = {
819 .modes = &innolux_at043tn24_mode,
820 .num_modes = 1,
821 .bpc = 8,
822 .size = {
823 .width = 95,
824 .height = 54,
825 },
826 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
827};
828
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +0200829static const struct drm_display_mode innolux_at070tn92_mode = {
830 .clock = 33333,
831 .hdisplay = 800,
832 .hsync_start = 800 + 210,
833 .hsync_end = 800 + 210 + 20,
834 .htotal = 800 + 210 + 20 + 46,
835 .vdisplay = 480,
836 .vsync_start = 480 + 22,
837 .vsync_end = 480 + 22 + 10,
838 .vtotal = 480 + 22 + 23 + 10,
839 .vrefresh = 60,
840};
841
842static const struct panel_desc innolux_at070tn92 = {
843 .modes = &innolux_at070tn92_mode,
844 .num_modes = 1,
845 .size = {
846 .width = 154,
847 .height = 86,
848 },
849 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
850};
851
Lucas Stachd731f662014-11-06 17:44:33 +0100852static const struct drm_display_mode innolux_g121i1_l01_mode = {
Thierry Reding0a2288c2014-07-03 14:02:59 +0200853 .clock = 71000,
Lucas Stachd731f662014-11-06 17:44:33 +0100854 .hdisplay = 1280,
855 .hsync_start = 1280 + 64,
856 .hsync_end = 1280 + 64 + 32,
857 .htotal = 1280 + 64 + 32 + 64,
858 .vdisplay = 800,
859 .vsync_start = 800 + 9,
860 .vsync_end = 800 + 9 + 6,
861 .vtotal = 800 + 9 + 6 + 9,
862 .vrefresh = 60,
863};
864
865static const struct panel_desc innolux_g121i1_l01 = {
866 .modes = &innolux_g121i1_l01_mode,
867 .num_modes = 1,
868 .bpc = 6,
869 .size = {
870 .width = 261,
871 .height = 163,
872 },
873};
874
Akshay Bhatf8fa17b2015-11-18 15:57:47 -0500875static const struct drm_display_mode innolux_g121x1_l03_mode = {
876 .clock = 65000,
877 .hdisplay = 1024,
878 .hsync_start = 1024 + 0,
879 .hsync_end = 1024 + 1,
880 .htotal = 1024 + 0 + 1 + 320,
881 .vdisplay = 768,
882 .vsync_start = 768 + 38,
883 .vsync_end = 768 + 38 + 1,
884 .vtotal = 768 + 38 + 1 + 0,
885 .vrefresh = 60,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -0500886 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -0500887};
888
889static const struct panel_desc innolux_g121x1_l03 = {
890 .modes = &innolux_g121x1_l03_mode,
891 .num_modes = 1,
892 .bpc = 6,
893 .size = {
894 .width = 246,
895 .height = 185,
896 },
897 .delay = {
898 .enable = 200,
899 .unprepare = 200,
900 .disable = 400,
901 },
902};
903
Thierry Reding0a2288c2014-07-03 14:02:59 +0200904static const struct drm_display_mode innolux_n116bge_mode = {
Daniel Kurtz7fe8c772014-09-02 10:56:46 +0800905 .clock = 76420,
Thierry Reding0a2288c2014-07-03 14:02:59 +0200906 .hdisplay = 1366,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +0800907 .hsync_start = 1366 + 136,
908 .hsync_end = 1366 + 136 + 30,
909 .htotal = 1366 + 136 + 30 + 60,
Thierry Reding0a2288c2014-07-03 14:02:59 +0200910 .vdisplay = 768,
911 .vsync_start = 768 + 8,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +0800912 .vsync_end = 768 + 8 + 12,
913 .vtotal = 768 + 8 + 12 + 12,
Thierry Reding0a2288c2014-07-03 14:02:59 +0200914 .vrefresh = 60,
915 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
916};
917
918static const struct panel_desc innolux_n116bge = {
919 .modes = &innolux_n116bge_mode,
920 .num_modes = 1,
921 .bpc = 6,
922 .size = {
923 .width = 256,
924 .height = 144,
925 },
926};
927
Alban Bedelea447392014-07-22 08:38:55 +0200928static const struct drm_display_mode innolux_n156bge_l21_mode = {
929 .clock = 69300,
930 .hdisplay = 1366,
931 .hsync_start = 1366 + 16,
932 .hsync_end = 1366 + 16 + 34,
933 .htotal = 1366 + 16 + 34 + 50,
934 .vdisplay = 768,
935 .vsync_start = 768 + 2,
936 .vsync_end = 768 + 2 + 6,
937 .vtotal = 768 + 2 + 6 + 12,
938 .vrefresh = 60,
939};
940
941static const struct panel_desc innolux_n156bge_l21 = {
942 .modes = &innolux_n156bge_l21_mode,
943 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700944 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +0200945 .size = {
946 .width = 344,
947 .height = 193,
948 },
949};
950
Michael Grzeschikbccac3f2015-03-19 12:22:44 +0100951static const struct drm_display_mode innolux_zj070na_01p_mode = {
952 .clock = 51501,
953 .hdisplay = 1024,
954 .hsync_start = 1024 + 128,
955 .hsync_end = 1024 + 128 + 64,
956 .htotal = 1024 + 128 + 64 + 128,
957 .vdisplay = 600,
958 .vsync_start = 600 + 16,
959 .vsync_end = 600 + 16 + 4,
960 .vtotal = 600 + 16 + 4 + 16,
961 .vrefresh = 60,
962};
963
964static const struct panel_desc innolux_zj070na_01p = {
965 .modes = &innolux_zj070na_01p_mode,
966 .num_modes = 1,
967 .bpc = 6,
968 .size = {
Thierry Reding81598842016-06-10 15:33:13 +0200969 .width = 154,
970 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +0100971 },
972};
973
Lucas Stach8def22e2015-12-02 19:41:11 +0100974static const struct display_timing kyo_tcg121xglp_timing = {
975 .pixelclock = { 52000000, 65000000, 71000000 },
976 .hactive = { 1024, 1024, 1024 },
977 .hfront_porch = { 2, 2, 2 },
978 .hback_porch = { 2, 2, 2 },
979 .hsync_len = { 86, 124, 244 },
980 .vactive = { 768, 768, 768 },
981 .vfront_porch = { 2, 2, 2 },
982 .vback_porch = { 2, 2, 2 },
983 .vsync_len = { 6, 34, 73 },
984 .flags = DISPLAY_FLAGS_DE_HIGH,
985};
986
987static const struct panel_desc kyo_tcg121xglp = {
988 .timings = &kyo_tcg121xglp_timing,
989 .num_timings = 1,
990 .bpc = 8,
991 .size = {
992 .width = 246,
993 .height = 184,
994 },
995 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
996};
997
Heiko Schocherdd015002015-05-22 10:25:57 +0200998static const struct drm_display_mode lg_lb070wv8_mode = {
999 .clock = 33246,
1000 .hdisplay = 800,
1001 .hsync_start = 800 + 88,
1002 .hsync_end = 800 + 88 + 80,
1003 .htotal = 800 + 88 + 80 + 88,
1004 .vdisplay = 480,
1005 .vsync_start = 480 + 10,
1006 .vsync_end = 480 + 10 + 25,
1007 .vtotal = 480 + 10 + 25 + 10,
1008 .vrefresh = 60,
1009};
1010
1011static const struct panel_desc lg_lb070wv8 = {
1012 .modes = &lg_lb070wv8_mode,
1013 .num_modes = 1,
1014 .bpc = 16,
1015 .size = {
1016 .width = 151,
1017 .height = 91,
1018 },
1019 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1020};
1021
Jitao Shi690d8fa2016-02-22 19:01:44 +08001022static const struct drm_display_mode lg_lp120up1_mode = {
1023 .clock = 162300,
1024 .hdisplay = 1920,
1025 .hsync_start = 1920 + 40,
1026 .hsync_end = 1920 + 40 + 40,
1027 .htotal = 1920 + 40 + 40+ 80,
1028 .vdisplay = 1280,
1029 .vsync_start = 1280 + 4,
1030 .vsync_end = 1280 + 4 + 4,
1031 .vtotal = 1280 + 4 + 4 + 12,
1032 .vrefresh = 60,
1033};
1034
1035static const struct panel_desc lg_lp120up1 = {
1036 .modes = &lg_lp120up1_mode,
1037 .num_modes = 1,
1038 .bpc = 8,
1039 .size = {
1040 .width = 267,
1041 .height = 183,
1042 },
1043};
1044
Thierry Redingec7c5652013-11-15 15:59:32 +01001045static const struct drm_display_mode lg_lp129qe_mode = {
1046 .clock = 285250,
1047 .hdisplay = 2560,
1048 .hsync_start = 2560 + 48,
1049 .hsync_end = 2560 + 48 + 32,
1050 .htotal = 2560 + 48 + 32 + 80,
1051 .vdisplay = 1700,
1052 .vsync_start = 1700 + 3,
1053 .vsync_end = 1700 + 3 + 10,
1054 .vtotal = 1700 + 3 + 10 + 36,
1055 .vrefresh = 60,
1056};
1057
1058static const struct panel_desc lg_lp129qe = {
1059 .modes = &lg_lp129qe_mode,
1060 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001061 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01001062 .size = {
1063 .width = 272,
1064 .height = 181,
1065 },
1066};
1067
jianwei wangc6e87f92015-07-29 16:30:02 +08001068static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
1069 .clock = 10870,
1070 .hdisplay = 480,
1071 .hsync_start = 480 + 2,
1072 .hsync_end = 480 + 2 + 41,
1073 .htotal = 480 + 2 + 41 + 2,
1074 .vdisplay = 272,
1075 .vsync_start = 272 + 2,
1076 .vsync_end = 272 + 2 + 4,
1077 .vtotal = 272 + 2 + 4 + 2,
1078 .vrefresh = 74,
Stefan Agner4bc390c2015-11-17 19:10:29 -08001079 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08001080};
1081
1082static const struct panel_desc nec_nl4827hc19_05b = {
1083 .modes = &nec_nl4827hc19_05b_mode,
1084 .num_modes = 1,
1085 .bpc = 8,
1086 .size = {
1087 .width = 95,
1088 .height = 54,
1089 },
Stefan Agner2c806612016-02-08 12:50:13 -08001090 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1091 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08001092};
1093
Gary Bissona99fb622015-06-10 18:44:23 +02001094static const struct display_timing okaya_rs800480t_7x0gp_timing = {
1095 .pixelclock = { 30000000, 30000000, 40000000 },
1096 .hactive = { 800, 800, 800 },
1097 .hfront_porch = { 40, 40, 40 },
1098 .hback_porch = { 40, 40, 40 },
1099 .hsync_len = { 1, 48, 48 },
1100 .vactive = { 480, 480, 480 },
1101 .vfront_porch = { 13, 13, 13 },
1102 .vback_porch = { 29, 29, 29 },
1103 .vsync_len = { 3, 3, 3 },
1104 .flags = DISPLAY_FLAGS_DE_HIGH,
1105};
1106
1107static const struct panel_desc okaya_rs800480t_7x0gp = {
1108 .timings = &okaya_rs800480t_7x0gp_timing,
1109 .num_timings = 1,
1110 .bpc = 6,
1111 .size = {
1112 .width = 154,
1113 .height = 87,
1114 },
1115 .delay = {
1116 .prepare = 41,
1117 .enable = 50,
1118 .unprepare = 41,
1119 .disable = 50,
1120 },
1121 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1122};
1123
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001124static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
1125 .clock = 9000,
1126 .hdisplay = 480,
1127 .hsync_start = 480 + 5,
1128 .hsync_end = 480 + 5 + 30,
1129 .htotal = 480 + 5 + 30 + 10,
1130 .vdisplay = 272,
1131 .vsync_start = 272 + 8,
1132 .vsync_end = 272 + 8 + 5,
1133 .vtotal = 272 + 8 + 5 + 3,
1134 .vrefresh = 60,
1135};
1136
1137static const struct panel_desc olimex_lcd_olinuxino_43ts = {
1138 .modes = &olimex_lcd_olinuxino_43ts_mode,
1139 .num_modes = 1,
1140 .size = {
1141 .width = 105,
1142 .height = 67,
1143 },
1144 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1145};
1146
Eric Anholte8b6f562016-03-24 17:23:48 -07001147/*
1148 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1149 * pixel clocks, but this is the timing that was being used in the Adafruit
1150 * installation instructions.
1151 */
1152static const struct drm_display_mode ontat_yx700wv03_mode = {
1153 .clock = 29500,
1154 .hdisplay = 800,
1155 .hsync_start = 824,
1156 .hsync_end = 896,
1157 .htotal = 992,
1158 .vdisplay = 480,
1159 .vsync_start = 483,
1160 .vsync_end = 493,
1161 .vtotal = 500,
1162 .vrefresh = 60,
1163 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1164};
1165
1166/*
1167 * Specification at:
1168 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1169 */
1170static const struct panel_desc ontat_yx700wv03 = {
1171 .modes = &ontat_yx700wv03_mode,
1172 .num_modes = 1,
1173 .bpc = 8,
1174 .size = {
1175 .width = 154,
1176 .height = 83,
1177 },
1178 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1179};
1180
Philipp Zabel725c9d42015-02-11 18:50:11 +01001181static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
1182 .clock = 25000,
1183 .hdisplay = 480,
1184 .hsync_start = 480 + 10,
1185 .hsync_end = 480 + 10 + 10,
1186 .htotal = 480 + 10 + 10 + 15,
1187 .vdisplay = 800,
1188 .vsync_start = 800 + 3,
1189 .vsync_end = 800 + 3 + 3,
1190 .vtotal = 800 + 3 + 3 + 3,
1191 .vrefresh = 60,
1192};
1193
1194static const struct panel_desc ortustech_com43h4m85ulc = {
1195 .modes = &ortustech_com43h4m85ulc_mode,
1196 .num_modes = 1,
1197 .bpc = 8,
1198 .size = {
1199 .width = 56,
1200 .height = 93,
1201 },
1202 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1203};
1204
Josh Wud2a6f0f2015-10-08 17:42:41 +02001205static const struct drm_display_mode qd43003c0_40_mode = {
1206 .clock = 9000,
1207 .hdisplay = 480,
1208 .hsync_start = 480 + 8,
1209 .hsync_end = 480 + 8 + 4,
1210 .htotal = 480 + 8 + 4 + 39,
1211 .vdisplay = 272,
1212 .vsync_start = 272 + 4,
1213 .vsync_end = 272 + 4 + 10,
1214 .vtotal = 272 + 4 + 10 + 2,
1215 .vrefresh = 60,
1216};
1217
1218static const struct panel_desc qd43003c0_40 = {
1219 .modes = &qd43003c0_40_mode,
1220 .num_modes = 1,
1221 .bpc = 8,
1222 .size = {
1223 .width = 95,
1224 .height = 53,
1225 },
1226 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1227};
1228
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001229static const struct drm_display_mode samsung_ltn101nt05_mode = {
1230 .clock = 54030,
1231 .hdisplay = 1024,
1232 .hsync_start = 1024 + 24,
1233 .hsync_end = 1024 + 24 + 136,
1234 .htotal = 1024 + 24 + 136 + 160,
1235 .vdisplay = 600,
1236 .vsync_start = 600 + 3,
1237 .vsync_end = 600 + 3 + 6,
1238 .vtotal = 600 + 3 + 6 + 61,
1239 .vrefresh = 60,
1240};
1241
1242static const struct panel_desc samsung_ltn101nt05 = {
1243 .modes = &samsung_ltn101nt05_mode,
1244 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001245 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001246 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001247 .width = 223,
1248 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001249 },
1250};
1251
Stéphane Marchesin0c934302015-03-18 10:52:18 +01001252static const struct drm_display_mode samsung_ltn140at29_301_mode = {
1253 .clock = 76300,
1254 .hdisplay = 1366,
1255 .hsync_start = 1366 + 64,
1256 .hsync_end = 1366 + 64 + 48,
1257 .htotal = 1366 + 64 + 48 + 128,
1258 .vdisplay = 768,
1259 .vsync_start = 768 + 2,
1260 .vsync_end = 768 + 2 + 5,
1261 .vtotal = 768 + 2 + 5 + 17,
1262 .vrefresh = 60,
1263};
1264
1265static const struct panel_desc samsung_ltn140at29_301 = {
1266 .modes = &samsung_ltn140at29_301_mode,
1267 .num_modes = 1,
1268 .bpc = 6,
1269 .size = {
1270 .width = 320,
1271 .height = 187,
1272 },
1273};
1274
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01001275static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
1276 .clock = 33300,
1277 .hdisplay = 800,
1278 .hsync_start = 800 + 1,
1279 .hsync_end = 800 + 1 + 64,
1280 .htotal = 800 + 1 + 64 + 64,
1281 .vdisplay = 480,
1282 .vsync_start = 480 + 1,
1283 .vsync_end = 480 + 1 + 23,
1284 .vtotal = 480 + 1 + 23 + 22,
1285 .vrefresh = 60,
1286};
1287
1288static const struct panel_desc shelly_sca07010_bfn_lnn = {
1289 .modes = &shelly_sca07010_bfn_lnn_mode,
1290 .num_modes = 1,
1291 .size = {
1292 .width = 152,
1293 .height = 91,
1294 },
1295 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1296};
1297
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05301298static const struct drm_display_mode tpk_f07a_0102_mode = {
1299 .clock = 33260,
1300 .hdisplay = 800,
1301 .hsync_start = 800 + 40,
1302 .hsync_end = 800 + 40 + 128,
1303 .htotal = 800 + 40 + 128 + 88,
1304 .vdisplay = 480,
1305 .vsync_start = 480 + 10,
1306 .vsync_end = 480 + 10 + 2,
1307 .vtotal = 480 + 10 + 2 + 33,
1308 .vrefresh = 60,
1309};
1310
1311static const struct panel_desc tpk_f07a_0102 = {
1312 .modes = &tpk_f07a_0102_mode,
1313 .num_modes = 1,
1314 .size = {
1315 .width = 152,
1316 .height = 91,
1317 },
1318 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
1319};
1320
1321static const struct drm_display_mode tpk_f10a_0102_mode = {
1322 .clock = 45000,
1323 .hdisplay = 1024,
1324 .hsync_start = 1024 + 176,
1325 .hsync_end = 1024 + 176 + 5,
1326 .htotal = 1024 + 176 + 5 + 88,
1327 .vdisplay = 600,
1328 .vsync_start = 600 + 20,
1329 .vsync_end = 600 + 20 + 5,
1330 .vtotal = 600 + 20 + 5 + 25,
1331 .vrefresh = 60,
1332};
1333
1334static const struct panel_desc tpk_f10a_0102 = {
1335 .modes = &tpk_f10a_0102_mode,
1336 .num_modes = 1,
1337 .size = {
1338 .width = 223,
1339 .height = 125,
1340 },
1341};
1342
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01001343static const struct display_timing urt_umsh_8596md_timing = {
1344 .pixelclock = { 33260000, 33260000, 33260000 },
1345 .hactive = { 800, 800, 800 },
1346 .hfront_porch = { 41, 41, 41 },
1347 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
1348 .hsync_len = { 71, 128, 128 },
1349 .vactive = { 480, 480, 480 },
1350 .vfront_porch = { 10, 10, 10 },
1351 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
1352 .vsync_len = { 2, 2, 2 },
1353 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
1354 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
1355};
1356
1357static const struct panel_desc urt_umsh_8596md_lvds = {
1358 .timings = &urt_umsh_8596md_timing,
1359 .num_timings = 1,
1360 .bpc = 6,
1361 .size = {
1362 .width = 152,
1363 .height = 91,
1364 },
1365 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1366};
1367
1368static const struct panel_desc urt_umsh_8596md_parallel = {
1369 .timings = &urt_umsh_8596md_timing,
1370 .num_timings = 1,
1371 .bpc = 6,
1372 .size = {
1373 .width = 152,
1374 .height = 91,
1375 },
1376 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1377};
1378
Thierry Reding280921d2013-08-30 15:10:14 +02001379static const struct of_device_id platform_of_match[] = {
1380 {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01001381 .compatible = "ampire,am800480r3tmqwa1h",
1382 .data = &ampire_am800480r3tmqwa1h,
1383 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001384 .compatible = "auo,b101aw03",
1385 .data = &auo_b101aw03,
1386 }, {
Huang Lina531bc32015-02-28 10:18:58 +08001387 .compatible = "auo,b101ean01",
1388 .data = &auo_b101ean01,
1389 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04001390 .compatible = "auo,b101xtn01",
1391 .data = &auo_b101xtn01,
1392 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05301393 .compatible = "auo,b116xw03",
1394 .data = &auo_b116xw03,
1395 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05301396 .compatible = "auo,b133htn01",
1397 .data = &auo_b133htn01,
1398 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07001399 .compatible = "auo,b133xtn01",
1400 .data = &auo_b133xtn01,
1401 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01001402 .compatible = "avic,tm070ddh03",
1403 .data = &avic_tm070ddh03,
1404 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07001405 .compatible = "chunghwa,claa101wa01a",
1406 .data = &chunghwa_claa101wa01a
1407 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001408 .compatible = "chunghwa,claa101wb01",
1409 .data = &chunghwa_claa101wb01
1410 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02001411 .compatible = "edt,et057090dhu",
1412 .data = &edt_et057090dhu,
1413 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02001414 .compatible = "edt,et070080dh6",
1415 .data = &edt_etm0700g0dh6,
1416 }, {
1417 .compatible = "edt,etm0700g0dh6",
1418 .data = &edt_etm0700g0dh6,
1419 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02001420 .compatible = "foxlink,fl500wvr00-a0t",
1421 .data = &foxlink_fl500wvr00_a0t,
1422 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001423 .compatible = "giantplus,gpg482739qs5",
1424 .data = &giantplus_gpg482739qs5
1425 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02001426 .compatible = "hannstar,hsd070pww1",
1427 .data = &hannstar_hsd070pww1,
1428 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001429 .compatible = "hannstar,hsd100pxn1",
1430 .data = &hannstar_hsd100pxn1,
1431 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001432 .compatible = "hit,tx23d38vm0caa",
1433 .data = &hitachi_tx23d38vm0caa
1434 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001435 .compatible = "innolux,at043tn24",
1436 .data = &innolux_at043tn24,
1437 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02001438 .compatible = "innolux,at070tn92",
1439 .data = &innolux_at070tn92,
1440 }, {
Lucas Stachd731f662014-11-06 17:44:33 +01001441 .compatible ="innolux,g121i1-l01",
1442 .data = &innolux_g121i1_l01
1443 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001444 .compatible = "innolux,g121x1-l03",
1445 .data = &innolux_g121x1_l03,
1446 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02001447 .compatible = "innolux,n116bge",
1448 .data = &innolux_n116bge,
1449 }, {
Alban Bedelea447392014-07-22 08:38:55 +02001450 .compatible = "innolux,n156bge-l21",
1451 .data = &innolux_n156bge_l21,
1452 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001453 .compatible = "innolux,zj070na-01p",
1454 .data = &innolux_zj070na_01p,
1455 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01001456 .compatible = "kyo,tcg121xglp",
1457 .data = &kyo_tcg121xglp,
1458 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02001459 .compatible = "lg,lb070wv8",
1460 .data = &lg_lb070wv8,
1461 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08001462 .compatible = "lg,lp120up1",
1463 .data = &lg_lp120up1,
1464 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01001465 .compatible = "lg,lp129qe",
1466 .data = &lg_lp129qe,
1467 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08001468 .compatible = "nec,nl4827hc19-05b",
1469 .data = &nec_nl4827hc19_05b,
1470 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02001471 .compatible = "okaya,rs800480t-7x0gp",
1472 .data = &okaya_rs800480t_7x0gp,
1473 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001474 .compatible = "olimex,lcd-olinuxino-43-ts",
1475 .data = &olimex_lcd_olinuxino_43ts,
1476 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07001477 .compatible = "ontat,yx700wv03",
1478 .data = &ontat_yx700wv03,
1479 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01001480 .compatible = "ortustech,com43h4m85ulc",
1481 .data = &ortustech_com43h4m85ulc,
1482 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02001483 .compatible = "qiaodian,qd43003c0-40",
1484 .data = &qd43003c0_40,
1485 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001486 .compatible = "samsung,ltn101nt05",
1487 .data = &samsung_ltn101nt05,
1488 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01001489 .compatible = "samsung,ltn140at29-301",
1490 .data = &samsung_ltn140at29_301,
1491 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01001492 .compatible = "shelly,sca07010-bfn-lnn",
1493 .data = &shelly_sca07010_bfn_lnn,
1494 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05301495 .compatible = "tpk,f07a-0102",
1496 .data = &tpk_f07a_0102,
1497 }, {
1498 .compatible = "tpk,f10a-0102",
1499 .data = &tpk_f10a_0102,
1500 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01001501 .compatible = "urt,umsh-8596md-t",
1502 .data = &urt_umsh_8596md_parallel,
1503 }, {
1504 .compatible = "urt,umsh-8596md-1t",
1505 .data = &urt_umsh_8596md_parallel,
1506 }, {
1507 .compatible = "urt,umsh-8596md-7t",
1508 .data = &urt_umsh_8596md_parallel,
1509 }, {
1510 .compatible = "urt,umsh-8596md-11t",
1511 .data = &urt_umsh_8596md_lvds,
1512 }, {
1513 .compatible = "urt,umsh-8596md-19t",
1514 .data = &urt_umsh_8596md_lvds,
1515 }, {
1516 .compatible = "urt,umsh-8596md-20t",
1517 .data = &urt_umsh_8596md_parallel,
1518 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02001519 /* sentinel */
1520 }
1521};
1522MODULE_DEVICE_TABLE(of, platform_of_match);
1523
1524static int panel_simple_platform_probe(struct platform_device *pdev)
1525{
1526 const struct of_device_id *id;
1527
1528 id = of_match_node(platform_of_match, pdev->dev.of_node);
1529 if (!id)
1530 return -ENODEV;
1531
1532 return panel_simple_probe(&pdev->dev, id->data);
1533}
1534
1535static int panel_simple_platform_remove(struct platform_device *pdev)
1536{
1537 return panel_simple_remove(&pdev->dev);
1538}
1539
Thierry Redingd02fd932014-04-29 17:21:21 +02001540static void panel_simple_platform_shutdown(struct platform_device *pdev)
1541{
1542 panel_simple_shutdown(&pdev->dev);
1543}
1544
Thierry Reding280921d2013-08-30 15:10:14 +02001545static struct platform_driver panel_simple_platform_driver = {
1546 .driver = {
1547 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02001548 .of_match_table = platform_of_match,
1549 },
1550 .probe = panel_simple_platform_probe,
1551 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02001552 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02001553};
1554
Thierry Reding210fcd92013-11-22 19:27:11 +01001555struct panel_desc_dsi {
1556 struct panel_desc desc;
1557
Thierry Reding462658b2014-03-14 11:24:57 +01001558 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01001559 enum mipi_dsi_pixel_format format;
1560 unsigned int lanes;
1561};
1562
Thierry Redingd718d792015-04-08 16:52:33 +02001563static const struct drm_display_mode auo_b080uan01_mode = {
1564 .clock = 154500,
1565 .hdisplay = 1200,
1566 .hsync_start = 1200 + 62,
1567 .hsync_end = 1200 + 62 + 4,
1568 .htotal = 1200 + 62 + 4 + 62,
1569 .vdisplay = 1920,
1570 .vsync_start = 1920 + 9,
1571 .vsync_end = 1920 + 9 + 2,
1572 .vtotal = 1920 + 9 + 2 + 8,
1573 .vrefresh = 60,
1574};
1575
1576static const struct panel_desc_dsi auo_b080uan01 = {
1577 .desc = {
1578 .modes = &auo_b080uan01_mode,
1579 .num_modes = 1,
1580 .bpc = 8,
1581 .size = {
1582 .width = 108,
1583 .height = 272,
1584 },
1585 },
1586 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
1587 .format = MIPI_DSI_FMT_RGB888,
1588 .lanes = 4,
1589};
1590
Chris Zhongc8521962015-11-20 16:15:37 +08001591static const struct drm_display_mode boe_tv080wum_nl0_mode = {
1592 .clock = 160000,
1593 .hdisplay = 1200,
1594 .hsync_start = 1200 + 120,
1595 .hsync_end = 1200 + 120 + 20,
1596 .htotal = 1200 + 120 + 20 + 21,
1597 .vdisplay = 1920,
1598 .vsync_start = 1920 + 21,
1599 .vsync_end = 1920 + 21 + 3,
1600 .vtotal = 1920 + 21 + 3 + 18,
1601 .vrefresh = 60,
1602 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1603};
1604
1605static const struct panel_desc_dsi boe_tv080wum_nl0 = {
1606 .desc = {
1607 .modes = &boe_tv080wum_nl0_mode,
1608 .num_modes = 1,
1609 .size = {
1610 .width = 107,
1611 .height = 172,
1612 },
1613 },
1614 .flags = MIPI_DSI_MODE_VIDEO |
1615 MIPI_DSI_MODE_VIDEO_BURST |
1616 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
1617 .format = MIPI_DSI_FMT_RGB888,
1618 .lanes = 4,
1619};
1620
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09001621static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
1622 .clock = 71000,
1623 .hdisplay = 800,
1624 .hsync_start = 800 + 32,
1625 .hsync_end = 800 + 32 + 1,
1626 .htotal = 800 + 32 + 1 + 57,
1627 .vdisplay = 1280,
1628 .vsync_start = 1280 + 28,
1629 .vsync_end = 1280 + 28 + 1,
1630 .vtotal = 1280 + 28 + 1 + 14,
1631 .vrefresh = 60,
1632};
1633
1634static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
1635 .desc = {
1636 .modes = &lg_ld070wx3_sl01_mode,
1637 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001638 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09001639 .size = {
1640 .width = 94,
1641 .height = 151,
1642 },
1643 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09001644 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09001645 .format = MIPI_DSI_FMT_RGB888,
1646 .lanes = 4,
1647};
1648
Alexandre Courbot499ce852014-01-21 18:57:09 +09001649static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
1650 .clock = 67000,
1651 .hdisplay = 720,
1652 .hsync_start = 720 + 12,
1653 .hsync_end = 720 + 12 + 4,
1654 .htotal = 720 + 12 + 4 + 112,
1655 .vdisplay = 1280,
1656 .vsync_start = 1280 + 8,
1657 .vsync_end = 1280 + 8 + 4,
1658 .vtotal = 1280 + 8 + 4 + 12,
1659 .vrefresh = 60,
1660};
1661
1662static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
1663 .desc = {
1664 .modes = &lg_lh500wx1_sd03_mode,
1665 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001666 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09001667 .size = {
1668 .width = 62,
1669 .height = 110,
1670 },
1671 },
1672 .flags = MIPI_DSI_MODE_VIDEO,
1673 .format = MIPI_DSI_FMT_RGB888,
1674 .lanes = 4,
1675};
1676
Thierry Reding280921d2013-08-30 15:10:14 +02001677static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
1678 .clock = 157200,
1679 .hdisplay = 1920,
1680 .hsync_start = 1920 + 154,
1681 .hsync_end = 1920 + 154 + 16,
1682 .htotal = 1920 + 154 + 16 + 32,
1683 .vdisplay = 1200,
1684 .vsync_start = 1200 + 17,
1685 .vsync_end = 1200 + 17 + 2,
1686 .vtotal = 1200 + 17 + 2 + 16,
1687 .vrefresh = 60,
1688};
1689
Thierry Reding210fcd92013-11-22 19:27:11 +01001690static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
1691 .desc = {
1692 .modes = &panasonic_vvx10f004b00_mode,
1693 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001694 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01001695 .size = {
1696 .width = 217,
1697 .height = 136,
1698 },
Thierry Reding280921d2013-08-30 15:10:14 +02001699 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09001700 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
1701 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01001702 .format = MIPI_DSI_FMT_RGB888,
1703 .lanes = 4,
1704};
1705
1706static const struct of_device_id dsi_of_match[] = {
1707 {
Thierry Redingd718d792015-04-08 16:52:33 +02001708 .compatible = "auo,b080uan01",
1709 .data = &auo_b080uan01
1710 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08001711 .compatible = "boe,tv080wum-nl0",
1712 .data = &boe_tv080wum_nl0
1713 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09001714 .compatible = "lg,ld070wx3-sl01",
1715 .data = &lg_ld070wx3_sl01
1716 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09001717 .compatible = "lg,lh500wx1-sd03",
1718 .data = &lg_lh500wx1_sd03
1719 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01001720 .compatible = "panasonic,vvx10f004b00",
1721 .data = &panasonic_vvx10f004b00
1722 }, {
1723 /* sentinel */
1724 }
1725};
1726MODULE_DEVICE_TABLE(of, dsi_of_match);
1727
1728static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
1729{
1730 const struct panel_desc_dsi *desc;
1731 const struct of_device_id *id;
1732 int err;
1733
1734 id = of_match_node(dsi_of_match, dsi->dev.of_node);
1735 if (!id)
1736 return -ENODEV;
1737
1738 desc = id->data;
1739
1740 err = panel_simple_probe(&dsi->dev, &desc->desc);
1741 if (err < 0)
1742 return err;
1743
Thierry Reding462658b2014-03-14 11:24:57 +01001744 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01001745 dsi->format = desc->format;
1746 dsi->lanes = desc->lanes;
1747
1748 return mipi_dsi_attach(dsi);
1749}
1750
1751static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
1752{
1753 int err;
1754
1755 err = mipi_dsi_detach(dsi);
1756 if (err < 0)
1757 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
1758
1759 return panel_simple_remove(&dsi->dev);
1760}
1761
Thierry Redingd02fd932014-04-29 17:21:21 +02001762static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
1763{
1764 panel_simple_shutdown(&dsi->dev);
1765}
1766
Thierry Reding210fcd92013-11-22 19:27:11 +01001767static struct mipi_dsi_driver panel_simple_dsi_driver = {
1768 .driver = {
1769 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01001770 .of_match_table = dsi_of_match,
1771 },
1772 .probe = panel_simple_dsi_probe,
1773 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02001774 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02001775};
1776
1777static int __init panel_simple_init(void)
1778{
Thierry Reding210fcd92013-11-22 19:27:11 +01001779 int err;
1780
1781 err = platform_driver_register(&panel_simple_platform_driver);
1782 if (err < 0)
1783 return err;
1784
1785 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
1786 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
1787 if (err < 0)
1788 return err;
1789 }
1790
1791 return 0;
Thierry Reding280921d2013-08-30 15:10:14 +02001792}
1793module_init(panel_simple_init);
1794
1795static void __exit panel_simple_exit(void)
1796{
Thierry Reding210fcd92013-11-22 19:27:11 +01001797 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
1798 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
1799
Thierry Reding280921d2013-08-30 15:10:14 +02001800 platform_driver_unregister(&panel_simple_platform_driver);
1801}
1802module_exit(panel_simple_exit);
1803
1804MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
1805MODULE_DESCRIPTION("DRM Driver for Simple Panels");
1806MODULE_LICENSE("GPL and additional rights");