blob: 2c4857e08a769b96dede5ad01c268f523f38a8f0 [file] [log] [blame]
Thierry Reding280921d2013-08-30 15:10:14 +02001/*
2 * Copyright (C) 2013, NVIDIA Corporation. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sub license,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the
12 * next paragraph) shall be included in all copies or substantial portions
13 * of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24#include <linux/backlight.h>
Alexandre Courbotcfdf0542014-03-01 14:00:58 +090025#include <linux/gpio/consumer.h>
Thierry Reding280921d2013-08-30 15:10:14 +020026#include <linux/module.h>
Thierry Reding280921d2013-08-30 15:10:14 +020027#include <linux/of_platform.h>
28#include <linux/platform_device.h>
29#include <linux/regulator/consumer.h>
30
31#include <drm/drmP.h>
32#include <drm/drm_crtc.h>
Thierry Reding210fcd92013-11-22 19:27:11 +010033#include <drm/drm_mipi_dsi.h>
Thierry Reding280921d2013-08-30 15:10:14 +020034#include <drm/drm_panel.h>
35
Philipp Zabela5d3e622014-12-11 18:32:45 +010036#include <video/display_timing.h>
37#include <video/videomode.h>
38
Thierry Reding280921d2013-08-30 15:10:14 +020039struct panel_desc {
40 const struct drm_display_mode *modes;
41 unsigned int num_modes;
Philipp Zabela5d3e622014-12-11 18:32:45 +010042 const struct display_timing *timings;
43 unsigned int num_timings;
Thierry Reding280921d2013-08-30 15:10:14 +020044
Stéphane Marchesin0208d512014-06-19 18:18:28 -070045 unsigned int bpc;
46
Ulrich Ölmann85533e32015-12-04 12:31:28 +010047 /**
48 * @width: width (in millimeters) of the panel's active display area
49 * @height: height (in millimeters) of the panel's active display area
50 */
Thierry Reding280921d2013-08-30 15:10:14 +020051 struct {
52 unsigned int width;
53 unsigned int height;
54 } size;
Ajay Kumarf673c372014-07-31 23:12:11 +053055
56 /**
57 * @prepare: the time (in milliseconds) that it takes for the panel to
58 * become ready and start receiving video data
59 * @enable: the time (in milliseconds) that it takes for the panel to
60 * display the first valid frame after starting to receive
61 * video data
62 * @disable: the time (in milliseconds) that it takes for the panel to
63 * turn the display off (no content is visible)
64 * @unprepare: the time (in milliseconds) that it takes for the panel
65 * to power itself down completely
66 */
67 struct {
68 unsigned int prepare;
69 unsigned int enable;
70 unsigned int disable;
71 unsigned int unprepare;
72 } delay;
Boris Brezillon795f7ab2014-07-22 13:33:59 +020073
74 u32 bus_format;
Stefan Agnerf0aa0832016-02-08 11:38:14 -080075 u32 bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +020076};
77
Thierry Reding280921d2013-08-30 15:10:14 +020078struct panel_simple {
79 struct drm_panel base;
Ajay Kumar613a6332014-07-31 23:12:10 +053080 bool prepared;
Thierry Reding280921d2013-08-30 15:10:14 +020081 bool enabled;
82
83 const struct panel_desc *desc;
84
85 struct backlight_device *backlight;
86 struct regulator *supply;
87 struct i2c_adapter *ddc;
88
Alexandre Courbotcfdf0542014-03-01 14:00:58 +090089 struct gpio_desc *enable_gpio;
Thierry Reding280921d2013-08-30 15:10:14 +020090};
91
92static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
93{
94 return container_of(panel, struct panel_simple, base);
95}
96
97static int panel_simple_get_fixed_modes(struct panel_simple *panel)
98{
99 struct drm_connector *connector = panel->base.connector;
100 struct drm_device *drm = panel->base.drm;
101 struct drm_display_mode *mode;
102 unsigned int i, num = 0;
103
104 if (!panel->desc)
105 return 0;
106
Philipp Zabela5d3e622014-12-11 18:32:45 +0100107 for (i = 0; i < panel->desc->num_timings; i++) {
108 const struct display_timing *dt = &panel->desc->timings[i];
109 struct videomode vm;
110
111 videomode_from_timing(dt, &vm);
112 mode = drm_mode_create(drm);
113 if (!mode) {
114 dev_err(drm->dev, "failed to add mode %ux%u\n",
115 dt->hactive.typ, dt->vactive.typ);
116 continue;
117 }
118
119 drm_display_mode_from_videomode(&vm, mode);
Boris Brezilloncda55372016-04-15 18:23:33 +0200120
121 mode->type |= DRM_MODE_TYPE_DRIVER;
122
Chen-Yu Tsai230c5b42016-10-24 21:21:15 +0800123 if (panel->desc->num_timings == 1)
Boris Brezilloncda55372016-04-15 18:23:33 +0200124 mode->type |= DRM_MODE_TYPE_PREFERRED;
125
Philipp Zabela5d3e622014-12-11 18:32:45 +0100126 drm_mode_probed_add(connector, mode);
127 num++;
128 }
129
Thierry Reding280921d2013-08-30 15:10:14 +0200130 for (i = 0; i < panel->desc->num_modes; i++) {
131 const struct drm_display_mode *m = &panel->desc->modes[i];
132
133 mode = drm_mode_duplicate(drm, m);
134 if (!mode) {
135 dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
136 m->hdisplay, m->vdisplay, m->vrefresh);
137 continue;
138 }
139
Boris Brezilloncda55372016-04-15 18:23:33 +0200140 mode->type |= DRM_MODE_TYPE_DRIVER;
141
142 if (panel->desc->num_modes == 1)
143 mode->type |= DRM_MODE_TYPE_PREFERRED;
144
Thierry Reding280921d2013-08-30 15:10:14 +0200145 drm_mode_set_name(mode);
146
147 drm_mode_probed_add(connector, mode);
148 num++;
149 }
150
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700151 connector->display_info.bpc = panel->desc->bpc;
Thierry Reding280921d2013-08-30 15:10:14 +0200152 connector->display_info.width_mm = panel->desc->size.width;
153 connector->display_info.height_mm = panel->desc->size.height;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200154 if (panel->desc->bus_format)
155 drm_display_info_set_bus_formats(&connector->display_info,
156 &panel->desc->bus_format, 1);
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800157 connector->display_info.bus_flags = panel->desc->bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200158
159 return num;
160}
161
162static int panel_simple_disable(struct drm_panel *panel)
163{
164 struct panel_simple *p = to_panel_simple(panel);
165
166 if (!p->enabled)
167 return 0;
168
169 if (p->backlight) {
170 p->backlight->props.power = FB_BLANK_POWERDOWN;
Thierry Redinge4aa3422016-06-17 19:11:53 +0200171 p->backlight->props.state |= BL_CORE_FBBLANK;
Thierry Reding280921d2013-08-30 15:10:14 +0200172 backlight_update_status(p->backlight);
173 }
174
Ajay Kumarf673c372014-07-31 23:12:11 +0530175 if (p->desc->delay.disable)
176 msleep(p->desc->delay.disable);
177
Thierry Reding280921d2013-08-30 15:10:14 +0200178 p->enabled = false;
179
180 return 0;
181}
182
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530183static int panel_simple_unprepare(struct drm_panel *panel)
184{
Ajay Kumar613a6332014-07-31 23:12:10 +0530185 struct panel_simple *p = to_panel_simple(panel);
186
187 if (!p->prepared)
188 return 0;
189
Fabio Estevam756b9182017-07-16 21:05:39 -0300190 gpiod_set_value_cansleep(p->enable_gpio, 0);
Ajay Kumar613a6332014-07-31 23:12:10 +0530191
192 regulator_disable(p->supply);
193
Ajay Kumarf673c372014-07-31 23:12:11 +0530194 if (p->desc->delay.unprepare)
195 msleep(p->desc->delay.unprepare);
196
Ajay Kumar613a6332014-07-31 23:12:10 +0530197 p->prepared = false;
198
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530199 return 0;
200}
201
202static int panel_simple_prepare(struct drm_panel *panel)
203{
Thierry Reding280921d2013-08-30 15:10:14 +0200204 struct panel_simple *p = to_panel_simple(panel);
205 int err;
206
Ajay Kumar613a6332014-07-31 23:12:10 +0530207 if (p->prepared)
Thierry Reding280921d2013-08-30 15:10:14 +0200208 return 0;
209
210 err = regulator_enable(p->supply);
211 if (err < 0) {
212 dev_err(panel->dev, "failed to enable supply: %d\n", err);
213 return err;
214 }
215
Fabio Estevam756b9182017-07-16 21:05:39 -0300216 gpiod_set_value_cansleep(p->enable_gpio, 1);
Thierry Reding280921d2013-08-30 15:10:14 +0200217
Ajay Kumarf673c372014-07-31 23:12:11 +0530218 if (p->desc->delay.prepare)
219 msleep(p->desc->delay.prepare);
220
Ajay Kumar613a6332014-07-31 23:12:10 +0530221 p->prepared = true;
222
223 return 0;
224}
225
226static int panel_simple_enable(struct drm_panel *panel)
227{
228 struct panel_simple *p = to_panel_simple(panel);
229
230 if (p->enabled)
231 return 0;
232
Ajay Kumarf673c372014-07-31 23:12:11 +0530233 if (p->desc->delay.enable)
234 msleep(p->desc->delay.enable);
235
Thierry Reding280921d2013-08-30 15:10:14 +0200236 if (p->backlight) {
Thierry Redinge4aa3422016-06-17 19:11:53 +0200237 p->backlight->props.state &= ~BL_CORE_FBBLANK;
Thierry Reding280921d2013-08-30 15:10:14 +0200238 p->backlight->props.power = FB_BLANK_UNBLANK;
239 backlight_update_status(p->backlight);
240 }
241
242 p->enabled = true;
243
244 return 0;
245}
246
247static int panel_simple_get_modes(struct drm_panel *panel)
248{
249 struct panel_simple *p = to_panel_simple(panel);
250 int num = 0;
251
252 /* probe EDID if a DDC bus is available */
253 if (p->ddc) {
254 struct edid *edid = drm_get_edid(panel->connector, p->ddc);
Stephen Warren70bf6872014-01-09 11:37:34 -0700255 drm_mode_connector_update_edid_property(panel->connector, edid);
Thierry Reding280921d2013-08-30 15:10:14 +0200256 if (edid) {
257 num += drm_add_edid_modes(panel->connector, edid);
258 kfree(edid);
259 }
260 }
261
262 /* add hard-coded panel modes */
263 num += panel_simple_get_fixed_modes(p);
264
265 return num;
266}
267
Philipp Zabela5d3e622014-12-11 18:32:45 +0100268static int panel_simple_get_timings(struct drm_panel *panel,
269 unsigned int num_timings,
270 struct display_timing *timings)
271{
272 struct panel_simple *p = to_panel_simple(panel);
273 unsigned int i;
274
275 if (p->desc->num_timings < num_timings)
276 num_timings = p->desc->num_timings;
277
278 if (timings)
279 for (i = 0; i < num_timings; i++)
280 timings[i] = p->desc->timings[i];
281
282 return p->desc->num_timings;
283}
284
Thierry Reding280921d2013-08-30 15:10:14 +0200285static const struct drm_panel_funcs panel_simple_funcs = {
286 .disable = panel_simple_disable,
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530287 .unprepare = panel_simple_unprepare,
288 .prepare = panel_simple_prepare,
Thierry Reding280921d2013-08-30 15:10:14 +0200289 .enable = panel_simple_enable,
290 .get_modes = panel_simple_get_modes,
Philipp Zabela5d3e622014-12-11 18:32:45 +0100291 .get_timings = panel_simple_get_timings,
Thierry Reding280921d2013-08-30 15:10:14 +0200292};
293
294static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
295{
296 struct device_node *backlight, *ddc;
297 struct panel_simple *panel;
Thierry Reding280921d2013-08-30 15:10:14 +0200298 int err;
299
300 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
301 if (!panel)
302 return -ENOMEM;
303
304 panel->enabled = false;
Ajay Kumar613a6332014-07-31 23:12:10 +0530305 panel->prepared = false;
Thierry Reding280921d2013-08-30 15:10:14 +0200306 panel->desc = desc;
307
308 panel->supply = devm_regulator_get(dev, "power");
309 if (IS_ERR(panel->supply))
310 return PTR_ERR(panel->supply);
311
Alexandre Courbota61400d2014-10-23 17:16:58 +0900312 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
313 GPIOD_OUT_LOW);
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900314 if (IS_ERR(panel->enable_gpio)) {
315 err = PTR_ERR(panel->enable_gpio);
Fabio Estevamb8e93802017-06-30 18:14:46 -0300316 if (err != -EPROBE_DEFER)
317 dev_err(dev, "failed to request GPIO: %d\n", err);
Alexandre Courbot9746c612014-07-25 23:47:25 +0900318 return err;
319 }
Thierry Reding280921d2013-08-30 15:10:14 +0200320
Thierry Reding280921d2013-08-30 15:10:14 +0200321 backlight = of_parse_phandle(dev->of_node, "backlight", 0);
322 if (backlight) {
323 panel->backlight = of_find_backlight_by_node(backlight);
324 of_node_put(backlight);
325
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900326 if (!panel->backlight)
327 return -EPROBE_DEFER;
Thierry Reding280921d2013-08-30 15:10:14 +0200328 }
329
330 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
331 if (ddc) {
332 panel->ddc = of_find_i2c_adapter_by_node(ddc);
333 of_node_put(ddc);
334
335 if (!panel->ddc) {
336 err = -EPROBE_DEFER;
337 goto free_backlight;
338 }
339 }
340
341 drm_panel_init(&panel->base);
342 panel->base.dev = dev;
343 panel->base.funcs = &panel_simple_funcs;
344
345 err = drm_panel_add(&panel->base);
346 if (err < 0)
347 goto free_ddc;
348
349 dev_set_drvdata(dev, panel);
350
351 return 0;
352
353free_ddc:
354 if (panel->ddc)
355 put_device(&panel->ddc->dev);
356free_backlight:
357 if (panel->backlight)
358 put_device(&panel->backlight->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200359
360 return err;
361}
362
363static int panel_simple_remove(struct device *dev)
364{
365 struct panel_simple *panel = dev_get_drvdata(dev);
366
Thierry Reding280921d2013-08-30 15:10:14 +0200367 drm_panel_remove(&panel->base);
368
369 panel_simple_disable(&panel->base);
Jonathan Liuf3621a82017-08-07 21:55:45 +1000370 panel_simple_unprepare(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200371
372 if (panel->ddc)
373 put_device(&panel->ddc->dev);
374
375 if (panel->backlight)
376 put_device(&panel->backlight->dev);
377
Thierry Reding280921d2013-08-30 15:10:14 +0200378 return 0;
379}
380
Thierry Redingd02fd932014-04-29 17:21:21 +0200381static void panel_simple_shutdown(struct device *dev)
382{
383 struct panel_simple *panel = dev_get_drvdata(dev);
384
385 panel_simple_disable(&panel->base);
Jonathan Liuf3621a82017-08-07 21:55:45 +1000386 panel_simple_unprepare(&panel->base);
Thierry Redingd02fd932014-04-29 17:21:21 +0200387}
388
Yannick Fertre966fea72017-03-28 11:44:49 +0200389static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
390 .clock = 9000,
391 .hdisplay = 480,
392 .hsync_start = 480 + 2,
393 .hsync_end = 480 + 2 + 41,
394 .htotal = 480 + 2 + 41 + 2,
395 .vdisplay = 272,
396 .vsync_start = 272 + 2,
397 .vsync_end = 272 + 2 + 10,
398 .vtotal = 272 + 2 + 10 + 2,
399 .vrefresh = 60,
400 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
401};
402
403static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
404 .modes = &ampire_am_480272h3tmqw_t01h_mode,
405 .num_modes = 1,
406 .bpc = 8,
407 .size = {
408 .width = 105,
409 .height = 67,
410 },
411 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
412};
413
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100414static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
415 .clock = 33333,
416 .hdisplay = 800,
417 .hsync_start = 800 + 0,
418 .hsync_end = 800 + 0 + 255,
419 .htotal = 800 + 0 + 255 + 0,
420 .vdisplay = 480,
421 .vsync_start = 480 + 2,
422 .vsync_end = 480 + 2 + 45,
423 .vtotal = 480 + 2 + 45 + 0,
424 .vrefresh = 60,
425 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
426};
427
428static const struct panel_desc ampire_am800480r3tmqwa1h = {
429 .modes = &ampire_am800480r3tmqwa1h_mode,
430 .num_modes = 1,
431 .bpc = 6,
432 .size = {
433 .width = 152,
434 .height = 91,
435 },
436 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
437};
438
Thierry Reding280921d2013-08-30 15:10:14 +0200439static const struct drm_display_mode auo_b101aw03_mode = {
440 .clock = 51450,
441 .hdisplay = 1024,
442 .hsync_start = 1024 + 156,
443 .hsync_end = 1024 + 156 + 8,
444 .htotal = 1024 + 156 + 8 + 156,
445 .vdisplay = 600,
446 .vsync_start = 600 + 16,
447 .vsync_end = 600 + 16 + 6,
448 .vtotal = 600 + 16 + 6 + 16,
449 .vrefresh = 60,
450};
451
452static const struct panel_desc auo_b101aw03 = {
453 .modes = &auo_b101aw03_mode,
454 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700455 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200456 .size = {
457 .width = 223,
458 .height = 125,
459 },
460};
461
Huang Lina531bc32015-02-28 10:18:58 +0800462static const struct drm_display_mode auo_b101ean01_mode = {
463 .clock = 72500,
464 .hdisplay = 1280,
465 .hsync_start = 1280 + 119,
466 .hsync_end = 1280 + 119 + 32,
467 .htotal = 1280 + 119 + 32 + 21,
468 .vdisplay = 800,
469 .vsync_start = 800 + 4,
470 .vsync_end = 800 + 4 + 20,
471 .vtotal = 800 + 4 + 20 + 8,
472 .vrefresh = 60,
473};
474
475static const struct panel_desc auo_b101ean01 = {
476 .modes = &auo_b101ean01_mode,
477 .num_modes = 1,
478 .bpc = 6,
479 .size = {
480 .width = 217,
481 .height = 136,
482 },
483};
484
Rob Clarkdac746e2014-08-01 17:01:06 -0400485static const struct drm_display_mode auo_b101xtn01_mode = {
486 .clock = 72000,
487 .hdisplay = 1366,
488 .hsync_start = 1366 + 20,
489 .hsync_end = 1366 + 20 + 70,
490 .htotal = 1366 + 20 + 70,
491 .vdisplay = 768,
492 .vsync_start = 768 + 14,
493 .vsync_end = 768 + 14 + 42,
494 .vtotal = 768 + 14 + 42,
495 .vrefresh = 60,
496 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
497};
498
499static const struct panel_desc auo_b101xtn01 = {
500 .modes = &auo_b101xtn01_mode,
501 .num_modes = 1,
502 .bpc = 6,
503 .size = {
504 .width = 223,
505 .height = 125,
506 },
507};
508
Ajay Kumare35e3052014-09-01 15:40:02 +0530509static const struct drm_display_mode auo_b116xw03_mode = {
510 .clock = 70589,
511 .hdisplay = 1366,
512 .hsync_start = 1366 + 40,
513 .hsync_end = 1366 + 40 + 40,
514 .htotal = 1366 + 40 + 40 + 32,
515 .vdisplay = 768,
516 .vsync_start = 768 + 10,
517 .vsync_end = 768 + 10 + 12,
518 .vtotal = 768 + 10 + 12 + 6,
519 .vrefresh = 60,
520};
521
522static const struct panel_desc auo_b116xw03 = {
523 .modes = &auo_b116xw03_mode,
524 .num_modes = 1,
525 .bpc = 6,
526 .size = {
527 .width = 256,
528 .height = 144,
529 },
530};
531
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700532static const struct drm_display_mode auo_b133xtn01_mode = {
533 .clock = 69500,
534 .hdisplay = 1366,
535 .hsync_start = 1366 + 48,
536 .hsync_end = 1366 + 48 + 32,
537 .htotal = 1366 + 48 + 32 + 20,
538 .vdisplay = 768,
539 .vsync_start = 768 + 3,
540 .vsync_end = 768 + 3 + 6,
541 .vtotal = 768 + 3 + 6 + 13,
542 .vrefresh = 60,
543};
544
545static const struct panel_desc auo_b133xtn01 = {
546 .modes = &auo_b133xtn01_mode,
547 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700548 .bpc = 6,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700549 .size = {
550 .width = 293,
551 .height = 165,
552 },
553};
554
Ajay Kumar3e51d602014-07-31 23:12:12 +0530555static const struct drm_display_mode auo_b133htn01_mode = {
556 .clock = 150660,
557 .hdisplay = 1920,
558 .hsync_start = 1920 + 172,
559 .hsync_end = 1920 + 172 + 80,
560 .htotal = 1920 + 172 + 80 + 60,
561 .vdisplay = 1080,
562 .vsync_start = 1080 + 25,
563 .vsync_end = 1080 + 25 + 10,
564 .vtotal = 1080 + 25 + 10 + 10,
565 .vrefresh = 60,
566};
567
568static const struct panel_desc auo_b133htn01 = {
569 .modes = &auo_b133htn01_mode,
570 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +0100571 .bpc = 6,
Ajay Kumar3e51d602014-07-31 23:12:12 +0530572 .size = {
573 .width = 293,
574 .height = 165,
575 },
576 .delay = {
577 .prepare = 105,
578 .enable = 20,
579 .unprepare = 50,
580 },
581};
582
Lukasz Majewskibccfaff2018-05-14 21:08:49 +0200583static const struct display_timing auo_g070vvn01_timings = {
584 .pixelclock = { 33300000, 34209000, 45000000 },
585 .hactive = { 800, 800, 800 },
586 .hfront_porch = { 20, 40, 200 },
587 .hback_porch = { 87, 40, 1 },
588 .hsync_len = { 1, 48, 87 },
589 .vactive = { 480, 480, 480 },
590 .vfront_porch = { 5, 13, 200 },
591 .vback_porch = { 31, 31, 29 },
592 .vsync_len = { 1, 1, 3 },
593};
594
595static const struct panel_desc auo_g070vvn01 = {
596 .timings = &auo_g070vvn01_timings,
597 .num_timings = 1,
598 .bpc = 8,
599 .size = {
600 .width = 152,
601 .height = 91,
602 },
603 .delay = {
604 .prepare = 200,
605 .enable = 50,
606 .disable = 50,
607 .unprepare = 1000,
608 },
609};
610
Christoph Fritz4451c282017-12-16 14:13:36 +0100611static const struct drm_display_mode auo_g104sn02_mode = {
612 .clock = 40000,
613 .hdisplay = 800,
614 .hsync_start = 800 + 40,
615 .hsync_end = 800 + 40 + 216,
616 .htotal = 800 + 40 + 216 + 128,
617 .vdisplay = 600,
618 .vsync_start = 600 + 10,
619 .vsync_end = 600 + 10 + 35,
620 .vtotal = 600 + 10 + 35 + 2,
621 .vrefresh = 60,
622};
623
624static const struct panel_desc auo_g104sn02 = {
625 .modes = &auo_g104sn02_mode,
626 .num_modes = 1,
627 .bpc = 8,
628 .size = {
629 .width = 211,
630 .height = 158,
631 },
632};
633
Lucas Stach697035c2016-11-30 14:09:55 +0100634static const struct display_timing auo_g133han01_timings = {
635 .pixelclock = { 134000000, 141200000, 149000000 },
636 .hactive = { 1920, 1920, 1920 },
637 .hfront_porch = { 39, 58, 77 },
638 .hback_porch = { 59, 88, 117 },
639 .hsync_len = { 28, 42, 56 },
640 .vactive = { 1080, 1080, 1080 },
641 .vfront_porch = { 3, 8, 11 },
642 .vback_porch = { 5, 14, 19 },
643 .vsync_len = { 4, 14, 19 },
644};
645
646static const struct panel_desc auo_g133han01 = {
647 .timings = &auo_g133han01_timings,
648 .num_timings = 1,
649 .bpc = 8,
650 .size = {
651 .width = 293,
652 .height = 165,
653 },
654 .delay = {
655 .prepare = 200,
656 .enable = 50,
657 .disable = 50,
658 .unprepare = 1000,
659 },
660 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
661};
662
Lucas Stach8c31f602016-11-30 14:09:56 +0100663static const struct display_timing auo_g185han01_timings = {
664 .pixelclock = { 120000000, 144000000, 175000000 },
665 .hactive = { 1920, 1920, 1920 },
666 .hfront_porch = { 18, 60, 74 },
667 .hback_porch = { 12, 44, 54 },
668 .hsync_len = { 10, 24, 32 },
669 .vactive = { 1080, 1080, 1080 },
670 .vfront_porch = { 6, 10, 40 },
671 .vback_porch = { 2, 5, 20 },
672 .vsync_len = { 2, 5, 20 },
673};
674
675static const struct panel_desc auo_g185han01 = {
676 .timings = &auo_g185han01_timings,
677 .num_timings = 1,
678 .bpc = 8,
679 .size = {
680 .width = 409,
681 .height = 230,
682 },
683 .delay = {
684 .prepare = 50,
685 .enable = 200,
686 .disable = 110,
687 .unprepare = 1000,
688 },
689 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
690};
691
Lucas Stach70c0d5b2017-06-08 20:07:58 +0200692static const struct display_timing auo_p320hvn03_timings = {
693 .pixelclock = { 106000000, 148500000, 164000000 },
694 .hactive = { 1920, 1920, 1920 },
695 .hfront_porch = { 25, 50, 130 },
696 .hback_porch = { 25, 50, 130 },
697 .hsync_len = { 20, 40, 105 },
698 .vactive = { 1080, 1080, 1080 },
699 .vfront_porch = { 8, 17, 150 },
700 .vback_porch = { 8, 17, 150 },
701 .vsync_len = { 4, 11, 100 },
702};
703
704static const struct panel_desc auo_p320hvn03 = {
705 .timings = &auo_p320hvn03_timings,
706 .num_timings = 1,
707 .bpc = 8,
708 .size = {
709 .width = 698,
710 .height = 393,
711 },
712 .delay = {
713 .prepare = 1,
714 .enable = 450,
715 .unprepare = 500,
716 },
Lucas Stach2554f152018-04-11 17:27:41 +0200717 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Lucas Stach70c0d5b2017-06-08 20:07:58 +0200718};
719
Haixia Shi7ee933a2016-10-11 14:59:16 -0700720static const struct drm_display_mode auo_t215hvn01_mode = {
721 .clock = 148800,
722 .hdisplay = 1920,
723 .hsync_start = 1920 + 88,
724 .hsync_end = 1920 + 88 + 44,
725 .htotal = 1920 + 88 + 44 + 148,
726 .vdisplay = 1080,
727 .vsync_start = 1080 + 4,
728 .vsync_end = 1080 + 4 + 5,
729 .vtotal = 1080 + 4 + 5 + 36,
730 .vrefresh = 60,
731};
732
733static const struct panel_desc auo_t215hvn01 = {
734 .modes = &auo_t215hvn01_mode,
735 .num_modes = 1,
736 .bpc = 8,
737 .size = {
738 .width = 430,
739 .height = 270,
740 },
741 .delay = {
742 .disable = 5,
743 .unprepare = 1000,
744 }
745};
746
Philipp Zabeld47df632014-12-18 16:43:43 +0100747static const struct drm_display_mode avic_tm070ddh03_mode = {
748 .clock = 51200,
749 .hdisplay = 1024,
750 .hsync_start = 1024 + 160,
751 .hsync_end = 1024 + 160 + 4,
752 .htotal = 1024 + 160 + 4 + 156,
753 .vdisplay = 600,
754 .vsync_start = 600 + 17,
755 .vsync_end = 600 + 17 + 1,
756 .vtotal = 600 + 17 + 1 + 17,
757 .vrefresh = 60,
758};
759
760static const struct panel_desc avic_tm070ddh03 = {
761 .modes = &avic_tm070ddh03_mode,
762 .num_modes = 1,
763 .bpc = 8,
764 .size = {
765 .width = 154,
766 .height = 90,
767 },
768 .delay = {
769 .prepare = 20,
770 .enable = 200,
771 .disable = 200,
772 },
773};
774
Andrzej Hajdaae8cf412018-06-19 10:19:26 +0200775static const struct drm_display_mode boe_hv070wsa_mode = {
776 .clock = 40800,
777 .hdisplay = 1024,
778 .hsync_start = 1024 + 90,
779 .hsync_end = 1024 + 90 + 90,
780 .htotal = 1024 + 90 + 90 + 90,
781 .vdisplay = 600,
782 .vsync_start = 600 + 3,
783 .vsync_end = 600 + 3 + 4,
784 .vtotal = 600 + 3 + 4 + 3,
785 .vrefresh = 60,
786};
787
788static const struct panel_desc boe_hv070wsa = {
789 .modes = &boe_hv070wsa_mode,
790 .num_modes = 1,
791 .size = {
792 .width = 154,
793 .height = 90,
794 },
795};
796
Caesar Wangcac1a412016-12-14 11:19:56 +0800797static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
798 {
799 .clock = 71900,
800 .hdisplay = 1280,
801 .hsync_start = 1280 + 48,
802 .hsync_end = 1280 + 48 + 32,
803 .htotal = 1280 + 48 + 32 + 80,
804 .vdisplay = 800,
805 .vsync_start = 800 + 3,
806 .vsync_end = 800 + 3 + 5,
807 .vtotal = 800 + 3 + 5 + 24,
808 .vrefresh = 60,
809 },
810 {
811 .clock = 57500,
812 .hdisplay = 1280,
813 .hsync_start = 1280 + 48,
814 .hsync_end = 1280 + 48 + 32,
815 .htotal = 1280 + 48 + 32 + 80,
816 .vdisplay = 800,
817 .vsync_start = 800 + 3,
818 .vsync_end = 800 + 3 + 5,
819 .vtotal = 800 + 3 + 5 + 24,
820 .vrefresh = 48,
821 },
822};
823
824static const struct panel_desc boe_nv101wxmn51 = {
825 .modes = boe_nv101wxmn51_modes,
826 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
827 .bpc = 8,
828 .size = {
829 .width = 217,
830 .height = 136,
831 },
832 .delay = {
833 .prepare = 210,
834 .enable = 50,
835 .unprepare = 160,
836 },
837};
838
Randy Li2cb35c82016-09-20 03:02:51 +0800839static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
840 .clock = 66770,
841 .hdisplay = 800,
842 .hsync_start = 800 + 49,
843 .hsync_end = 800 + 49 + 33,
844 .htotal = 800 + 49 + 33 + 17,
845 .vdisplay = 1280,
846 .vsync_start = 1280 + 1,
847 .vsync_end = 1280 + 1 + 7,
848 .vtotal = 1280 + 1 + 7 + 15,
849 .vrefresh = 60,
850 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
851};
852
853static const struct panel_desc chunghwa_claa070wp03xg = {
854 .modes = &chunghwa_claa070wp03xg_mode,
855 .num_modes = 1,
856 .bpc = 6,
857 .size = {
858 .width = 94,
859 .height = 150,
860 },
861};
862
Stephen Warren4c930752014-01-07 16:46:26 -0700863static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
864 .clock = 72070,
865 .hdisplay = 1366,
866 .hsync_start = 1366 + 58,
867 .hsync_end = 1366 + 58 + 58,
868 .htotal = 1366 + 58 + 58 + 58,
869 .vdisplay = 768,
870 .vsync_start = 768 + 4,
871 .vsync_end = 768 + 4 + 4,
872 .vtotal = 768 + 4 + 4 + 4,
873 .vrefresh = 60,
874};
875
876static const struct panel_desc chunghwa_claa101wa01a = {
877 .modes = &chunghwa_claa101wa01a_mode,
878 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700879 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -0700880 .size = {
881 .width = 220,
882 .height = 120,
883 },
884};
885
Thierry Reding280921d2013-08-30 15:10:14 +0200886static const struct drm_display_mode chunghwa_claa101wb01_mode = {
887 .clock = 69300,
888 .hdisplay = 1366,
889 .hsync_start = 1366 + 48,
890 .hsync_end = 1366 + 48 + 32,
891 .htotal = 1366 + 48 + 32 + 20,
892 .vdisplay = 768,
893 .vsync_start = 768 + 16,
894 .vsync_end = 768 + 16 + 8,
895 .vtotal = 768 + 16 + 8 + 16,
896 .vrefresh = 60,
897};
898
899static const struct panel_desc chunghwa_claa101wb01 = {
900 .modes = &chunghwa_claa101wb01_mode,
901 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700902 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200903 .size = {
904 .width = 223,
905 .height = 125,
906 },
907};
908
Philipp Zabel0ca0c822018-05-23 11:25:04 +0200909static const struct display_timing dlc_dlc0700yzg_1_timing = {
910 .pixelclock = { 45000000, 51200000, 57000000 },
911 .hactive = { 1024, 1024, 1024 },
912 .hfront_porch = { 100, 106, 113 },
913 .hback_porch = { 100, 106, 113 },
914 .hsync_len = { 100, 108, 114 },
915 .vactive = { 600, 600, 600 },
916 .vfront_porch = { 8, 11, 15 },
917 .vback_porch = { 8, 11, 15 },
918 .vsync_len = { 9, 13, 15 },
919 .flags = DISPLAY_FLAGS_DE_HIGH,
920};
921
922static const struct panel_desc dlc_dlc0700yzg_1 = {
923 .timings = &dlc_dlc0700yzg_1_timing,
924 .num_timings = 1,
925 .bpc = 6,
926 .size = {
927 .width = 154,
928 .height = 86,
929 },
930 .delay = {
931 .prepare = 30,
932 .enable = 200,
933 .disable = 200,
934 },
935 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
936};
937
Stefan Agner26ab0062014-05-15 11:38:45 +0200938static const struct drm_display_mode edt_et057090dhu_mode = {
939 .clock = 25175,
940 .hdisplay = 640,
941 .hsync_start = 640 + 16,
942 .hsync_end = 640 + 16 + 30,
943 .htotal = 640 + 16 + 30 + 114,
944 .vdisplay = 480,
945 .vsync_start = 480 + 10,
946 .vsync_end = 480 + 10 + 3,
947 .vtotal = 480 + 10 + 3 + 32,
948 .vrefresh = 60,
949 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
950};
951
952static const struct panel_desc edt_et057090dhu = {
953 .modes = &edt_et057090dhu_mode,
954 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700955 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +0200956 .size = {
957 .width = 115,
958 .height = 86,
959 },
Stefan Agnereaeebff2016-12-08 14:54:31 -0800960 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
961 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
Stefan Agner26ab0062014-05-15 11:38:45 +0200962};
963
Philipp Zabelfff5de42014-05-15 12:25:47 +0200964static const struct drm_display_mode edt_etm0700g0dh6_mode = {
965 .clock = 33260,
966 .hdisplay = 800,
967 .hsync_start = 800 + 40,
968 .hsync_end = 800 + 40 + 128,
969 .htotal = 800 + 40 + 128 + 88,
970 .vdisplay = 480,
971 .vsync_start = 480 + 10,
972 .vsync_end = 480 + 10 + 2,
973 .vtotal = 480 + 10 + 2 + 33,
974 .vrefresh = 60,
975 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
976};
977
978static const struct panel_desc edt_etm0700g0dh6 = {
979 .modes = &edt_etm0700g0dh6_mode,
980 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700981 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +0200982 .size = {
983 .width = 152,
984 .height = 91,
985 },
Stefan Agnereaeebff2016-12-08 14:54:31 -0800986 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
987 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
Philipp Zabelfff5de42014-05-15 12:25:47 +0200988};
989
Jan Tuerkaa7e6452018-06-19 11:55:44 +0200990static const struct panel_desc edt_etm0700g0bdh6 = {
991 .modes = &edt_etm0700g0dh6_mode,
992 .num_modes = 1,
993 .bpc = 6,
994 .size = {
995 .width = 152,
996 .height = 91,
997 },
998 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
999 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
1000};
1001
Boris BREZILLON102932b2014-06-05 15:53:32 +02001002static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
1003 .clock = 32260,
1004 .hdisplay = 800,
1005 .hsync_start = 800 + 168,
1006 .hsync_end = 800 + 168 + 64,
1007 .htotal = 800 + 168 + 64 + 88,
1008 .vdisplay = 480,
1009 .vsync_start = 480 + 37,
1010 .vsync_end = 480 + 37 + 2,
1011 .vtotal = 480 + 37 + 2 + 8,
1012 .vrefresh = 60,
1013};
1014
1015static const struct panel_desc foxlink_fl500wvr00_a0t = {
1016 .modes = &foxlink_fl500wvr00_a0t_mode,
1017 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001018 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001019 .size = {
1020 .width = 108,
1021 .height = 65,
1022 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +02001023 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001024};
1025
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001026static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
1027 .clock = 9000,
1028 .hdisplay = 480,
1029 .hsync_start = 480 + 5,
1030 .hsync_end = 480 + 5 + 1,
1031 .htotal = 480 + 5 + 1 + 40,
1032 .vdisplay = 272,
1033 .vsync_start = 272 + 8,
1034 .vsync_end = 272 + 8 + 1,
1035 .vtotal = 272 + 8 + 1 + 8,
1036 .vrefresh = 60,
1037};
1038
1039static const struct panel_desc giantplus_gpg482739qs5 = {
1040 .modes = &giantplus_gpg482739qs5_mode,
1041 .num_modes = 1,
1042 .bpc = 8,
1043 .size = {
1044 .width = 95,
1045 .height = 54,
1046 },
Philipp Zabel33536a02015-02-11 18:50:07 +01001047 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001048};
1049
Philipp Zabelab077252014-12-11 18:32:46 +01001050static const struct display_timing hannstar_hsd070pww1_timing = {
1051 .pixelclock = { 64300000, 71100000, 82000000 },
1052 .hactive = { 1280, 1280, 1280 },
1053 .hfront_porch = { 1, 1, 10 },
1054 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +02001055 /*
1056 * According to the data sheet, the minimum horizontal blanking interval
1057 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
1058 * minimum working horizontal blanking interval to be 60 clocks.
1059 */
1060 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +01001061 .vactive = { 800, 800, 800 },
1062 .vfront_porch = { 1, 1, 10 },
1063 .vback_porch = { 1, 1, 10 },
1064 .vsync_len = { 1, 21, 203 },
1065 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +02001066};
1067
1068static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +01001069 .timings = &hannstar_hsd070pww1_timing,
1070 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +02001071 .bpc = 6,
1072 .size = {
1073 .width = 151,
1074 .height = 94,
1075 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +02001076 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Philipp Zabela8532052014-10-23 16:31:06 +02001077};
1078
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001079static const struct display_timing hannstar_hsd100pxn1_timing = {
1080 .pixelclock = { 55000000, 65000000, 75000000 },
1081 .hactive = { 1024, 1024, 1024 },
1082 .hfront_porch = { 40, 40, 40 },
1083 .hback_porch = { 220, 220, 220 },
1084 .hsync_len = { 20, 60, 100 },
1085 .vactive = { 768, 768, 768 },
1086 .vfront_porch = { 7, 7, 7 },
1087 .vback_porch = { 21, 21, 21 },
1088 .vsync_len = { 10, 10, 10 },
1089 .flags = DISPLAY_FLAGS_DE_HIGH,
1090};
1091
1092static const struct panel_desc hannstar_hsd100pxn1 = {
1093 .timings = &hannstar_hsd100pxn1_timing,
1094 .num_timings = 1,
1095 .bpc = 6,
1096 .size = {
1097 .width = 203,
1098 .height = 152,
1099 },
Philipp Zabel4946b042015-05-20 11:34:08 +02001100 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001101};
1102
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001103static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
1104 .clock = 33333,
1105 .hdisplay = 800,
1106 .hsync_start = 800 + 85,
1107 .hsync_end = 800 + 85 + 86,
1108 .htotal = 800 + 85 + 86 + 85,
1109 .vdisplay = 480,
1110 .vsync_start = 480 + 16,
1111 .vsync_end = 480 + 16 + 13,
1112 .vtotal = 480 + 16 + 13 + 16,
1113 .vrefresh = 60,
1114};
1115
1116static const struct panel_desc hitachi_tx23d38vm0caa = {
1117 .modes = &hitachi_tx23d38vm0caa_mode,
1118 .num_modes = 1,
1119 .bpc = 6,
1120 .size = {
1121 .width = 195,
1122 .height = 117,
1123 },
Philipp Zabel6c684e32017-10-11 14:59:58 +02001124 .delay = {
1125 .enable = 160,
1126 .disable = 160,
1127 },
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001128};
1129
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001130static const struct drm_display_mode innolux_at043tn24_mode = {
1131 .clock = 9000,
1132 .hdisplay = 480,
1133 .hsync_start = 480 + 2,
1134 .hsync_end = 480 + 2 + 41,
1135 .htotal = 480 + 2 + 41 + 2,
1136 .vdisplay = 272,
1137 .vsync_start = 272 + 2,
Philipp Zabela4831592017-10-11 14:59:56 +02001138 .vsync_end = 272 + 2 + 10,
1139 .vtotal = 272 + 2 + 10 + 2,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001140 .vrefresh = 60,
1141 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1142};
1143
1144static const struct panel_desc innolux_at043tn24 = {
1145 .modes = &innolux_at043tn24_mode,
1146 .num_modes = 1,
1147 .bpc = 8,
1148 .size = {
1149 .width = 95,
1150 .height = 54,
1151 },
1152 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabel65602792017-10-11 14:59:57 +02001153 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001154};
1155
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02001156static const struct drm_display_mode innolux_at070tn92_mode = {
1157 .clock = 33333,
1158 .hdisplay = 800,
1159 .hsync_start = 800 + 210,
1160 .hsync_end = 800 + 210 + 20,
1161 .htotal = 800 + 210 + 20 + 46,
1162 .vdisplay = 480,
1163 .vsync_start = 480 + 22,
1164 .vsync_end = 480 + 22 + 10,
1165 .vtotal = 480 + 22 + 23 + 10,
1166 .vrefresh = 60,
1167};
1168
1169static const struct panel_desc innolux_at070tn92 = {
1170 .modes = &innolux_at070tn92_mode,
1171 .num_modes = 1,
1172 .size = {
1173 .width = 154,
1174 .height = 86,
1175 },
1176 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1177};
1178
Michael Olbrich1e29b842016-08-15 14:32:02 +02001179static const struct display_timing innolux_g101ice_l01_timing = {
1180 .pixelclock = { 60400000, 71100000, 74700000 },
1181 .hactive = { 1280, 1280, 1280 },
1182 .hfront_porch = { 41, 80, 100 },
1183 .hback_porch = { 40, 79, 99 },
1184 .hsync_len = { 1, 1, 1 },
1185 .vactive = { 800, 800, 800 },
1186 .vfront_porch = { 5, 11, 14 },
1187 .vback_porch = { 4, 11, 14 },
1188 .vsync_len = { 1, 1, 1 },
1189 .flags = DISPLAY_FLAGS_DE_HIGH,
1190};
1191
1192static const struct panel_desc innolux_g101ice_l01 = {
1193 .timings = &innolux_g101ice_l01_timing,
1194 .num_timings = 1,
1195 .bpc = 8,
1196 .size = {
1197 .width = 217,
1198 .height = 135,
1199 },
1200 .delay = {
1201 .enable = 200,
1202 .disable = 200,
1203 },
1204 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1205};
1206
Lucas Stach4ae13e42016-11-30 14:09:54 +01001207static const struct display_timing innolux_g121i1_l01_timing = {
1208 .pixelclock = { 67450000, 71000000, 74550000 },
1209 .hactive = { 1280, 1280, 1280 },
1210 .hfront_porch = { 40, 80, 160 },
1211 .hback_porch = { 39, 79, 159 },
1212 .hsync_len = { 1, 1, 1 },
1213 .vactive = { 800, 800, 800 },
1214 .vfront_porch = { 5, 11, 100 },
1215 .vback_porch = { 4, 11, 99 },
1216 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01001217};
1218
1219static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01001220 .timings = &innolux_g121i1_l01_timing,
1221 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01001222 .bpc = 6,
1223 .size = {
1224 .width = 261,
1225 .height = 163,
1226 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01001227 .delay = {
1228 .enable = 200,
1229 .disable = 20,
1230 },
1231 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Lucas Stachd731f662014-11-06 17:44:33 +01001232};
1233
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001234static const struct drm_display_mode innolux_g121x1_l03_mode = {
1235 .clock = 65000,
1236 .hdisplay = 1024,
1237 .hsync_start = 1024 + 0,
1238 .hsync_end = 1024 + 1,
1239 .htotal = 1024 + 0 + 1 + 320,
1240 .vdisplay = 768,
1241 .vsync_start = 768 + 38,
1242 .vsync_end = 768 + 38 + 1,
1243 .vtotal = 768 + 38 + 1 + 0,
1244 .vrefresh = 60,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05001245 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05001246};
1247
1248static const struct panel_desc innolux_g121x1_l03 = {
1249 .modes = &innolux_g121x1_l03_mode,
1250 .num_modes = 1,
1251 .bpc = 6,
1252 .size = {
1253 .width = 246,
1254 .height = 185,
1255 },
1256 .delay = {
1257 .enable = 200,
1258 .unprepare = 200,
1259 .disable = 400,
1260 },
1261};
1262
Thierry Reding0a2288c2014-07-03 14:02:59 +02001263static const struct drm_display_mode innolux_n116bge_mode = {
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001264 .clock = 76420,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001265 .hdisplay = 1366,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001266 .hsync_start = 1366 + 136,
1267 .hsync_end = 1366 + 136 + 30,
1268 .htotal = 1366 + 136 + 30 + 60,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001269 .vdisplay = 768,
1270 .vsync_start = 768 + 8,
Daniel Kurtz7fe8c772014-09-02 10:56:46 +08001271 .vsync_end = 768 + 8 + 12,
1272 .vtotal = 768 + 8 + 12 + 12,
Thierry Reding0a2288c2014-07-03 14:02:59 +02001273 .vrefresh = 60,
1274 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1275};
1276
1277static const struct panel_desc innolux_n116bge = {
1278 .modes = &innolux_n116bge_mode,
1279 .num_modes = 1,
1280 .bpc = 6,
1281 .size = {
1282 .width = 256,
1283 .height = 144,
1284 },
1285};
1286
Alban Bedelea447392014-07-22 08:38:55 +02001287static const struct drm_display_mode innolux_n156bge_l21_mode = {
1288 .clock = 69300,
1289 .hdisplay = 1366,
1290 .hsync_start = 1366 + 16,
1291 .hsync_end = 1366 + 16 + 34,
1292 .htotal = 1366 + 16 + 34 + 50,
1293 .vdisplay = 768,
1294 .vsync_start = 768 + 2,
1295 .vsync_end = 768 + 2 + 6,
1296 .vtotal = 768 + 2 + 6 + 12,
1297 .vrefresh = 60,
1298};
1299
1300static const struct panel_desc innolux_n156bge_l21 = {
1301 .modes = &innolux_n156bge_l21_mode,
1302 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001303 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02001304 .size = {
1305 .width = 344,
1306 .height = 193,
1307 },
1308};
1309
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05301310static const struct drm_display_mode innolux_tv123wam_mode = {
1311 .clock = 206016,
1312 .hdisplay = 2160,
1313 .hsync_start = 2160 + 48,
1314 .hsync_end = 2160 + 48 + 32,
1315 .htotal = 2160 + 48 + 32 + 80,
1316 .vdisplay = 1440,
1317 .vsync_start = 1440 + 3,
1318 .vsync_end = 1440 + 3 + 10,
1319 .vtotal = 1440 + 3 + 10 + 27,
1320 .vrefresh = 60,
1321 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
1322};
1323
1324static const struct panel_desc innolux_tv123wam = {
1325 .modes = &innolux_tv123wam_mode,
1326 .num_modes = 1,
1327 .bpc = 8,
1328 .size = {
1329 .width = 259,
1330 .height = 173,
1331 },
1332};
1333
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001334static const struct drm_display_mode innolux_zj070na_01p_mode = {
1335 .clock = 51501,
1336 .hdisplay = 1024,
1337 .hsync_start = 1024 + 128,
1338 .hsync_end = 1024 + 128 + 64,
1339 .htotal = 1024 + 128 + 64 + 128,
1340 .vdisplay = 600,
1341 .vsync_start = 600 + 16,
1342 .vsync_end = 600 + 16 + 4,
1343 .vtotal = 600 + 16 + 4 + 16,
1344 .vrefresh = 60,
1345};
1346
1347static const struct panel_desc innolux_zj070na_01p = {
1348 .modes = &innolux_zj070na_01p_mode,
1349 .num_modes = 1,
1350 .bpc = 6,
1351 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001352 .width = 154,
1353 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01001354 },
1355};
1356
Jagan Teki8cfe8342018-02-04 23:19:28 +05301357static const struct display_timing koe_tx31d200vm0baa_timing = {
1358 .pixelclock = { 39600000, 43200000, 48000000 },
1359 .hactive = { 1280, 1280, 1280 },
1360 .hfront_porch = { 16, 36, 56 },
1361 .hback_porch = { 16, 36, 56 },
1362 .hsync_len = { 8, 8, 8 },
1363 .vactive = { 480, 480, 480 },
Stefan Agnerc9b6be72018-04-19 23:20:03 +02001364 .vfront_porch = { 6, 21, 33 },
1365 .vback_porch = { 6, 21, 33 },
Jagan Teki8cfe8342018-02-04 23:19:28 +05301366 .vsync_len = { 8, 8, 8 },
1367 .flags = DISPLAY_FLAGS_DE_HIGH,
1368};
1369
1370static const struct panel_desc koe_tx31d200vm0baa = {
1371 .timings = &koe_tx31d200vm0baa_timing,
1372 .num_timings = 1,
1373 .bpc = 6,
1374 .size = {
1375 .width = 292,
1376 .height = 109,
1377 },
1378 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1379};
1380
Lucas Stach8def22e2015-12-02 19:41:11 +01001381static const struct display_timing kyo_tcg121xglp_timing = {
1382 .pixelclock = { 52000000, 65000000, 71000000 },
1383 .hactive = { 1024, 1024, 1024 },
1384 .hfront_porch = { 2, 2, 2 },
1385 .hback_porch = { 2, 2, 2 },
1386 .hsync_len = { 86, 124, 244 },
1387 .vactive = { 768, 768, 768 },
1388 .vfront_porch = { 2, 2, 2 },
1389 .vback_porch = { 2, 2, 2 },
1390 .vsync_len = { 6, 34, 73 },
1391 .flags = DISPLAY_FLAGS_DE_HIGH,
1392};
1393
1394static const struct panel_desc kyo_tcg121xglp = {
1395 .timings = &kyo_tcg121xglp_timing,
1396 .num_timings = 1,
1397 .bpc = 8,
1398 .size = {
1399 .width = 246,
1400 .height = 184,
1401 },
1402 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1403};
1404
Heiko Schocherdd015002015-05-22 10:25:57 +02001405static const struct drm_display_mode lg_lb070wv8_mode = {
1406 .clock = 33246,
1407 .hdisplay = 800,
1408 .hsync_start = 800 + 88,
1409 .hsync_end = 800 + 88 + 80,
1410 .htotal = 800 + 88 + 80 + 88,
1411 .vdisplay = 480,
1412 .vsync_start = 480 + 10,
1413 .vsync_end = 480 + 10 + 25,
1414 .vtotal = 480 + 10 + 25 + 10,
1415 .vrefresh = 60,
1416};
1417
1418static const struct panel_desc lg_lb070wv8 = {
1419 .modes = &lg_lb070wv8_mode,
1420 .num_modes = 1,
1421 .bpc = 16,
1422 .size = {
1423 .width = 151,
1424 .height = 91,
1425 },
1426 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1427};
1428
Yakir Yangc5ece402016-06-28 12:51:15 +08001429static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1430 .clock = 200000,
1431 .hdisplay = 1536,
1432 .hsync_start = 1536 + 12,
1433 .hsync_end = 1536 + 12 + 16,
1434 .htotal = 1536 + 12 + 16 + 48,
1435 .vdisplay = 2048,
1436 .vsync_start = 2048 + 8,
1437 .vsync_end = 2048 + 8 + 4,
1438 .vtotal = 2048 + 8 + 4 + 8,
1439 .vrefresh = 60,
1440 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1441};
1442
1443static const struct panel_desc lg_lp079qx1_sp0v = {
1444 .modes = &lg_lp079qx1_sp0v_mode,
1445 .num_modes = 1,
1446 .size = {
1447 .width = 129,
1448 .height = 171,
1449 },
1450};
1451
Yakir Yang0355dde2016-06-12 10:56:02 +08001452static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1453 .clock = 205210,
1454 .hdisplay = 2048,
1455 .hsync_start = 2048 + 150,
1456 .hsync_end = 2048 + 150 + 5,
1457 .htotal = 2048 + 150 + 5 + 5,
1458 .vdisplay = 1536,
1459 .vsync_start = 1536 + 3,
1460 .vsync_end = 1536 + 3 + 1,
1461 .vtotal = 1536 + 3 + 1 + 9,
1462 .vrefresh = 60,
1463};
1464
1465static const struct panel_desc lg_lp097qx1_spa1 = {
1466 .modes = &lg_lp097qx1_spa1_mode,
1467 .num_modes = 1,
1468 .size = {
1469 .width = 208,
1470 .height = 147,
1471 },
1472};
1473
Jitao Shi690d8fa2016-02-22 19:01:44 +08001474static const struct drm_display_mode lg_lp120up1_mode = {
1475 .clock = 162300,
1476 .hdisplay = 1920,
1477 .hsync_start = 1920 + 40,
1478 .hsync_end = 1920 + 40 + 40,
1479 .htotal = 1920 + 40 + 40+ 80,
1480 .vdisplay = 1280,
1481 .vsync_start = 1280 + 4,
1482 .vsync_end = 1280 + 4 + 4,
1483 .vtotal = 1280 + 4 + 4 + 12,
1484 .vrefresh = 60,
1485};
1486
1487static const struct panel_desc lg_lp120up1 = {
1488 .modes = &lg_lp120up1_mode,
1489 .num_modes = 1,
1490 .bpc = 8,
1491 .size = {
1492 .width = 267,
1493 .height = 183,
1494 },
1495};
1496
Thierry Redingec7c5652013-11-15 15:59:32 +01001497static const struct drm_display_mode lg_lp129qe_mode = {
1498 .clock = 285250,
1499 .hdisplay = 2560,
1500 .hsync_start = 2560 + 48,
1501 .hsync_end = 2560 + 48 + 32,
1502 .htotal = 2560 + 48 + 32 + 80,
1503 .vdisplay = 1700,
1504 .vsync_start = 1700 + 3,
1505 .vsync_end = 1700 + 3 + 10,
1506 .vtotal = 1700 + 3 + 10 + 36,
1507 .vrefresh = 60,
1508};
1509
1510static const struct panel_desc lg_lp129qe = {
1511 .modes = &lg_lp129qe_mode,
1512 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001513 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01001514 .size = {
1515 .width = 272,
1516 .height = 181,
1517 },
1518};
1519
Lukasz Majewski65c766c2017-10-21 00:18:37 +02001520static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
1521 .clock = 30400,
1522 .hdisplay = 800,
1523 .hsync_start = 800 + 0,
1524 .hsync_end = 800 + 1,
1525 .htotal = 800 + 0 + 1 + 160,
1526 .vdisplay = 480,
1527 .vsync_start = 480 + 0,
1528 .vsync_end = 480 + 48 + 1,
1529 .vtotal = 480 + 48 + 1 + 0,
1530 .vrefresh = 60,
1531 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1532};
1533
1534static const struct panel_desc mitsubishi_aa070mc01 = {
1535 .modes = &mitsubishi_aa070mc01_mode,
1536 .num_modes = 1,
1537 .bpc = 8,
1538 .size = {
1539 .width = 152,
1540 .height = 91,
1541 },
1542
1543 .delay = {
1544 .enable = 200,
1545 .unprepare = 200,
1546 .disable = 400,
1547 },
1548 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1549 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1550};
1551
Lucas Stach01bacc132017-06-08 20:07:55 +02001552static const struct display_timing nec_nl12880bc20_05_timing = {
1553 .pixelclock = { 67000000, 71000000, 75000000 },
1554 .hactive = { 1280, 1280, 1280 },
1555 .hfront_porch = { 2, 30, 30 },
1556 .hback_porch = { 6, 100, 100 },
1557 .hsync_len = { 2, 30, 30 },
1558 .vactive = { 800, 800, 800 },
1559 .vfront_porch = { 5, 5, 5 },
1560 .vback_porch = { 11, 11, 11 },
1561 .vsync_len = { 7, 7, 7 },
1562};
1563
1564static const struct panel_desc nec_nl12880bc20_05 = {
1565 .timings = &nec_nl12880bc20_05_timing,
1566 .num_timings = 1,
1567 .bpc = 8,
1568 .size = {
1569 .width = 261,
1570 .height = 163,
1571 },
1572 .delay = {
1573 .enable = 50,
1574 .disable = 50,
1575 },
1576 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1577};
1578
jianwei wangc6e87f92015-07-29 16:30:02 +08001579static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
1580 .clock = 10870,
1581 .hdisplay = 480,
1582 .hsync_start = 480 + 2,
1583 .hsync_end = 480 + 2 + 41,
1584 .htotal = 480 + 2 + 41 + 2,
1585 .vdisplay = 272,
1586 .vsync_start = 272 + 2,
1587 .vsync_end = 272 + 2 + 4,
1588 .vtotal = 272 + 2 + 4 + 2,
1589 .vrefresh = 74,
Stefan Agner4bc390c2015-11-17 19:10:29 -08001590 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08001591};
1592
1593static const struct panel_desc nec_nl4827hc19_05b = {
1594 .modes = &nec_nl4827hc19_05b_mode,
1595 .num_modes = 1,
1596 .bpc = 8,
1597 .size = {
1598 .width = 95,
1599 .height = 54,
1600 },
Stefan Agner2c806612016-02-08 12:50:13 -08001601 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1602 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08001603};
1604
Maxime Riparde6c2f062016-09-06 16:46:17 +02001605static const struct drm_display_mode netron_dy_e231732_mode = {
1606 .clock = 66000,
1607 .hdisplay = 1024,
1608 .hsync_start = 1024 + 160,
1609 .hsync_end = 1024 + 160 + 70,
1610 .htotal = 1024 + 160 + 70 + 90,
1611 .vdisplay = 600,
1612 .vsync_start = 600 + 127,
1613 .vsync_end = 600 + 127 + 20,
1614 .vtotal = 600 + 127 + 20 + 3,
1615 .vrefresh = 60,
1616};
1617
1618static const struct panel_desc netron_dy_e231732 = {
1619 .modes = &netron_dy_e231732_mode,
1620 .num_modes = 1,
1621 .size = {
1622 .width = 154,
1623 .height = 87,
1624 },
1625 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1626};
1627
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03001628static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
1629 .clock = 9000,
1630 .hdisplay = 480,
1631 .hsync_start = 480 + 2,
1632 .hsync_end = 480 + 2 + 41,
1633 .htotal = 480 + 2 + 41 + 2,
1634 .vdisplay = 272,
1635 .vsync_start = 272 + 2,
1636 .vsync_end = 272 + 2 + 10,
1637 .vtotal = 272 + 2 + 10 + 2,
1638 .vrefresh = 60,
1639 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1640};
1641
1642static const struct panel_desc newhaven_nhd_43_480272ef_atxl = {
1643 .modes = &newhaven_nhd_43_480272ef_atxl_mode,
1644 .num_modes = 1,
1645 .bpc = 8,
1646 .size = {
1647 .width = 95,
1648 .height = 54,
1649 },
1650 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1651 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE |
1652 DRM_BUS_FLAG_SYNC_POSEDGE,
1653};
1654
Lucas Stach4177fa62017-06-08 20:07:57 +02001655static const struct display_timing nlt_nl192108ac18_02d_timing = {
1656 .pixelclock = { 130000000, 148350000, 163000000 },
1657 .hactive = { 1920, 1920, 1920 },
1658 .hfront_porch = { 80, 100, 100 },
1659 .hback_porch = { 100, 120, 120 },
1660 .hsync_len = { 50, 60, 60 },
1661 .vactive = { 1080, 1080, 1080 },
1662 .vfront_porch = { 12, 30, 30 },
1663 .vback_porch = { 4, 10, 10 },
1664 .vsync_len = { 4, 5, 5 },
1665};
1666
1667static const struct panel_desc nlt_nl192108ac18_02d = {
1668 .timings = &nlt_nl192108ac18_02d_timing,
1669 .num_timings = 1,
1670 .bpc = 8,
1671 .size = {
1672 .width = 344,
1673 .height = 194,
1674 },
1675 .delay = {
1676 .unprepare = 500,
1677 },
1678 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1679};
1680
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02001681static const struct drm_display_mode nvd_9128_mode = {
1682 .clock = 29500,
1683 .hdisplay = 800,
1684 .hsync_start = 800 + 130,
1685 .hsync_end = 800 + 130 + 98,
1686 .htotal = 800 + 0 + 130 + 98,
1687 .vdisplay = 480,
1688 .vsync_start = 480 + 10,
1689 .vsync_end = 480 + 10 + 50,
1690 .vtotal = 480 + 0 + 10 + 50,
1691};
1692
1693static const struct panel_desc nvd_9128 = {
1694 .modes = &nvd_9128_mode,
1695 .num_modes = 1,
1696 .bpc = 8,
1697 .size = {
1698 .width = 156,
1699 .height = 88,
1700 },
1701 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1702};
1703
Gary Bissona99fb622015-06-10 18:44:23 +02001704static const struct display_timing okaya_rs800480t_7x0gp_timing = {
1705 .pixelclock = { 30000000, 30000000, 40000000 },
1706 .hactive = { 800, 800, 800 },
1707 .hfront_porch = { 40, 40, 40 },
1708 .hback_porch = { 40, 40, 40 },
1709 .hsync_len = { 1, 48, 48 },
1710 .vactive = { 480, 480, 480 },
1711 .vfront_porch = { 13, 13, 13 },
1712 .vback_porch = { 29, 29, 29 },
1713 .vsync_len = { 3, 3, 3 },
1714 .flags = DISPLAY_FLAGS_DE_HIGH,
1715};
1716
1717static const struct panel_desc okaya_rs800480t_7x0gp = {
1718 .timings = &okaya_rs800480t_7x0gp_timing,
1719 .num_timings = 1,
1720 .bpc = 6,
1721 .size = {
1722 .width = 154,
1723 .height = 87,
1724 },
1725 .delay = {
1726 .prepare = 41,
1727 .enable = 50,
1728 .unprepare = 41,
1729 .disable = 50,
1730 },
1731 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1732};
1733
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001734static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
1735 .clock = 9000,
1736 .hdisplay = 480,
1737 .hsync_start = 480 + 5,
1738 .hsync_end = 480 + 5 + 30,
1739 .htotal = 480 + 5 + 30 + 10,
1740 .vdisplay = 272,
1741 .vsync_start = 272 + 8,
1742 .vsync_end = 272 + 8 + 5,
1743 .vtotal = 272 + 8 + 5 + 3,
1744 .vrefresh = 60,
1745};
1746
1747static const struct panel_desc olimex_lcd_olinuxino_43ts = {
1748 .modes = &olimex_lcd_olinuxino_43ts_mode,
1749 .num_modes = 1,
1750 .size = {
Jonathan Liu30c6d7ab92017-07-20 20:29:43 +10001751 .width = 95,
1752 .height = 54,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001753 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10001754 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01001755};
1756
Eric Anholte8b6f562016-03-24 17:23:48 -07001757/*
1758 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1759 * pixel clocks, but this is the timing that was being used in the Adafruit
1760 * installation instructions.
1761 */
1762static const struct drm_display_mode ontat_yx700wv03_mode = {
1763 .clock = 29500,
1764 .hdisplay = 800,
1765 .hsync_start = 824,
1766 .hsync_end = 896,
1767 .htotal = 992,
1768 .vdisplay = 480,
1769 .vsync_start = 483,
1770 .vsync_end = 493,
1771 .vtotal = 500,
1772 .vrefresh = 60,
1773 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1774};
1775
1776/*
1777 * Specification at:
1778 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1779 */
1780static const struct panel_desc ontat_yx700wv03 = {
1781 .modes = &ontat_yx700wv03_mode,
1782 .num_modes = 1,
1783 .bpc = 8,
1784 .size = {
1785 .width = 154,
1786 .height = 83,
1787 },
Eric Anholt5651e5e2018-03-09 15:33:32 -08001788 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Eric Anholte8b6f562016-03-24 17:23:48 -07001789};
1790
Philipp Zabel725c9d42015-02-11 18:50:11 +01001791static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
1792 .clock = 25000,
1793 .hdisplay = 480,
1794 .hsync_start = 480 + 10,
1795 .hsync_end = 480 + 10 + 10,
1796 .htotal = 480 + 10 + 10 + 15,
1797 .vdisplay = 800,
1798 .vsync_start = 800 + 3,
1799 .vsync_end = 800 + 3 + 3,
1800 .vtotal = 800 + 3 + 3 + 3,
1801 .vrefresh = 60,
1802};
1803
1804static const struct panel_desc ortustech_com43h4m85ulc = {
1805 .modes = &ortustech_com43h4m85ulc_mode,
1806 .num_modes = 1,
1807 .bpc = 8,
1808 .size = {
1809 .width = 56,
1810 .height = 93,
1811 },
1812 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Marek Vasute0932f92016-08-26 18:26:00 +02001813 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
Philipp Zabel725c9d42015-02-11 18:50:11 +01001814};
1815
Josh Wud2a6f0f2015-10-08 17:42:41 +02001816static const struct drm_display_mode qd43003c0_40_mode = {
1817 .clock = 9000,
1818 .hdisplay = 480,
1819 .hsync_start = 480 + 8,
1820 .hsync_end = 480 + 8 + 4,
1821 .htotal = 480 + 8 + 4 + 39,
1822 .vdisplay = 272,
1823 .vsync_start = 272 + 4,
1824 .vsync_end = 272 + 4 + 10,
1825 .vtotal = 272 + 4 + 10 + 2,
1826 .vrefresh = 60,
1827};
1828
1829static const struct panel_desc qd43003c0_40 = {
1830 .modes = &qd43003c0_40_mode,
1831 .num_modes = 1,
1832 .bpc = 8,
1833 .size = {
1834 .width = 95,
1835 .height = 53,
1836 },
1837 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1838};
1839
Jagan Teki23167fa2018-06-07 19:16:48 +05301840static const struct display_timing rocktech_rk070er9427_timing = {
1841 .pixelclock = { 26400000, 33300000, 46800000 },
1842 .hactive = { 800, 800, 800 },
1843 .hfront_porch = { 16, 210, 354 },
1844 .hback_porch = { 46, 46, 46 },
1845 .hsync_len = { 1, 1, 1 },
1846 .vactive = { 480, 480, 480 },
1847 .vfront_porch = { 7, 22, 147 },
1848 .vback_porch = { 23, 23, 23 },
1849 .vsync_len = { 1, 1, 1 },
1850 .flags = DISPLAY_FLAGS_DE_HIGH,
1851};
1852
1853static const struct panel_desc rocktech_rk070er9427 = {
1854 .timings = &rocktech_rk070er9427_timing,
1855 .num_timings = 1,
1856 .bpc = 6,
1857 .size = {
1858 .width = 154,
1859 .height = 86,
1860 },
1861 .delay = {
1862 .prepare = 41,
1863 .enable = 50,
1864 .unprepare = 41,
1865 .disable = 50,
1866 },
1867 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1868};
1869
Yakir Yang0330eaf2016-06-12 10:56:13 +08001870static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
1871 .clock = 271560,
1872 .hdisplay = 2560,
1873 .hsync_start = 2560 + 48,
1874 .hsync_end = 2560 + 48 + 32,
1875 .htotal = 2560 + 48 + 32 + 80,
1876 .vdisplay = 1600,
1877 .vsync_start = 1600 + 2,
1878 .vsync_end = 1600 + 2 + 5,
1879 .vtotal = 1600 + 2 + 5 + 57,
1880 .vrefresh = 60,
1881};
1882
1883static const struct panel_desc samsung_lsn122dl01_c01 = {
1884 .modes = &samsung_lsn122dl01_c01_mode,
1885 .num_modes = 1,
1886 .size = {
1887 .width = 263,
1888 .height = 164,
1889 },
1890};
1891
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001892static const struct drm_display_mode samsung_ltn101nt05_mode = {
1893 .clock = 54030,
1894 .hdisplay = 1024,
1895 .hsync_start = 1024 + 24,
1896 .hsync_end = 1024 + 24 + 136,
1897 .htotal = 1024 + 24 + 136 + 160,
1898 .vdisplay = 600,
1899 .vsync_start = 600 + 3,
1900 .vsync_end = 600 + 3 + 6,
1901 .vtotal = 600 + 3 + 6 + 61,
1902 .vrefresh = 60,
1903};
1904
1905static const struct panel_desc samsung_ltn101nt05 = {
1906 .modes = &samsung_ltn101nt05_mode,
1907 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001908 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001909 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02001910 .width = 223,
1911 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01001912 },
1913};
1914
Stéphane Marchesin0c934302015-03-18 10:52:18 +01001915static const struct drm_display_mode samsung_ltn140at29_301_mode = {
1916 .clock = 76300,
1917 .hdisplay = 1366,
1918 .hsync_start = 1366 + 64,
1919 .hsync_end = 1366 + 64 + 48,
1920 .htotal = 1366 + 64 + 48 + 128,
1921 .vdisplay = 768,
1922 .vsync_start = 768 + 2,
1923 .vsync_end = 768 + 2 + 5,
1924 .vtotal = 768 + 2 + 5 + 17,
1925 .vrefresh = 60,
1926};
1927
1928static const struct panel_desc samsung_ltn140at29_301 = {
1929 .modes = &samsung_ltn140at29_301_mode,
1930 .num_modes = 1,
1931 .bpc = 6,
1932 .size = {
1933 .width = 320,
1934 .height = 187,
1935 },
1936};
1937
Joshua Clayton592aa022016-07-06 15:59:16 -07001938static const struct display_timing sharp_lq101k1ly04_timing = {
1939 .pixelclock = { 60000000, 65000000, 80000000 },
1940 .hactive = { 1280, 1280, 1280 },
1941 .hfront_porch = { 20, 20, 20 },
1942 .hback_porch = { 20, 20, 20 },
1943 .hsync_len = { 10, 10, 10 },
1944 .vactive = { 800, 800, 800 },
1945 .vfront_porch = { 4, 4, 4 },
1946 .vback_porch = { 4, 4, 4 },
1947 .vsync_len = { 4, 4, 4 },
1948 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
1949};
1950
1951static const struct panel_desc sharp_lq101k1ly04 = {
1952 .timings = &sharp_lq101k1ly04_timing,
1953 .num_timings = 1,
1954 .bpc = 8,
1955 .size = {
1956 .width = 217,
1957 .height = 136,
1958 },
1959 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
1960};
1961
Sean Paul9f7bae22018-02-08 12:48:52 -05001962static const struct display_timing sharp_lq123p1jx31_timing = {
1963 .pixelclock = { 252750000, 252750000, 266604720 },
1964 .hactive = { 2400, 2400, 2400 },
1965 .hfront_porch = { 48, 48, 48 },
1966 .hback_porch = { 80, 80, 84 },
1967 .hsync_len = { 32, 32, 32 },
1968 .vactive = { 1600, 1600, 1600 },
1969 .vfront_porch = { 3, 3, 3 },
1970 .vback_porch = { 33, 33, 120 },
1971 .vsync_len = { 10, 10, 10 },
1972 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Yakir Yang739c7de2016-06-12 10:56:35 +08001973};
1974
1975static const struct panel_desc sharp_lq123p1jx31 = {
Sean Paul9f7bae22018-02-08 12:48:52 -05001976 .timings = &sharp_lq123p1jx31_timing,
1977 .num_timings = 1,
zain wang5466a632016-11-19 10:27:16 +08001978 .bpc = 8,
Yakir Yang739c7de2016-06-12 10:56:35 +08001979 .size = {
1980 .width = 259,
1981 .height = 173,
1982 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08001983 .delay = {
1984 .prepare = 110,
1985 .enable = 50,
1986 .unprepare = 550,
1987 },
Yakir Yang739c7de2016-06-12 10:56:35 +08001988};
1989
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02001990static const struct drm_display_mode sharp_lq150x1lg11_mode = {
1991 .clock = 71100,
1992 .hdisplay = 1024,
1993 .hsync_start = 1024 + 168,
1994 .hsync_end = 1024 + 168 + 64,
1995 .htotal = 1024 + 168 + 64 + 88,
1996 .vdisplay = 768,
1997 .vsync_start = 768 + 37,
1998 .vsync_end = 768 + 37 + 2,
1999 .vtotal = 768 + 37 + 2 + 8,
2000 .vrefresh = 60,
2001};
2002
2003static const struct panel_desc sharp_lq150x1lg11 = {
2004 .modes = &sharp_lq150x1lg11_mode,
2005 .num_modes = 1,
2006 .bpc = 6,
2007 .size = {
2008 .width = 304,
2009 .height = 228,
2010 },
2011 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
2012};
2013
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01002014static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
2015 .clock = 33300,
2016 .hdisplay = 800,
2017 .hsync_start = 800 + 1,
2018 .hsync_end = 800 + 1 + 64,
2019 .htotal = 800 + 1 + 64 + 64,
2020 .vdisplay = 480,
2021 .vsync_start = 480 + 1,
2022 .vsync_end = 480 + 1 + 23,
2023 .vtotal = 480 + 1 + 23 + 22,
2024 .vrefresh = 60,
2025};
2026
2027static const struct panel_desc shelly_sca07010_bfn_lnn = {
2028 .modes = &shelly_sca07010_bfn_lnn_mode,
2029 .num_modes = 1,
2030 .size = {
2031 .width = 152,
2032 .height = 91,
2033 },
2034 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2035};
2036
Douglas Anderson9bb34c42016-06-10 10:02:07 -07002037static const struct drm_display_mode starry_kr122ea0sra_mode = {
2038 .clock = 147000,
2039 .hdisplay = 1920,
2040 .hsync_start = 1920 + 16,
2041 .hsync_end = 1920 + 16 + 16,
2042 .htotal = 1920 + 16 + 16 + 32,
2043 .vdisplay = 1200,
2044 .vsync_start = 1200 + 15,
2045 .vsync_end = 1200 + 15 + 2,
2046 .vtotal = 1200 + 15 + 2 + 18,
2047 .vrefresh = 60,
2048 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2049};
2050
2051static const struct panel_desc starry_kr122ea0sra = {
2052 .modes = &starry_kr122ea0sra_mode,
2053 .num_modes = 1,
2054 .size = {
2055 .width = 263,
2056 .height = 164,
2057 },
Brian Norrisc46b9242016-08-26 14:32:14 -07002058 .delay = {
2059 .prepare = 10 + 200,
2060 .enable = 50,
2061 .unprepare = 10 + 500,
2062 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07002063};
2064
Gary Bissonadb973e2016-12-02 09:52:08 +01002065static const struct display_timing tianma_tm070jdhg30_timing = {
2066 .pixelclock = { 62600000, 68200000, 78100000 },
2067 .hactive = { 1280, 1280, 1280 },
2068 .hfront_porch = { 15, 64, 159 },
2069 .hback_porch = { 5, 5, 5 },
2070 .hsync_len = { 1, 1, 256 },
2071 .vactive = { 800, 800, 800 },
2072 .vfront_porch = { 3, 40, 99 },
2073 .vback_porch = { 2, 2, 2 },
2074 .vsync_len = { 1, 1, 128 },
2075 .flags = DISPLAY_FLAGS_DE_HIGH,
2076};
2077
2078static const struct panel_desc tianma_tm070jdhg30 = {
2079 .timings = &tianma_tm070jdhg30_timing,
2080 .num_timings = 1,
2081 .bpc = 8,
2082 .size = {
2083 .width = 151,
2084 .height = 95,
2085 },
2086 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2087};
2088
Lukasz Majewski870a0b12017-11-07 16:30:58 +01002089static const struct display_timing tianma_tm070rvhg71_timing = {
2090 .pixelclock = { 27700000, 29200000, 39600000 },
2091 .hactive = { 800, 800, 800 },
2092 .hfront_porch = { 12, 40, 212 },
2093 .hback_porch = { 88, 88, 88 },
2094 .hsync_len = { 1, 1, 40 },
2095 .vactive = { 480, 480, 480 },
2096 .vfront_porch = { 1, 13, 88 },
2097 .vback_porch = { 32, 32, 32 },
2098 .vsync_len = { 1, 1, 3 },
2099 .flags = DISPLAY_FLAGS_DE_HIGH,
2100};
2101
2102static const struct panel_desc tianma_tm070rvhg71 = {
2103 .timings = &tianma_tm070rvhg71_timing,
2104 .num_timings = 1,
2105 .bpc = 8,
2106 .size = {
2107 .width = 154,
2108 .height = 86,
2109 },
2110 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2111};
2112
Lucas Stach06e733e2017-10-18 19:22:40 +02002113static const struct drm_display_mode toshiba_lt089ac29000_mode = {
2114 .clock = 79500,
2115 .hdisplay = 1280,
2116 .hsync_start = 1280 + 192,
2117 .hsync_end = 1280 + 192 + 128,
2118 .htotal = 1280 + 192 + 128 + 64,
2119 .vdisplay = 768,
2120 .vsync_start = 768 + 20,
2121 .vsync_end = 768 + 20 + 7,
2122 .vtotal = 768 + 20 + 7 + 3,
2123 .vrefresh = 60,
2124};
2125
2126static const struct panel_desc toshiba_lt089ac29000 = {
2127 .modes = &toshiba_lt089ac29000_mode,
2128 .num_modes = 1,
2129 .size = {
2130 .width = 194,
2131 .height = 116,
2132 },
2133 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2134 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
2135};
2136
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05302137static const struct drm_display_mode tpk_f07a_0102_mode = {
2138 .clock = 33260,
2139 .hdisplay = 800,
2140 .hsync_start = 800 + 40,
2141 .hsync_end = 800 + 40 + 128,
2142 .htotal = 800 + 40 + 128 + 88,
2143 .vdisplay = 480,
2144 .vsync_start = 480 + 10,
2145 .vsync_end = 480 + 10 + 2,
2146 .vtotal = 480 + 10 + 2 + 33,
2147 .vrefresh = 60,
2148};
2149
2150static const struct panel_desc tpk_f07a_0102 = {
2151 .modes = &tpk_f07a_0102_mode,
2152 .num_modes = 1,
2153 .size = {
2154 .width = 152,
2155 .height = 91,
2156 },
2157 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
2158};
2159
2160static const struct drm_display_mode tpk_f10a_0102_mode = {
2161 .clock = 45000,
2162 .hdisplay = 1024,
2163 .hsync_start = 1024 + 176,
2164 .hsync_end = 1024 + 176 + 5,
2165 .htotal = 1024 + 176 + 5 + 88,
2166 .vdisplay = 600,
2167 .vsync_start = 600 + 20,
2168 .vsync_end = 600 + 20 + 5,
2169 .vtotal = 600 + 20 + 5 + 25,
2170 .vrefresh = 60,
2171};
2172
2173static const struct panel_desc tpk_f10a_0102 = {
2174 .modes = &tpk_f10a_0102_mode,
2175 .num_modes = 1,
2176 .size = {
2177 .width = 223,
2178 .height = 125,
2179 },
2180};
2181
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01002182static const struct display_timing urt_umsh_8596md_timing = {
2183 .pixelclock = { 33260000, 33260000, 33260000 },
2184 .hactive = { 800, 800, 800 },
2185 .hfront_porch = { 41, 41, 41 },
2186 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
2187 .hsync_len = { 71, 128, 128 },
2188 .vactive = { 480, 480, 480 },
2189 .vfront_porch = { 10, 10, 10 },
2190 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
2191 .vsync_len = { 2, 2, 2 },
2192 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
2193 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
2194};
2195
2196static const struct panel_desc urt_umsh_8596md_lvds = {
2197 .timings = &urt_umsh_8596md_timing,
2198 .num_timings = 1,
2199 .bpc = 6,
2200 .size = {
2201 .width = 152,
2202 .height = 91,
2203 },
2204 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
2205};
2206
2207static const struct panel_desc urt_umsh_8596md_parallel = {
2208 .timings = &urt_umsh_8596md_timing,
2209 .num_timings = 1,
2210 .bpc = 6,
2211 .size = {
2212 .width = 152,
2213 .height = 91,
2214 },
2215 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2216};
2217
Richard Genoude4bac402017-03-27 12:33:23 +02002218static const struct drm_display_mode winstar_wf35ltiacd_mode = {
2219 .clock = 6410,
2220 .hdisplay = 320,
2221 .hsync_start = 320 + 20,
2222 .hsync_end = 320 + 20 + 30,
2223 .htotal = 320 + 20 + 30 + 38,
2224 .vdisplay = 240,
2225 .vsync_start = 240 + 4,
2226 .vsync_end = 240 + 4 + 3,
2227 .vtotal = 240 + 4 + 3 + 15,
2228 .vrefresh = 60,
2229 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2230};
2231
2232static const struct panel_desc winstar_wf35ltiacd = {
2233 .modes = &winstar_wf35ltiacd_mode,
2234 .num_modes = 1,
2235 .bpc = 8,
2236 .size = {
2237 .width = 70,
2238 .height = 53,
2239 },
2240 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2241};
2242
Thierry Reding280921d2013-08-30 15:10:14 +02002243static const struct of_device_id platform_of_match[] = {
2244 {
Yannick Fertre966fea72017-03-28 11:44:49 +02002245 .compatible = "ampire,am-480272h3tmqw-t01h",
2246 .data = &ampire_am_480272h3tmqw_t01h,
2247 }, {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01002248 .compatible = "ampire,am800480r3tmqwa1h",
2249 .data = &ampire_am800480r3tmqwa1h,
2250 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02002251 .compatible = "auo,b101aw03",
2252 .data = &auo_b101aw03,
2253 }, {
Huang Lina531bc32015-02-28 10:18:58 +08002254 .compatible = "auo,b101ean01",
2255 .data = &auo_b101ean01,
2256 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04002257 .compatible = "auo,b101xtn01",
2258 .data = &auo_b101xtn01,
2259 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05302260 .compatible = "auo,b116xw03",
2261 .data = &auo_b116xw03,
2262 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05302263 .compatible = "auo,b133htn01",
2264 .data = &auo_b133htn01,
2265 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07002266 .compatible = "auo,b133xtn01",
2267 .data = &auo_b133xtn01,
2268 }, {
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02002269 .compatible = "auo,g070vvn01",
2270 .data = &auo_g070vvn01,
2271 }, {
Christoph Fritz4451c282017-12-16 14:13:36 +01002272 .compatible = "auo,g104sn02",
2273 .data = &auo_g104sn02,
2274 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01002275 .compatible = "auo,g133han01",
2276 .data = &auo_g133han01,
2277 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01002278 .compatible = "auo,g185han01",
2279 .data = &auo_g185han01,
2280 }, {
Lucas Stach70c0d5b2017-06-08 20:07:58 +02002281 .compatible = "auo,p320hvn03",
2282 .data = &auo_p320hvn03,
2283 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07002284 .compatible = "auo,t215hvn01",
2285 .data = &auo_t215hvn01,
2286 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01002287 .compatible = "avic,tm070ddh03",
2288 .data = &avic_tm070ddh03,
2289 }, {
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02002290 .compatible = "boe,hv070wsa-100",
2291 .data = &boe_hv070wsa
2292 }, {
Caesar Wangcac1a412016-12-14 11:19:56 +08002293 .compatible = "boe,nv101wxmn51",
2294 .data = &boe_nv101wxmn51,
2295 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08002296 .compatible = "chunghwa,claa070wp03xg",
2297 .data = &chunghwa_claa070wp03xg,
2298 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07002299 .compatible = "chunghwa,claa101wa01a",
2300 .data = &chunghwa_claa101wa01a
2301 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02002302 .compatible = "chunghwa,claa101wb01",
2303 .data = &chunghwa_claa101wb01
2304 }, {
Philipp Zabel0ca0c822018-05-23 11:25:04 +02002305 .compatible = "dlc,dlc0700yzg-1",
2306 .data = &dlc_dlc0700yzg_1,
2307 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02002308 .compatible = "edt,et057090dhu",
2309 .data = &edt_et057090dhu,
2310 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02002311 .compatible = "edt,et070080dh6",
2312 .data = &edt_etm0700g0dh6,
2313 }, {
2314 .compatible = "edt,etm0700g0dh6",
2315 .data = &edt_etm0700g0dh6,
2316 }, {
Jan Tuerkaa7e6452018-06-19 11:55:44 +02002317 .compatible = "edt,etm0700g0bdh6",
2318 .data = &edt_etm0700g0bdh6,
2319 }, {
Jan Tuerkaad34de2018-06-19 11:55:45 +02002320 .compatible = "edt,etm0700g0edh6",
2321 .data = &edt_etm0700g0bdh6,
2322 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02002323 .compatible = "foxlink,fl500wvr00-a0t",
2324 .data = &foxlink_fl500wvr00_a0t,
2325 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002326 .compatible = "giantplus,gpg482739qs5",
2327 .data = &giantplus_gpg482739qs5
2328 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02002329 .compatible = "hannstar,hsd070pww1",
2330 .data = &hannstar_hsd070pww1,
2331 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002332 .compatible = "hannstar,hsd100pxn1",
2333 .data = &hannstar_hsd100pxn1,
2334 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002335 .compatible = "hit,tx23d38vm0caa",
2336 .data = &hitachi_tx23d38vm0caa
2337 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002338 .compatible = "innolux,at043tn24",
2339 .data = &innolux_at043tn24,
2340 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002341 .compatible = "innolux,at070tn92",
2342 .data = &innolux_at070tn92,
2343 }, {
Michael Olbrich1e29b842016-08-15 14:32:02 +02002344 .compatible ="innolux,g101ice-l01",
2345 .data = &innolux_g101ice_l01
2346 }, {
Lucas Stachd731f662014-11-06 17:44:33 +01002347 .compatible ="innolux,g121i1-l01",
2348 .data = &innolux_g121i1_l01
2349 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002350 .compatible = "innolux,g121x1-l03",
2351 .data = &innolux_g121x1_l03,
2352 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02002353 .compatible = "innolux,n116bge",
2354 .data = &innolux_n116bge,
2355 }, {
Alban Bedelea447392014-07-22 08:38:55 +02002356 .compatible = "innolux,n156bge-l21",
2357 .data = &innolux_n156bge_l21,
2358 }, {
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302359 .compatible = "innolux,tv123wam",
2360 .data = &innolux_tv123wam,
2361 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002362 .compatible = "innolux,zj070na-01p",
2363 .data = &innolux_zj070na_01p,
2364 }, {
Jagan Teki8cfe8342018-02-04 23:19:28 +05302365 .compatible = "koe,tx31d200vm0baa",
2366 .data = &koe_tx31d200vm0baa,
2367 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01002368 .compatible = "kyo,tcg121xglp",
2369 .data = &kyo_tcg121xglp,
2370 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02002371 .compatible = "lg,lb070wv8",
2372 .data = &lg_lb070wv8,
2373 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08002374 .compatible = "lg,lp079qx1-sp0v",
2375 .data = &lg_lp079qx1_sp0v,
2376 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08002377 .compatible = "lg,lp097qx1-spa1",
2378 .data = &lg_lp097qx1_spa1,
2379 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08002380 .compatible = "lg,lp120up1",
2381 .data = &lg_lp120up1,
2382 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01002383 .compatible = "lg,lp129qe",
2384 .data = &lg_lp129qe,
2385 }, {
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002386 .compatible = "mitsubishi,aa070mc01-ca1",
2387 .data = &mitsubishi_aa070mc01,
2388 }, {
Lucas Stach01bacc132017-06-08 20:07:55 +02002389 .compatible = "nec,nl12880bc20-05",
2390 .data = &nec_nl12880bc20_05,
2391 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08002392 .compatible = "nec,nl4827hc19-05b",
2393 .data = &nec_nl4827hc19_05b,
2394 }, {
Maxime Riparde6c2f062016-09-06 16:46:17 +02002395 .compatible = "netron-dy,e231732",
2396 .data = &netron_dy_e231732,
2397 }, {
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03002398 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
2399 .data = &newhaven_nhd_43_480272ef_atxl,
2400 }, {
Lucas Stach4177fa62017-06-08 20:07:57 +02002401 .compatible = "nlt,nl192108ac18-02d",
2402 .data = &nlt_nl192108ac18_02d,
2403 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02002404 .compatible = "nvd,9128",
2405 .data = &nvd_9128,
2406 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02002407 .compatible = "okaya,rs800480t-7x0gp",
2408 .data = &okaya_rs800480t_7x0gp,
2409 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002410 .compatible = "olimex,lcd-olinuxino-43-ts",
2411 .data = &olimex_lcd_olinuxino_43ts,
2412 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07002413 .compatible = "ontat,yx700wv03",
2414 .data = &ontat_yx700wv03,
2415 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01002416 .compatible = "ortustech,com43h4m85ulc",
2417 .data = &ortustech_com43h4m85ulc,
2418 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02002419 .compatible = "qiaodian,qd43003c0-40",
2420 .data = &qd43003c0_40,
2421 }, {
Jagan Teki23167fa2018-06-07 19:16:48 +05302422 .compatible = "rocktech,rk070er9427",
2423 .data = &rocktech_rk070er9427,
2424 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08002425 .compatible = "samsung,lsn122dl01-c01",
2426 .data = &samsung_lsn122dl01_c01,
2427 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01002428 .compatible = "samsung,ltn101nt05",
2429 .data = &samsung_ltn101nt05,
2430 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01002431 .compatible = "samsung,ltn140at29-301",
2432 .data = &samsung_ltn140at29_301,
2433 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07002434 .compatible = "sharp,lq101k1ly04",
2435 .data = &sharp_lq101k1ly04,
2436 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08002437 .compatible = "sharp,lq123p1jx31",
2438 .data = &sharp_lq123p1jx31,
2439 }, {
Gustaf Lindström0f9cdd72016-10-04 17:29:21 +02002440 .compatible = "sharp,lq150x1lg11",
2441 .data = &sharp_lq150x1lg11,
2442 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01002443 .compatible = "shelly,sca07010-bfn-lnn",
2444 .data = &shelly_sca07010_bfn_lnn,
2445 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07002446 .compatible = "starry,kr122ea0sra",
2447 .data = &starry_kr122ea0sra,
2448 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01002449 .compatible = "tianma,tm070jdhg30",
2450 .data = &tianma_tm070jdhg30,
2451 }, {
Lukasz Majewski870a0b12017-11-07 16:30:58 +01002452 .compatible = "tianma,tm070rvhg71",
2453 .data = &tianma_tm070rvhg71,
2454 }, {
Lucas Stach06e733e2017-10-18 19:22:40 +02002455 .compatible = "toshiba,lt089ac29000",
2456 .data = &toshiba_lt089ac29000,
2457 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05302458 .compatible = "tpk,f07a-0102",
2459 .data = &tpk_f07a_0102,
2460 }, {
2461 .compatible = "tpk,f10a-0102",
2462 .data = &tpk_f10a_0102,
2463 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01002464 .compatible = "urt,umsh-8596md-t",
2465 .data = &urt_umsh_8596md_parallel,
2466 }, {
2467 .compatible = "urt,umsh-8596md-1t",
2468 .data = &urt_umsh_8596md_parallel,
2469 }, {
2470 .compatible = "urt,umsh-8596md-7t",
2471 .data = &urt_umsh_8596md_parallel,
2472 }, {
2473 .compatible = "urt,umsh-8596md-11t",
2474 .data = &urt_umsh_8596md_lvds,
2475 }, {
2476 .compatible = "urt,umsh-8596md-19t",
2477 .data = &urt_umsh_8596md_lvds,
2478 }, {
2479 .compatible = "urt,umsh-8596md-20t",
2480 .data = &urt_umsh_8596md_parallel,
2481 }, {
Richard Genoude4bac402017-03-27 12:33:23 +02002482 .compatible = "winstar,wf35ltiacd",
2483 .data = &winstar_wf35ltiacd,
2484 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02002485 /* sentinel */
2486 }
2487};
2488MODULE_DEVICE_TABLE(of, platform_of_match);
2489
2490static int panel_simple_platform_probe(struct platform_device *pdev)
2491{
2492 const struct of_device_id *id;
2493
2494 id = of_match_node(platform_of_match, pdev->dev.of_node);
2495 if (!id)
2496 return -ENODEV;
2497
2498 return panel_simple_probe(&pdev->dev, id->data);
2499}
2500
2501static int panel_simple_platform_remove(struct platform_device *pdev)
2502{
2503 return panel_simple_remove(&pdev->dev);
2504}
2505
Thierry Redingd02fd932014-04-29 17:21:21 +02002506static void panel_simple_platform_shutdown(struct platform_device *pdev)
2507{
2508 panel_simple_shutdown(&pdev->dev);
2509}
2510
Thierry Reding280921d2013-08-30 15:10:14 +02002511static struct platform_driver panel_simple_platform_driver = {
2512 .driver = {
2513 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02002514 .of_match_table = platform_of_match,
2515 },
2516 .probe = panel_simple_platform_probe,
2517 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002518 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002519};
2520
Thierry Reding210fcd92013-11-22 19:27:11 +01002521struct panel_desc_dsi {
2522 struct panel_desc desc;
2523
Thierry Reding462658b2014-03-14 11:24:57 +01002524 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01002525 enum mipi_dsi_pixel_format format;
2526 unsigned int lanes;
2527};
2528
Thierry Redingd718d792015-04-08 16:52:33 +02002529static const struct drm_display_mode auo_b080uan01_mode = {
2530 .clock = 154500,
2531 .hdisplay = 1200,
2532 .hsync_start = 1200 + 62,
2533 .hsync_end = 1200 + 62 + 4,
2534 .htotal = 1200 + 62 + 4 + 62,
2535 .vdisplay = 1920,
2536 .vsync_start = 1920 + 9,
2537 .vsync_end = 1920 + 9 + 2,
2538 .vtotal = 1920 + 9 + 2 + 8,
2539 .vrefresh = 60,
2540};
2541
2542static const struct panel_desc_dsi auo_b080uan01 = {
2543 .desc = {
2544 .modes = &auo_b080uan01_mode,
2545 .num_modes = 1,
2546 .bpc = 8,
2547 .size = {
2548 .width = 108,
2549 .height = 272,
2550 },
2551 },
2552 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2553 .format = MIPI_DSI_FMT_RGB888,
2554 .lanes = 4,
2555};
2556
Chris Zhongc8521962015-11-20 16:15:37 +08002557static const struct drm_display_mode boe_tv080wum_nl0_mode = {
2558 .clock = 160000,
2559 .hdisplay = 1200,
2560 .hsync_start = 1200 + 120,
2561 .hsync_end = 1200 + 120 + 20,
2562 .htotal = 1200 + 120 + 20 + 21,
2563 .vdisplay = 1920,
2564 .vsync_start = 1920 + 21,
2565 .vsync_end = 1920 + 21 + 3,
2566 .vtotal = 1920 + 21 + 3 + 18,
2567 .vrefresh = 60,
2568 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2569};
2570
2571static const struct panel_desc_dsi boe_tv080wum_nl0 = {
2572 .desc = {
2573 .modes = &boe_tv080wum_nl0_mode,
2574 .num_modes = 1,
2575 .size = {
2576 .width = 107,
2577 .height = 172,
2578 },
2579 },
2580 .flags = MIPI_DSI_MODE_VIDEO |
2581 MIPI_DSI_MODE_VIDEO_BURST |
2582 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
2583 .format = MIPI_DSI_FMT_RGB888,
2584 .lanes = 4,
2585};
2586
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002587static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
2588 .clock = 71000,
2589 .hdisplay = 800,
2590 .hsync_start = 800 + 32,
2591 .hsync_end = 800 + 32 + 1,
2592 .htotal = 800 + 32 + 1 + 57,
2593 .vdisplay = 1280,
2594 .vsync_start = 1280 + 28,
2595 .vsync_end = 1280 + 28 + 1,
2596 .vtotal = 1280 + 28 + 1 + 14,
2597 .vrefresh = 60,
2598};
2599
2600static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
2601 .desc = {
2602 .modes = &lg_ld070wx3_sl01_mode,
2603 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002604 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002605 .size = {
2606 .width = 94,
2607 .height = 151,
2608 },
2609 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09002610 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002611 .format = MIPI_DSI_FMT_RGB888,
2612 .lanes = 4,
2613};
2614
Alexandre Courbot499ce852014-01-21 18:57:09 +09002615static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
2616 .clock = 67000,
2617 .hdisplay = 720,
2618 .hsync_start = 720 + 12,
2619 .hsync_end = 720 + 12 + 4,
2620 .htotal = 720 + 12 + 4 + 112,
2621 .vdisplay = 1280,
2622 .vsync_start = 1280 + 8,
2623 .vsync_end = 1280 + 8 + 4,
2624 .vtotal = 1280 + 8 + 4 + 12,
2625 .vrefresh = 60,
2626};
2627
2628static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
2629 .desc = {
2630 .modes = &lg_lh500wx1_sd03_mode,
2631 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002632 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09002633 .size = {
2634 .width = 62,
2635 .height = 110,
2636 },
2637 },
2638 .flags = MIPI_DSI_MODE_VIDEO,
2639 .format = MIPI_DSI_FMT_RGB888,
2640 .lanes = 4,
2641};
2642
Thierry Reding280921d2013-08-30 15:10:14 +02002643static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
2644 .clock = 157200,
2645 .hdisplay = 1920,
2646 .hsync_start = 1920 + 154,
2647 .hsync_end = 1920 + 154 + 16,
2648 .htotal = 1920 + 154 + 16 + 32,
2649 .vdisplay = 1200,
2650 .vsync_start = 1200 + 17,
2651 .vsync_end = 1200 + 17 + 2,
2652 .vtotal = 1200 + 17 + 2 + 16,
2653 .vrefresh = 60,
2654};
2655
Thierry Reding210fcd92013-11-22 19:27:11 +01002656static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
2657 .desc = {
2658 .modes = &panasonic_vvx10f004b00_mode,
2659 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002660 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01002661 .size = {
2662 .width = 217,
2663 .height = 136,
2664 },
Thierry Reding280921d2013-08-30 15:10:14 +02002665 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09002666 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
2667 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01002668 .format = MIPI_DSI_FMT_RGB888,
2669 .lanes = 4,
2670};
2671
2672static const struct of_device_id dsi_of_match[] = {
2673 {
Thierry Redingd718d792015-04-08 16:52:33 +02002674 .compatible = "auo,b080uan01",
2675 .data = &auo_b080uan01
2676 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08002677 .compatible = "boe,tv080wum-nl0",
2678 .data = &boe_tv080wum_nl0
2679 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09002680 .compatible = "lg,ld070wx3-sl01",
2681 .data = &lg_ld070wx3_sl01
2682 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09002683 .compatible = "lg,lh500wx1-sd03",
2684 .data = &lg_lh500wx1_sd03
2685 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01002686 .compatible = "panasonic,vvx10f004b00",
2687 .data = &panasonic_vvx10f004b00
2688 }, {
2689 /* sentinel */
2690 }
2691};
2692MODULE_DEVICE_TABLE(of, dsi_of_match);
2693
2694static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
2695{
2696 const struct panel_desc_dsi *desc;
2697 const struct of_device_id *id;
2698 int err;
2699
2700 id = of_match_node(dsi_of_match, dsi->dev.of_node);
2701 if (!id)
2702 return -ENODEV;
2703
2704 desc = id->data;
2705
2706 err = panel_simple_probe(&dsi->dev, &desc->desc);
2707 if (err < 0)
2708 return err;
2709
Thierry Reding462658b2014-03-14 11:24:57 +01002710 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01002711 dsi->format = desc->format;
2712 dsi->lanes = desc->lanes;
2713
2714 return mipi_dsi_attach(dsi);
2715}
2716
2717static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
2718{
2719 int err;
2720
2721 err = mipi_dsi_detach(dsi);
2722 if (err < 0)
2723 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
2724
2725 return panel_simple_remove(&dsi->dev);
2726}
2727
Thierry Redingd02fd932014-04-29 17:21:21 +02002728static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
2729{
2730 panel_simple_shutdown(&dsi->dev);
2731}
2732
Thierry Reding210fcd92013-11-22 19:27:11 +01002733static struct mipi_dsi_driver panel_simple_dsi_driver = {
2734 .driver = {
2735 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01002736 .of_match_table = dsi_of_match,
2737 },
2738 .probe = panel_simple_dsi_probe,
2739 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02002740 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02002741};
2742
2743static int __init panel_simple_init(void)
2744{
Thierry Reding210fcd92013-11-22 19:27:11 +01002745 int err;
2746
2747 err = platform_driver_register(&panel_simple_platform_driver);
2748 if (err < 0)
2749 return err;
2750
2751 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
2752 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
2753 if (err < 0)
2754 return err;
2755 }
2756
2757 return 0;
Thierry Reding280921d2013-08-30 15:10:14 +02002758}
2759module_init(panel_simple_init);
2760
2761static void __exit panel_simple_exit(void)
2762{
Thierry Reding210fcd92013-11-22 19:27:11 +01002763 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
2764 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
2765
Thierry Reding280921d2013-08-30 15:10:14 +02002766 platform_driver_unregister(&panel_simple_platform_driver);
2767}
2768module_exit(panel_simple_exit);
2769
2770MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
2771MODULE_DESCRIPTION("DRM Driver for Simple Panels");
2772MODULE_LICENSE("GPL and additional rights");