blob: 5cba33394083a7be0aaed3d1e2fd3c480a938a54 [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
Sam Ravnborgcb23eae2019-05-26 20:05:32 +020024#include <linux/delay.h>
Alexandre Courbotcfdf0542014-03-01 14:00:58 +090025#include <linux/gpio/consumer.h>
Douglas Anderson48834e62020-05-07 14:34:57 -070026#include <linux/iopoll.h>
Thierry Reding280921d2013-08-30 15:10:14 +020027#include <linux/module.h>
Thierry Reding280921d2013-08-30 15:10:14 +020028#include <linux/of_platform.h>
29#include <linux/platform_device.h>
30#include <linux/regulator/consumer.h>
31
Philipp Zabela5d3e622014-12-11 18:32:45 +010032#include <video/display_timing.h>
Sean Paulb8a29482019-07-11 13:34:53 -070033#include <video/of_display_timing.h>
Philipp Zabela5d3e622014-12-11 18:32:45 +010034#include <video/videomode.h>
35
Sam Ravnborgcb23eae2019-05-26 20:05:32 +020036#include <drm/drm_crtc.h>
37#include <drm/drm_device.h>
38#include <drm/drm_mipi_dsi.h>
39#include <drm/drm_panel.h>
40
Douglas Andersone362cc62019-07-12 09:33:33 -070041/**
42 * @modes: Pointer to array of fixed modes appropriate for this panel. If
43 * only one mode then this can just be the address of this the mode.
44 * NOTE: cannot be used with "timings" and also if this is specified
45 * then you cannot override the mode in the device tree.
46 * @num_modes: Number of elements in modes array.
47 * @timings: Pointer to array of display timings. NOTE: cannot be used with
48 * "modes" and also these will be used to validate a device tree
49 * override if one is present.
50 * @num_timings: Number of elements in timings array.
51 * @bpc: Bits per color.
52 * @size: Structure containing the physical size of this panel.
53 * @delay: Structure containing various delay values for this panel.
54 * @bus_format: See MEDIA_BUS_FMT_... defines.
55 * @bus_flags: See DRM_BUS_FLAG_... defines.
56 */
Thierry Reding280921d2013-08-30 15:10:14 +020057struct panel_desc {
58 const struct drm_display_mode *modes;
59 unsigned int num_modes;
Philipp Zabela5d3e622014-12-11 18:32:45 +010060 const struct display_timing *timings;
61 unsigned int num_timings;
Thierry Reding280921d2013-08-30 15:10:14 +020062
Stéphane Marchesin0208d512014-06-19 18:18:28 -070063 unsigned int bpc;
64
Ulrich Ölmann85533e32015-12-04 12:31:28 +010065 /**
66 * @width: width (in millimeters) of the panel's active display area
67 * @height: height (in millimeters) of the panel's active display area
68 */
Thierry Reding280921d2013-08-30 15:10:14 +020069 struct {
70 unsigned int width;
71 unsigned int height;
72 } size;
Ajay Kumarf673c372014-07-31 23:12:11 +053073
74 /**
75 * @prepare: the time (in milliseconds) that it takes for the panel to
76 * become ready and start receiving video data
Douglas Anderson2ed3e952018-10-25 15:21:30 -070077 * @hpd_absent_delay: Add this to the prepare delay if we know Hot
78 * Plug Detect isn't used.
Ajay Kumarf673c372014-07-31 23:12:11 +053079 * @enable: the time (in milliseconds) that it takes for the panel to
80 * display the first valid frame after starting to receive
81 * video data
82 * @disable: the time (in milliseconds) that it takes for the panel to
83 * turn the display off (no content is visible)
84 * @unprepare: the time (in milliseconds) that it takes for the panel
85 * to power itself down completely
86 */
87 struct {
88 unsigned int prepare;
Douglas Anderson2ed3e952018-10-25 15:21:30 -070089 unsigned int hpd_absent_delay;
Ajay Kumarf673c372014-07-31 23:12:11 +053090 unsigned int enable;
91 unsigned int disable;
92 unsigned int unprepare;
93 } delay;
Boris Brezillon795f7ab2014-07-22 13:33:59 +020094
95 u32 bus_format;
Stefan Agnerf0aa0832016-02-08 11:38:14 -080096 u32 bus_flags;
Laurent Pinchart9a2654c2019-09-04 16:28:03 +030097 int connector_type;
Thierry Reding280921d2013-08-30 15:10:14 +020098};
99
Thierry Reding280921d2013-08-30 15:10:14 +0200100struct panel_simple {
101 struct drm_panel base;
Ajay Kumar613a6332014-07-31 23:12:10 +0530102 bool prepared;
Thierry Reding280921d2013-08-30 15:10:14 +0200103 bool enabled;
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700104 bool no_hpd;
Thierry Reding280921d2013-08-30 15:10:14 +0200105
106 const struct panel_desc *desc;
107
Thierry Reding280921d2013-08-30 15:10:14 +0200108 struct regulator *supply;
109 struct i2c_adapter *ddc;
110
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900111 struct gpio_desc *enable_gpio;
Douglas Anderson48834e62020-05-07 14:34:57 -0700112 struct gpio_desc *hpd_gpio;
Sean Paulb8a29482019-07-11 13:34:53 -0700113
114 struct drm_display_mode override_mode;
Thierry Reding280921d2013-08-30 15:10:14 +0200115};
116
117static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
118{
119 return container_of(panel, struct panel_simple, base);
120}
121
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100122static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
123 struct drm_connector *connector)
Thierry Reding280921d2013-08-30 15:10:14 +0200124{
Thierry Reding280921d2013-08-30 15:10:14 +0200125 struct drm_display_mode *mode;
126 unsigned int i, num = 0;
127
Philipp Zabela5d3e622014-12-11 18:32:45 +0100128 for (i = 0; i < panel->desc->num_timings; i++) {
129 const struct display_timing *dt = &panel->desc->timings[i];
130 struct videomode vm;
131
132 videomode_from_timing(dt, &vm);
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100133 mode = drm_mode_create(connector->dev);
Philipp Zabela5d3e622014-12-11 18:32:45 +0100134 if (!mode) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100135 dev_err(panel->base.dev, "failed to add mode %ux%u\n",
Philipp Zabela5d3e622014-12-11 18:32:45 +0100136 dt->hactive.typ, dt->vactive.typ);
137 continue;
138 }
139
140 drm_display_mode_from_videomode(&vm, mode);
Boris Brezilloncda55372016-04-15 18:23:33 +0200141
142 mode->type |= DRM_MODE_TYPE_DRIVER;
143
Chen-Yu Tsai230c5b42016-10-24 21:21:15 +0800144 if (panel->desc->num_timings == 1)
Boris Brezilloncda55372016-04-15 18:23:33 +0200145 mode->type |= DRM_MODE_TYPE_PREFERRED;
146
Philipp Zabela5d3e622014-12-11 18:32:45 +0100147 drm_mode_probed_add(connector, mode);
148 num++;
149 }
150
Sean Paulb8a29482019-07-11 13:34:53 -0700151 return num;
152}
153
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100154static unsigned int panel_simple_get_display_modes(struct panel_simple *panel,
155 struct drm_connector *connector)
Sean Paulb8a29482019-07-11 13:34:53 -0700156{
Sean Paulb8a29482019-07-11 13:34:53 -0700157 struct drm_display_mode *mode;
158 unsigned int i, num = 0;
159
Thierry Reding280921d2013-08-30 15:10:14 +0200160 for (i = 0; i < panel->desc->num_modes; i++) {
161 const struct drm_display_mode *m = &panel->desc->modes[i];
162
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100163 mode = drm_mode_duplicate(connector->dev, m);
Thierry Reding280921d2013-08-30 15:10:14 +0200164 if (!mode) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100165 dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
Ville Syrjälä04256622020-04-28 20:19:27 +0300166 m->hdisplay, m->vdisplay,
167 drm_mode_vrefresh(m));
Thierry Reding280921d2013-08-30 15:10:14 +0200168 continue;
169 }
170
Boris Brezilloncda55372016-04-15 18:23:33 +0200171 mode->type |= DRM_MODE_TYPE_DRIVER;
172
173 if (panel->desc->num_modes == 1)
174 mode->type |= DRM_MODE_TYPE_PREFERRED;
175
Thierry Reding280921d2013-08-30 15:10:14 +0200176 drm_mode_set_name(mode);
177
178 drm_mode_probed_add(connector, mode);
179 num++;
180 }
181
Sean Paulb8a29482019-07-11 13:34:53 -0700182 return num;
183}
184
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100185static int panel_simple_get_non_edid_modes(struct panel_simple *panel,
186 struct drm_connector *connector)
Sean Paulb8a29482019-07-11 13:34:53 -0700187{
Sean Paulb8a29482019-07-11 13:34:53 -0700188 struct drm_display_mode *mode;
189 bool has_override = panel->override_mode.type;
190 unsigned int num = 0;
191
192 if (!panel->desc)
193 return 0;
194
195 if (has_override) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100196 mode = drm_mode_duplicate(connector->dev,
197 &panel->override_mode);
Sean Paulb8a29482019-07-11 13:34:53 -0700198 if (mode) {
199 drm_mode_probed_add(connector, mode);
200 num = 1;
201 } else {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100202 dev_err(panel->base.dev, "failed to add override mode\n");
Sean Paulb8a29482019-07-11 13:34:53 -0700203 }
204 }
205
206 /* Only add timings if override was not there or failed to validate */
207 if (num == 0 && panel->desc->num_timings)
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100208 num = panel_simple_get_timings_modes(panel, connector);
Sean Paulb8a29482019-07-11 13:34:53 -0700209
210 /*
211 * Only add fixed modes if timings/override added no mode.
212 *
213 * We should only ever have either the display timings specified
214 * or a fixed mode. Anything else is rather bogus.
215 */
216 WARN_ON(panel->desc->num_timings && panel->desc->num_modes);
217 if (num == 0)
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100218 num = panel_simple_get_display_modes(panel, connector);
Sean Paulb8a29482019-07-11 13:34:53 -0700219
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700220 connector->display_info.bpc = panel->desc->bpc;
Thierry Reding280921d2013-08-30 15:10:14 +0200221 connector->display_info.width_mm = panel->desc->size.width;
222 connector->display_info.height_mm = panel->desc->size.height;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200223 if (panel->desc->bus_format)
224 drm_display_info_set_bus_formats(&connector->display_info,
225 &panel->desc->bus_format, 1);
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800226 connector->display_info.bus_flags = panel->desc->bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200227
228 return num;
229}
230
231static int panel_simple_disable(struct drm_panel *panel)
232{
233 struct panel_simple *p = to_panel_simple(panel);
234
235 if (!p->enabled)
236 return 0;
237
Ajay Kumarf673c372014-07-31 23:12:11 +0530238 if (p->desc->delay.disable)
239 msleep(p->desc->delay.disable);
240
Thierry Reding280921d2013-08-30 15:10:14 +0200241 p->enabled = false;
242
243 return 0;
244}
245
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530246static int panel_simple_unprepare(struct drm_panel *panel)
247{
Ajay Kumar613a6332014-07-31 23:12:10 +0530248 struct panel_simple *p = to_panel_simple(panel);
249
250 if (!p->prepared)
251 return 0;
252
Fabio Estevam756b9182017-07-16 21:05:39 -0300253 gpiod_set_value_cansleep(p->enable_gpio, 0);
Ajay Kumar613a6332014-07-31 23:12:10 +0530254
255 regulator_disable(p->supply);
256
Ajay Kumarf673c372014-07-31 23:12:11 +0530257 if (p->desc->delay.unprepare)
258 msleep(p->desc->delay.unprepare);
259
Ajay Kumar613a6332014-07-31 23:12:10 +0530260 p->prepared = false;
261
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530262 return 0;
263}
264
Douglas Anderson48834e62020-05-07 14:34:57 -0700265static int panel_simple_get_hpd_gpio(struct device *dev,
266 struct panel_simple *p, bool from_probe)
267{
268 int err;
269
270 p->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN);
271 if (IS_ERR(p->hpd_gpio)) {
272 err = PTR_ERR(p->hpd_gpio);
273
274 /*
275 * If we're called from probe we won't consider '-EPROBE_DEFER'
276 * to be an error--we'll leave the error code in "hpd_gpio".
277 * When we try to use it we'll try again. This allows for
278 * circular dependencies where the component providing the
279 * hpd gpio needs the panel to init before probing.
280 */
281 if (err != -EPROBE_DEFER || !from_probe) {
282 dev_err(dev, "failed to get 'hpd' GPIO: %d\n", err);
283 return err;
284 }
285 }
286
287 return 0;
288}
289
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530290static int panel_simple_prepare(struct drm_panel *panel)
291{
Thierry Reding280921d2013-08-30 15:10:14 +0200292 struct panel_simple *p = to_panel_simple(panel);
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700293 unsigned int delay;
Thierry Reding280921d2013-08-30 15:10:14 +0200294 int err;
Douglas Anderson48834e62020-05-07 14:34:57 -0700295 int hpd_asserted;
Thierry Reding280921d2013-08-30 15:10:14 +0200296
Ajay Kumar613a6332014-07-31 23:12:10 +0530297 if (p->prepared)
Thierry Reding280921d2013-08-30 15:10:14 +0200298 return 0;
299
300 err = regulator_enable(p->supply);
301 if (err < 0) {
302 dev_err(panel->dev, "failed to enable supply: %d\n", err);
303 return err;
304 }
305
Fabio Estevam756b9182017-07-16 21:05:39 -0300306 gpiod_set_value_cansleep(p->enable_gpio, 1);
Thierry Reding280921d2013-08-30 15:10:14 +0200307
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700308 delay = p->desc->delay.prepare;
309 if (p->no_hpd)
310 delay += p->desc->delay.hpd_absent_delay;
311 if (delay)
312 msleep(delay);
Ajay Kumarf673c372014-07-31 23:12:11 +0530313
Douglas Anderson48834e62020-05-07 14:34:57 -0700314 if (p->hpd_gpio) {
315 if (IS_ERR(p->hpd_gpio)) {
316 err = panel_simple_get_hpd_gpio(panel->dev, p, false);
317 if (err)
318 return err;
319 }
320
321 err = readx_poll_timeout(gpiod_get_value_cansleep, p->hpd_gpio,
322 hpd_asserted, hpd_asserted,
323 1000, 2000000);
324 if (hpd_asserted < 0)
325 err = hpd_asserted;
326
327 if (err) {
328 dev_err(panel->dev,
329 "error waiting for hpd GPIO: %d\n", err);
330 return err;
331 }
332 }
333
Ajay Kumar613a6332014-07-31 23:12:10 +0530334 p->prepared = true;
335
336 return 0;
337}
338
339static int panel_simple_enable(struct drm_panel *panel)
340{
341 struct panel_simple *p = to_panel_simple(panel);
342
343 if (p->enabled)
344 return 0;
345
Ajay Kumarf673c372014-07-31 23:12:11 +0530346 if (p->desc->delay.enable)
347 msleep(p->desc->delay.enable);
348
Thierry Reding280921d2013-08-30 15:10:14 +0200349 p->enabled = true;
350
351 return 0;
352}
353
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100354static int panel_simple_get_modes(struct drm_panel *panel,
355 struct drm_connector *connector)
Thierry Reding280921d2013-08-30 15:10:14 +0200356{
357 struct panel_simple *p = to_panel_simple(panel);
358 int num = 0;
359
360 /* probe EDID if a DDC bus is available */
361 if (p->ddc) {
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100362 struct edid *edid = drm_get_edid(connector, p->ddc);
363
364 drm_connector_update_edid_property(connector, edid);
Thierry Reding280921d2013-08-30 15:10:14 +0200365 if (edid) {
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100366 num += drm_add_edid_modes(connector, edid);
Thierry Reding280921d2013-08-30 15:10:14 +0200367 kfree(edid);
368 }
369 }
370
371 /* add hard-coded panel modes */
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100372 num += panel_simple_get_non_edid_modes(p, connector);
Thierry Reding280921d2013-08-30 15:10:14 +0200373
374 return num;
375}
376
Philipp Zabela5d3e622014-12-11 18:32:45 +0100377static int panel_simple_get_timings(struct drm_panel *panel,
378 unsigned int num_timings,
379 struct display_timing *timings)
380{
381 struct panel_simple *p = to_panel_simple(panel);
382 unsigned int i;
383
384 if (p->desc->num_timings < num_timings)
385 num_timings = p->desc->num_timings;
386
387 if (timings)
388 for (i = 0; i < num_timings; i++)
389 timings[i] = p->desc->timings[i];
390
391 return p->desc->num_timings;
392}
393
Thierry Reding280921d2013-08-30 15:10:14 +0200394static const struct drm_panel_funcs panel_simple_funcs = {
395 .disable = panel_simple_disable,
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530396 .unprepare = panel_simple_unprepare,
397 .prepare = panel_simple_prepare,
Thierry Reding280921d2013-08-30 15:10:14 +0200398 .enable = panel_simple_enable,
399 .get_modes = panel_simple_get_modes,
Philipp Zabela5d3e622014-12-11 18:32:45 +0100400 .get_timings = panel_simple_get_timings,
Thierry Reding280921d2013-08-30 15:10:14 +0200401};
402
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100403static struct panel_desc panel_dpi;
404
405static int panel_dpi_probe(struct device *dev,
406 struct panel_simple *panel)
407{
408 struct display_timing *timing;
409 const struct device_node *np;
410 struct panel_desc *desc;
411 unsigned int bus_flags;
412 struct videomode vm;
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100413 int ret;
414
415 np = dev->of_node;
416 desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
417 if (!desc)
418 return -ENOMEM;
419
420 timing = devm_kzalloc(dev, sizeof(*timing), GFP_KERNEL);
421 if (!timing)
422 return -ENOMEM;
423
424 ret = of_get_display_timing(np, "panel-timing", timing);
425 if (ret < 0) {
426 dev_err(dev, "%pOF: no panel-timing node found for \"panel-dpi\" binding\n",
427 np);
428 return ret;
429 }
430
431 desc->timings = timing;
432 desc->num_timings = 1;
433
434 of_property_read_u32(np, "width-mm", &desc->size.width);
435 of_property_read_u32(np, "height-mm", &desc->size.height);
436
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100437 /* Extract bus_flags from display_timing */
438 bus_flags = 0;
439 vm.flags = timing->flags;
440 drm_bus_flags_from_videomode(&vm, &bus_flags);
441 desc->bus_flags = bus_flags;
442
443 /* We do not know the connector for the DT node, so guess it */
444 desc->connector_type = DRM_MODE_CONNECTOR_DPI;
445
446 panel->desc = desc;
447
448 return 0;
449}
450
Sean Paulb8a29482019-07-11 13:34:53 -0700451#define PANEL_SIMPLE_BOUNDS_CHECK(to_check, bounds, field) \
452 (to_check->field.typ >= bounds->field.min && \
453 to_check->field.typ <= bounds->field.max)
Douglas Andersone362cc62019-07-12 09:33:33 -0700454static void panel_simple_parse_panel_timing_node(struct device *dev,
455 struct panel_simple *panel,
456 const struct display_timing *ot)
Sean Paulb8a29482019-07-11 13:34:53 -0700457{
458 const struct panel_desc *desc = panel->desc;
459 struct videomode vm;
460 unsigned int i;
461
462 if (WARN_ON(desc->num_modes)) {
463 dev_err(dev, "Reject override mode: panel has a fixed mode\n");
464 return;
465 }
466 if (WARN_ON(!desc->num_timings)) {
467 dev_err(dev, "Reject override mode: no timings specified\n");
468 return;
469 }
470
471 for (i = 0; i < panel->desc->num_timings; i++) {
472 const struct display_timing *dt = &panel->desc->timings[i];
473
474 if (!PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hactive) ||
475 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hfront_porch) ||
476 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hback_porch) ||
477 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hsync_len) ||
478 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vactive) ||
479 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vfront_porch) ||
480 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vback_porch) ||
481 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vsync_len))
482 continue;
483
484 if (ot->flags != dt->flags)
485 continue;
486
487 videomode_from_timing(ot, &vm);
488 drm_display_mode_from_videomode(&vm, &panel->override_mode);
489 panel->override_mode.type |= DRM_MODE_TYPE_DRIVER |
490 DRM_MODE_TYPE_PREFERRED;
491 break;
492 }
493
494 if (WARN_ON(!panel->override_mode.type))
495 dev_err(dev, "Reject override mode: No display_timing found\n");
496}
497
Thierry Reding280921d2013-08-30 15:10:14 +0200498static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
499{
Thierry Reding280921d2013-08-30 15:10:14 +0200500 struct panel_simple *panel;
Sean Paulb8a29482019-07-11 13:34:53 -0700501 struct display_timing dt;
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100502 struct device_node *ddc;
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200503 int connector_type;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200504 u32 bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200505 int err;
506
507 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
508 if (!panel)
509 return -ENOMEM;
510
511 panel->enabled = false;
Ajay Kumar613a6332014-07-31 23:12:10 +0530512 panel->prepared = false;
Thierry Reding280921d2013-08-30 15:10:14 +0200513 panel->desc = desc;
514
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700515 panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd");
Douglas Anderson48834e62020-05-07 14:34:57 -0700516 if (!panel->no_hpd) {
517 err = panel_simple_get_hpd_gpio(dev, panel, true);
518 if (err)
519 return err;
520 }
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700521
Thierry Reding280921d2013-08-30 15:10:14 +0200522 panel->supply = devm_regulator_get(dev, "power");
523 if (IS_ERR(panel->supply))
524 return PTR_ERR(panel->supply);
525
Alexandre Courbota61400d2014-10-23 17:16:58 +0900526 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
527 GPIOD_OUT_LOW);
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900528 if (IS_ERR(panel->enable_gpio)) {
529 err = PTR_ERR(panel->enable_gpio);
Fabio Estevamb8e93802017-06-30 18:14:46 -0300530 if (err != -EPROBE_DEFER)
531 dev_err(dev, "failed to request GPIO: %d\n", err);
Alexandre Courbot9746c612014-07-25 23:47:25 +0900532 return err;
533 }
Thierry Reding280921d2013-08-30 15:10:14 +0200534
Thierry Reding280921d2013-08-30 15:10:14 +0200535 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
536 if (ddc) {
537 panel->ddc = of_find_i2c_adapter_by_node(ddc);
538 of_node_put(ddc);
539
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100540 if (!panel->ddc)
541 return -EPROBE_DEFER;
Thierry Reding280921d2013-08-30 15:10:14 +0200542 }
543
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100544 if (desc == &panel_dpi) {
545 /* Handle the generic panel-dpi binding */
546 err = panel_dpi_probe(dev, panel);
547 if (err)
548 goto free_ddc;
549 } else {
550 if (!of_get_display_timing(dev->of_node, "panel-timing", &dt))
551 panel_simple_parse_panel_timing_node(dev, panel, &dt);
552 }
Sean Paulb8a29482019-07-11 13:34:53 -0700553
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200554 connector_type = desc->connector_type;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200555 /* Catch common mistakes for panels. */
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200556 switch (connector_type) {
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200557 case 0:
558 dev_warn(dev, "Specify missing connector_type\n");
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200559 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200560 break;
561 case DRM_MODE_CONNECTOR_LVDS:
Laurent Pinchartc4715832020-06-30 02:33:19 +0300562 WARN_ON(desc->bus_flags &
563 ~(DRM_BUS_FLAG_DE_LOW |
564 DRM_BUS_FLAG_DE_HIGH |
565 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
566 DRM_BUS_FLAG_DATA_LSB_TO_MSB));
Laurent Pinchart1185c402020-06-30 02:33:20 +0300567 WARN_ON(desc->bus_format != MEDIA_BUS_FMT_RGB666_1X7X3_SPWG &&
568 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_SPWG &&
569 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA);
570 WARN_ON(desc->bus_format == MEDIA_BUS_FMT_RGB666_1X7X3_SPWG &&
571 desc->bpc != 6);
572 WARN_ON((desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_SPWG ||
573 desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA) &&
574 desc->bpc != 8);
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200575 break;
576 case DRM_MODE_CONNECTOR_eDP:
577 if (desc->bus_format == 0)
578 dev_warn(dev, "Specify missing bus_format\n");
579 if (desc->bpc != 6 && desc->bpc != 8)
580 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
581 break;
582 case DRM_MODE_CONNECTOR_DSI:
583 if (desc->bpc != 6 && desc->bpc != 8)
584 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
585 break;
586 case DRM_MODE_CONNECTOR_DPI:
587 bus_flags = DRM_BUS_FLAG_DE_LOW |
588 DRM_BUS_FLAG_DE_HIGH |
589 DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE |
590 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
591 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
592 DRM_BUS_FLAG_DATA_LSB_TO_MSB |
593 DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE |
594 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE;
595 if (desc->bus_flags & ~bus_flags)
596 dev_warn(dev, "Unexpected bus_flags(%d)\n", desc->bus_flags & ~bus_flags);
597 if (!(desc->bus_flags & bus_flags))
598 dev_warn(dev, "Specify missing bus_flags\n");
599 if (desc->bus_format == 0)
600 dev_warn(dev, "Specify missing bus_format\n");
601 if (desc->bpc != 6 && desc->bpc != 8)
602 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
603 break;
604 default:
605 dev_warn(dev, "Specify a valid connector_type: %d\n", desc->connector_type);
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200606 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200607 break;
Laurent Pinchart1185c402020-06-30 02:33:20 +0300608 }
Laurent Pinchartc4715832020-06-30 02:33:19 +0300609
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200610 drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type);
Thierry Reding280921d2013-08-30 15:10:14 +0200611
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100612 err = drm_panel_of_backlight(&panel->base);
613 if (err)
614 goto free_ddc;
615
Thierry Reding280921d2013-08-30 15:10:14 +0200616 err = drm_panel_add(&panel->base);
617 if (err < 0)
618 goto free_ddc;
619
620 dev_set_drvdata(dev, panel);
621
622 return 0;
623
624free_ddc:
625 if (panel->ddc)
626 put_device(&panel->ddc->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200627
628 return err;
629}
630
631static int panel_simple_remove(struct device *dev)
632{
633 struct panel_simple *panel = dev_get_drvdata(dev);
634
Thierry Reding280921d2013-08-30 15:10:14 +0200635 drm_panel_remove(&panel->base);
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100636 drm_panel_disable(&panel->base);
637 drm_panel_unprepare(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200638
639 if (panel->ddc)
640 put_device(&panel->ddc->dev);
641
Thierry Reding280921d2013-08-30 15:10:14 +0200642 return 0;
643}
644
Thierry Redingd02fd932014-04-29 17:21:21 +0200645static void panel_simple_shutdown(struct device *dev)
646{
647 struct panel_simple *panel = dev_get_drvdata(dev);
648
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100649 drm_panel_disable(&panel->base);
650 drm_panel_unprepare(&panel->base);
Thierry Redingd02fd932014-04-29 17:21:21 +0200651}
652
Yannick Fertre966fea72017-03-28 11:44:49 +0200653static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
654 .clock = 9000,
655 .hdisplay = 480,
656 .hsync_start = 480 + 2,
657 .hsync_end = 480 + 2 + 41,
658 .htotal = 480 + 2 + 41 + 2,
659 .vdisplay = 272,
660 .vsync_start = 272 + 2,
661 .vsync_end = 272 + 2 + 10,
662 .vtotal = 272 + 2 + 10 + 2,
Yannick Fertre966fea72017-03-28 11:44:49 +0200663 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
664};
665
666static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
667 .modes = &ampire_am_480272h3tmqw_t01h_mode,
668 .num_modes = 1,
669 .bpc = 8,
670 .size = {
671 .width = 105,
672 .height = 67,
673 },
674 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
675};
676
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100677static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
678 .clock = 33333,
679 .hdisplay = 800,
680 .hsync_start = 800 + 0,
681 .hsync_end = 800 + 0 + 255,
682 .htotal = 800 + 0 + 255 + 0,
683 .vdisplay = 480,
684 .vsync_start = 480 + 2,
685 .vsync_end = 480 + 2 + 45,
686 .vtotal = 480 + 2 + 45 + 0,
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100687 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
688};
689
690static const struct panel_desc ampire_am800480r3tmqwa1h = {
691 .modes = &ampire_am800480r3tmqwa1h_mode,
692 .num_modes = 1,
693 .bpc = 6,
694 .size = {
695 .width = 152,
696 .height = 91,
697 },
698 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
699};
700
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200701static const struct display_timing santek_st0700i5y_rbslw_f_timing = {
702 .pixelclock = { 26400000, 33300000, 46800000 },
703 .hactive = { 800, 800, 800 },
704 .hfront_porch = { 16, 210, 354 },
705 .hback_porch = { 45, 36, 6 },
706 .hsync_len = { 1, 10, 40 },
707 .vactive = { 480, 480, 480 },
708 .vfront_porch = { 7, 22, 147 },
709 .vback_porch = { 22, 13, 3 },
710 .vsync_len = { 1, 10, 20 },
711 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
712 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE
713};
714
715static const struct panel_desc armadeus_st0700_adapt = {
716 .timings = &santek_st0700i5y_rbslw_f_timing,
717 .num_timings = 1,
718 .bpc = 6,
719 .size = {
720 .width = 154,
721 .height = 86,
722 },
723 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +0200724 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200725};
726
Thierry Reding280921d2013-08-30 15:10:14 +0200727static const struct drm_display_mode auo_b101aw03_mode = {
728 .clock = 51450,
729 .hdisplay = 1024,
730 .hsync_start = 1024 + 156,
731 .hsync_end = 1024 + 156 + 8,
732 .htotal = 1024 + 156 + 8 + 156,
733 .vdisplay = 600,
734 .vsync_start = 600 + 16,
735 .vsync_end = 600 + 16 + 6,
736 .vtotal = 600 + 16 + 6 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +0200737};
738
739static const struct panel_desc auo_b101aw03 = {
740 .modes = &auo_b101aw03_mode,
741 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700742 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200743 .size = {
744 .width = 223,
745 .height = 125,
746 },
Dmitry Osipenko85560822020-06-22 01:27:42 +0300747 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +0300748 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +0300749 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +0200750};
751
Douglas Anderson374bf822019-07-11 13:34:55 -0700752static const struct display_timing auo_b101ean01_timing = {
753 .pixelclock = { 65300000, 72500000, 75000000 },
754 .hactive = { 1280, 1280, 1280 },
755 .hfront_porch = { 18, 119, 119 },
756 .hback_porch = { 21, 21, 21 },
757 .hsync_len = { 32, 32, 32 },
758 .vactive = { 800, 800, 800 },
759 .vfront_porch = { 4, 4, 4 },
760 .vback_porch = { 8, 8, 8 },
761 .vsync_len = { 18, 20, 20 },
Huang Lina531bc32015-02-28 10:18:58 +0800762};
763
764static const struct panel_desc auo_b101ean01 = {
Douglas Anderson374bf822019-07-11 13:34:55 -0700765 .timings = &auo_b101ean01_timing,
766 .num_timings = 1,
Huang Lina531bc32015-02-28 10:18:58 +0800767 .bpc = 6,
768 .size = {
769 .width = 217,
770 .height = 136,
771 },
772};
773
Rob Clarkdac746e2014-08-01 17:01:06 -0400774static const struct drm_display_mode auo_b101xtn01_mode = {
775 .clock = 72000,
776 .hdisplay = 1366,
777 .hsync_start = 1366 + 20,
778 .hsync_end = 1366 + 20 + 70,
779 .htotal = 1366 + 20 + 70,
780 .vdisplay = 768,
781 .vsync_start = 768 + 14,
782 .vsync_end = 768 + 14 + 42,
783 .vtotal = 768 + 14 + 42,
Rob Clarkdac746e2014-08-01 17:01:06 -0400784 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
785};
786
787static const struct panel_desc auo_b101xtn01 = {
788 .modes = &auo_b101xtn01_mode,
789 .num_modes = 1,
790 .bpc = 6,
791 .size = {
792 .width = 223,
793 .height = 125,
794 },
795};
796
Rob Clarkda4582862020-01-08 15:53:56 -0800797static const struct drm_display_mode auo_b116xak01_mode = {
798 .clock = 69300,
799 .hdisplay = 1366,
800 .hsync_start = 1366 + 48,
801 .hsync_end = 1366 + 48 + 32,
802 .htotal = 1366 + 48 + 32 + 10,
803 .vdisplay = 768,
804 .vsync_start = 768 + 4,
805 .vsync_end = 768 + 4 + 6,
806 .vtotal = 768 + 4 + 6 + 15,
Rob Clarkda4582862020-01-08 15:53:56 -0800807 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
808};
809
810static const struct panel_desc auo_b116xak01 = {
811 .modes = &auo_b116xak01_mode,
812 .num_modes = 1,
813 .bpc = 6,
814 .size = {
815 .width = 256,
816 .height = 144,
817 },
818 .delay = {
819 .hpd_absent_delay = 200,
820 },
821 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
822 .connector_type = DRM_MODE_CONNECTOR_eDP,
823};
824
Ajay Kumare35e3052014-09-01 15:40:02 +0530825static const struct drm_display_mode auo_b116xw03_mode = {
826 .clock = 70589,
827 .hdisplay = 1366,
828 .hsync_start = 1366 + 40,
829 .hsync_end = 1366 + 40 + 40,
830 .htotal = 1366 + 40 + 40 + 32,
831 .vdisplay = 768,
832 .vsync_start = 768 + 10,
833 .vsync_end = 768 + 10 + 12,
834 .vtotal = 768 + 10 + 12 + 6,
Jitao Shi88d34572020-07-05 17:45:14 +0800835 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
Ajay Kumare35e3052014-09-01 15:40:02 +0530836};
837
838static const struct panel_desc auo_b116xw03 = {
839 .modes = &auo_b116xw03_mode,
840 .num_modes = 1,
841 .bpc = 6,
842 .size = {
843 .width = 256,
844 .height = 144,
845 },
Jitao Shi88d34572020-07-05 17:45:14 +0800846 .delay = {
847 .enable = 400,
848 },
849 .bus_flags = DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
850 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
851 .connector_type = DRM_MODE_CONNECTOR_eDP,
Ajay Kumare35e3052014-09-01 15:40:02 +0530852};
853
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700854static const struct drm_display_mode auo_b133xtn01_mode = {
855 .clock = 69500,
856 .hdisplay = 1366,
857 .hsync_start = 1366 + 48,
858 .hsync_end = 1366 + 48 + 32,
859 .htotal = 1366 + 48 + 32 + 20,
860 .vdisplay = 768,
861 .vsync_start = 768 + 3,
862 .vsync_end = 768 + 3 + 6,
863 .vtotal = 768 + 3 + 6 + 13,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700864};
865
866static const struct panel_desc auo_b133xtn01 = {
867 .modes = &auo_b133xtn01_mode,
868 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700869 .bpc = 6,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700870 .size = {
871 .width = 293,
872 .height = 165,
873 },
874};
875
Ajay Kumar3e51d602014-07-31 23:12:12 +0530876static const struct drm_display_mode auo_b133htn01_mode = {
877 .clock = 150660,
878 .hdisplay = 1920,
879 .hsync_start = 1920 + 172,
880 .hsync_end = 1920 + 172 + 80,
881 .htotal = 1920 + 172 + 80 + 60,
882 .vdisplay = 1080,
883 .vsync_start = 1080 + 25,
884 .vsync_end = 1080 + 25 + 10,
885 .vtotal = 1080 + 25 + 10 + 10,
Ajay Kumar3e51d602014-07-31 23:12:12 +0530886};
887
888static const struct panel_desc auo_b133htn01 = {
889 .modes = &auo_b133htn01_mode,
890 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +0100891 .bpc = 6,
Ajay Kumar3e51d602014-07-31 23:12:12 +0530892 .size = {
893 .width = 293,
894 .height = 165,
895 },
896 .delay = {
897 .prepare = 105,
898 .enable = 20,
899 .unprepare = 50,
900 },
901};
902
Lukasz Majewskibccfaff2018-05-14 21:08:49 +0200903static const struct display_timing auo_g070vvn01_timings = {
904 .pixelclock = { 33300000, 34209000, 45000000 },
905 .hactive = { 800, 800, 800 },
906 .hfront_porch = { 20, 40, 200 },
907 .hback_porch = { 87, 40, 1 },
908 .hsync_len = { 1, 48, 87 },
909 .vactive = { 480, 480, 480 },
910 .vfront_porch = { 5, 13, 200 },
911 .vback_porch = { 31, 31, 29 },
912 .vsync_len = { 1, 1, 3 },
913};
914
915static const struct panel_desc auo_g070vvn01 = {
916 .timings = &auo_g070vvn01_timings,
917 .num_timings = 1,
918 .bpc = 8,
919 .size = {
920 .width = 152,
921 .height = 91,
922 },
923 .delay = {
924 .prepare = 200,
925 .enable = 50,
926 .disable = 50,
927 .unprepare = 1000,
928 },
929};
930
Alex Gonzalez4fb86402018-10-25 17:09:30 +0200931static const struct drm_display_mode auo_g101evn010_mode = {
932 .clock = 68930,
933 .hdisplay = 1280,
934 .hsync_start = 1280 + 82,
935 .hsync_end = 1280 + 82 + 2,
936 .htotal = 1280 + 82 + 2 + 84,
937 .vdisplay = 800,
938 .vsync_start = 800 + 8,
939 .vsync_end = 800 + 8 + 2,
940 .vtotal = 800 + 8 + 2 + 6,
Alex Gonzalez4fb86402018-10-25 17:09:30 +0200941};
942
943static const struct panel_desc auo_g101evn010 = {
944 .modes = &auo_g101evn010_mode,
945 .num_modes = 1,
946 .bpc = 6,
947 .size = {
948 .width = 216,
949 .height = 135,
950 },
Tomi Valkeinen27a46fb2020-04-17 14:40:43 +0300951 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
952 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alex Gonzalez4fb86402018-10-25 17:09:30 +0200953};
954
Christoph Fritz4451c282017-12-16 14:13:36 +0100955static const struct drm_display_mode auo_g104sn02_mode = {
956 .clock = 40000,
957 .hdisplay = 800,
958 .hsync_start = 800 + 40,
959 .hsync_end = 800 + 40 + 216,
960 .htotal = 800 + 40 + 216 + 128,
961 .vdisplay = 600,
962 .vsync_start = 600 + 10,
963 .vsync_end = 600 + 10 + 35,
964 .vtotal = 600 + 10 + 35 + 2,
Christoph Fritz4451c282017-12-16 14:13:36 +0100965};
966
967static const struct panel_desc auo_g104sn02 = {
968 .modes = &auo_g104sn02_mode,
969 .num_modes = 1,
970 .bpc = 8,
971 .size = {
972 .width = 211,
973 .height = 158,
974 },
975};
976
Sebastian Reichel03e909a2020-04-15 19:27:25 +0200977static const struct drm_display_mode auo_g121ean01_mode = {
978 .clock = 66700,
979 .hdisplay = 1280,
980 .hsync_start = 1280 + 58,
981 .hsync_end = 1280 + 58 + 8,
982 .htotal = 1280 + 58 + 8 + 70,
983 .vdisplay = 800,
984 .vsync_start = 800 + 6,
985 .vsync_end = 800 + 6 + 4,
986 .vtotal = 800 + 6 + 4 + 10,
Sebastian Reichel03e909a2020-04-15 19:27:25 +0200987};
988
989static const struct panel_desc auo_g121ean01 = {
990 .modes = &auo_g121ean01_mode,
991 .num_modes = 1,
992 .bpc = 8,
993 .size = {
994 .width = 261,
995 .height = 163,
996 },
997 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
998 .connector_type = DRM_MODE_CONNECTOR_LVDS,
999};
1000
Lucas Stach697035c2016-11-30 14:09:55 +01001001static const struct display_timing auo_g133han01_timings = {
1002 .pixelclock = { 134000000, 141200000, 149000000 },
1003 .hactive = { 1920, 1920, 1920 },
1004 .hfront_porch = { 39, 58, 77 },
1005 .hback_porch = { 59, 88, 117 },
1006 .hsync_len = { 28, 42, 56 },
1007 .vactive = { 1080, 1080, 1080 },
1008 .vfront_porch = { 3, 8, 11 },
1009 .vback_porch = { 5, 14, 19 },
1010 .vsync_len = { 4, 14, 19 },
1011};
1012
1013static const struct panel_desc auo_g133han01 = {
1014 .timings = &auo_g133han01_timings,
1015 .num_timings = 1,
1016 .bpc = 8,
1017 .size = {
1018 .width = 293,
1019 .height = 165,
1020 },
1021 .delay = {
1022 .prepare = 200,
1023 .enable = 50,
1024 .disable = 50,
1025 .unprepare = 1000,
1026 },
1027 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001028 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach697035c2016-11-30 14:09:55 +01001029};
1030
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02001031static const struct drm_display_mode auo_g156xtn01_mode = {
1032 .clock = 76000,
1033 .hdisplay = 1366,
1034 .hsync_start = 1366 + 33,
1035 .hsync_end = 1366 + 33 + 67,
1036 .htotal = 1560,
1037 .vdisplay = 768,
1038 .vsync_start = 768 + 4,
1039 .vsync_end = 768 + 4 + 4,
1040 .vtotal = 806,
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02001041};
1042
1043static const struct panel_desc auo_g156xtn01 = {
1044 .modes = &auo_g156xtn01_mode,
1045 .num_modes = 1,
1046 .bpc = 8,
1047 .size = {
1048 .width = 344,
1049 .height = 194,
1050 },
1051 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1052 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1053};
1054
Lucas Stach8c31f602016-11-30 14:09:56 +01001055static const struct display_timing auo_g185han01_timings = {
1056 .pixelclock = { 120000000, 144000000, 175000000 },
1057 .hactive = { 1920, 1920, 1920 },
Lucas Stachf8c6bfc2019-07-10 15:07:40 +02001058 .hfront_porch = { 36, 120, 148 },
1059 .hback_porch = { 24, 88, 108 },
1060 .hsync_len = { 20, 48, 64 },
Lucas Stach8c31f602016-11-30 14:09:56 +01001061 .vactive = { 1080, 1080, 1080 },
1062 .vfront_porch = { 6, 10, 40 },
1063 .vback_porch = { 2, 5, 20 },
1064 .vsync_len = { 2, 5, 20 },
1065};
1066
1067static const struct panel_desc auo_g185han01 = {
1068 .timings = &auo_g185han01_timings,
1069 .num_timings = 1,
1070 .bpc = 8,
1071 .size = {
1072 .width = 409,
1073 .height = 230,
1074 },
1075 .delay = {
1076 .prepare = 50,
1077 .enable = 200,
1078 .disable = 110,
1079 .unprepare = 1000,
1080 },
1081 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001082 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8c31f602016-11-30 14:09:56 +01001083};
1084
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02001085static const struct display_timing auo_g190ean01_timings = {
1086 .pixelclock = { 90000000, 108000000, 135000000 },
1087 .hactive = { 1280, 1280, 1280 },
1088 .hfront_porch = { 126, 184, 1266 },
1089 .hback_porch = { 84, 122, 844 },
1090 .hsync_len = { 70, 102, 704 },
1091 .vactive = { 1024, 1024, 1024 },
1092 .vfront_porch = { 4, 26, 76 },
1093 .vback_porch = { 2, 8, 25 },
1094 .vsync_len = { 2, 8, 25 },
1095};
1096
1097static const struct panel_desc auo_g190ean01 = {
1098 .timings = &auo_g190ean01_timings,
1099 .num_timings = 1,
1100 .bpc = 8,
1101 .size = {
1102 .width = 376,
1103 .height = 301,
1104 },
1105 .delay = {
1106 .prepare = 50,
1107 .enable = 200,
1108 .disable = 110,
1109 .unprepare = 1000,
1110 },
1111 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1112 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1113};
1114
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001115static const struct display_timing auo_p320hvn03_timings = {
1116 .pixelclock = { 106000000, 148500000, 164000000 },
1117 .hactive = { 1920, 1920, 1920 },
1118 .hfront_porch = { 25, 50, 130 },
1119 .hback_porch = { 25, 50, 130 },
1120 .hsync_len = { 20, 40, 105 },
1121 .vactive = { 1080, 1080, 1080 },
1122 .vfront_porch = { 8, 17, 150 },
1123 .vback_porch = { 8, 17, 150 },
1124 .vsync_len = { 4, 11, 100 },
1125};
1126
1127static const struct panel_desc auo_p320hvn03 = {
1128 .timings = &auo_p320hvn03_timings,
1129 .num_timings = 1,
1130 .bpc = 8,
1131 .size = {
1132 .width = 698,
1133 .height = 393,
1134 },
1135 .delay = {
1136 .prepare = 1,
1137 .enable = 450,
1138 .unprepare = 500,
1139 },
Lucas Stach2554f152018-04-11 17:27:41 +02001140 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001141 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001142};
1143
Haixia Shi7ee933a2016-10-11 14:59:16 -07001144static const struct drm_display_mode auo_t215hvn01_mode = {
1145 .clock = 148800,
1146 .hdisplay = 1920,
1147 .hsync_start = 1920 + 88,
1148 .hsync_end = 1920 + 88 + 44,
1149 .htotal = 1920 + 88 + 44 + 148,
1150 .vdisplay = 1080,
1151 .vsync_start = 1080 + 4,
1152 .vsync_end = 1080 + 4 + 5,
1153 .vtotal = 1080 + 4 + 5 + 36,
Haixia Shi7ee933a2016-10-11 14:59:16 -07001154};
1155
1156static const struct panel_desc auo_t215hvn01 = {
1157 .modes = &auo_t215hvn01_mode,
1158 .num_modes = 1,
1159 .bpc = 8,
1160 .size = {
1161 .width = 430,
1162 .height = 270,
1163 },
1164 .delay = {
1165 .disable = 5,
1166 .unprepare = 1000,
1167 }
1168};
1169
Philipp Zabeld47df632014-12-18 16:43:43 +01001170static const struct drm_display_mode avic_tm070ddh03_mode = {
1171 .clock = 51200,
1172 .hdisplay = 1024,
1173 .hsync_start = 1024 + 160,
1174 .hsync_end = 1024 + 160 + 4,
1175 .htotal = 1024 + 160 + 4 + 156,
1176 .vdisplay = 600,
1177 .vsync_start = 600 + 17,
1178 .vsync_end = 600 + 17 + 1,
1179 .vtotal = 600 + 17 + 1 + 17,
Philipp Zabeld47df632014-12-18 16:43:43 +01001180};
1181
1182static const struct panel_desc avic_tm070ddh03 = {
1183 .modes = &avic_tm070ddh03_mode,
1184 .num_modes = 1,
1185 .bpc = 8,
1186 .size = {
1187 .width = 154,
1188 .height = 90,
1189 },
1190 .delay = {
1191 .prepare = 20,
1192 .enable = 200,
1193 .disable = 200,
1194 },
1195};
1196
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08001197static const struct drm_display_mode bananapi_s070wv20_ct16_mode = {
1198 .clock = 30000,
1199 .hdisplay = 800,
1200 .hsync_start = 800 + 40,
1201 .hsync_end = 800 + 40 + 48,
1202 .htotal = 800 + 40 + 48 + 40,
1203 .vdisplay = 480,
1204 .vsync_start = 480 + 13,
1205 .vsync_end = 480 + 13 + 3,
1206 .vtotal = 480 + 13 + 3 + 29,
1207};
1208
1209static const struct panel_desc bananapi_s070wv20_ct16 = {
1210 .modes = &bananapi_s070wv20_ct16_mode,
1211 .num_modes = 1,
1212 .bpc = 6,
1213 .size = {
1214 .width = 154,
1215 .height = 86,
1216 },
1217};
1218
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001219static const struct drm_display_mode boe_hv070wsa_mode = {
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001220 .clock = 42105,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001221 .hdisplay = 1024,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001222 .hsync_start = 1024 + 30,
1223 .hsync_end = 1024 + 30 + 30,
1224 .htotal = 1024 + 30 + 30 + 30,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001225 .vdisplay = 600,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001226 .vsync_start = 600 + 10,
1227 .vsync_end = 600 + 10 + 10,
1228 .vtotal = 600 + 10 + 10 + 10,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001229};
1230
1231static const struct panel_desc boe_hv070wsa = {
1232 .modes = &boe_hv070wsa_mode,
1233 .num_modes = 1,
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001234 .bpc = 8,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001235 .size = {
1236 .width = 154,
1237 .height = 90,
1238 },
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001239 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1240 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1241 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001242};
1243
Caesar Wangcac1a412016-12-14 11:19:56 +08001244static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
1245 {
1246 .clock = 71900,
1247 .hdisplay = 1280,
1248 .hsync_start = 1280 + 48,
1249 .hsync_end = 1280 + 48 + 32,
1250 .htotal = 1280 + 48 + 32 + 80,
1251 .vdisplay = 800,
1252 .vsync_start = 800 + 3,
1253 .vsync_end = 800 + 3 + 5,
1254 .vtotal = 800 + 3 + 5 + 24,
Caesar Wangcac1a412016-12-14 11:19:56 +08001255 },
1256 {
1257 .clock = 57500,
1258 .hdisplay = 1280,
1259 .hsync_start = 1280 + 48,
1260 .hsync_end = 1280 + 48 + 32,
1261 .htotal = 1280 + 48 + 32 + 80,
1262 .vdisplay = 800,
1263 .vsync_start = 800 + 3,
1264 .vsync_end = 800 + 3 + 5,
1265 .vtotal = 800 + 3 + 5 + 24,
Caesar Wangcac1a412016-12-14 11:19:56 +08001266 },
1267};
1268
1269static const struct panel_desc boe_nv101wxmn51 = {
1270 .modes = boe_nv101wxmn51_modes,
1271 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
1272 .bpc = 8,
1273 .size = {
1274 .width = 217,
1275 .height = 136,
1276 },
1277 .delay = {
1278 .prepare = 210,
1279 .enable = 50,
1280 .unprepare = 160,
1281 },
1282};
1283
Douglas Andersoncfe40d02020-05-08 15:59:02 -07001284/* Also used for boe_nv133fhm_n62 */
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001285static const struct drm_display_mode boe_nv133fhm_n61_modes = {
1286 .clock = 147840,
1287 .hdisplay = 1920,
1288 .hsync_start = 1920 + 48,
1289 .hsync_end = 1920 + 48 + 32,
1290 .htotal = 1920 + 48 + 32 + 200,
1291 .vdisplay = 1080,
1292 .vsync_start = 1080 + 3,
1293 .vsync_end = 1080 + 3 + 6,
1294 .vtotal = 1080 + 3 + 6 + 31,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001295};
1296
Douglas Andersoncfe40d02020-05-08 15:59:02 -07001297/* Also used for boe_nv133fhm_n62 */
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001298static const struct panel_desc boe_nv133fhm_n61 = {
1299 .modes = &boe_nv133fhm_n61_modes,
1300 .num_modes = 1,
Douglas Anderson9694d9c2020-05-08 15:59:00 -07001301 .bpc = 6,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001302 .size = {
Douglas Anderson9694d9c2020-05-08 15:59:00 -07001303 .width = 294,
1304 .height = 165,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001305 },
1306 .delay = {
1307 .hpd_absent_delay = 200,
1308 .unprepare = 500,
1309 },
1310 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1311 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1312 .connector_type = DRM_MODE_CONNECTOR_eDP,
1313};
1314
Tobias Schramma5119812020-01-09 12:29:52 +01001315static const struct drm_display_mode boe_nv140fhmn49_modes[] = {
1316 {
1317 .clock = 148500,
1318 .hdisplay = 1920,
1319 .hsync_start = 1920 + 48,
1320 .hsync_end = 1920 + 48 + 32,
1321 .htotal = 2200,
1322 .vdisplay = 1080,
1323 .vsync_start = 1080 + 3,
1324 .vsync_end = 1080 + 3 + 5,
1325 .vtotal = 1125,
Tobias Schramma5119812020-01-09 12:29:52 +01001326 },
1327};
1328
1329static const struct panel_desc boe_nv140fhmn49 = {
1330 .modes = boe_nv140fhmn49_modes,
1331 .num_modes = ARRAY_SIZE(boe_nv140fhmn49_modes),
1332 .bpc = 6,
1333 .size = {
1334 .width = 309,
1335 .height = 174,
1336 },
1337 .delay = {
1338 .prepare = 210,
1339 .enable = 50,
1340 .unprepare = 160,
1341 },
1342 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1343 .connector_type = DRM_MODE_CONNECTOR_eDP,
1344};
1345
Giulio Benettie58edce2018-07-31 01:11:16 +02001346static const struct drm_display_mode cdtech_s043wq26h_ct7_mode = {
1347 .clock = 9000,
1348 .hdisplay = 480,
1349 .hsync_start = 480 + 5,
1350 .hsync_end = 480 + 5 + 5,
1351 .htotal = 480 + 5 + 5 + 40,
1352 .vdisplay = 272,
1353 .vsync_start = 272 + 8,
1354 .vsync_end = 272 + 8 + 8,
1355 .vtotal = 272 + 8 + 8 + 8,
Giulio Benettie58edce2018-07-31 01:11:16 +02001356 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1357};
1358
1359static const struct panel_desc cdtech_s043wq26h_ct7 = {
1360 .modes = &cdtech_s043wq26h_ct7_mode,
1361 .num_modes = 1,
1362 .bpc = 8,
1363 .size = {
1364 .width = 95,
1365 .height = 54,
1366 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001367 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Giulio Benettie58edce2018-07-31 01:11:16 +02001368};
1369
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001370/* S070PWS19HP-FC21 2017/04/22 */
1371static const struct drm_display_mode cdtech_s070pws19hp_fc21_mode = {
1372 .clock = 51200,
1373 .hdisplay = 1024,
1374 .hsync_start = 1024 + 160,
1375 .hsync_end = 1024 + 160 + 20,
1376 .htotal = 1024 + 160 + 20 + 140,
1377 .vdisplay = 600,
1378 .vsync_start = 600 + 12,
1379 .vsync_end = 600 + 12 + 3,
1380 .vtotal = 600 + 12 + 3 + 20,
1381 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1382};
1383
1384static const struct panel_desc cdtech_s070pws19hp_fc21 = {
1385 .modes = &cdtech_s070pws19hp_fc21_mode,
1386 .num_modes = 1,
1387 .bpc = 6,
1388 .size = {
1389 .width = 154,
1390 .height = 86,
1391 },
1392 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001393 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001394 .connector_type = DRM_MODE_CONNECTOR_DPI,
1395};
1396
1397/* S070SWV29HG-DC44 2017/09/21 */
1398static const struct drm_display_mode cdtech_s070swv29hg_dc44_mode = {
1399 .clock = 33300,
1400 .hdisplay = 800,
1401 .hsync_start = 800 + 210,
1402 .hsync_end = 800 + 210 + 2,
1403 .htotal = 800 + 210 + 2 + 44,
1404 .vdisplay = 480,
1405 .vsync_start = 480 + 22,
1406 .vsync_end = 480 + 22 + 2,
1407 .vtotal = 480 + 22 + 2 + 21,
1408 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1409};
1410
1411static const struct panel_desc cdtech_s070swv29hg_dc44 = {
1412 .modes = &cdtech_s070swv29hg_dc44_mode,
1413 .num_modes = 1,
1414 .bpc = 6,
1415 .size = {
1416 .width = 154,
1417 .height = 86,
1418 },
1419 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001420 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001421 .connector_type = DRM_MODE_CONNECTOR_DPI,
1422};
1423
Giulio Benetti982f9442018-07-31 01:11:14 +02001424static const struct drm_display_mode cdtech_s070wv95_ct16_mode = {
1425 .clock = 35000,
1426 .hdisplay = 800,
1427 .hsync_start = 800 + 40,
1428 .hsync_end = 800 + 40 + 40,
1429 .htotal = 800 + 40 + 40 + 48,
1430 .vdisplay = 480,
1431 .vsync_start = 480 + 29,
1432 .vsync_end = 480 + 29 + 13,
1433 .vtotal = 480 + 29 + 13 + 3,
Giulio Benetti982f9442018-07-31 01:11:14 +02001434 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1435};
1436
1437static const struct panel_desc cdtech_s070wv95_ct16 = {
1438 .modes = &cdtech_s070wv95_ct16_mode,
1439 .num_modes = 1,
1440 .bpc = 8,
1441 .size = {
1442 .width = 154,
1443 .height = 85,
1444 },
1445};
1446
Randy Li2cb35c82016-09-20 03:02:51 +08001447static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
1448 .clock = 66770,
1449 .hdisplay = 800,
1450 .hsync_start = 800 + 49,
1451 .hsync_end = 800 + 49 + 33,
1452 .htotal = 800 + 49 + 33 + 17,
1453 .vdisplay = 1280,
1454 .vsync_start = 1280 + 1,
1455 .vsync_end = 1280 + 1 + 7,
1456 .vtotal = 1280 + 1 + 7 + 15,
Randy Li2cb35c82016-09-20 03:02:51 +08001457 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1458};
1459
1460static const struct panel_desc chunghwa_claa070wp03xg = {
1461 .modes = &chunghwa_claa070wp03xg_mode,
1462 .num_modes = 1,
1463 .bpc = 6,
1464 .size = {
1465 .width = 94,
1466 .height = 150,
1467 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001468 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001469 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001470 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Randy Li2cb35c82016-09-20 03:02:51 +08001471};
1472
Stephen Warren4c930752014-01-07 16:46:26 -07001473static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
1474 .clock = 72070,
1475 .hdisplay = 1366,
1476 .hsync_start = 1366 + 58,
1477 .hsync_end = 1366 + 58 + 58,
1478 .htotal = 1366 + 58 + 58 + 58,
1479 .vdisplay = 768,
1480 .vsync_start = 768 + 4,
1481 .vsync_end = 768 + 4 + 4,
1482 .vtotal = 768 + 4 + 4 + 4,
Stephen Warren4c930752014-01-07 16:46:26 -07001483};
1484
1485static const struct panel_desc chunghwa_claa101wa01a = {
1486 .modes = &chunghwa_claa101wa01a_mode,
1487 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001488 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -07001489 .size = {
1490 .width = 220,
1491 .height = 120,
1492 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001493 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001494 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001495 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Stephen Warren4c930752014-01-07 16:46:26 -07001496};
1497
Thierry Reding280921d2013-08-30 15:10:14 +02001498static const struct drm_display_mode chunghwa_claa101wb01_mode = {
1499 .clock = 69300,
1500 .hdisplay = 1366,
1501 .hsync_start = 1366 + 48,
1502 .hsync_end = 1366 + 48 + 32,
1503 .htotal = 1366 + 48 + 32 + 20,
1504 .vdisplay = 768,
1505 .vsync_start = 768 + 16,
1506 .vsync_end = 768 + 16 + 8,
1507 .vtotal = 768 + 16 + 8 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02001508};
1509
1510static const struct panel_desc chunghwa_claa101wb01 = {
1511 .modes = &chunghwa_claa101wb01_mode,
1512 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001513 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +02001514 .size = {
1515 .width = 223,
1516 .height = 125,
1517 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001518 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001519 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001520 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +02001521};
1522
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001523static const struct drm_display_mode dataimage_scf0700c48ggu18_mode = {
1524 .clock = 33260,
1525 .hdisplay = 800,
1526 .hsync_start = 800 + 40,
1527 .hsync_end = 800 + 40 + 128,
1528 .htotal = 800 + 40 + 128 + 88,
1529 .vdisplay = 480,
1530 .vsync_start = 480 + 10,
1531 .vsync_end = 480 + 10 + 2,
1532 .vtotal = 480 + 10 + 2 + 33,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001533 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1534};
1535
1536static const struct panel_desc dataimage_scf0700c48ggu18 = {
1537 .modes = &dataimage_scf0700c48ggu18_mode,
1538 .num_modes = 1,
1539 .bpc = 8,
1540 .size = {
1541 .width = 152,
1542 .height = 91,
1543 },
1544 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001545 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001546};
1547
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001548static const struct display_timing dlc_dlc0700yzg_1_timing = {
1549 .pixelclock = { 45000000, 51200000, 57000000 },
1550 .hactive = { 1024, 1024, 1024 },
1551 .hfront_porch = { 100, 106, 113 },
1552 .hback_porch = { 100, 106, 113 },
1553 .hsync_len = { 100, 108, 114 },
1554 .vactive = { 600, 600, 600 },
1555 .vfront_porch = { 8, 11, 15 },
1556 .vback_porch = { 8, 11, 15 },
1557 .vsync_len = { 9, 13, 15 },
1558 .flags = DISPLAY_FLAGS_DE_HIGH,
1559};
1560
1561static const struct panel_desc dlc_dlc0700yzg_1 = {
1562 .timings = &dlc_dlc0700yzg_1_timing,
1563 .num_timings = 1,
1564 .bpc = 6,
1565 .size = {
1566 .width = 154,
1567 .height = 86,
1568 },
1569 .delay = {
1570 .prepare = 30,
1571 .enable = 200,
1572 .disable = 200,
1573 },
1574 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001575 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001576};
1577
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001578static const struct display_timing dlc_dlc1010gig_timing = {
1579 .pixelclock = { 68900000, 71100000, 73400000 },
1580 .hactive = { 1280, 1280, 1280 },
1581 .hfront_porch = { 43, 53, 63 },
1582 .hback_porch = { 43, 53, 63 },
1583 .hsync_len = { 44, 54, 64 },
1584 .vactive = { 800, 800, 800 },
1585 .vfront_porch = { 5, 8, 11 },
1586 .vback_porch = { 5, 8, 11 },
1587 .vsync_len = { 5, 7, 11 },
1588 .flags = DISPLAY_FLAGS_DE_HIGH,
1589};
1590
1591static const struct panel_desc dlc_dlc1010gig = {
1592 .timings = &dlc_dlc1010gig_timing,
1593 .num_timings = 1,
1594 .bpc = 8,
1595 .size = {
1596 .width = 216,
1597 .height = 135,
1598 },
1599 .delay = {
1600 .prepare = 60,
1601 .enable = 150,
1602 .disable = 100,
1603 .unprepare = 60,
1604 },
1605 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001606 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001607};
1608
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001609static const struct drm_display_mode edt_et035012dm6_mode = {
1610 .clock = 6500,
1611 .hdisplay = 320,
1612 .hsync_start = 320 + 20,
1613 .hsync_end = 320 + 20 + 30,
1614 .htotal = 320 + 20 + 68,
1615 .vdisplay = 240,
1616 .vsync_start = 240 + 4,
1617 .vsync_end = 240 + 4 + 4,
1618 .vtotal = 240 + 4 + 4 + 14,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001619 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1620};
1621
1622static const struct panel_desc edt_et035012dm6 = {
1623 .modes = &edt_et035012dm6_mode,
1624 .num_modes = 1,
1625 .bpc = 8,
1626 .size = {
1627 .width = 70,
1628 .height = 52,
1629 },
1630 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001631 .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001632};
1633
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00001634static const struct drm_display_mode edt_etm043080dh6gp_mode = {
1635 .clock = 10870,
1636 .hdisplay = 480,
1637 .hsync_start = 480 + 8,
1638 .hsync_end = 480 + 8 + 4,
1639 .htotal = 480 + 8 + 4 + 41,
1640
1641 /*
1642 * IWG22M: Y resolution changed for "dc_linuxfb" module crashing while
1643 * fb_align
1644 */
1645
1646 .vdisplay = 288,
1647 .vsync_start = 288 + 2,
1648 .vsync_end = 288 + 2 + 4,
1649 .vtotal = 288 + 2 + 4 + 10,
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00001650};
1651
1652static const struct panel_desc edt_etm043080dh6gp = {
1653 .modes = &edt_etm043080dh6gp_mode,
1654 .num_modes = 1,
1655 .bpc = 8,
1656 .size = {
1657 .width = 100,
1658 .height = 65,
1659 },
1660 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1661 .connector_type = DRM_MODE_CONNECTOR_DPI,
1662};
1663
Marek Vasutfd819bf2019-02-19 15:04:38 +01001664static const struct drm_display_mode edt_etm0430g0dh6_mode = {
1665 .clock = 9000,
1666 .hdisplay = 480,
1667 .hsync_start = 480 + 2,
1668 .hsync_end = 480 + 2 + 41,
1669 .htotal = 480 + 2 + 41 + 2,
1670 .vdisplay = 272,
1671 .vsync_start = 272 + 2,
1672 .vsync_end = 272 + 2 + 10,
1673 .vtotal = 272 + 2 + 10 + 2,
Marek Vasutfd819bf2019-02-19 15:04:38 +01001674 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1675};
1676
1677static const struct panel_desc edt_etm0430g0dh6 = {
1678 .modes = &edt_etm0430g0dh6_mode,
1679 .num_modes = 1,
1680 .bpc = 6,
1681 .size = {
1682 .width = 95,
1683 .height = 54,
1684 },
1685};
1686
Stefan Agner26ab0062014-05-15 11:38:45 +02001687static const struct drm_display_mode edt_et057090dhu_mode = {
1688 .clock = 25175,
1689 .hdisplay = 640,
1690 .hsync_start = 640 + 16,
1691 .hsync_end = 640 + 16 + 30,
1692 .htotal = 640 + 16 + 30 + 114,
1693 .vdisplay = 480,
1694 .vsync_start = 480 + 10,
1695 .vsync_end = 480 + 10 + 3,
1696 .vtotal = 480 + 10 + 3 + 32,
Stefan Agner26ab0062014-05-15 11:38:45 +02001697 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1698};
1699
1700static const struct panel_desc edt_et057090dhu = {
1701 .modes = &edt_et057090dhu_mode,
1702 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001703 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +02001704 .size = {
1705 .width = 115,
1706 .height = 86,
1707 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08001708 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001709 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Dmitry Osipenko75e73222020-06-22 01:27:41 +03001710 .connector_type = DRM_MODE_CONNECTOR_DPI,
Stefan Agner26ab0062014-05-15 11:38:45 +02001711};
1712
Philipp Zabelfff5de42014-05-15 12:25:47 +02001713static const struct drm_display_mode edt_etm0700g0dh6_mode = {
1714 .clock = 33260,
1715 .hdisplay = 800,
1716 .hsync_start = 800 + 40,
1717 .hsync_end = 800 + 40 + 128,
1718 .htotal = 800 + 40 + 128 + 88,
1719 .vdisplay = 480,
1720 .vsync_start = 480 + 10,
1721 .vsync_end = 480 + 10 + 2,
1722 .vtotal = 480 + 10 + 2 + 33,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001723 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1724};
1725
1726static const struct panel_desc edt_etm0700g0dh6 = {
1727 .modes = &edt_etm0700g0dh6_mode,
1728 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001729 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001730 .size = {
1731 .width = 152,
1732 .height = 91,
1733 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08001734 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001735 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001736};
1737
Jan Tuerkaa7e6452018-06-19 11:55:44 +02001738static const struct panel_desc edt_etm0700g0bdh6 = {
1739 .modes = &edt_etm0700g0dh6_mode,
1740 .num_modes = 1,
1741 .bpc = 6,
1742 .size = {
1743 .width = 152,
1744 .height = 91,
1745 },
1746 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001747 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Jan Tuerkaa7e6452018-06-19 11:55:44 +02001748};
1749
Marco Felsch9158e3c2019-04-16 12:06:45 +02001750static const struct display_timing evervision_vgg804821_timing = {
1751 .pixelclock = { 27600000, 33300000, 50000000 },
1752 .hactive = { 800, 800, 800 },
1753 .hfront_porch = { 40, 66, 70 },
1754 .hback_porch = { 40, 67, 70 },
1755 .hsync_len = { 40, 67, 70 },
1756 .vactive = { 480, 480, 480 },
1757 .vfront_porch = { 6, 10, 10 },
1758 .vback_porch = { 7, 11, 11 },
1759 .vsync_len = { 7, 11, 11 },
1760 .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH |
1761 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
1762 DISPLAY_FLAGS_SYNC_NEGEDGE,
1763};
1764
1765static const struct panel_desc evervision_vgg804821 = {
1766 .timings = &evervision_vgg804821_timing,
1767 .num_timings = 1,
1768 .bpc = 8,
1769 .size = {
1770 .width = 108,
1771 .height = 64,
1772 },
1773 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001774 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Marco Felsch9158e3c2019-04-16 12:06:45 +02001775};
1776
Boris BREZILLON102932b2014-06-05 15:53:32 +02001777static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
1778 .clock = 32260,
1779 .hdisplay = 800,
1780 .hsync_start = 800 + 168,
1781 .hsync_end = 800 + 168 + 64,
1782 .htotal = 800 + 168 + 64 + 88,
1783 .vdisplay = 480,
1784 .vsync_start = 480 + 37,
1785 .vsync_end = 480 + 37 + 2,
1786 .vtotal = 480 + 37 + 2 + 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001787};
1788
1789static const struct panel_desc foxlink_fl500wvr00_a0t = {
1790 .modes = &foxlink_fl500wvr00_a0t_mode,
1791 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001792 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001793 .size = {
1794 .width = 108,
1795 .height = 65,
1796 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +02001797 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001798};
1799
Paul Cercueil795db2a2020-07-16 14:56:47 +02001800static const struct drm_display_mode frida_frd350h54004_modes[] = {
1801 { /* 60 Hz */
1802 .clock = 6000,
1803 .hdisplay = 320,
1804 .hsync_start = 320 + 44,
1805 .hsync_end = 320 + 44 + 16,
1806 .htotal = 320 + 44 + 16 + 20,
1807 .vdisplay = 240,
1808 .vsync_start = 240 + 2,
1809 .vsync_end = 240 + 2 + 6,
1810 .vtotal = 240 + 2 + 6 + 2,
1811 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1812 },
1813 { /* 50 Hz */
1814 .clock = 5400,
1815 .hdisplay = 320,
1816 .hsync_start = 320 + 56,
1817 .hsync_end = 320 + 56 + 16,
1818 .htotal = 320 + 56 + 16 + 40,
1819 .vdisplay = 240,
1820 .vsync_start = 240 + 2,
1821 .vsync_end = 240 + 2 + 6,
1822 .vtotal = 240 + 2 + 6 + 2,
1823 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1824 },
Paul Cercueil7b6bd842020-01-13 13:17:41 -03001825};
1826
1827static const struct panel_desc frida_frd350h54004 = {
Paul Cercueil795db2a2020-07-16 14:56:47 +02001828 .modes = frida_frd350h54004_modes,
1829 .num_modes = ARRAY_SIZE(frida_frd350h54004_modes),
Paul Cercueil7b6bd842020-01-13 13:17:41 -03001830 .bpc = 8,
1831 .size = {
1832 .width = 77,
1833 .height = 64,
1834 },
1835 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001836 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Paul Cercueil7b6bd842020-01-13 13:17:41 -03001837 .connector_type = DRM_MODE_CONNECTOR_DPI,
1838};
1839
Jagan Teki3be20712019-05-07 18:37:07 +05301840static const struct drm_display_mode friendlyarm_hd702e_mode = {
1841 .clock = 67185,
1842 .hdisplay = 800,
1843 .hsync_start = 800 + 20,
1844 .hsync_end = 800 + 20 + 24,
1845 .htotal = 800 + 20 + 24 + 20,
1846 .vdisplay = 1280,
1847 .vsync_start = 1280 + 4,
1848 .vsync_end = 1280 + 4 + 8,
1849 .vtotal = 1280 + 4 + 8 + 4,
Jagan Teki3be20712019-05-07 18:37:07 +05301850 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1851};
1852
1853static const struct panel_desc friendlyarm_hd702e = {
1854 .modes = &friendlyarm_hd702e_mode,
1855 .num_modes = 1,
1856 .size = {
1857 .width = 94,
1858 .height = 151,
1859 },
1860};
1861
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001862static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
1863 .clock = 9000,
1864 .hdisplay = 480,
1865 .hsync_start = 480 + 5,
1866 .hsync_end = 480 + 5 + 1,
1867 .htotal = 480 + 5 + 1 + 40,
1868 .vdisplay = 272,
1869 .vsync_start = 272 + 8,
1870 .vsync_end = 272 + 8 + 1,
1871 .vtotal = 272 + 8 + 1 + 8,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001872};
1873
1874static const struct panel_desc giantplus_gpg482739qs5 = {
1875 .modes = &giantplus_gpg482739qs5_mode,
1876 .num_modes = 1,
1877 .bpc = 8,
1878 .size = {
1879 .width = 95,
1880 .height = 54,
1881 },
Philipp Zabel33536a02015-02-11 18:50:07 +01001882 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001883};
1884
Paul Cercueil2c6574a2019-06-06 00:22:47 +02001885static const struct display_timing giantplus_gpm940b0_timing = {
1886 .pixelclock = { 13500000, 27000000, 27500000 },
1887 .hactive = { 320, 320, 320 },
1888 .hfront_porch = { 14, 686, 718 },
1889 .hback_porch = { 50, 70, 255 },
1890 .hsync_len = { 1, 1, 1 },
1891 .vactive = { 240, 240, 240 },
1892 .vfront_porch = { 1, 1, 179 },
1893 .vback_porch = { 1, 21, 31 },
1894 .vsync_len = { 1, 1, 6 },
1895 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
1896};
1897
1898static const struct panel_desc giantplus_gpm940b0 = {
1899 .timings = &giantplus_gpm940b0_timing,
1900 .num_timings = 1,
1901 .bpc = 8,
1902 .size = {
1903 .width = 60,
1904 .height = 45,
1905 },
1906 .bus_format = MEDIA_BUS_FMT_RGB888_3X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001907 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Paul Cercueil2c6574a2019-06-06 00:22:47 +02001908};
1909
Philipp Zabelab077252014-12-11 18:32:46 +01001910static const struct display_timing hannstar_hsd070pww1_timing = {
1911 .pixelclock = { 64300000, 71100000, 82000000 },
1912 .hactive = { 1280, 1280, 1280 },
1913 .hfront_porch = { 1, 1, 10 },
1914 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +02001915 /*
1916 * According to the data sheet, the minimum horizontal blanking interval
1917 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
1918 * minimum working horizontal blanking interval to be 60 clocks.
1919 */
1920 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +01001921 .vactive = { 800, 800, 800 },
1922 .vfront_porch = { 1, 1, 10 },
1923 .vback_porch = { 1, 1, 10 },
1924 .vsync_len = { 1, 21, 203 },
1925 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +02001926};
1927
1928static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +01001929 .timings = &hannstar_hsd070pww1_timing,
1930 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +02001931 .bpc = 6,
1932 .size = {
1933 .width = 151,
1934 .height = 94,
1935 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +02001936 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001937 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabela8532052014-10-23 16:31:06 +02001938};
1939
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001940static const struct display_timing hannstar_hsd100pxn1_timing = {
1941 .pixelclock = { 55000000, 65000000, 75000000 },
1942 .hactive = { 1024, 1024, 1024 },
1943 .hfront_porch = { 40, 40, 40 },
1944 .hback_porch = { 220, 220, 220 },
1945 .hsync_len = { 20, 60, 100 },
1946 .vactive = { 768, 768, 768 },
1947 .vfront_porch = { 7, 7, 7 },
1948 .vback_porch = { 21, 21, 21 },
1949 .vsync_len = { 10, 10, 10 },
1950 .flags = DISPLAY_FLAGS_DE_HIGH,
1951};
1952
1953static const struct panel_desc hannstar_hsd100pxn1 = {
1954 .timings = &hannstar_hsd100pxn1_timing,
1955 .num_timings = 1,
1956 .bpc = 6,
1957 .size = {
1958 .width = 203,
1959 .height = 152,
1960 },
Philipp Zabel4946b042015-05-20 11:34:08 +02001961 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001962 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001963};
1964
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001965static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
1966 .clock = 33333,
1967 .hdisplay = 800,
1968 .hsync_start = 800 + 85,
1969 .hsync_end = 800 + 85 + 86,
1970 .htotal = 800 + 85 + 86 + 85,
1971 .vdisplay = 480,
1972 .vsync_start = 480 + 16,
1973 .vsync_end = 480 + 16 + 13,
1974 .vtotal = 480 + 16 + 13 + 16,
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001975};
1976
1977static const struct panel_desc hitachi_tx23d38vm0caa = {
1978 .modes = &hitachi_tx23d38vm0caa_mode,
1979 .num_modes = 1,
1980 .bpc = 6,
1981 .size = {
1982 .width = 195,
1983 .height = 117,
1984 },
Philipp Zabel6c684e32017-10-11 14:59:58 +02001985 .delay = {
1986 .enable = 160,
1987 .disable = 160,
1988 },
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001989};
1990
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001991static const struct drm_display_mode innolux_at043tn24_mode = {
1992 .clock = 9000,
1993 .hdisplay = 480,
1994 .hsync_start = 480 + 2,
1995 .hsync_end = 480 + 2 + 41,
1996 .htotal = 480 + 2 + 41 + 2,
1997 .vdisplay = 272,
1998 .vsync_start = 272 + 2,
Philipp Zabela4831592017-10-11 14:59:56 +02001999 .vsync_end = 272 + 2 + 10,
2000 .vtotal = 272 + 2 + 10 + 2,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002001 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2002};
2003
2004static const struct panel_desc innolux_at043tn24 = {
2005 .modes = &innolux_at043tn24_mode,
2006 .num_modes = 1,
2007 .bpc = 8,
2008 .size = {
2009 .width = 95,
2010 .height = 54,
2011 },
2012 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002013 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002014};
2015
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002016static const struct drm_display_mode innolux_at070tn92_mode = {
2017 .clock = 33333,
2018 .hdisplay = 800,
2019 .hsync_start = 800 + 210,
2020 .hsync_end = 800 + 210 + 20,
2021 .htotal = 800 + 210 + 20 + 46,
2022 .vdisplay = 480,
2023 .vsync_start = 480 + 22,
2024 .vsync_end = 480 + 22 + 10,
2025 .vtotal = 480 + 22 + 23 + 10,
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002026};
2027
2028static const struct panel_desc innolux_at070tn92 = {
2029 .modes = &innolux_at070tn92_mode,
2030 .num_modes = 1,
2031 .size = {
2032 .width = 154,
2033 .height = 86,
2034 },
2035 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2036};
2037
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002038static const struct display_timing innolux_g070y2_l01_timing = {
2039 .pixelclock = { 28000000, 29500000, 32000000 },
2040 .hactive = { 800, 800, 800 },
2041 .hfront_porch = { 61, 91, 141 },
2042 .hback_porch = { 60, 90, 140 },
2043 .hsync_len = { 12, 12, 12 },
2044 .vactive = { 480, 480, 480 },
2045 .vfront_porch = { 4, 9, 30 },
2046 .vback_porch = { 4, 8, 28 },
2047 .vsync_len = { 2, 2, 2 },
2048 .flags = DISPLAY_FLAGS_DE_HIGH,
2049};
2050
2051static const struct panel_desc innolux_g070y2_l01 = {
2052 .timings = &innolux_g070y2_l01_timing,
2053 .num_timings = 1,
2054 .bpc = 6,
2055 .size = {
2056 .width = 152,
2057 .height = 91,
2058 },
2059 .delay = {
2060 .prepare = 10,
2061 .enable = 100,
2062 .disable = 100,
2063 .unprepare = 800,
2064 },
2065 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002066 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002067};
2068
Michael Olbrich1e29b842016-08-15 14:32:02 +02002069static const struct display_timing innolux_g101ice_l01_timing = {
2070 .pixelclock = { 60400000, 71100000, 74700000 },
2071 .hactive = { 1280, 1280, 1280 },
2072 .hfront_porch = { 41, 80, 100 },
2073 .hback_porch = { 40, 79, 99 },
2074 .hsync_len = { 1, 1, 1 },
2075 .vactive = { 800, 800, 800 },
2076 .vfront_porch = { 5, 11, 14 },
2077 .vback_porch = { 4, 11, 14 },
2078 .vsync_len = { 1, 1, 1 },
2079 .flags = DISPLAY_FLAGS_DE_HIGH,
2080};
2081
2082static const struct panel_desc innolux_g101ice_l01 = {
2083 .timings = &innolux_g101ice_l01_timing,
2084 .num_timings = 1,
2085 .bpc = 8,
2086 .size = {
2087 .width = 217,
2088 .height = 135,
2089 },
2090 .delay = {
2091 .enable = 200,
2092 .disable = 200,
2093 },
2094 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002095 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Michael Olbrich1e29b842016-08-15 14:32:02 +02002096};
2097
Lucas Stach4ae13e42016-11-30 14:09:54 +01002098static const struct display_timing innolux_g121i1_l01_timing = {
2099 .pixelclock = { 67450000, 71000000, 74550000 },
2100 .hactive = { 1280, 1280, 1280 },
2101 .hfront_porch = { 40, 80, 160 },
2102 .hback_porch = { 39, 79, 159 },
2103 .hsync_len = { 1, 1, 1 },
2104 .vactive = { 800, 800, 800 },
2105 .vfront_porch = { 5, 11, 100 },
2106 .vback_porch = { 4, 11, 99 },
2107 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01002108};
2109
2110static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01002111 .timings = &innolux_g121i1_l01_timing,
2112 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01002113 .bpc = 6,
2114 .size = {
2115 .width = 261,
2116 .height = 163,
2117 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01002118 .delay = {
2119 .enable = 200,
2120 .disable = 20,
2121 },
2122 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002123 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stachd731f662014-11-06 17:44:33 +01002124};
2125
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002126static const struct drm_display_mode innolux_g121x1_l03_mode = {
2127 .clock = 65000,
2128 .hdisplay = 1024,
2129 .hsync_start = 1024 + 0,
2130 .hsync_end = 1024 + 1,
2131 .htotal = 1024 + 0 + 1 + 320,
2132 .vdisplay = 768,
2133 .vsync_start = 768 + 38,
2134 .vsync_end = 768 + 38 + 1,
2135 .vtotal = 768 + 38 + 1 + 0,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05002136 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002137};
2138
2139static const struct panel_desc innolux_g121x1_l03 = {
2140 .modes = &innolux_g121x1_l03_mode,
2141 .num_modes = 1,
2142 .bpc = 6,
2143 .size = {
2144 .width = 246,
2145 .height = 185,
2146 },
2147 .delay = {
2148 .enable = 200,
2149 .unprepare = 200,
2150 .disable = 400,
2151 },
2152};
2153
Douglas Andersond719cbe2019-07-11 13:34:54 -07002154/*
2155 * Datasheet specifies that at 60 Hz refresh rate:
2156 * - total horizontal time: { 1506, 1592, 1716 }
2157 * - total vertical time: { 788, 800, 868 }
2158 *
2159 * ...but doesn't go into exactly how that should be split into a front
2160 * porch, back porch, or sync length. For now we'll leave a single setting
2161 * here which allows a bit of tweaking of the pixel clock at the expense of
2162 * refresh rate.
2163 */
2164static const struct display_timing innolux_n116bge_timing = {
2165 .pixelclock = { 72600000, 76420000, 80240000 },
2166 .hactive = { 1366, 1366, 1366 },
2167 .hfront_porch = { 136, 136, 136 },
2168 .hback_porch = { 60, 60, 60 },
2169 .hsync_len = { 30, 30, 30 },
2170 .vactive = { 768, 768, 768 },
2171 .vfront_porch = { 8, 8, 8 },
2172 .vback_porch = { 12, 12, 12 },
2173 .vsync_len = { 12, 12, 12 },
2174 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002175};
2176
2177static const struct panel_desc innolux_n116bge = {
Douglas Andersond719cbe2019-07-11 13:34:54 -07002178 .timings = &innolux_n116bge_timing,
2179 .num_timings = 1,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002180 .bpc = 6,
2181 .size = {
2182 .width = 256,
2183 .height = 144,
2184 },
2185};
2186
Alban Bedelea447392014-07-22 08:38:55 +02002187static const struct drm_display_mode innolux_n156bge_l21_mode = {
2188 .clock = 69300,
2189 .hdisplay = 1366,
2190 .hsync_start = 1366 + 16,
2191 .hsync_end = 1366 + 16 + 34,
2192 .htotal = 1366 + 16 + 34 + 50,
2193 .vdisplay = 768,
2194 .vsync_start = 768 + 2,
2195 .vsync_end = 768 + 2 + 6,
2196 .vtotal = 768 + 2 + 6 + 12,
Alban Bedelea447392014-07-22 08:38:55 +02002197};
2198
2199static const struct panel_desc innolux_n156bge_l21 = {
2200 .modes = &innolux_n156bge_l21_mode,
2201 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002202 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02002203 .size = {
2204 .width = 344,
2205 .height = 193,
2206 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03002207 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002208 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03002209 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alban Bedelea447392014-07-22 08:38:55 +02002210};
2211
Douglas Anderson8f054b62018-10-25 15:21:34 -07002212static const struct drm_display_mode innolux_p120zdg_bf1_mode = {
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302213 .clock = 206016,
2214 .hdisplay = 2160,
2215 .hsync_start = 2160 + 48,
2216 .hsync_end = 2160 + 48 + 32,
2217 .htotal = 2160 + 48 + 32 + 80,
2218 .vdisplay = 1440,
2219 .vsync_start = 1440 + 3,
2220 .vsync_end = 1440 + 3 + 10,
2221 .vtotal = 1440 + 3 + 10 + 27,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302222 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2223};
2224
Douglas Anderson8f054b62018-10-25 15:21:34 -07002225static const struct panel_desc innolux_p120zdg_bf1 = {
2226 .modes = &innolux_p120zdg_bf1_mode,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302227 .num_modes = 1,
2228 .bpc = 8,
2229 .size = {
Douglas Anderson8f054b62018-10-25 15:21:34 -07002230 .width = 254,
2231 .height = 169,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302232 },
Sean Paul22fd99e2018-08-13 17:30:40 -04002233 .delay = {
Douglas Anderson625d3b52018-10-25 15:21:31 -07002234 .hpd_absent_delay = 200,
Sean Paul22fd99e2018-08-13 17:30:40 -04002235 .unprepare = 500,
2236 },
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302237};
2238
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002239static const struct drm_display_mode innolux_zj070na_01p_mode = {
2240 .clock = 51501,
2241 .hdisplay = 1024,
2242 .hsync_start = 1024 + 128,
2243 .hsync_end = 1024 + 128 + 64,
2244 .htotal = 1024 + 128 + 64 + 128,
2245 .vdisplay = 600,
2246 .vsync_start = 600 + 16,
2247 .vsync_end = 600 + 16 + 4,
2248 .vtotal = 600 + 16 + 4 + 16,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002249};
2250
2251static const struct panel_desc innolux_zj070na_01p = {
2252 .modes = &innolux_zj070na_01p_mode,
2253 .num_modes = 1,
2254 .bpc = 6,
2255 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02002256 .width = 154,
2257 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002258 },
2259};
2260
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07002261static const struct drm_display_mode ivo_m133nwf4_r0_mode = {
2262 .clock = 138778,
2263 .hdisplay = 1920,
2264 .hsync_start = 1920 + 24,
2265 .hsync_end = 1920 + 24 + 48,
2266 .htotal = 1920 + 24 + 48 + 88,
2267 .vdisplay = 1080,
2268 .vsync_start = 1080 + 3,
2269 .vsync_end = 1080 + 3 + 12,
2270 .vtotal = 1080 + 3 + 12 + 17,
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07002271 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2272};
2273
2274static const struct panel_desc ivo_m133nwf4_r0 = {
2275 .modes = &ivo_m133nwf4_r0_mode,
2276 .num_modes = 1,
2277 .bpc = 8,
2278 .size = {
2279 .width = 294,
2280 .height = 165,
2281 },
2282 .delay = {
2283 .hpd_absent_delay = 200,
2284 .unprepare = 500,
2285 },
2286 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2287 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
2288 .connector_type = DRM_MODE_CONNECTOR_eDP,
2289};
2290
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02002291static const struct display_timing koe_tx14d24vm1bpa_timing = {
2292 .pixelclock = { 5580000, 5850000, 6200000 },
2293 .hactive = { 320, 320, 320 },
2294 .hfront_porch = { 30, 30, 30 },
2295 .hback_porch = { 30, 30, 30 },
2296 .hsync_len = { 1, 5, 17 },
2297 .vactive = { 240, 240, 240 },
2298 .vfront_porch = { 6, 6, 6 },
2299 .vback_porch = { 5, 5, 5 },
2300 .vsync_len = { 1, 2, 11 },
2301 .flags = DISPLAY_FLAGS_DE_HIGH,
2302};
2303
2304static const struct panel_desc koe_tx14d24vm1bpa = {
2305 .timings = &koe_tx14d24vm1bpa_timing,
2306 .num_timings = 1,
2307 .bpc = 6,
2308 .size = {
2309 .width = 115,
2310 .height = 86,
2311 },
2312};
2313
Liu Ying8a070522020-06-01 14:11:20 +08002314static const struct display_timing koe_tx26d202vm0bwa_timing = {
2315 .pixelclock = { 151820000, 156720000, 159780000 },
2316 .hactive = { 1920, 1920, 1920 },
2317 .hfront_porch = { 105, 130, 142 },
2318 .hback_porch = { 45, 70, 82 },
2319 .hsync_len = { 30, 30, 30 },
2320 .vactive = { 1200, 1200, 1200},
2321 .vfront_porch = { 3, 5, 10 },
2322 .vback_porch = { 2, 5, 10 },
2323 .vsync_len = { 5, 5, 5 },
2324};
2325
2326static const struct panel_desc koe_tx26d202vm0bwa = {
2327 .timings = &koe_tx26d202vm0bwa_timing,
2328 .num_timings = 1,
2329 .bpc = 8,
2330 .size = {
2331 .width = 217,
2332 .height = 136,
2333 },
2334 .delay = {
2335 .prepare = 1000,
2336 .enable = 1000,
2337 .unprepare = 1000,
2338 .disable = 1000,
2339 },
2340 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002341 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Liu Ying8a070522020-06-01 14:11:20 +08002342 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2343};
2344
Jagan Teki8cfe8342018-02-04 23:19:28 +05302345static const struct display_timing koe_tx31d200vm0baa_timing = {
2346 .pixelclock = { 39600000, 43200000, 48000000 },
2347 .hactive = { 1280, 1280, 1280 },
2348 .hfront_porch = { 16, 36, 56 },
2349 .hback_porch = { 16, 36, 56 },
2350 .hsync_len = { 8, 8, 8 },
2351 .vactive = { 480, 480, 480 },
Stefan Agnerc9b6be72018-04-19 23:20:03 +02002352 .vfront_porch = { 6, 21, 33 },
2353 .vback_porch = { 6, 21, 33 },
Jagan Teki8cfe8342018-02-04 23:19:28 +05302354 .vsync_len = { 8, 8, 8 },
2355 .flags = DISPLAY_FLAGS_DE_HIGH,
2356};
2357
2358static const struct panel_desc koe_tx31d200vm0baa = {
2359 .timings = &koe_tx31d200vm0baa_timing,
2360 .num_timings = 1,
2361 .bpc = 6,
2362 .size = {
2363 .width = 292,
2364 .height = 109,
2365 },
2366 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002367 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Jagan Teki8cfe8342018-02-04 23:19:28 +05302368};
2369
Lucas Stach8def22e2015-12-02 19:41:11 +01002370static const struct display_timing kyo_tcg121xglp_timing = {
2371 .pixelclock = { 52000000, 65000000, 71000000 },
2372 .hactive = { 1024, 1024, 1024 },
2373 .hfront_porch = { 2, 2, 2 },
2374 .hback_porch = { 2, 2, 2 },
2375 .hsync_len = { 86, 124, 244 },
2376 .vactive = { 768, 768, 768 },
2377 .vfront_porch = { 2, 2, 2 },
2378 .vback_porch = { 2, 2, 2 },
2379 .vsync_len = { 6, 34, 73 },
2380 .flags = DISPLAY_FLAGS_DE_HIGH,
2381};
2382
2383static const struct panel_desc kyo_tcg121xglp = {
2384 .timings = &kyo_tcg121xglp_timing,
2385 .num_timings = 1,
2386 .bpc = 8,
2387 .size = {
2388 .width = 246,
2389 .height = 184,
2390 },
2391 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002392 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8def22e2015-12-02 19:41:11 +01002393};
2394
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002395static const struct drm_display_mode lemaker_bl035_rgb_002_mode = {
2396 .clock = 7000,
2397 .hdisplay = 320,
2398 .hsync_start = 320 + 20,
2399 .hsync_end = 320 + 20 + 30,
2400 .htotal = 320 + 20 + 30 + 38,
2401 .vdisplay = 240,
2402 .vsync_start = 240 + 4,
2403 .vsync_end = 240 + 4 + 3,
2404 .vtotal = 240 + 4 + 3 + 15,
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002405};
2406
2407static const struct panel_desc lemaker_bl035_rgb_002 = {
2408 .modes = &lemaker_bl035_rgb_002_mode,
2409 .num_modes = 1,
2410 .size = {
2411 .width = 70,
2412 .height = 52,
2413 },
2414 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2415 .bus_flags = DRM_BUS_FLAG_DE_LOW,
2416};
2417
Heiko Schocherdd015002015-05-22 10:25:57 +02002418static const struct drm_display_mode lg_lb070wv8_mode = {
2419 .clock = 33246,
2420 .hdisplay = 800,
2421 .hsync_start = 800 + 88,
2422 .hsync_end = 800 + 88 + 80,
2423 .htotal = 800 + 88 + 80 + 88,
2424 .vdisplay = 480,
2425 .vsync_start = 480 + 10,
2426 .vsync_end = 480 + 10 + 25,
2427 .vtotal = 480 + 10 + 25 + 10,
Heiko Schocherdd015002015-05-22 10:25:57 +02002428};
2429
2430static const struct panel_desc lg_lb070wv8 = {
2431 .modes = &lg_lb070wv8_mode,
2432 .num_modes = 1,
Laurent Pincharta6ae2fe2020-07-12 01:53:17 +03002433 .bpc = 8,
Heiko Schocherdd015002015-05-22 10:25:57 +02002434 .size = {
2435 .width = 151,
2436 .height = 91,
2437 },
2438 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002439 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Heiko Schocherdd015002015-05-22 10:25:57 +02002440};
2441
Yakir Yangc5ece402016-06-28 12:51:15 +08002442static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
2443 .clock = 200000,
2444 .hdisplay = 1536,
2445 .hsync_start = 1536 + 12,
2446 .hsync_end = 1536 + 12 + 16,
2447 .htotal = 1536 + 12 + 16 + 48,
2448 .vdisplay = 2048,
2449 .vsync_start = 2048 + 8,
2450 .vsync_end = 2048 + 8 + 4,
2451 .vtotal = 2048 + 8 + 4 + 8,
Yakir Yangc5ece402016-06-28 12:51:15 +08002452 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2453};
2454
2455static const struct panel_desc lg_lp079qx1_sp0v = {
2456 .modes = &lg_lp079qx1_sp0v_mode,
2457 .num_modes = 1,
2458 .size = {
2459 .width = 129,
2460 .height = 171,
2461 },
2462};
2463
Yakir Yang0355dde2016-06-12 10:56:02 +08002464static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
2465 .clock = 205210,
2466 .hdisplay = 2048,
2467 .hsync_start = 2048 + 150,
2468 .hsync_end = 2048 + 150 + 5,
2469 .htotal = 2048 + 150 + 5 + 5,
2470 .vdisplay = 1536,
2471 .vsync_start = 1536 + 3,
2472 .vsync_end = 1536 + 3 + 1,
2473 .vtotal = 1536 + 3 + 1 + 9,
Yakir Yang0355dde2016-06-12 10:56:02 +08002474};
2475
2476static const struct panel_desc lg_lp097qx1_spa1 = {
2477 .modes = &lg_lp097qx1_spa1_mode,
2478 .num_modes = 1,
2479 .size = {
2480 .width = 208,
2481 .height = 147,
2482 },
2483};
2484
Jitao Shi690d8fa2016-02-22 19:01:44 +08002485static const struct drm_display_mode lg_lp120up1_mode = {
2486 .clock = 162300,
2487 .hdisplay = 1920,
2488 .hsync_start = 1920 + 40,
2489 .hsync_end = 1920 + 40 + 40,
2490 .htotal = 1920 + 40 + 40+ 80,
2491 .vdisplay = 1280,
2492 .vsync_start = 1280 + 4,
2493 .vsync_end = 1280 + 4 + 4,
2494 .vtotal = 1280 + 4 + 4 + 12,
Jitao Shi690d8fa2016-02-22 19:01:44 +08002495};
2496
2497static const struct panel_desc lg_lp120up1 = {
2498 .modes = &lg_lp120up1_mode,
2499 .num_modes = 1,
2500 .bpc = 8,
2501 .size = {
2502 .width = 267,
2503 .height = 183,
2504 },
Enric Balletbo i Serrad53139b2020-04-16 18:44:03 +02002505 .connector_type = DRM_MODE_CONNECTOR_eDP,
Jitao Shi690d8fa2016-02-22 19:01:44 +08002506};
2507
Thierry Redingec7c5652013-11-15 15:59:32 +01002508static const struct drm_display_mode lg_lp129qe_mode = {
2509 .clock = 285250,
2510 .hdisplay = 2560,
2511 .hsync_start = 2560 + 48,
2512 .hsync_end = 2560 + 48 + 32,
2513 .htotal = 2560 + 48 + 32 + 80,
2514 .vdisplay = 1700,
2515 .vsync_start = 1700 + 3,
2516 .vsync_end = 1700 + 3 + 10,
2517 .vtotal = 1700 + 3 + 10 + 36,
Thierry Redingec7c5652013-11-15 15:59:32 +01002518};
2519
2520static const struct panel_desc lg_lp129qe = {
2521 .modes = &lg_lp129qe_mode,
2522 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002523 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01002524 .size = {
2525 .width = 272,
2526 .height = 181,
2527 },
2528};
2529
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01002530static const struct display_timing logictechno_lt161010_2nh_timing = {
2531 .pixelclock = { 26400000, 33300000, 46800000 },
2532 .hactive = { 800, 800, 800 },
2533 .hfront_porch = { 16, 210, 354 },
2534 .hback_porch = { 46, 46, 46 },
2535 .hsync_len = { 1, 20, 40 },
2536 .vactive = { 480, 480, 480 },
2537 .vfront_porch = { 7, 22, 147 },
2538 .vback_porch = { 23, 23, 23 },
2539 .vsync_len = { 1, 10, 20 },
2540 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2541 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
2542 DISPLAY_FLAGS_SYNC_POSEDGE,
2543};
2544
2545static const struct panel_desc logictechno_lt161010_2nh = {
2546 .timings = &logictechno_lt161010_2nh_timing,
2547 .num_timings = 1,
2548 .size = {
2549 .width = 154,
2550 .height = 86,
2551 },
2552 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2553 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
2554 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
2555 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
2556 .connector_type = DRM_MODE_CONNECTOR_DPI,
2557};
2558
2559static const struct display_timing logictechno_lt170410_2whc_timing = {
2560 .pixelclock = { 68900000, 71100000, 73400000 },
2561 .hactive = { 1280, 1280, 1280 },
2562 .hfront_porch = { 23, 60, 71 },
2563 .hback_porch = { 23, 60, 71 },
2564 .hsync_len = { 15, 40, 47 },
2565 .vactive = { 800, 800, 800 },
2566 .vfront_porch = { 5, 7, 10 },
2567 .vback_porch = { 5, 7, 10 },
2568 .vsync_len = { 6, 9, 12 },
2569 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2570 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
2571 DISPLAY_FLAGS_SYNC_POSEDGE,
2572};
2573
2574static const struct panel_desc logictechno_lt170410_2whc = {
2575 .timings = &logictechno_lt170410_2whc_timing,
2576 .num_timings = 1,
2577 .size = {
2578 .width = 217,
2579 .height = 136,
2580 },
2581 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002582 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01002583 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2584};
2585
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002586static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
2587 .clock = 30400,
2588 .hdisplay = 800,
2589 .hsync_start = 800 + 0,
2590 .hsync_end = 800 + 1,
2591 .htotal = 800 + 0 + 1 + 160,
2592 .vdisplay = 480,
2593 .vsync_start = 480 + 0,
2594 .vsync_end = 480 + 48 + 1,
2595 .vtotal = 480 + 48 + 1 + 0,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002596 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2597};
2598
Adam Ford0d354082019-10-16 08:51:45 -05002599static const struct drm_display_mode logicpd_type_28_mode = {
Ville Syrjäläf873c5d2020-03-02 22:34:40 +02002600 .clock = 9107,
Adam Ford0d354082019-10-16 08:51:45 -05002601 .hdisplay = 480,
2602 .hsync_start = 480 + 3,
2603 .hsync_end = 480 + 3 + 42,
2604 .htotal = 480 + 3 + 42 + 2,
2605
2606 .vdisplay = 272,
2607 .vsync_start = 272 + 2,
2608 .vsync_end = 272 + 2 + 11,
2609 .vtotal = 272 + 2 + 11 + 3,
Adam Ford0d354082019-10-16 08:51:45 -05002610 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2611};
2612
2613static const struct panel_desc logicpd_type_28 = {
2614 .modes = &logicpd_type_28_mode,
2615 .num_modes = 1,
2616 .bpc = 8,
2617 .size = {
2618 .width = 105,
2619 .height = 67,
2620 },
2621 .delay = {
2622 .prepare = 200,
2623 .enable = 200,
2624 .unprepare = 200,
2625 .disable = 200,
2626 },
2627 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2628 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
2629 DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
2630};
2631
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002632static const struct panel_desc mitsubishi_aa070mc01 = {
2633 .modes = &mitsubishi_aa070mc01_mode,
2634 .num_modes = 1,
2635 .bpc = 8,
2636 .size = {
2637 .width = 152,
2638 .height = 91,
2639 },
2640
2641 .delay = {
2642 .enable = 200,
2643 .unprepare = 200,
2644 .disable = 400,
2645 },
2646 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002647 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002648 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
2649};
2650
Lucas Stach01bacc132017-06-08 20:07:55 +02002651static const struct display_timing nec_nl12880bc20_05_timing = {
2652 .pixelclock = { 67000000, 71000000, 75000000 },
2653 .hactive = { 1280, 1280, 1280 },
2654 .hfront_porch = { 2, 30, 30 },
2655 .hback_porch = { 6, 100, 100 },
2656 .hsync_len = { 2, 30, 30 },
2657 .vactive = { 800, 800, 800 },
2658 .vfront_porch = { 5, 5, 5 },
2659 .vback_porch = { 11, 11, 11 },
2660 .vsync_len = { 7, 7, 7 },
2661};
2662
2663static const struct panel_desc nec_nl12880bc20_05 = {
2664 .timings = &nec_nl12880bc20_05_timing,
2665 .num_timings = 1,
2666 .bpc = 8,
2667 .size = {
2668 .width = 261,
2669 .height = 163,
2670 },
2671 .delay = {
2672 .enable = 50,
2673 .disable = 50,
2674 },
2675 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002676 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach01bacc132017-06-08 20:07:55 +02002677};
2678
jianwei wangc6e87f92015-07-29 16:30:02 +08002679static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
2680 .clock = 10870,
2681 .hdisplay = 480,
2682 .hsync_start = 480 + 2,
2683 .hsync_end = 480 + 2 + 41,
2684 .htotal = 480 + 2 + 41 + 2,
2685 .vdisplay = 272,
2686 .vsync_start = 272 + 2,
2687 .vsync_end = 272 + 2 + 4,
2688 .vtotal = 272 + 2 + 4 + 2,
Stefan Agner4bc390c2015-11-17 19:10:29 -08002689 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08002690};
2691
2692static const struct panel_desc nec_nl4827hc19_05b = {
2693 .modes = &nec_nl4827hc19_05b_mode,
2694 .num_modes = 1,
2695 .bpc = 8,
2696 .size = {
2697 .width = 95,
2698 .height = 54,
2699 },
Stefan Agner2c806612016-02-08 12:50:13 -08002700 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002701 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08002702};
2703
Maxime Riparde6c2f062016-09-06 16:46:17 +02002704static const struct drm_display_mode netron_dy_e231732_mode = {
2705 .clock = 66000,
2706 .hdisplay = 1024,
2707 .hsync_start = 1024 + 160,
2708 .hsync_end = 1024 + 160 + 70,
2709 .htotal = 1024 + 160 + 70 + 90,
2710 .vdisplay = 600,
2711 .vsync_start = 600 + 127,
2712 .vsync_end = 600 + 127 + 20,
2713 .vtotal = 600 + 127 + 20 + 3,
Maxime Riparde6c2f062016-09-06 16:46:17 +02002714};
2715
2716static const struct panel_desc netron_dy_e231732 = {
2717 .modes = &netron_dy_e231732_mode,
2718 .num_modes = 1,
2719 .size = {
2720 .width = 154,
2721 .height = 87,
2722 },
2723 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2724};
2725
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08002726static const struct drm_display_mode neweast_wjfh116008a_modes[] = {
2727 {
2728 .clock = 138500,
2729 .hdisplay = 1920,
2730 .hsync_start = 1920 + 48,
2731 .hsync_end = 1920 + 48 + 32,
2732 .htotal = 1920 + 48 + 32 + 80,
2733 .vdisplay = 1080,
2734 .vsync_start = 1080 + 3,
2735 .vsync_end = 1080 + 3 + 5,
2736 .vtotal = 1080 + 3 + 5 + 23,
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08002737 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2738 }, {
2739 .clock = 110920,
2740 .hdisplay = 1920,
2741 .hsync_start = 1920 + 48,
2742 .hsync_end = 1920 + 48 + 32,
2743 .htotal = 1920 + 48 + 32 + 80,
2744 .vdisplay = 1080,
2745 .vsync_start = 1080 + 3,
2746 .vsync_end = 1080 + 3 + 5,
2747 .vtotal = 1080 + 3 + 5 + 23,
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08002748 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2749 }
2750};
2751
2752static const struct panel_desc neweast_wjfh116008a = {
2753 .modes = neweast_wjfh116008a_modes,
2754 .num_modes = 2,
2755 .bpc = 6,
2756 .size = {
2757 .width = 260,
2758 .height = 150,
2759 },
2760 .delay = {
2761 .prepare = 110,
2762 .enable = 20,
2763 .unprepare = 500,
2764 },
2765 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2766 .connector_type = DRM_MODE_CONNECTOR_eDP,
2767};
2768
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03002769static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
2770 .clock = 9000,
2771 .hdisplay = 480,
2772 .hsync_start = 480 + 2,
2773 .hsync_end = 480 + 2 + 41,
2774 .htotal = 480 + 2 + 41 + 2,
2775 .vdisplay = 272,
2776 .vsync_start = 272 + 2,
2777 .vsync_end = 272 + 2 + 10,
2778 .vtotal = 272 + 2 + 10 + 2,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03002779 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2780};
2781
2782static const struct panel_desc newhaven_nhd_43_480272ef_atxl = {
2783 .modes = &newhaven_nhd_43_480272ef_atxl_mode,
2784 .num_modes = 1,
2785 .bpc = 8,
2786 .size = {
2787 .width = 95,
2788 .height = 54,
2789 },
2790 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002791 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
2792 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03002793};
2794
Lucas Stach4177fa62017-06-08 20:07:57 +02002795static const struct display_timing nlt_nl192108ac18_02d_timing = {
2796 .pixelclock = { 130000000, 148350000, 163000000 },
2797 .hactive = { 1920, 1920, 1920 },
2798 .hfront_porch = { 80, 100, 100 },
2799 .hback_porch = { 100, 120, 120 },
2800 .hsync_len = { 50, 60, 60 },
2801 .vactive = { 1080, 1080, 1080 },
2802 .vfront_porch = { 12, 30, 30 },
2803 .vback_porch = { 4, 10, 10 },
2804 .vsync_len = { 4, 5, 5 },
2805};
2806
2807static const struct panel_desc nlt_nl192108ac18_02d = {
2808 .timings = &nlt_nl192108ac18_02d_timing,
2809 .num_timings = 1,
2810 .bpc = 8,
2811 .size = {
2812 .width = 344,
2813 .height = 194,
2814 },
2815 .delay = {
2816 .unprepare = 500,
2817 },
2818 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002819 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach4177fa62017-06-08 20:07:57 +02002820};
2821
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02002822static const struct drm_display_mode nvd_9128_mode = {
2823 .clock = 29500,
2824 .hdisplay = 800,
2825 .hsync_start = 800 + 130,
2826 .hsync_end = 800 + 130 + 98,
2827 .htotal = 800 + 0 + 130 + 98,
2828 .vdisplay = 480,
2829 .vsync_start = 480 + 10,
2830 .vsync_end = 480 + 10 + 50,
2831 .vtotal = 480 + 0 + 10 + 50,
2832};
2833
2834static const struct panel_desc nvd_9128 = {
2835 .modes = &nvd_9128_mode,
2836 .num_modes = 1,
2837 .bpc = 8,
2838 .size = {
2839 .width = 156,
2840 .height = 88,
2841 },
2842 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002843 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02002844};
2845
Gary Bissona99fb622015-06-10 18:44:23 +02002846static const struct display_timing okaya_rs800480t_7x0gp_timing = {
2847 .pixelclock = { 30000000, 30000000, 40000000 },
2848 .hactive = { 800, 800, 800 },
2849 .hfront_porch = { 40, 40, 40 },
2850 .hback_porch = { 40, 40, 40 },
2851 .hsync_len = { 1, 48, 48 },
2852 .vactive = { 480, 480, 480 },
2853 .vfront_porch = { 13, 13, 13 },
2854 .vback_porch = { 29, 29, 29 },
2855 .vsync_len = { 3, 3, 3 },
2856 .flags = DISPLAY_FLAGS_DE_HIGH,
2857};
2858
2859static const struct panel_desc okaya_rs800480t_7x0gp = {
2860 .timings = &okaya_rs800480t_7x0gp_timing,
2861 .num_timings = 1,
2862 .bpc = 6,
2863 .size = {
2864 .width = 154,
2865 .height = 87,
2866 },
2867 .delay = {
2868 .prepare = 41,
2869 .enable = 50,
2870 .unprepare = 41,
2871 .disable = 50,
2872 },
2873 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2874};
2875
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002876static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
2877 .clock = 9000,
2878 .hdisplay = 480,
2879 .hsync_start = 480 + 5,
2880 .hsync_end = 480 + 5 + 30,
2881 .htotal = 480 + 5 + 30 + 10,
2882 .vdisplay = 272,
2883 .vsync_start = 272 + 8,
2884 .vsync_end = 272 + 8 + 5,
2885 .vtotal = 272 + 8 + 5 + 3,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002886};
2887
2888static const struct panel_desc olimex_lcd_olinuxino_43ts = {
2889 .modes = &olimex_lcd_olinuxino_43ts_mode,
2890 .num_modes = 1,
2891 .size = {
Jonathan Liu30c6d7ab92017-07-20 20:29:43 +10002892 .width = 95,
2893 .height = 54,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002894 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10002895 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002896};
2897
Eric Anholte8b6f562016-03-24 17:23:48 -07002898/*
2899 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
2900 * pixel clocks, but this is the timing that was being used in the Adafruit
2901 * installation instructions.
2902 */
2903static const struct drm_display_mode ontat_yx700wv03_mode = {
2904 .clock = 29500,
2905 .hdisplay = 800,
2906 .hsync_start = 824,
2907 .hsync_end = 896,
2908 .htotal = 992,
2909 .vdisplay = 480,
2910 .vsync_start = 483,
2911 .vsync_end = 493,
2912 .vtotal = 500,
Eric Anholte8b6f562016-03-24 17:23:48 -07002913 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2914};
2915
2916/*
2917 * Specification at:
2918 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
2919 */
2920static const struct panel_desc ontat_yx700wv03 = {
2921 .modes = &ontat_yx700wv03_mode,
2922 .num_modes = 1,
2923 .bpc = 8,
2924 .size = {
2925 .width = 154,
2926 .height = 83,
2927 },
Eric Anholt5651e5e2018-03-09 15:33:32 -08002928 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Eric Anholte8b6f562016-03-24 17:23:48 -07002929};
2930
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02002931static const struct drm_display_mode ortustech_com37h3m_mode = {
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01002932 .clock = 22230,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02002933 .hdisplay = 480,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01002934 .hsync_start = 480 + 40,
2935 .hsync_end = 480 + 40 + 10,
2936 .htotal = 480 + 40 + 10 + 40,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02002937 .vdisplay = 640,
2938 .vsync_start = 640 + 4,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01002939 .vsync_end = 640 + 4 + 2,
2940 .vtotal = 640 + 4 + 2 + 4,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02002941 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2942};
2943
2944static const struct panel_desc ortustech_com37h3m = {
2945 .modes = &ortustech_com37h3m_mode,
2946 .num_modes = 1,
2947 .bpc = 8,
2948 .size = {
2949 .width = 56, /* 56.16mm */
2950 .height = 75, /* 74.88mm */
2951 },
2952 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002953 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02002954 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
2955};
2956
Philipp Zabel725c9d42015-02-11 18:50:11 +01002957static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
2958 .clock = 25000,
2959 .hdisplay = 480,
2960 .hsync_start = 480 + 10,
2961 .hsync_end = 480 + 10 + 10,
2962 .htotal = 480 + 10 + 10 + 15,
2963 .vdisplay = 800,
2964 .vsync_start = 800 + 3,
2965 .vsync_end = 800 + 3 + 3,
2966 .vtotal = 800 + 3 + 3 + 3,
Philipp Zabel725c9d42015-02-11 18:50:11 +01002967};
2968
2969static const struct panel_desc ortustech_com43h4m85ulc = {
2970 .modes = &ortustech_com43h4m85ulc_mode,
2971 .num_modes = 1,
2972 .bpc = 8,
2973 .size = {
2974 .width = 56,
2975 .height = 93,
2976 },
2977 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002978 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Laurent Pinchart2ccedf42020-03-09 20:42:10 +02002979 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabel725c9d42015-02-11 18:50:11 +01002980};
2981
Laurent Pinchart163f7a32018-12-07 22:13:44 +02002982static const struct drm_display_mode osddisplays_osd070t1718_19ts_mode = {
2983 .clock = 33000,
2984 .hdisplay = 800,
2985 .hsync_start = 800 + 210,
2986 .hsync_end = 800 + 210 + 30,
2987 .htotal = 800 + 210 + 30 + 16,
2988 .vdisplay = 480,
2989 .vsync_start = 480 + 22,
2990 .vsync_end = 480 + 22 + 13,
2991 .vtotal = 480 + 22 + 13 + 10,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02002992 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2993};
2994
2995static const struct panel_desc osddisplays_osd070t1718_19ts = {
2996 .modes = &osddisplays_osd070t1718_19ts_mode,
2997 .num_modes = 1,
2998 .bpc = 8,
2999 .size = {
3000 .width = 152,
3001 .height = 91,
3002 },
3003 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Tomi Valkeinenfb0629e2019-11-14 11:39:50 +02003004 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3005 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Laurent Pincharta793f0e2019-09-04 16:37:23 +03003006 .connector_type = DRM_MODE_CONNECTOR_DPI,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003007};
3008
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003009static const struct drm_display_mode pda_91_00156_a0_mode = {
3010 .clock = 33300,
3011 .hdisplay = 800,
3012 .hsync_start = 800 + 1,
3013 .hsync_end = 800 + 1 + 64,
3014 .htotal = 800 + 1 + 64 + 64,
3015 .vdisplay = 480,
3016 .vsync_start = 480 + 1,
3017 .vsync_end = 480 + 1 + 23,
3018 .vtotal = 480 + 1 + 23 + 22,
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003019};
3020
3021static const struct panel_desc pda_91_00156_a0 = {
3022 .modes = &pda_91_00156_a0_mode,
3023 .num_modes = 1,
3024 .size = {
3025 .width = 152,
3026 .height = 91,
3027 },
3028 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3029};
3030
3031
Josh Wud2a6f0f2015-10-08 17:42:41 +02003032static const struct drm_display_mode qd43003c0_40_mode = {
3033 .clock = 9000,
3034 .hdisplay = 480,
3035 .hsync_start = 480 + 8,
3036 .hsync_end = 480 + 8 + 4,
3037 .htotal = 480 + 8 + 4 + 39,
3038 .vdisplay = 272,
3039 .vsync_start = 272 + 4,
3040 .vsync_end = 272 + 4 + 10,
3041 .vtotal = 272 + 4 + 10 + 2,
Josh Wud2a6f0f2015-10-08 17:42:41 +02003042};
3043
3044static const struct panel_desc qd43003c0_40 = {
3045 .modes = &qd43003c0_40_mode,
3046 .num_modes = 1,
3047 .bpc = 8,
3048 .size = {
3049 .width = 95,
3050 .height = 53,
3051 },
3052 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3053};
3054
Jagan Teki23167fa2018-06-07 19:16:48 +05303055static const struct display_timing rocktech_rk070er9427_timing = {
3056 .pixelclock = { 26400000, 33300000, 46800000 },
3057 .hactive = { 800, 800, 800 },
3058 .hfront_porch = { 16, 210, 354 },
3059 .hback_porch = { 46, 46, 46 },
3060 .hsync_len = { 1, 1, 1 },
3061 .vactive = { 480, 480, 480 },
3062 .vfront_porch = { 7, 22, 147 },
3063 .vback_porch = { 23, 23, 23 },
3064 .vsync_len = { 1, 1, 1 },
3065 .flags = DISPLAY_FLAGS_DE_HIGH,
3066};
3067
3068static const struct panel_desc rocktech_rk070er9427 = {
3069 .timings = &rocktech_rk070er9427_timing,
3070 .num_timings = 1,
3071 .bpc = 6,
3072 .size = {
3073 .width = 154,
3074 .height = 86,
3075 },
3076 .delay = {
3077 .prepare = 41,
3078 .enable = 50,
3079 .unprepare = 41,
3080 .disable = 50,
3081 },
3082 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3083};
3084
Jyri Sarhaf3050472020-02-11 14:17:18 +02003085static const struct drm_display_mode rocktech_rk101ii01d_ct_mode = {
3086 .clock = 71100,
3087 .hdisplay = 1280,
3088 .hsync_start = 1280 + 48,
3089 .hsync_end = 1280 + 48 + 32,
3090 .htotal = 1280 + 48 + 32 + 80,
3091 .vdisplay = 800,
3092 .vsync_start = 800 + 2,
3093 .vsync_end = 800 + 2 + 5,
3094 .vtotal = 800 + 2 + 5 + 16,
Jyri Sarhaf3050472020-02-11 14:17:18 +02003095};
3096
3097static const struct panel_desc rocktech_rk101ii01d_ct = {
3098 .modes = &rocktech_rk101ii01d_ct_mode,
3099 .num_modes = 1,
3100 .size = {
3101 .width = 217,
3102 .height = 136,
3103 },
3104 .delay = {
3105 .prepare = 50,
3106 .disable = 50,
3107 },
3108 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
3109 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3110 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3111};
3112
Yakir Yang0330eaf2016-06-12 10:56:13 +08003113static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
3114 .clock = 271560,
3115 .hdisplay = 2560,
3116 .hsync_start = 2560 + 48,
3117 .hsync_end = 2560 + 48 + 32,
3118 .htotal = 2560 + 48 + 32 + 80,
3119 .vdisplay = 1600,
3120 .vsync_start = 1600 + 2,
3121 .vsync_end = 1600 + 2 + 5,
3122 .vtotal = 1600 + 2 + 5 + 57,
Yakir Yang0330eaf2016-06-12 10:56:13 +08003123};
3124
3125static const struct panel_desc samsung_lsn122dl01_c01 = {
3126 .modes = &samsung_lsn122dl01_c01_mode,
3127 .num_modes = 1,
3128 .size = {
3129 .width = 263,
3130 .height = 164,
3131 },
3132};
3133
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003134static const struct drm_display_mode samsung_ltn101nt05_mode = {
3135 .clock = 54030,
3136 .hdisplay = 1024,
3137 .hsync_start = 1024 + 24,
3138 .hsync_end = 1024 + 24 + 136,
3139 .htotal = 1024 + 24 + 136 + 160,
3140 .vdisplay = 600,
3141 .vsync_start = 600 + 3,
3142 .vsync_end = 600 + 3 + 6,
3143 .vtotal = 600 + 3 + 6 + 61,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003144};
3145
3146static const struct panel_desc samsung_ltn101nt05 = {
3147 .modes = &samsung_ltn101nt05_mode,
3148 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07003149 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003150 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02003151 .width = 223,
3152 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003153 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03003154 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003155 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03003156 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003157};
3158
Stéphane Marchesin0c934302015-03-18 10:52:18 +01003159static const struct drm_display_mode samsung_ltn140at29_301_mode = {
3160 .clock = 76300,
3161 .hdisplay = 1366,
3162 .hsync_start = 1366 + 64,
3163 .hsync_end = 1366 + 64 + 48,
3164 .htotal = 1366 + 64 + 48 + 128,
3165 .vdisplay = 768,
3166 .vsync_start = 768 + 2,
3167 .vsync_end = 768 + 2 + 5,
3168 .vtotal = 768 + 2 + 5 + 17,
Stéphane Marchesin0c934302015-03-18 10:52:18 +01003169};
3170
3171static const struct panel_desc samsung_ltn140at29_301 = {
3172 .modes = &samsung_ltn140at29_301_mode,
3173 .num_modes = 1,
3174 .bpc = 6,
3175 .size = {
3176 .width = 320,
3177 .height = 187,
3178 },
3179};
3180
Miquel Raynal44c58c52020-01-09 19:40:37 +01003181static const struct display_timing satoz_sat050at40h12r2_timing = {
3182 .pixelclock = {33300000, 33300000, 50000000},
3183 .hactive = {800, 800, 800},
3184 .hfront_porch = {16, 210, 354},
3185 .hback_porch = {46, 46, 46},
3186 .hsync_len = {1, 1, 40},
3187 .vactive = {480, 480, 480},
3188 .vfront_porch = {7, 22, 147},
3189 .vback_porch = {23, 23, 23},
3190 .vsync_len = {1, 1, 20},
3191};
3192
3193static const struct panel_desc satoz_sat050at40h12r2 = {
3194 .timings = &satoz_sat050at40h12r2_timing,
3195 .num_timings = 1,
3196 .bpc = 8,
3197 .size = {
3198 .width = 108,
3199 .height = 65,
3200 },
Laurent Pinchart34ca6b52020-06-30 02:33:18 +03003201 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Miquel Raynal44c58c52020-01-09 19:40:37 +01003202 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3203};
3204
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07003205static const struct drm_display_mode sharp_ld_d5116z01b_mode = {
3206 .clock = 168480,
3207 .hdisplay = 1920,
3208 .hsync_start = 1920 + 48,
3209 .hsync_end = 1920 + 48 + 32,
3210 .htotal = 1920 + 48 + 32 + 80,
3211 .vdisplay = 1280,
3212 .vsync_start = 1280 + 3,
3213 .vsync_end = 1280 + 3 + 10,
3214 .vtotal = 1280 + 3 + 10 + 57,
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07003215 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3216};
3217
3218static const struct panel_desc sharp_ld_d5116z01b = {
3219 .modes = &sharp_ld_d5116z01b_mode,
3220 .num_modes = 1,
3221 .bpc = 8,
3222 .size = {
3223 .width = 260,
3224 .height = 120,
3225 },
3226 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3227 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
3228};
3229
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003230static const struct drm_display_mode sharp_lq070y3dg3b_mode = {
3231 .clock = 33260,
3232 .hdisplay = 800,
3233 .hsync_start = 800 + 64,
3234 .hsync_end = 800 + 64 + 128,
3235 .htotal = 800 + 64 + 128 + 64,
3236 .vdisplay = 480,
3237 .vsync_start = 480 + 8,
3238 .vsync_end = 480 + 8 + 2,
3239 .vtotal = 480 + 8 + 2 + 35,
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003240 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3241};
3242
3243static const struct panel_desc sharp_lq070y3dg3b = {
3244 .modes = &sharp_lq070y3dg3b_mode,
3245 .num_modes = 1,
3246 .bpc = 8,
3247 .size = {
3248 .width = 152, /* 152.4mm */
3249 .height = 91, /* 91.4mm */
3250 },
3251 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003252 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003253 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
3254};
3255
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003256static const struct drm_display_mode sharp_lq035q7db03_mode = {
3257 .clock = 5500,
3258 .hdisplay = 240,
3259 .hsync_start = 240 + 16,
3260 .hsync_end = 240 + 16 + 7,
3261 .htotal = 240 + 16 + 7 + 5,
3262 .vdisplay = 320,
3263 .vsync_start = 320 + 9,
3264 .vsync_end = 320 + 9 + 1,
3265 .vtotal = 320 + 9 + 1 + 7,
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003266};
3267
3268static const struct panel_desc sharp_lq035q7db03 = {
3269 .modes = &sharp_lq035q7db03_mode,
3270 .num_modes = 1,
3271 .bpc = 6,
3272 .size = {
3273 .width = 54,
3274 .height = 72,
3275 },
3276 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3277};
3278
Joshua Clayton592aa022016-07-06 15:59:16 -07003279static const struct display_timing sharp_lq101k1ly04_timing = {
3280 .pixelclock = { 60000000, 65000000, 80000000 },
3281 .hactive = { 1280, 1280, 1280 },
3282 .hfront_porch = { 20, 20, 20 },
3283 .hback_porch = { 20, 20, 20 },
3284 .hsync_len = { 10, 10, 10 },
3285 .vactive = { 800, 800, 800 },
3286 .vfront_porch = { 4, 4, 4 },
3287 .vback_porch = { 4, 4, 4 },
3288 .vsync_len = { 4, 4, 4 },
3289 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3290};
3291
3292static const struct panel_desc sharp_lq101k1ly04 = {
3293 .timings = &sharp_lq101k1ly04_timing,
3294 .num_timings = 1,
3295 .bpc = 8,
3296 .size = {
3297 .width = 217,
3298 .height = 136,
3299 },
3300 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003301 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Joshua Clayton592aa022016-07-06 15:59:16 -07003302};
3303
Sean Paul9f7bae22018-02-08 12:48:52 -05003304static const struct display_timing sharp_lq123p1jx31_timing = {
3305 .pixelclock = { 252750000, 252750000, 266604720 },
3306 .hactive = { 2400, 2400, 2400 },
3307 .hfront_porch = { 48, 48, 48 },
3308 .hback_porch = { 80, 80, 84 },
3309 .hsync_len = { 32, 32, 32 },
3310 .vactive = { 1600, 1600, 1600 },
3311 .vfront_porch = { 3, 3, 3 },
3312 .vback_porch = { 33, 33, 120 },
3313 .vsync_len = { 10, 10, 10 },
3314 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Yakir Yang739c7de2016-06-12 10:56:35 +08003315};
3316
3317static const struct panel_desc sharp_lq123p1jx31 = {
Sean Paul9f7bae22018-02-08 12:48:52 -05003318 .timings = &sharp_lq123p1jx31_timing,
3319 .num_timings = 1,
zain wang5466a632016-11-19 10:27:16 +08003320 .bpc = 8,
Yakir Yang739c7de2016-06-12 10:56:35 +08003321 .size = {
3322 .width = 259,
3323 .height = 173,
3324 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08003325 .delay = {
3326 .prepare = 110,
3327 .enable = 50,
3328 .unprepare = 550,
3329 },
Yakir Yang739c7de2016-06-12 10:56:35 +08003330};
3331
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003332static const struct display_timing sharp_ls020b1dd01d_timing = {
3333 .pixelclock = { 2000000, 4200000, 5000000 },
3334 .hactive = { 240, 240, 240 },
3335 .hfront_porch = { 66, 66, 66 },
3336 .hback_porch = { 1, 1, 1 },
3337 .hsync_len = { 1, 1, 1 },
3338 .vactive = { 160, 160, 160 },
3339 .vfront_porch = { 52, 52, 52 },
3340 .vback_porch = { 6, 6, 6 },
3341 .vsync_len = { 10, 10, 10 },
3342 .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_LOW,
3343};
3344
3345static const struct panel_desc sharp_ls020b1dd01d = {
3346 .timings = &sharp_ls020b1dd01d_timing,
3347 .num_timings = 1,
3348 .bpc = 6,
3349 .size = {
3350 .width = 42,
3351 .height = 28,
3352 },
3353 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
3354 .bus_flags = DRM_BUS_FLAG_DE_HIGH
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003355 | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003356 | DRM_BUS_FLAG_SHARP_SIGNALS,
3357};
3358
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003359static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
3360 .clock = 33300,
3361 .hdisplay = 800,
3362 .hsync_start = 800 + 1,
3363 .hsync_end = 800 + 1 + 64,
3364 .htotal = 800 + 1 + 64 + 64,
3365 .vdisplay = 480,
3366 .vsync_start = 480 + 1,
3367 .vsync_end = 480 + 1 + 23,
3368 .vtotal = 480 + 1 + 23 + 22,
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003369};
3370
3371static const struct panel_desc shelly_sca07010_bfn_lnn = {
3372 .modes = &shelly_sca07010_bfn_lnn_mode,
3373 .num_modes = 1,
3374 .size = {
3375 .width = 152,
3376 .height = 91,
3377 },
3378 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3379};
3380
Pascal Roeleven105235e2020-03-20 12:21:33 +01003381static const struct drm_display_mode starry_kr070pe2t_mode = {
3382 .clock = 33000,
3383 .hdisplay = 800,
3384 .hsync_start = 800 + 209,
3385 .hsync_end = 800 + 209 + 1,
3386 .htotal = 800 + 209 + 1 + 45,
3387 .vdisplay = 480,
3388 .vsync_start = 480 + 22,
3389 .vsync_end = 480 + 22 + 1,
3390 .vtotal = 480 + 22 + 1 + 22,
Pascal Roeleven105235e2020-03-20 12:21:33 +01003391};
3392
3393static const struct panel_desc starry_kr070pe2t = {
3394 .modes = &starry_kr070pe2t_mode,
3395 .num_modes = 1,
3396 .bpc = 8,
3397 .size = {
3398 .width = 152,
3399 .height = 86,
3400 },
3401 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3402 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Laurent Pinchart41fad302020-06-30 02:33:17 +03003403 .connector_type = DRM_MODE_CONNECTOR_DPI,
Pascal Roeleven105235e2020-03-20 12:21:33 +01003404};
3405
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003406static const struct drm_display_mode starry_kr122ea0sra_mode = {
3407 .clock = 147000,
3408 .hdisplay = 1920,
3409 .hsync_start = 1920 + 16,
3410 .hsync_end = 1920 + 16 + 16,
3411 .htotal = 1920 + 16 + 16 + 32,
3412 .vdisplay = 1200,
3413 .vsync_start = 1200 + 15,
3414 .vsync_end = 1200 + 15 + 2,
3415 .vtotal = 1200 + 15 + 2 + 18,
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003416 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3417};
3418
3419static const struct panel_desc starry_kr122ea0sra = {
3420 .modes = &starry_kr122ea0sra_mode,
3421 .num_modes = 1,
3422 .size = {
3423 .width = 263,
3424 .height = 164,
3425 },
Brian Norrisc46b9242016-08-26 14:32:14 -07003426 .delay = {
3427 .prepare = 10 + 200,
3428 .enable = 50,
3429 .unprepare = 10 + 500,
3430 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003431};
3432
Jyri Sarha42161532019-03-22 10:33:36 +02003433static const struct drm_display_mode tfc_s9700rtwv43tr_01b_mode = {
3434 .clock = 30000,
3435 .hdisplay = 800,
3436 .hsync_start = 800 + 39,
3437 .hsync_end = 800 + 39 + 47,
3438 .htotal = 800 + 39 + 47 + 39,
3439 .vdisplay = 480,
3440 .vsync_start = 480 + 13,
3441 .vsync_end = 480 + 13 + 2,
3442 .vtotal = 480 + 13 + 2 + 29,
Jyri Sarha42161532019-03-22 10:33:36 +02003443};
3444
3445static const struct panel_desc tfc_s9700rtwv43tr_01b = {
3446 .modes = &tfc_s9700rtwv43tr_01b_mode,
3447 .num_modes = 1,
3448 .bpc = 8,
3449 .size = {
3450 .width = 155,
3451 .height = 90,
3452 },
3453 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003454 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Jyri Sarha42161532019-03-22 10:33:36 +02003455};
3456
Gary Bissonadb973e2016-12-02 09:52:08 +01003457static const struct display_timing tianma_tm070jdhg30_timing = {
3458 .pixelclock = { 62600000, 68200000, 78100000 },
3459 .hactive = { 1280, 1280, 1280 },
3460 .hfront_porch = { 15, 64, 159 },
3461 .hback_porch = { 5, 5, 5 },
3462 .hsync_len = { 1, 1, 256 },
3463 .vactive = { 800, 800, 800 },
3464 .vfront_porch = { 3, 40, 99 },
3465 .vback_porch = { 2, 2, 2 },
3466 .vsync_len = { 1, 1, 128 },
3467 .flags = DISPLAY_FLAGS_DE_HIGH,
3468};
3469
3470static const struct panel_desc tianma_tm070jdhg30 = {
3471 .timings = &tianma_tm070jdhg30_timing,
3472 .num_timings = 1,
3473 .bpc = 8,
3474 .size = {
3475 .width = 151,
3476 .height = 95,
3477 },
3478 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003479 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Gary Bissonadb973e2016-12-02 09:52:08 +01003480};
3481
Max Merchelb3bfcdf2020-06-12 09:22:19 +02003482static const struct panel_desc tianma_tm070jvhg33 = {
3483 .timings = &tianma_tm070jdhg30_timing,
3484 .num_timings = 1,
3485 .bpc = 8,
3486 .size = {
3487 .width = 150,
3488 .height = 94,
3489 },
3490 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3491 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3492};
3493
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003494static const struct display_timing tianma_tm070rvhg71_timing = {
3495 .pixelclock = { 27700000, 29200000, 39600000 },
3496 .hactive = { 800, 800, 800 },
3497 .hfront_porch = { 12, 40, 212 },
3498 .hback_porch = { 88, 88, 88 },
3499 .hsync_len = { 1, 1, 40 },
3500 .vactive = { 480, 480, 480 },
3501 .vfront_porch = { 1, 13, 88 },
3502 .vback_porch = { 32, 32, 32 },
3503 .vsync_len = { 1, 1, 3 },
3504 .flags = DISPLAY_FLAGS_DE_HIGH,
3505};
3506
3507static const struct panel_desc tianma_tm070rvhg71 = {
3508 .timings = &tianma_tm070rvhg71_timing,
3509 .num_timings = 1,
3510 .bpc = 8,
3511 .size = {
3512 .width = 154,
3513 .height = 86,
3514 },
3515 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003516 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003517};
3518
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003519static const struct drm_display_mode ti_nspire_cx_lcd_mode[] = {
3520 {
3521 .clock = 10000,
3522 .hdisplay = 320,
3523 .hsync_start = 320 + 50,
3524 .hsync_end = 320 + 50 + 6,
3525 .htotal = 320 + 50 + 6 + 38,
3526 .vdisplay = 240,
3527 .vsync_start = 240 + 3,
3528 .vsync_end = 240 + 3 + 1,
3529 .vtotal = 240 + 3 + 1 + 17,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003530 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3531 },
3532};
3533
3534static const struct panel_desc ti_nspire_cx_lcd_panel = {
3535 .modes = ti_nspire_cx_lcd_mode,
3536 .num_modes = 1,
3537 .bpc = 8,
3538 .size = {
3539 .width = 65,
3540 .height = 49,
3541 },
3542 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003543 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003544};
3545
3546static const struct drm_display_mode ti_nspire_classic_lcd_mode[] = {
3547 {
3548 .clock = 10000,
3549 .hdisplay = 320,
3550 .hsync_start = 320 + 6,
3551 .hsync_end = 320 + 6 + 6,
3552 .htotal = 320 + 6 + 6 + 6,
3553 .vdisplay = 240,
3554 .vsync_start = 240 + 0,
3555 .vsync_end = 240 + 0 + 1,
3556 .vtotal = 240 + 0 + 1 + 0,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003557 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3558 },
3559};
3560
3561static const struct panel_desc ti_nspire_classic_lcd_panel = {
3562 .modes = ti_nspire_classic_lcd_mode,
3563 .num_modes = 1,
3564 /* The grayscale panel has 8 bit for the color .. Y (black) */
3565 .bpc = 8,
3566 .size = {
3567 .width = 71,
3568 .height = 53,
3569 },
3570 /* This is the grayscale bus format */
3571 .bus_format = MEDIA_BUS_FMT_Y8_1X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003572 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003573};
3574
Lucas Stach06e733e2017-10-18 19:22:40 +02003575static const struct drm_display_mode toshiba_lt089ac29000_mode = {
3576 .clock = 79500,
3577 .hdisplay = 1280,
3578 .hsync_start = 1280 + 192,
3579 .hsync_end = 1280 + 192 + 128,
3580 .htotal = 1280 + 192 + 128 + 64,
3581 .vdisplay = 768,
3582 .vsync_start = 768 + 20,
3583 .vsync_end = 768 + 20 + 7,
3584 .vtotal = 768 + 20 + 7 + 3,
Lucas Stach06e733e2017-10-18 19:22:40 +02003585};
3586
3587static const struct panel_desc toshiba_lt089ac29000 = {
3588 .modes = &toshiba_lt089ac29000_mode,
3589 .num_modes = 1,
3590 .size = {
3591 .width = 194,
3592 .height = 116,
3593 },
Boris Brezillon9781bd12020-01-28 14:55:13 +01003594 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003595 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003596 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach06e733e2017-10-18 19:22:40 +02003597};
3598
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303599static const struct drm_display_mode tpk_f07a_0102_mode = {
3600 .clock = 33260,
3601 .hdisplay = 800,
3602 .hsync_start = 800 + 40,
3603 .hsync_end = 800 + 40 + 128,
3604 .htotal = 800 + 40 + 128 + 88,
3605 .vdisplay = 480,
3606 .vsync_start = 480 + 10,
3607 .vsync_end = 480 + 10 + 2,
3608 .vtotal = 480 + 10 + 2 + 33,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303609};
3610
3611static const struct panel_desc tpk_f07a_0102 = {
3612 .modes = &tpk_f07a_0102_mode,
3613 .num_modes = 1,
3614 .size = {
3615 .width = 152,
3616 .height = 91,
3617 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003618 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303619};
3620
3621static const struct drm_display_mode tpk_f10a_0102_mode = {
3622 .clock = 45000,
3623 .hdisplay = 1024,
3624 .hsync_start = 1024 + 176,
3625 .hsync_end = 1024 + 176 + 5,
3626 .htotal = 1024 + 176 + 5 + 88,
3627 .vdisplay = 600,
3628 .vsync_start = 600 + 20,
3629 .vsync_end = 600 + 20 + 5,
3630 .vtotal = 600 + 20 + 5 + 25,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303631};
3632
3633static const struct panel_desc tpk_f10a_0102 = {
3634 .modes = &tpk_f10a_0102_mode,
3635 .num_modes = 1,
3636 .size = {
3637 .width = 223,
3638 .height = 125,
3639 },
3640};
3641
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01003642static const struct display_timing urt_umsh_8596md_timing = {
3643 .pixelclock = { 33260000, 33260000, 33260000 },
3644 .hactive = { 800, 800, 800 },
3645 .hfront_porch = { 41, 41, 41 },
3646 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
3647 .hsync_len = { 71, 128, 128 },
3648 .vactive = { 480, 480, 480 },
3649 .vfront_porch = { 10, 10, 10 },
3650 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
3651 .vsync_len = { 2, 2, 2 },
3652 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
3653 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
3654};
3655
3656static const struct panel_desc urt_umsh_8596md_lvds = {
3657 .timings = &urt_umsh_8596md_timing,
3658 .num_timings = 1,
3659 .bpc = 6,
3660 .size = {
3661 .width = 152,
3662 .height = 91,
3663 },
3664 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003665 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01003666};
3667
3668static const struct panel_desc urt_umsh_8596md_parallel = {
3669 .timings = &urt_umsh_8596md_timing,
3670 .num_timings = 1,
3671 .bpc = 6,
3672 .size = {
3673 .width = 152,
3674 .height = 91,
3675 },
3676 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3677};
3678
Fabio Estevam04206182019-02-18 21:27:06 -03003679static const struct drm_display_mode vl050_8048nt_c01_mode = {
3680 .clock = 33333,
3681 .hdisplay = 800,
3682 .hsync_start = 800 + 210,
3683 .hsync_end = 800 + 210 + 20,
3684 .htotal = 800 + 210 + 20 + 46,
3685 .vdisplay = 480,
3686 .vsync_start = 480 + 22,
3687 .vsync_end = 480 + 22 + 10,
3688 .vtotal = 480 + 22 + 10 + 23,
Fabio Estevam04206182019-02-18 21:27:06 -03003689 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
3690};
3691
3692static const struct panel_desc vl050_8048nt_c01 = {
3693 .modes = &vl050_8048nt_c01_mode,
3694 .num_modes = 1,
3695 .bpc = 8,
3696 .size = {
3697 .width = 120,
3698 .height = 76,
3699 },
3700 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003701 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Fabio Estevam04206182019-02-18 21:27:06 -03003702};
3703
Richard Genoude4bac402017-03-27 12:33:23 +02003704static const struct drm_display_mode winstar_wf35ltiacd_mode = {
3705 .clock = 6410,
3706 .hdisplay = 320,
3707 .hsync_start = 320 + 20,
3708 .hsync_end = 320 + 20 + 30,
3709 .htotal = 320 + 20 + 30 + 38,
3710 .vdisplay = 240,
3711 .vsync_start = 240 + 4,
3712 .vsync_end = 240 + 4 + 3,
3713 .vtotal = 240 + 4 + 3 + 15,
Richard Genoude4bac402017-03-27 12:33:23 +02003714 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3715};
3716
3717static const struct panel_desc winstar_wf35ltiacd = {
3718 .modes = &winstar_wf35ltiacd_mode,
3719 .num_modes = 1,
3720 .bpc = 8,
3721 .size = {
3722 .width = 70,
3723 .height = 53,
3724 },
3725 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3726};
3727
Linus Walleijfcec4162018-10-26 13:13:34 +02003728static const struct drm_display_mode arm_rtsm_mode[] = {
3729 {
3730 .clock = 65000,
3731 .hdisplay = 1024,
3732 .hsync_start = 1024 + 24,
3733 .hsync_end = 1024 + 24 + 136,
3734 .htotal = 1024 + 24 + 136 + 160,
3735 .vdisplay = 768,
3736 .vsync_start = 768 + 3,
3737 .vsync_end = 768 + 3 + 6,
3738 .vtotal = 768 + 3 + 6 + 29,
Linus Walleijfcec4162018-10-26 13:13:34 +02003739 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3740 },
3741};
3742
3743static const struct panel_desc arm_rtsm = {
3744 .modes = arm_rtsm_mode,
3745 .num_modes = 1,
3746 .bpc = 8,
3747 .size = {
3748 .width = 400,
3749 .height = 300,
3750 },
3751 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3752};
3753
Thierry Reding280921d2013-08-30 15:10:14 +02003754static const struct of_device_id platform_of_match[] = {
3755 {
Yannick Fertre966fea72017-03-28 11:44:49 +02003756 .compatible = "ampire,am-480272h3tmqw-t01h",
3757 .data = &ampire_am_480272h3tmqw_t01h,
3758 }, {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01003759 .compatible = "ampire,am800480r3tmqwa1h",
3760 .data = &ampire_am800480r3tmqwa1h,
3761 }, {
Linus Walleijfcec4162018-10-26 13:13:34 +02003762 .compatible = "arm,rtsm-display",
3763 .data = &arm_rtsm,
3764 }, {
Sébastien Szymanskic479450f2019-05-07 17:27:12 +02003765 .compatible = "armadeus,st0700-adapt",
3766 .data = &armadeus_st0700_adapt,
3767 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02003768 .compatible = "auo,b101aw03",
3769 .data = &auo_b101aw03,
3770 }, {
Huang Lina531bc32015-02-28 10:18:58 +08003771 .compatible = "auo,b101ean01",
3772 .data = &auo_b101ean01,
3773 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04003774 .compatible = "auo,b101xtn01",
3775 .data = &auo_b101xtn01,
3776 }, {
Rob Clarkda4582862020-01-08 15:53:56 -08003777 .compatible = "auo,b116xa01",
3778 .data = &auo_b116xak01,
3779 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05303780 .compatible = "auo,b116xw03",
3781 .data = &auo_b116xw03,
3782 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05303783 .compatible = "auo,b133htn01",
3784 .data = &auo_b133htn01,
3785 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07003786 .compatible = "auo,b133xtn01",
3787 .data = &auo_b133xtn01,
3788 }, {
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02003789 .compatible = "auo,g070vvn01",
3790 .data = &auo_g070vvn01,
3791 }, {
Alex Gonzalez4fb86402018-10-25 17:09:30 +02003792 .compatible = "auo,g101evn010",
3793 .data = &auo_g101evn010,
3794 }, {
Christoph Fritz4451c282017-12-16 14:13:36 +01003795 .compatible = "auo,g104sn02",
3796 .data = &auo_g104sn02,
3797 }, {
Sebastian Reichel03e909a2020-04-15 19:27:25 +02003798 .compatible = "auo,g121ean01",
3799 .data = &auo_g121ean01,
3800 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01003801 .compatible = "auo,g133han01",
3802 .data = &auo_g133han01,
3803 }, {
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02003804 .compatible = "auo,g156xtn01",
3805 .data = &auo_g156xtn01,
3806 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01003807 .compatible = "auo,g185han01",
3808 .data = &auo_g185han01,
3809 }, {
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02003810 .compatible = "auo,g190ean01",
3811 .data = &auo_g190ean01,
3812 }, {
Lucas Stach70c0d5b2017-06-08 20:07:58 +02003813 .compatible = "auo,p320hvn03",
3814 .data = &auo_p320hvn03,
3815 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07003816 .compatible = "auo,t215hvn01",
3817 .data = &auo_t215hvn01,
3818 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01003819 .compatible = "avic,tm070ddh03",
3820 .data = &avic_tm070ddh03,
3821 }, {
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08003822 .compatible = "bananapi,s070wv20-ct16",
3823 .data = &bananapi_s070wv20_ct16,
3824 }, {
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02003825 .compatible = "boe,hv070wsa-100",
3826 .data = &boe_hv070wsa
3827 }, {
Caesar Wangcac1a412016-12-14 11:19:56 +08003828 .compatible = "boe,nv101wxmn51",
3829 .data = &boe_nv101wxmn51,
3830 }, {
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07003831 .compatible = "boe,nv133fhm-n61",
3832 .data = &boe_nv133fhm_n61,
3833 }, {
Douglas Andersoncfe40d02020-05-08 15:59:02 -07003834 .compatible = "boe,nv133fhm-n62",
3835 .data = &boe_nv133fhm_n61,
3836 }, {
Tobias Schramma5119812020-01-09 12:29:52 +01003837 .compatible = "boe,nv140fhmn49",
3838 .data = &boe_nv140fhmn49,
3839 }, {
Giulio Benettie58edce2018-07-31 01:11:16 +02003840 .compatible = "cdtech,s043wq26h-ct7",
3841 .data = &cdtech_s043wq26h_ct7,
3842 }, {
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02003843 .compatible = "cdtech,s070pws19hp-fc21",
3844 .data = &cdtech_s070pws19hp_fc21,
3845 }, {
3846 .compatible = "cdtech,s070swv29hg-dc44",
3847 .data = &cdtech_s070swv29hg_dc44,
3848 }, {
Giulio Benetti982f9442018-07-31 01:11:14 +02003849 .compatible = "cdtech,s070wv95-ct16",
3850 .data = &cdtech_s070wv95_ct16,
3851 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08003852 .compatible = "chunghwa,claa070wp03xg",
3853 .data = &chunghwa_claa070wp03xg,
3854 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07003855 .compatible = "chunghwa,claa101wa01a",
3856 .data = &chunghwa_claa101wa01a
3857 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02003858 .compatible = "chunghwa,claa101wb01",
3859 .data = &chunghwa_claa101wb01
3860 }, {
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02003861 .compatible = "dataimage,scf0700c48ggu18",
3862 .data = &dataimage_scf0700c48ggu18,
3863 }, {
Philipp Zabel0ca0c822018-05-23 11:25:04 +02003864 .compatible = "dlc,dlc0700yzg-1",
3865 .data = &dlc_dlc0700yzg_1,
3866 }, {
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02003867 .compatible = "dlc,dlc1010gig",
3868 .data = &dlc_dlc1010gig,
3869 }, {
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02003870 .compatible = "edt,et035012dm6",
3871 .data = &edt_et035012dm6,
3872 }, {
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00003873 .compatible = "edt,etm043080dh6gp",
3874 .data = &edt_etm043080dh6gp,
3875 }, {
Marek Vasutfd819bf2019-02-19 15:04:38 +01003876 .compatible = "edt,etm0430g0dh6",
3877 .data = &edt_etm0430g0dh6,
3878 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02003879 .compatible = "edt,et057090dhu",
3880 .data = &edt_et057090dhu,
3881 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02003882 .compatible = "edt,et070080dh6",
3883 .data = &edt_etm0700g0dh6,
3884 }, {
3885 .compatible = "edt,etm0700g0dh6",
3886 .data = &edt_etm0700g0dh6,
3887 }, {
Jan Tuerkaa7e6452018-06-19 11:55:44 +02003888 .compatible = "edt,etm0700g0bdh6",
3889 .data = &edt_etm0700g0bdh6,
3890 }, {
Jan Tuerkaad34de2018-06-19 11:55:45 +02003891 .compatible = "edt,etm0700g0edh6",
3892 .data = &edt_etm0700g0bdh6,
3893 }, {
Marco Felsch9158e3c2019-04-16 12:06:45 +02003894 .compatible = "evervision,vgg804821",
3895 .data = &evervision_vgg804821,
3896 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02003897 .compatible = "foxlink,fl500wvr00-a0t",
3898 .data = &foxlink_fl500wvr00_a0t,
3899 }, {
Paul Cercueil7b6bd842020-01-13 13:17:41 -03003900 .compatible = "frida,frd350h54004",
3901 .data = &frida_frd350h54004,
3902 }, {
Jagan Teki3be20712019-05-07 18:37:07 +05303903 .compatible = "friendlyarm,hd702e",
3904 .data = &friendlyarm_hd702e,
3905 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01003906 .compatible = "giantplus,gpg482739qs5",
3907 .data = &giantplus_gpg482739qs5
3908 }, {
Paul Cercueil2c6574a2019-06-06 00:22:47 +02003909 .compatible = "giantplus,gpm940b0",
3910 .data = &giantplus_gpm940b0,
3911 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02003912 .compatible = "hannstar,hsd070pww1",
3913 .data = &hannstar_hsd070pww1,
3914 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07003915 .compatible = "hannstar,hsd100pxn1",
3916 .data = &hannstar_hsd100pxn1,
3917 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01003918 .compatible = "hit,tx23d38vm0caa",
3919 .data = &hitachi_tx23d38vm0caa
3920 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01003921 .compatible = "innolux,at043tn24",
3922 .data = &innolux_at043tn24,
3923 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02003924 .compatible = "innolux,at070tn92",
3925 .data = &innolux_at070tn92,
3926 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02003927 .compatible = "innolux,g070y2-l01",
3928 .data = &innolux_g070y2_l01,
3929 }, {
3930 .compatible = "innolux,g101ice-l01",
Michael Olbrich1e29b842016-08-15 14:32:02 +02003931 .data = &innolux_g101ice_l01
3932 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02003933 .compatible = "innolux,g121i1-l01",
Lucas Stachd731f662014-11-06 17:44:33 +01003934 .data = &innolux_g121i1_l01
3935 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05003936 .compatible = "innolux,g121x1-l03",
3937 .data = &innolux_g121x1_l03,
3938 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02003939 .compatible = "innolux,n116bge",
3940 .data = &innolux_n116bge,
3941 }, {
Alban Bedelea447392014-07-22 08:38:55 +02003942 .compatible = "innolux,n156bge-l21",
3943 .data = &innolux_n156bge_l21,
3944 }, {
Douglas Anderson8f054b62018-10-25 15:21:34 -07003945 .compatible = "innolux,p120zdg-bf1",
3946 .data = &innolux_p120zdg_bf1,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05303947 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01003948 .compatible = "innolux,zj070na-01p",
3949 .data = &innolux_zj070na_01p,
3950 }, {
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07003951 .compatible = "ivo,m133nwf4-r0",
3952 .data = &ivo_m133nwf4_r0,
3953 }, {
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02003954 .compatible = "koe,tx14d24vm1bpa",
3955 .data = &koe_tx14d24vm1bpa,
3956 }, {
Liu Ying8a070522020-06-01 14:11:20 +08003957 .compatible = "koe,tx26d202vm0bwa",
3958 .data = &koe_tx26d202vm0bwa,
3959 }, {
Jagan Teki8cfe8342018-02-04 23:19:28 +05303960 .compatible = "koe,tx31d200vm0baa",
3961 .data = &koe_tx31d200vm0baa,
3962 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01003963 .compatible = "kyo,tcg121xglp",
3964 .data = &kyo_tcg121xglp,
3965 }, {
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01003966 .compatible = "lemaker,bl035-rgb-002",
3967 .data = &lemaker_bl035_rgb_002,
3968 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02003969 .compatible = "lg,lb070wv8",
3970 .data = &lg_lb070wv8,
3971 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08003972 .compatible = "lg,lp079qx1-sp0v",
3973 .data = &lg_lp079qx1_sp0v,
3974 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08003975 .compatible = "lg,lp097qx1-spa1",
3976 .data = &lg_lp097qx1_spa1,
3977 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08003978 .compatible = "lg,lp120up1",
3979 .data = &lg_lp120up1,
3980 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01003981 .compatible = "lg,lp129qe",
3982 .data = &lg_lp129qe,
3983 }, {
Adam Ford0d354082019-10-16 08:51:45 -05003984 .compatible = "logicpd,type28",
3985 .data = &logicpd_type_28,
3986 }, {
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01003987 .compatible = "logictechno,lt161010-2nhc",
3988 .data = &logictechno_lt161010_2nh,
3989 }, {
3990 .compatible = "logictechno,lt161010-2nhr",
3991 .data = &logictechno_lt161010_2nh,
3992 }, {
3993 .compatible = "logictechno,lt170410-2whc",
3994 .data = &logictechno_lt170410_2whc,
3995 }, {
Lukasz Majewski65c766c2017-10-21 00:18:37 +02003996 .compatible = "mitsubishi,aa070mc01-ca1",
3997 .data = &mitsubishi_aa070mc01,
3998 }, {
Lucas Stach01bacc132017-06-08 20:07:55 +02003999 .compatible = "nec,nl12880bc20-05",
4000 .data = &nec_nl12880bc20_05,
4001 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08004002 .compatible = "nec,nl4827hc19-05b",
4003 .data = &nec_nl4827hc19_05b,
4004 }, {
Maxime Riparde6c2f062016-09-06 16:46:17 +02004005 .compatible = "netron-dy,e231732",
4006 .data = &netron_dy_e231732,
4007 }, {
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08004008 .compatible = "neweast,wjfh116008a",
4009 .data = &neweast_wjfh116008a,
4010 }, {
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03004011 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
4012 .data = &newhaven_nhd_43_480272ef_atxl,
4013 }, {
Lucas Stach4177fa62017-06-08 20:07:57 +02004014 .compatible = "nlt,nl192108ac18-02d",
4015 .data = &nlt_nl192108ac18_02d,
4016 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02004017 .compatible = "nvd,9128",
4018 .data = &nvd_9128,
4019 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02004020 .compatible = "okaya,rs800480t-7x0gp",
4021 .data = &okaya_rs800480t_7x0gp,
4022 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01004023 .compatible = "olimex,lcd-olinuxino-43-ts",
4024 .data = &olimex_lcd_olinuxino_43ts,
4025 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07004026 .compatible = "ontat,yx700wv03",
4027 .data = &ontat_yx700wv03,
4028 }, {
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02004029 .compatible = "ortustech,com37h3m05dtc",
4030 .data = &ortustech_com37h3m,
4031 }, {
4032 .compatible = "ortustech,com37h3m99dtc",
4033 .data = &ortustech_com37h3m,
4034 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01004035 .compatible = "ortustech,com43h4m85ulc",
4036 .data = &ortustech_com43h4m85ulc,
4037 }, {
Laurent Pinchart163f7a32018-12-07 22:13:44 +02004038 .compatible = "osddisplays,osd070t1718-19ts",
4039 .data = &osddisplays_osd070t1718_19ts,
4040 }, {
Eugen Hristev4ba3e562019-01-14 09:43:31 +00004041 .compatible = "pda,91-00156-a0",
4042 .data = &pda_91_00156_a0,
4043 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02004044 .compatible = "qiaodian,qd43003c0-40",
4045 .data = &qd43003c0_40,
4046 }, {
Jagan Teki23167fa2018-06-07 19:16:48 +05304047 .compatible = "rocktech,rk070er9427",
4048 .data = &rocktech_rk070er9427,
4049 }, {
Jyri Sarhaf3050472020-02-11 14:17:18 +02004050 .compatible = "rocktech,rk101ii01d-ct",
4051 .data = &rocktech_rk101ii01d_ct,
4052 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08004053 .compatible = "samsung,lsn122dl01-c01",
4054 .data = &samsung_lsn122dl01_c01,
4055 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01004056 .compatible = "samsung,ltn101nt05",
4057 .data = &samsung_ltn101nt05,
4058 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01004059 .compatible = "samsung,ltn140at29-301",
4060 .data = &samsung_ltn140at29_301,
4061 }, {
Miquel Raynal44c58c52020-01-09 19:40:37 +01004062 .compatible = "satoz,sat050at40h12r2",
4063 .data = &satoz_sat050at40h12r2,
4064 }, {
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07004065 .compatible = "sharp,ld-d5116z01b",
4066 .data = &sharp_ld_d5116z01b,
4067 }, {
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03004068 .compatible = "sharp,lq035q7db03",
4069 .data = &sharp_lq035q7db03,
4070 }, {
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02004071 .compatible = "sharp,lq070y3dg3b",
4072 .data = &sharp_lq070y3dg3b,
4073 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07004074 .compatible = "sharp,lq101k1ly04",
4075 .data = &sharp_lq101k1ly04,
4076 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08004077 .compatible = "sharp,lq123p1jx31",
4078 .data = &sharp_lq123p1jx31,
4079 }, {
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02004080 .compatible = "sharp,ls020b1dd01d",
4081 .data = &sharp_ls020b1dd01d,
4082 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01004083 .compatible = "shelly,sca07010-bfn-lnn",
4084 .data = &shelly_sca07010_bfn_lnn,
4085 }, {
Pascal Roeleven105235e2020-03-20 12:21:33 +01004086 .compatible = "starry,kr070pe2t",
4087 .data = &starry_kr070pe2t,
4088 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07004089 .compatible = "starry,kr122ea0sra",
4090 .data = &starry_kr122ea0sra,
4091 }, {
Jyri Sarha42161532019-03-22 10:33:36 +02004092 .compatible = "tfc,s9700rtwv43tr-01b",
4093 .data = &tfc_s9700rtwv43tr_01b,
4094 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01004095 .compatible = "tianma,tm070jdhg30",
4096 .data = &tianma_tm070jdhg30,
4097 }, {
Max Merchelb3bfcdf2020-06-12 09:22:19 +02004098 .compatible = "tianma,tm070jvhg33",
4099 .data = &tianma_tm070jvhg33,
4100 }, {
Lukasz Majewski870a0b12017-11-07 16:30:58 +01004101 .compatible = "tianma,tm070rvhg71",
4102 .data = &tianma_tm070rvhg71,
4103 }, {
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004104 .compatible = "ti,nspire-cx-lcd-panel",
4105 .data = &ti_nspire_cx_lcd_panel,
4106 }, {
4107 .compatible = "ti,nspire-classic-lcd-panel",
4108 .data = &ti_nspire_classic_lcd_panel,
4109 }, {
Lucas Stach06e733e2017-10-18 19:22:40 +02004110 .compatible = "toshiba,lt089ac29000",
4111 .data = &toshiba_lt089ac29000,
4112 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304113 .compatible = "tpk,f07a-0102",
4114 .data = &tpk_f07a_0102,
4115 }, {
4116 .compatible = "tpk,f10a-0102",
4117 .data = &tpk_f10a_0102,
4118 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01004119 .compatible = "urt,umsh-8596md-t",
4120 .data = &urt_umsh_8596md_parallel,
4121 }, {
4122 .compatible = "urt,umsh-8596md-1t",
4123 .data = &urt_umsh_8596md_parallel,
4124 }, {
4125 .compatible = "urt,umsh-8596md-7t",
4126 .data = &urt_umsh_8596md_parallel,
4127 }, {
4128 .compatible = "urt,umsh-8596md-11t",
4129 .data = &urt_umsh_8596md_lvds,
4130 }, {
4131 .compatible = "urt,umsh-8596md-19t",
4132 .data = &urt_umsh_8596md_lvds,
4133 }, {
4134 .compatible = "urt,umsh-8596md-20t",
4135 .data = &urt_umsh_8596md_parallel,
4136 }, {
Fabio Estevam04206182019-02-18 21:27:06 -03004137 .compatible = "vxt,vl050-8048nt-c01",
4138 .data = &vl050_8048nt_c01,
4139 }, {
Richard Genoude4bac402017-03-27 12:33:23 +02004140 .compatible = "winstar,wf35ltiacd",
4141 .data = &winstar_wf35ltiacd,
4142 }, {
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +01004143 /* Must be the last entry */
4144 .compatible = "panel-dpi",
4145 .data = &panel_dpi,
4146 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004147 /* sentinel */
4148 }
4149};
4150MODULE_DEVICE_TABLE(of, platform_of_match);
4151
4152static int panel_simple_platform_probe(struct platform_device *pdev)
4153{
4154 const struct of_device_id *id;
4155
4156 id = of_match_node(platform_of_match, pdev->dev.of_node);
4157 if (!id)
4158 return -ENODEV;
4159
4160 return panel_simple_probe(&pdev->dev, id->data);
4161}
4162
4163static int panel_simple_platform_remove(struct platform_device *pdev)
4164{
4165 return panel_simple_remove(&pdev->dev);
4166}
4167
Thierry Redingd02fd932014-04-29 17:21:21 +02004168static void panel_simple_platform_shutdown(struct platform_device *pdev)
4169{
4170 panel_simple_shutdown(&pdev->dev);
4171}
4172
Thierry Reding280921d2013-08-30 15:10:14 +02004173static struct platform_driver panel_simple_platform_driver = {
4174 .driver = {
4175 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02004176 .of_match_table = platform_of_match,
4177 },
4178 .probe = panel_simple_platform_probe,
4179 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004180 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004181};
4182
Thierry Reding210fcd92013-11-22 19:27:11 +01004183struct panel_desc_dsi {
4184 struct panel_desc desc;
4185
Thierry Reding462658b2014-03-14 11:24:57 +01004186 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004187 enum mipi_dsi_pixel_format format;
4188 unsigned int lanes;
4189};
4190
Thierry Redingd718d792015-04-08 16:52:33 +02004191static const struct drm_display_mode auo_b080uan01_mode = {
4192 .clock = 154500,
4193 .hdisplay = 1200,
4194 .hsync_start = 1200 + 62,
4195 .hsync_end = 1200 + 62 + 4,
4196 .htotal = 1200 + 62 + 4 + 62,
4197 .vdisplay = 1920,
4198 .vsync_start = 1920 + 9,
4199 .vsync_end = 1920 + 9 + 2,
4200 .vtotal = 1920 + 9 + 2 + 8,
Thierry Redingd718d792015-04-08 16:52:33 +02004201};
4202
4203static const struct panel_desc_dsi auo_b080uan01 = {
4204 .desc = {
4205 .modes = &auo_b080uan01_mode,
4206 .num_modes = 1,
4207 .bpc = 8,
4208 .size = {
4209 .width = 108,
4210 .height = 272,
4211 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004212 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Redingd718d792015-04-08 16:52:33 +02004213 },
4214 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
4215 .format = MIPI_DSI_FMT_RGB888,
4216 .lanes = 4,
4217};
4218
Chris Zhongc8521962015-11-20 16:15:37 +08004219static const struct drm_display_mode boe_tv080wum_nl0_mode = {
4220 .clock = 160000,
4221 .hdisplay = 1200,
4222 .hsync_start = 1200 + 120,
4223 .hsync_end = 1200 + 120 + 20,
4224 .htotal = 1200 + 120 + 20 + 21,
4225 .vdisplay = 1920,
4226 .vsync_start = 1920 + 21,
4227 .vsync_end = 1920 + 21 + 3,
4228 .vtotal = 1920 + 21 + 3 + 18,
Chris Zhongc8521962015-11-20 16:15:37 +08004229 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4230};
4231
4232static const struct panel_desc_dsi boe_tv080wum_nl0 = {
4233 .desc = {
4234 .modes = &boe_tv080wum_nl0_mode,
4235 .num_modes = 1,
4236 .size = {
4237 .width = 107,
4238 .height = 172,
4239 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004240 .connector_type = DRM_MODE_CONNECTOR_DSI,
Chris Zhongc8521962015-11-20 16:15:37 +08004241 },
4242 .flags = MIPI_DSI_MODE_VIDEO |
4243 MIPI_DSI_MODE_VIDEO_BURST |
4244 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
4245 .format = MIPI_DSI_FMT_RGB888,
4246 .lanes = 4,
4247};
4248
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004249static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
4250 .clock = 71000,
4251 .hdisplay = 800,
4252 .hsync_start = 800 + 32,
4253 .hsync_end = 800 + 32 + 1,
4254 .htotal = 800 + 32 + 1 + 57,
4255 .vdisplay = 1280,
4256 .vsync_start = 1280 + 28,
4257 .vsync_end = 1280 + 28 + 1,
4258 .vtotal = 1280 + 28 + 1 + 14,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004259};
4260
4261static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
4262 .desc = {
4263 .modes = &lg_ld070wx3_sl01_mode,
4264 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004265 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004266 .size = {
4267 .width = 94,
4268 .height = 151,
4269 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004270 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004271 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004272 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004273 .format = MIPI_DSI_FMT_RGB888,
4274 .lanes = 4,
4275};
4276
Alexandre Courbot499ce852014-01-21 18:57:09 +09004277static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
4278 .clock = 67000,
4279 .hdisplay = 720,
4280 .hsync_start = 720 + 12,
4281 .hsync_end = 720 + 12 + 4,
4282 .htotal = 720 + 12 + 4 + 112,
4283 .vdisplay = 1280,
4284 .vsync_start = 1280 + 8,
4285 .vsync_end = 1280 + 8 + 4,
4286 .vtotal = 1280 + 8 + 4 + 12,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004287};
4288
4289static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
4290 .desc = {
4291 .modes = &lg_lh500wx1_sd03_mode,
4292 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004293 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004294 .size = {
4295 .width = 62,
4296 .height = 110,
4297 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004298 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004299 },
4300 .flags = MIPI_DSI_MODE_VIDEO,
4301 .format = MIPI_DSI_FMT_RGB888,
4302 .lanes = 4,
4303};
4304
Thierry Reding280921d2013-08-30 15:10:14 +02004305static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
4306 .clock = 157200,
4307 .hdisplay = 1920,
4308 .hsync_start = 1920 + 154,
4309 .hsync_end = 1920 + 154 + 16,
4310 .htotal = 1920 + 154 + 16 + 32,
4311 .vdisplay = 1200,
4312 .vsync_start = 1200 + 17,
4313 .vsync_end = 1200 + 17 + 2,
4314 .vtotal = 1200 + 17 + 2 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02004315};
4316
Thierry Reding210fcd92013-11-22 19:27:11 +01004317static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
4318 .desc = {
4319 .modes = &panasonic_vvx10f004b00_mode,
4320 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004321 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01004322 .size = {
4323 .width = 217,
4324 .height = 136,
4325 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004326 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Reding280921d2013-08-30 15:10:14 +02004327 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004328 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
4329 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01004330 .format = MIPI_DSI_FMT_RGB888,
4331 .lanes = 4,
4332};
4333
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004334static const struct drm_display_mode lg_acx467akm_7_mode = {
4335 .clock = 150000,
4336 .hdisplay = 1080,
4337 .hsync_start = 1080 + 2,
4338 .hsync_end = 1080 + 2 + 2,
4339 .htotal = 1080 + 2 + 2 + 2,
4340 .vdisplay = 1920,
4341 .vsync_start = 1920 + 2,
4342 .vsync_end = 1920 + 2 + 2,
4343 .vtotal = 1920 + 2 + 2 + 2,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004344};
4345
4346static const struct panel_desc_dsi lg_acx467akm_7 = {
4347 .desc = {
4348 .modes = &lg_acx467akm_7_mode,
4349 .num_modes = 1,
4350 .bpc = 8,
4351 .size = {
4352 .width = 62,
4353 .height = 110,
4354 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004355 .connector_type = DRM_MODE_CONNECTOR_DSI,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004356 },
4357 .flags = 0,
4358 .format = MIPI_DSI_FMT_RGB888,
4359 .lanes = 4,
4360};
4361
Peter Ujfalusi62967232019-02-26 09:55:21 +02004362static const struct drm_display_mode osd101t2045_53ts_mode = {
4363 .clock = 154500,
4364 .hdisplay = 1920,
4365 .hsync_start = 1920 + 112,
4366 .hsync_end = 1920 + 112 + 16,
4367 .htotal = 1920 + 112 + 16 + 32,
4368 .vdisplay = 1200,
4369 .vsync_start = 1200 + 16,
4370 .vsync_end = 1200 + 16 + 2,
4371 .vtotal = 1200 + 16 + 2 + 16,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004372 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
4373};
4374
4375static const struct panel_desc_dsi osd101t2045_53ts = {
4376 .desc = {
4377 .modes = &osd101t2045_53ts_mode,
4378 .num_modes = 1,
4379 .bpc = 8,
4380 .size = {
4381 .width = 217,
4382 .height = 136,
4383 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004384 .connector_type = DRM_MODE_CONNECTOR_DSI,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004385 },
4386 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
4387 MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
4388 MIPI_DSI_MODE_EOT_PACKET,
4389 .format = MIPI_DSI_FMT_RGB888,
4390 .lanes = 4,
4391};
4392
Thierry Reding210fcd92013-11-22 19:27:11 +01004393static const struct of_device_id dsi_of_match[] = {
4394 {
Thierry Redingd718d792015-04-08 16:52:33 +02004395 .compatible = "auo,b080uan01",
4396 .data = &auo_b080uan01
4397 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08004398 .compatible = "boe,tv080wum-nl0",
4399 .data = &boe_tv080wum_nl0
4400 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004401 .compatible = "lg,ld070wx3-sl01",
4402 .data = &lg_ld070wx3_sl01
4403 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09004404 .compatible = "lg,lh500wx1-sd03",
4405 .data = &lg_lh500wx1_sd03
4406 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01004407 .compatible = "panasonic,vvx10f004b00",
4408 .data = &panasonic_vvx10f004b00
4409 }, {
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004410 .compatible = "lg,acx467akm-7",
4411 .data = &lg_acx467akm_7
4412 }, {
Peter Ujfalusi62967232019-02-26 09:55:21 +02004413 .compatible = "osddisplays,osd101t2045-53ts",
4414 .data = &osd101t2045_53ts
4415 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01004416 /* sentinel */
4417 }
4418};
4419MODULE_DEVICE_TABLE(of, dsi_of_match);
4420
4421static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
4422{
4423 const struct panel_desc_dsi *desc;
4424 const struct of_device_id *id;
4425 int err;
4426
4427 id = of_match_node(dsi_of_match, dsi->dev.of_node);
4428 if (!id)
4429 return -ENODEV;
4430
4431 desc = id->data;
4432
4433 err = panel_simple_probe(&dsi->dev, &desc->desc);
4434 if (err < 0)
4435 return err;
4436
Thierry Reding462658b2014-03-14 11:24:57 +01004437 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004438 dsi->format = desc->format;
4439 dsi->lanes = desc->lanes;
4440
Peter Ujfalusi7ad9db62019-02-26 10:11:53 +02004441 err = mipi_dsi_attach(dsi);
4442 if (err) {
4443 struct panel_simple *panel = dev_get_drvdata(&dsi->dev);
4444
4445 drm_panel_remove(&panel->base);
4446 }
4447
4448 return err;
Thierry Reding210fcd92013-11-22 19:27:11 +01004449}
4450
4451static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
4452{
4453 int err;
4454
4455 err = mipi_dsi_detach(dsi);
4456 if (err < 0)
4457 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
4458
4459 return panel_simple_remove(&dsi->dev);
4460}
4461
Thierry Redingd02fd932014-04-29 17:21:21 +02004462static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
4463{
4464 panel_simple_shutdown(&dsi->dev);
4465}
4466
Thierry Reding210fcd92013-11-22 19:27:11 +01004467static struct mipi_dsi_driver panel_simple_dsi_driver = {
4468 .driver = {
4469 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01004470 .of_match_table = dsi_of_match,
4471 },
4472 .probe = panel_simple_dsi_probe,
4473 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004474 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004475};
4476
4477static int __init panel_simple_init(void)
4478{
Thierry Reding210fcd92013-11-22 19:27:11 +01004479 int err;
4480
4481 err = platform_driver_register(&panel_simple_platform_driver);
4482 if (err < 0)
4483 return err;
4484
4485 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
4486 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
4487 if (err < 0)
4488 return err;
4489 }
4490
4491 return 0;
Thierry Reding280921d2013-08-30 15:10:14 +02004492}
4493module_init(panel_simple_init);
4494
4495static void __exit panel_simple_exit(void)
4496{
Thierry Reding210fcd92013-11-22 19:27:11 +01004497 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
4498 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
4499
Thierry Reding280921d2013-08-30 15:10:14 +02004500 platform_driver_unregister(&panel_simple_platform_driver);
4501}
4502module_exit(panel_simple_exit);
4503
4504MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
4505MODULE_DESCRIPTION("DRM Driver for Simple Panels");
4506MODULE_LICENSE("GPL and additional rights");