blob: faa45af48c152480a8ce23111c766e783a1223af [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/**
Douglas Andersona00fa422020-12-01 12:59:12 -080042 * struct panel_desc - Describes a simple panel.
Douglas Andersone362cc62019-07-12 09:33:33 -070043 */
Thierry Reding280921d2013-08-30 15:10:14 +020044struct panel_desc {
Douglas Andersona00fa422020-12-01 12:59:12 -080045 /**
46 * @modes: Pointer to array of fixed modes appropriate for this panel.
47 *
48 * If only one mode then this can just be the address of the mode.
49 * NOTE: cannot be used with "timings" and also if this is specified
50 * then you cannot override the mode in the device tree.
51 */
Thierry Reding280921d2013-08-30 15:10:14 +020052 const struct drm_display_mode *modes;
Douglas Andersona00fa422020-12-01 12:59:12 -080053
54 /** @num_modes: Number of elements in modes array. */
Thierry Reding280921d2013-08-30 15:10:14 +020055 unsigned int num_modes;
Douglas Andersona00fa422020-12-01 12:59:12 -080056
57 /**
58 * @timings: Pointer to array of display timings
59 *
60 * NOTE: cannot be used with "modes" and also these will be used to
61 * validate a device tree override if one is present.
62 */
Philipp Zabela5d3e622014-12-11 18:32:45 +010063 const struct display_timing *timings;
Douglas Andersona00fa422020-12-01 12:59:12 -080064
65 /** @num_timings: Number of elements in timings array. */
Philipp Zabela5d3e622014-12-11 18:32:45 +010066 unsigned int num_timings;
Thierry Reding280921d2013-08-30 15:10:14 +020067
Douglas Andersona00fa422020-12-01 12:59:12 -080068 /** @bpc: Bits per color. */
Stéphane Marchesin0208d512014-06-19 18:18:28 -070069 unsigned int bpc;
70
Douglas Andersona00fa422020-12-01 12:59:12 -080071 /** @size: Structure containing the physical size of this panel. */
Thierry Reding280921d2013-08-30 15:10:14 +020072 struct {
Douglas Anderson131f9092020-11-09 17:00:55 -080073 /**
74 * @size.width: Width (in mm) of the active display area.
75 */
Thierry Reding280921d2013-08-30 15:10:14 +020076 unsigned int width;
Douglas Anderson131f9092020-11-09 17:00:55 -080077
78 /**
79 * @size.height: Height (in mm) of the active display area.
80 */
Thierry Reding280921d2013-08-30 15:10:14 +020081 unsigned int height;
82 } size;
Ajay Kumarf673c372014-07-31 23:12:11 +053083
Douglas Andersona00fa422020-12-01 12:59:12 -080084 /** @delay: Structure containing various delay values for this panel. */
Ajay Kumarf673c372014-07-31 23:12:11 +053085 struct {
Douglas Anderson131f9092020-11-09 17:00:55 -080086 /**
87 * @delay.prepare: Time for the panel to become ready.
88 *
89 * The time (in milliseconds) that it takes for the panel to
90 * become ready and start receiving video data
91 */
Ajay Kumarf673c372014-07-31 23:12:11 +053092 unsigned int prepare;
Douglas Anderson131f9092020-11-09 17:00:55 -080093
94 /**
95 * @delay.hpd_absent_delay: Time to wait if HPD isn't hooked up.
96 *
97 * Add this to the prepare delay if we know Hot Plug Detect
98 * isn't used.
99 */
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700100 unsigned int hpd_absent_delay;
Douglas Anderson131f9092020-11-09 17:00:55 -0800101
102 /**
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800103 * @delay.prepare_to_enable: Time between prepare and enable.
104 *
105 * The minimum time, in milliseconds, that needs to have passed
106 * between when prepare finished and enable may begin. If at
107 * enable time less time has passed since prepare finished,
108 * the driver waits for the remaining time.
109 *
110 * If a fixed enable delay is also specified, we'll start
111 * counting before delaying for the fixed delay.
112 *
113 * If a fixed prepare delay is also specified, we won't start
114 * counting until after the fixed delay. We can't overlap this
115 * fixed delay with the min time because the fixed delay
116 * doesn't happen at the end of the function if a HPD GPIO was
117 * specified.
118 *
119 * In other words:
120 * prepare()
121 * ...
122 * // do fixed prepare delay
123 * // wait for HPD GPIO if applicable
124 * // start counting for prepare_to_enable
125 *
126 * enable()
127 * // do fixed enable delay
128 * // enforce prepare_to_enable min time
129 */
130 unsigned int prepare_to_enable;
131
132 /**
Douglas Anderson131f9092020-11-09 17:00:55 -0800133 * @delay.enable: Time for the panel to display a valid frame.
134 *
135 * The time (in milliseconds) that it takes for the panel to
136 * display the first valid frame after starting to receive
137 * video data.
138 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530139 unsigned int enable;
Douglas Anderson131f9092020-11-09 17:00:55 -0800140
141 /**
142 * @delay.disable: Time for the panel to turn the display off.
143 *
144 * The time (in milliseconds) that it takes for the panel to
145 * turn the display off (no content is visible).
146 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530147 unsigned int disable;
Douglas Anderson131f9092020-11-09 17:00:55 -0800148
149 /**
150 * @delay.unprepare: Time to power down completely.
151 *
152 * The time (in milliseconds) that it takes for the panel
153 * to power itself down completely.
Douglas Andersone5e30df2020-11-09 17:00:56 -0800154 *
155 * This time is used to prevent a future "prepare" from
156 * starting until at least this many milliseconds has passed.
157 * If at prepare time less time has passed since unprepare
158 * finished, the driver waits for the remaining time.
Douglas Anderson131f9092020-11-09 17:00:55 -0800159 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530160 unsigned int unprepare;
161 } delay;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200162
Douglas Andersona00fa422020-12-01 12:59:12 -0800163 /** @bus_format: See MEDIA_BUS_FMT_... defines. */
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200164 u32 bus_format;
Douglas Andersona00fa422020-12-01 12:59:12 -0800165
166 /** @bus_flags: See DRM_BUS_FLAG_... defines. */
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800167 u32 bus_flags;
Douglas Andersona00fa422020-12-01 12:59:12 -0800168
169 /** @connector_type: LVDS, eDP, DSI, DPI, etc. */
Laurent Pinchart9a2654c2019-09-04 16:28:03 +0300170 int connector_type;
Thierry Reding280921d2013-08-30 15:10:14 +0200171};
172
Thierry Reding280921d2013-08-30 15:10:14 +0200173struct panel_simple {
174 struct drm_panel base;
175 bool enabled;
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700176 bool no_hpd;
Thierry Reding280921d2013-08-30 15:10:14 +0200177
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800178 ktime_t prepared_time;
Douglas Andersone5e30df2020-11-09 17:00:56 -0800179 ktime_t unprepared_time;
180
Thierry Reding280921d2013-08-30 15:10:14 +0200181 const struct panel_desc *desc;
182
Thierry Reding280921d2013-08-30 15:10:14 +0200183 struct regulator *supply;
184 struct i2c_adapter *ddc;
185
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900186 struct gpio_desc *enable_gpio;
Douglas Anderson48834e62020-05-07 14:34:57 -0700187 struct gpio_desc *hpd_gpio;
Sean Paulb8a29482019-07-11 13:34:53 -0700188
189 struct drm_display_mode override_mode;
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300190
191 enum drm_panel_orientation orientation;
Thierry Reding280921d2013-08-30 15:10:14 +0200192};
193
194static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
195{
196 return container_of(panel, struct panel_simple, base);
197}
198
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100199static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
200 struct drm_connector *connector)
Thierry Reding280921d2013-08-30 15:10:14 +0200201{
Thierry Reding280921d2013-08-30 15:10:14 +0200202 struct drm_display_mode *mode;
203 unsigned int i, num = 0;
204
Philipp Zabela5d3e622014-12-11 18:32:45 +0100205 for (i = 0; i < panel->desc->num_timings; i++) {
206 const struct display_timing *dt = &panel->desc->timings[i];
207 struct videomode vm;
208
209 videomode_from_timing(dt, &vm);
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100210 mode = drm_mode_create(connector->dev);
Philipp Zabela5d3e622014-12-11 18:32:45 +0100211 if (!mode) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100212 dev_err(panel->base.dev, "failed to add mode %ux%u\n",
Philipp Zabela5d3e622014-12-11 18:32:45 +0100213 dt->hactive.typ, dt->vactive.typ);
214 continue;
215 }
216
217 drm_display_mode_from_videomode(&vm, mode);
Boris Brezilloncda55372016-04-15 18:23:33 +0200218
219 mode->type |= DRM_MODE_TYPE_DRIVER;
220
Chen-Yu Tsai230c5b42016-10-24 21:21:15 +0800221 if (panel->desc->num_timings == 1)
Boris Brezilloncda55372016-04-15 18:23:33 +0200222 mode->type |= DRM_MODE_TYPE_PREFERRED;
223
Philipp Zabela5d3e622014-12-11 18:32:45 +0100224 drm_mode_probed_add(connector, mode);
225 num++;
226 }
227
Sean Paulb8a29482019-07-11 13:34:53 -0700228 return num;
229}
230
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100231static unsigned int panel_simple_get_display_modes(struct panel_simple *panel,
232 struct drm_connector *connector)
Sean Paulb8a29482019-07-11 13:34:53 -0700233{
Sean Paulb8a29482019-07-11 13:34:53 -0700234 struct drm_display_mode *mode;
235 unsigned int i, num = 0;
236
Thierry Reding280921d2013-08-30 15:10:14 +0200237 for (i = 0; i < panel->desc->num_modes; i++) {
238 const struct drm_display_mode *m = &panel->desc->modes[i];
239
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100240 mode = drm_mode_duplicate(connector->dev, m);
Thierry Reding280921d2013-08-30 15:10:14 +0200241 if (!mode) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100242 dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
Ville Syrjälä04256622020-04-28 20:19:27 +0300243 m->hdisplay, m->vdisplay,
244 drm_mode_vrefresh(m));
Thierry Reding280921d2013-08-30 15:10:14 +0200245 continue;
246 }
247
Boris Brezilloncda55372016-04-15 18:23:33 +0200248 mode->type |= DRM_MODE_TYPE_DRIVER;
249
250 if (panel->desc->num_modes == 1)
251 mode->type |= DRM_MODE_TYPE_PREFERRED;
252
Thierry Reding280921d2013-08-30 15:10:14 +0200253 drm_mode_set_name(mode);
254
255 drm_mode_probed_add(connector, mode);
256 num++;
257 }
258
Sean Paulb8a29482019-07-11 13:34:53 -0700259 return num;
260}
261
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100262static int panel_simple_get_non_edid_modes(struct panel_simple *panel,
263 struct drm_connector *connector)
Sean Paulb8a29482019-07-11 13:34:53 -0700264{
Sean Paulb8a29482019-07-11 13:34:53 -0700265 struct drm_display_mode *mode;
266 bool has_override = panel->override_mode.type;
267 unsigned int num = 0;
268
269 if (!panel->desc)
270 return 0;
271
272 if (has_override) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100273 mode = drm_mode_duplicate(connector->dev,
274 &panel->override_mode);
Sean Paulb8a29482019-07-11 13:34:53 -0700275 if (mode) {
276 drm_mode_probed_add(connector, mode);
277 num = 1;
278 } else {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100279 dev_err(panel->base.dev, "failed to add override mode\n");
Sean Paulb8a29482019-07-11 13:34:53 -0700280 }
281 }
282
283 /* Only add timings if override was not there or failed to validate */
284 if (num == 0 && panel->desc->num_timings)
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100285 num = panel_simple_get_timings_modes(panel, connector);
Sean Paulb8a29482019-07-11 13:34:53 -0700286
287 /*
288 * Only add fixed modes if timings/override added no mode.
289 *
290 * We should only ever have either the display timings specified
291 * or a fixed mode. Anything else is rather bogus.
292 */
293 WARN_ON(panel->desc->num_timings && panel->desc->num_modes);
294 if (num == 0)
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100295 num = panel_simple_get_display_modes(panel, connector);
Sean Paulb8a29482019-07-11 13:34:53 -0700296
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700297 connector->display_info.bpc = panel->desc->bpc;
Thierry Reding280921d2013-08-30 15:10:14 +0200298 connector->display_info.width_mm = panel->desc->size.width;
299 connector->display_info.height_mm = panel->desc->size.height;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200300 if (panel->desc->bus_format)
301 drm_display_info_set_bus_formats(&connector->display_info,
302 &panel->desc->bus_format, 1);
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800303 connector->display_info.bus_flags = panel->desc->bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200304
305 return num;
306}
307
Douglas Andersone5e30df2020-11-09 17:00:56 -0800308static void panel_simple_wait(ktime_t start_ktime, unsigned int min_ms)
309{
310 ktime_t now_ktime, min_ktime;
311
312 if (!min_ms)
313 return;
314
315 min_ktime = ktime_add(start_ktime, ms_to_ktime(min_ms));
316 now_ktime = ktime_get();
317
318 if (ktime_before(now_ktime, min_ktime))
319 msleep(ktime_to_ms(ktime_sub(min_ktime, now_ktime)) + 1);
320}
321
Thierry Reding280921d2013-08-30 15:10:14 +0200322static int panel_simple_disable(struct drm_panel *panel)
323{
324 struct panel_simple *p = to_panel_simple(panel);
325
326 if (!p->enabled)
327 return 0;
328
Ajay Kumarf673c372014-07-31 23:12:11 +0530329 if (p->desc->delay.disable)
330 msleep(p->desc->delay.disable);
331
Thierry Reding280921d2013-08-30 15:10:14 +0200332 p->enabled = false;
333
334 return 0;
335}
336
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530337static int panel_simple_unprepare(struct drm_panel *panel)
338{
Ajay Kumar613a6332014-07-31 23:12:10 +0530339 struct panel_simple *p = to_panel_simple(panel);
340
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800341 if (p->prepared_time == 0)
Ajay Kumar613a6332014-07-31 23:12:10 +0530342 return 0;
343
Fabio Estevam756b9182017-07-16 21:05:39 -0300344 gpiod_set_value_cansleep(p->enable_gpio, 0);
Ajay Kumar613a6332014-07-31 23:12:10 +0530345
346 regulator_disable(p->supply);
347
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800348 p->prepared_time = 0;
Douglas Andersone5e30df2020-11-09 17:00:56 -0800349 p->unprepared_time = ktime_get();
Ajay Kumar613a6332014-07-31 23:12:10 +0530350
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530351 return 0;
352}
353
Douglas Anderson48834e62020-05-07 14:34:57 -0700354static int panel_simple_get_hpd_gpio(struct device *dev,
355 struct panel_simple *p, bool from_probe)
356{
357 int err;
358
359 p->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN);
360 if (IS_ERR(p->hpd_gpio)) {
361 err = PTR_ERR(p->hpd_gpio);
362
363 /*
364 * If we're called from probe we won't consider '-EPROBE_DEFER'
365 * to be an error--we'll leave the error code in "hpd_gpio".
366 * When we try to use it we'll try again. This allows for
367 * circular dependencies where the component providing the
368 * hpd gpio needs the panel to init before probing.
369 */
370 if (err != -EPROBE_DEFER || !from_probe) {
371 dev_err(dev, "failed to get 'hpd' GPIO: %d\n", err);
372 return err;
373 }
374 }
375
376 return 0;
377}
378
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530379static int panel_simple_prepare(struct drm_panel *panel)
380{
Thierry Reding280921d2013-08-30 15:10:14 +0200381 struct panel_simple *p = to_panel_simple(panel);
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700382 unsigned int delay;
Thierry Reding280921d2013-08-30 15:10:14 +0200383 int err;
Douglas Anderson48834e62020-05-07 14:34:57 -0700384 int hpd_asserted;
Thierry Reding280921d2013-08-30 15:10:14 +0200385
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800386 if (p->prepared_time != 0)
Thierry Reding280921d2013-08-30 15:10:14 +0200387 return 0;
388
Douglas Andersone5e30df2020-11-09 17:00:56 -0800389 panel_simple_wait(p->unprepared_time, p->desc->delay.unprepare);
390
Thierry Reding280921d2013-08-30 15:10:14 +0200391 err = regulator_enable(p->supply);
392 if (err < 0) {
393 dev_err(panel->dev, "failed to enable supply: %d\n", err);
394 return err;
395 }
396
Fabio Estevam756b9182017-07-16 21:05:39 -0300397 gpiod_set_value_cansleep(p->enable_gpio, 1);
Thierry Reding280921d2013-08-30 15:10:14 +0200398
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700399 delay = p->desc->delay.prepare;
400 if (p->no_hpd)
401 delay += p->desc->delay.hpd_absent_delay;
402 if (delay)
403 msleep(delay);
Ajay Kumarf673c372014-07-31 23:12:11 +0530404
Douglas Anderson48834e62020-05-07 14:34:57 -0700405 if (p->hpd_gpio) {
406 if (IS_ERR(p->hpd_gpio)) {
407 err = panel_simple_get_hpd_gpio(panel->dev, p, false);
408 if (err)
409 return err;
410 }
411
412 err = readx_poll_timeout(gpiod_get_value_cansleep, p->hpd_gpio,
413 hpd_asserted, hpd_asserted,
414 1000, 2000000);
415 if (hpd_asserted < 0)
416 err = hpd_asserted;
417
418 if (err) {
419 dev_err(panel->dev,
420 "error waiting for hpd GPIO: %d\n", err);
421 return err;
422 }
423 }
424
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800425 p->prepared_time = ktime_get();
Ajay Kumar613a6332014-07-31 23:12:10 +0530426
427 return 0;
428}
429
430static int panel_simple_enable(struct drm_panel *panel)
431{
432 struct panel_simple *p = to_panel_simple(panel);
433
434 if (p->enabled)
435 return 0;
436
Ajay Kumarf673c372014-07-31 23:12:11 +0530437 if (p->desc->delay.enable)
438 msleep(p->desc->delay.enable);
439
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800440 panel_simple_wait(p->prepared_time, p->desc->delay.prepare_to_enable);
441
Thierry Reding280921d2013-08-30 15:10:14 +0200442 p->enabled = true;
443
444 return 0;
445}
446
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100447static int panel_simple_get_modes(struct drm_panel *panel,
448 struct drm_connector *connector)
Thierry Reding280921d2013-08-30 15:10:14 +0200449{
450 struct panel_simple *p = to_panel_simple(panel);
451 int num = 0;
452
453 /* probe EDID if a DDC bus is available */
454 if (p->ddc) {
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100455 struct edid *edid = drm_get_edid(connector, p->ddc);
456
457 drm_connector_update_edid_property(connector, edid);
Thierry Reding280921d2013-08-30 15:10:14 +0200458 if (edid) {
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100459 num += drm_add_edid_modes(connector, edid);
Thierry Reding280921d2013-08-30 15:10:14 +0200460 kfree(edid);
461 }
462 }
463
464 /* add hard-coded panel modes */
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100465 num += panel_simple_get_non_edid_modes(p, connector);
Thierry Reding280921d2013-08-30 15:10:14 +0200466
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300467 /* set up connector's "panel orientation" property */
468 drm_connector_set_panel_orientation(connector, p->orientation);
469
Thierry Reding280921d2013-08-30 15:10:14 +0200470 return num;
471}
472
Philipp Zabela5d3e622014-12-11 18:32:45 +0100473static int panel_simple_get_timings(struct drm_panel *panel,
474 unsigned int num_timings,
475 struct display_timing *timings)
476{
477 struct panel_simple *p = to_panel_simple(panel);
478 unsigned int i;
479
480 if (p->desc->num_timings < num_timings)
481 num_timings = p->desc->num_timings;
482
483 if (timings)
484 for (i = 0; i < num_timings; i++)
485 timings[i] = p->desc->timings[i];
486
487 return p->desc->num_timings;
488}
489
Thierry Reding280921d2013-08-30 15:10:14 +0200490static const struct drm_panel_funcs panel_simple_funcs = {
491 .disable = panel_simple_disable,
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530492 .unprepare = panel_simple_unprepare,
493 .prepare = panel_simple_prepare,
Thierry Reding280921d2013-08-30 15:10:14 +0200494 .enable = panel_simple_enable,
495 .get_modes = panel_simple_get_modes,
Philipp Zabela5d3e622014-12-11 18:32:45 +0100496 .get_timings = panel_simple_get_timings,
Thierry Reding280921d2013-08-30 15:10:14 +0200497};
498
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100499static struct panel_desc panel_dpi;
500
501static int panel_dpi_probe(struct device *dev,
502 struct panel_simple *panel)
503{
504 struct display_timing *timing;
505 const struct device_node *np;
506 struct panel_desc *desc;
507 unsigned int bus_flags;
508 struct videomode vm;
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100509 int ret;
510
511 np = dev->of_node;
512 desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
513 if (!desc)
514 return -ENOMEM;
515
516 timing = devm_kzalloc(dev, sizeof(*timing), GFP_KERNEL);
517 if (!timing)
518 return -ENOMEM;
519
520 ret = of_get_display_timing(np, "panel-timing", timing);
521 if (ret < 0) {
522 dev_err(dev, "%pOF: no panel-timing node found for \"panel-dpi\" binding\n",
523 np);
524 return ret;
525 }
526
527 desc->timings = timing;
528 desc->num_timings = 1;
529
530 of_property_read_u32(np, "width-mm", &desc->size.width);
531 of_property_read_u32(np, "height-mm", &desc->size.height);
532
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100533 /* Extract bus_flags from display_timing */
534 bus_flags = 0;
535 vm.flags = timing->flags;
536 drm_bus_flags_from_videomode(&vm, &bus_flags);
537 desc->bus_flags = bus_flags;
538
539 /* We do not know the connector for the DT node, so guess it */
540 desc->connector_type = DRM_MODE_CONNECTOR_DPI;
541
542 panel->desc = desc;
543
544 return 0;
545}
546
Sean Paulb8a29482019-07-11 13:34:53 -0700547#define PANEL_SIMPLE_BOUNDS_CHECK(to_check, bounds, field) \
548 (to_check->field.typ >= bounds->field.min && \
549 to_check->field.typ <= bounds->field.max)
Douglas Andersone362cc62019-07-12 09:33:33 -0700550static void panel_simple_parse_panel_timing_node(struct device *dev,
551 struct panel_simple *panel,
552 const struct display_timing *ot)
Sean Paulb8a29482019-07-11 13:34:53 -0700553{
554 const struct panel_desc *desc = panel->desc;
555 struct videomode vm;
556 unsigned int i;
557
558 if (WARN_ON(desc->num_modes)) {
559 dev_err(dev, "Reject override mode: panel has a fixed mode\n");
560 return;
561 }
562 if (WARN_ON(!desc->num_timings)) {
563 dev_err(dev, "Reject override mode: no timings specified\n");
564 return;
565 }
566
567 for (i = 0; i < panel->desc->num_timings; i++) {
568 const struct display_timing *dt = &panel->desc->timings[i];
569
570 if (!PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hactive) ||
571 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hfront_porch) ||
572 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hback_porch) ||
573 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hsync_len) ||
574 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vactive) ||
575 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vfront_porch) ||
576 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vback_porch) ||
577 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vsync_len))
578 continue;
579
580 if (ot->flags != dt->flags)
581 continue;
582
583 videomode_from_timing(ot, &vm);
584 drm_display_mode_from_videomode(&vm, &panel->override_mode);
585 panel->override_mode.type |= DRM_MODE_TYPE_DRIVER |
586 DRM_MODE_TYPE_PREFERRED;
587 break;
588 }
589
590 if (WARN_ON(!panel->override_mode.type))
591 dev_err(dev, "Reject override mode: No display_timing found\n");
592}
593
Thierry Reding280921d2013-08-30 15:10:14 +0200594static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
595{
Thierry Reding280921d2013-08-30 15:10:14 +0200596 struct panel_simple *panel;
Sean Paulb8a29482019-07-11 13:34:53 -0700597 struct display_timing dt;
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100598 struct device_node *ddc;
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200599 int connector_type;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200600 u32 bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200601 int err;
602
603 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
604 if (!panel)
605 return -ENOMEM;
606
607 panel->enabled = false;
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800608 panel->prepared_time = 0;
Thierry Reding280921d2013-08-30 15:10:14 +0200609 panel->desc = desc;
610
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700611 panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd");
Douglas Anderson48834e62020-05-07 14:34:57 -0700612 if (!panel->no_hpd) {
613 err = panel_simple_get_hpd_gpio(dev, panel, true);
614 if (err)
615 return err;
616 }
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700617
Thierry Reding280921d2013-08-30 15:10:14 +0200618 panel->supply = devm_regulator_get(dev, "power");
619 if (IS_ERR(panel->supply))
620 return PTR_ERR(panel->supply);
621
Alexandre Courbota61400d2014-10-23 17:16:58 +0900622 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
623 GPIOD_OUT_LOW);
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900624 if (IS_ERR(panel->enable_gpio)) {
625 err = PTR_ERR(panel->enable_gpio);
Fabio Estevamb8e93802017-06-30 18:14:46 -0300626 if (err != -EPROBE_DEFER)
627 dev_err(dev, "failed to request GPIO: %d\n", err);
Alexandre Courbot9746c612014-07-25 23:47:25 +0900628 return err;
629 }
Thierry Reding280921d2013-08-30 15:10:14 +0200630
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300631 err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
632 if (err) {
633 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
634 return err;
635 }
636
Thierry Reding280921d2013-08-30 15:10:14 +0200637 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
638 if (ddc) {
639 panel->ddc = of_find_i2c_adapter_by_node(ddc);
640 of_node_put(ddc);
641
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100642 if (!panel->ddc)
643 return -EPROBE_DEFER;
Thierry Reding280921d2013-08-30 15:10:14 +0200644 }
645
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100646 if (desc == &panel_dpi) {
647 /* Handle the generic panel-dpi binding */
648 err = panel_dpi_probe(dev, panel);
649 if (err)
650 goto free_ddc;
651 } else {
652 if (!of_get_display_timing(dev->of_node, "panel-timing", &dt))
653 panel_simple_parse_panel_timing_node(dev, panel, &dt);
654 }
Sean Paulb8a29482019-07-11 13:34:53 -0700655
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200656 connector_type = desc->connector_type;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200657 /* Catch common mistakes for panels. */
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200658 switch (connector_type) {
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200659 case 0:
660 dev_warn(dev, "Specify missing connector_type\n");
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200661 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200662 break;
663 case DRM_MODE_CONNECTOR_LVDS:
Laurent Pinchartc4715832020-06-30 02:33:19 +0300664 WARN_ON(desc->bus_flags &
665 ~(DRM_BUS_FLAG_DE_LOW |
666 DRM_BUS_FLAG_DE_HIGH |
667 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
668 DRM_BUS_FLAG_DATA_LSB_TO_MSB));
Laurent Pinchart1185c402020-06-30 02:33:20 +0300669 WARN_ON(desc->bus_format != MEDIA_BUS_FMT_RGB666_1X7X3_SPWG &&
670 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_SPWG &&
671 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA);
672 WARN_ON(desc->bus_format == MEDIA_BUS_FMT_RGB666_1X7X3_SPWG &&
673 desc->bpc != 6);
674 WARN_ON((desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_SPWG ||
675 desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA) &&
676 desc->bpc != 8);
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200677 break;
678 case DRM_MODE_CONNECTOR_eDP:
679 if (desc->bus_format == 0)
680 dev_warn(dev, "Specify missing bus_format\n");
681 if (desc->bpc != 6 && desc->bpc != 8)
682 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
683 break;
684 case DRM_MODE_CONNECTOR_DSI:
685 if (desc->bpc != 6 && desc->bpc != 8)
686 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
687 break;
688 case DRM_MODE_CONNECTOR_DPI:
689 bus_flags = DRM_BUS_FLAG_DE_LOW |
690 DRM_BUS_FLAG_DE_HIGH |
691 DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE |
692 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
693 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
694 DRM_BUS_FLAG_DATA_LSB_TO_MSB |
695 DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE |
696 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE;
697 if (desc->bus_flags & ~bus_flags)
698 dev_warn(dev, "Unexpected bus_flags(%d)\n", desc->bus_flags & ~bus_flags);
699 if (!(desc->bus_flags & bus_flags))
700 dev_warn(dev, "Specify missing bus_flags\n");
701 if (desc->bus_format == 0)
702 dev_warn(dev, "Specify missing bus_format\n");
703 if (desc->bpc != 6 && desc->bpc != 8)
704 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
705 break;
706 default:
707 dev_warn(dev, "Specify a valid connector_type: %d\n", desc->connector_type);
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200708 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200709 break;
Laurent Pinchart1185c402020-06-30 02:33:20 +0300710 }
Laurent Pinchartc4715832020-06-30 02:33:19 +0300711
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200712 drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type);
Thierry Reding280921d2013-08-30 15:10:14 +0200713
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100714 err = drm_panel_of_backlight(&panel->base);
715 if (err)
716 goto free_ddc;
717
Bernard Zhaoc3ee8c62020-08-01 20:02:13 +0800718 drm_panel_add(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200719
720 dev_set_drvdata(dev, panel);
721
722 return 0;
723
724free_ddc:
725 if (panel->ddc)
726 put_device(&panel->ddc->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200727
728 return err;
729}
730
731static int panel_simple_remove(struct device *dev)
732{
733 struct panel_simple *panel = dev_get_drvdata(dev);
734
Thierry Reding280921d2013-08-30 15:10:14 +0200735 drm_panel_remove(&panel->base);
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100736 drm_panel_disable(&panel->base);
737 drm_panel_unprepare(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200738
739 if (panel->ddc)
740 put_device(&panel->ddc->dev);
741
Thierry Reding280921d2013-08-30 15:10:14 +0200742 return 0;
743}
744
Thierry Redingd02fd932014-04-29 17:21:21 +0200745static void panel_simple_shutdown(struct device *dev)
746{
747 struct panel_simple *panel = dev_get_drvdata(dev);
748
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100749 drm_panel_disable(&panel->base);
750 drm_panel_unprepare(&panel->base);
Thierry Redingd02fd932014-04-29 17:21:21 +0200751}
752
Jagan Tekibca684e2020-08-29 22:03:28 +0530753static const struct drm_display_mode ampire_am_1280800n3tzqw_t00h_mode = {
754 .clock = 71100,
755 .hdisplay = 1280,
756 .hsync_start = 1280 + 40,
757 .hsync_end = 1280 + 40 + 80,
758 .htotal = 1280 + 40 + 80 + 40,
759 .vdisplay = 800,
760 .vsync_start = 800 + 3,
761 .vsync_end = 800 + 3 + 10,
762 .vtotal = 800 + 3 + 10 + 10,
763 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
764};
765
766static const struct panel_desc ampire_am_1280800n3tzqw_t00h = {
767 .modes = &ampire_am_1280800n3tzqw_t00h_mode,
768 .num_modes = 1,
769 .bpc = 6,
770 .size = {
771 .width = 217,
772 .height = 136,
773 },
774 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
775 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
776 .connector_type = DRM_MODE_CONNECTOR_LVDS,
777};
778
Yannick Fertre966fea72017-03-28 11:44:49 +0200779static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
780 .clock = 9000,
781 .hdisplay = 480,
782 .hsync_start = 480 + 2,
783 .hsync_end = 480 + 2 + 41,
784 .htotal = 480 + 2 + 41 + 2,
785 .vdisplay = 272,
786 .vsync_start = 272 + 2,
787 .vsync_end = 272 + 2 + 10,
788 .vtotal = 272 + 2 + 10 + 2,
Yannick Fertre966fea72017-03-28 11:44:49 +0200789 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
790};
791
792static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
793 .modes = &ampire_am_480272h3tmqw_t01h_mode,
794 .num_modes = 1,
795 .bpc = 8,
796 .size = {
797 .width = 105,
798 .height = 67,
799 },
800 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
801};
802
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100803static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
804 .clock = 33333,
805 .hdisplay = 800,
806 .hsync_start = 800 + 0,
807 .hsync_end = 800 + 0 + 255,
808 .htotal = 800 + 0 + 255 + 0,
809 .vdisplay = 480,
810 .vsync_start = 480 + 2,
811 .vsync_end = 480 + 2 + 45,
812 .vtotal = 480 + 2 + 45 + 0,
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100813 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
814};
815
816static const struct panel_desc ampire_am800480r3tmqwa1h = {
817 .modes = &ampire_am800480r3tmqwa1h_mode,
818 .num_modes = 1,
819 .bpc = 6,
820 .size = {
821 .width = 152,
822 .height = 91,
823 },
824 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
825};
826
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200827static const struct display_timing santek_st0700i5y_rbslw_f_timing = {
828 .pixelclock = { 26400000, 33300000, 46800000 },
829 .hactive = { 800, 800, 800 },
830 .hfront_porch = { 16, 210, 354 },
831 .hback_porch = { 45, 36, 6 },
832 .hsync_len = { 1, 10, 40 },
833 .vactive = { 480, 480, 480 },
834 .vfront_porch = { 7, 22, 147 },
835 .vback_porch = { 22, 13, 3 },
836 .vsync_len = { 1, 10, 20 },
837 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
838 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE
839};
840
841static const struct panel_desc armadeus_st0700_adapt = {
842 .timings = &santek_st0700i5y_rbslw_f_timing,
843 .num_timings = 1,
844 .bpc = 6,
845 .size = {
846 .width = 154,
847 .height = 86,
848 },
849 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +0200850 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200851};
852
Thierry Reding280921d2013-08-30 15:10:14 +0200853static const struct drm_display_mode auo_b101aw03_mode = {
854 .clock = 51450,
855 .hdisplay = 1024,
856 .hsync_start = 1024 + 156,
857 .hsync_end = 1024 + 156 + 8,
858 .htotal = 1024 + 156 + 8 + 156,
859 .vdisplay = 600,
860 .vsync_start = 600 + 16,
861 .vsync_end = 600 + 16 + 6,
862 .vtotal = 600 + 16 + 6 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +0200863};
864
865static const struct panel_desc auo_b101aw03 = {
866 .modes = &auo_b101aw03_mode,
867 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700868 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200869 .size = {
870 .width = 223,
871 .height = 125,
872 },
Dmitry Osipenko85560822020-06-22 01:27:42 +0300873 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +0300874 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +0300875 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +0200876};
877
Douglas Anderson374bf822019-07-11 13:34:55 -0700878static const struct display_timing auo_b101ean01_timing = {
879 .pixelclock = { 65300000, 72500000, 75000000 },
880 .hactive = { 1280, 1280, 1280 },
881 .hfront_porch = { 18, 119, 119 },
882 .hback_porch = { 21, 21, 21 },
883 .hsync_len = { 32, 32, 32 },
884 .vactive = { 800, 800, 800 },
885 .vfront_porch = { 4, 4, 4 },
886 .vback_porch = { 8, 8, 8 },
887 .vsync_len = { 18, 20, 20 },
Huang Lina531bc32015-02-28 10:18:58 +0800888};
889
890static const struct panel_desc auo_b101ean01 = {
Douglas Anderson374bf822019-07-11 13:34:55 -0700891 .timings = &auo_b101ean01_timing,
892 .num_timings = 1,
Huang Lina531bc32015-02-28 10:18:58 +0800893 .bpc = 6,
894 .size = {
895 .width = 217,
896 .height = 136,
897 },
898};
899
Rob Clarkdac746e2014-08-01 17:01:06 -0400900static const struct drm_display_mode auo_b101xtn01_mode = {
901 .clock = 72000,
902 .hdisplay = 1366,
903 .hsync_start = 1366 + 20,
904 .hsync_end = 1366 + 20 + 70,
905 .htotal = 1366 + 20 + 70,
906 .vdisplay = 768,
907 .vsync_start = 768 + 14,
908 .vsync_end = 768 + 14 + 42,
909 .vtotal = 768 + 14 + 42,
Rob Clarkdac746e2014-08-01 17:01:06 -0400910 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
911};
912
913static const struct panel_desc auo_b101xtn01 = {
914 .modes = &auo_b101xtn01_mode,
915 .num_modes = 1,
916 .bpc = 6,
917 .size = {
918 .width = 223,
919 .height = 125,
920 },
921};
922
Rob Clarkda4582862020-01-08 15:53:56 -0800923static const struct drm_display_mode auo_b116xak01_mode = {
924 .clock = 69300,
925 .hdisplay = 1366,
926 .hsync_start = 1366 + 48,
927 .hsync_end = 1366 + 48 + 32,
928 .htotal = 1366 + 48 + 32 + 10,
929 .vdisplay = 768,
930 .vsync_start = 768 + 4,
931 .vsync_end = 768 + 4 + 6,
932 .vtotal = 768 + 4 + 6 + 15,
Rob Clarkda4582862020-01-08 15:53:56 -0800933 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
934};
935
936static const struct panel_desc auo_b116xak01 = {
937 .modes = &auo_b116xak01_mode,
938 .num_modes = 1,
939 .bpc = 6,
940 .size = {
941 .width = 256,
942 .height = 144,
943 },
944 .delay = {
945 .hpd_absent_delay = 200,
946 },
947 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
948 .connector_type = DRM_MODE_CONNECTOR_eDP,
949};
950
Ajay Kumare35e3052014-09-01 15:40:02 +0530951static const struct drm_display_mode auo_b116xw03_mode = {
952 .clock = 70589,
953 .hdisplay = 1366,
954 .hsync_start = 1366 + 40,
955 .hsync_end = 1366 + 40 + 40,
956 .htotal = 1366 + 40 + 40 + 32,
957 .vdisplay = 768,
958 .vsync_start = 768 + 10,
959 .vsync_end = 768 + 10 + 12,
960 .vtotal = 768 + 10 + 12 + 6,
Jitao Shi88d34572020-07-05 17:45:14 +0800961 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
Ajay Kumare35e3052014-09-01 15:40:02 +0530962};
963
964static const struct panel_desc auo_b116xw03 = {
965 .modes = &auo_b116xw03_mode,
966 .num_modes = 1,
967 .bpc = 6,
968 .size = {
969 .width = 256,
970 .height = 144,
971 },
Jitao Shi88d34572020-07-05 17:45:14 +0800972 .delay = {
973 .enable = 400,
974 },
975 .bus_flags = DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
976 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
977 .connector_type = DRM_MODE_CONNECTOR_eDP,
Ajay Kumare35e3052014-09-01 15:40:02 +0530978};
979
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700980static const struct drm_display_mode auo_b133xtn01_mode = {
981 .clock = 69500,
982 .hdisplay = 1366,
983 .hsync_start = 1366 + 48,
984 .hsync_end = 1366 + 48 + 32,
985 .htotal = 1366 + 48 + 32 + 20,
986 .vdisplay = 768,
987 .vsync_start = 768 + 3,
988 .vsync_end = 768 + 3 + 6,
989 .vtotal = 768 + 3 + 6 + 13,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700990};
991
992static const struct panel_desc auo_b133xtn01 = {
993 .modes = &auo_b133xtn01_mode,
994 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700995 .bpc = 6,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700996 .size = {
997 .width = 293,
998 .height = 165,
999 },
1000};
1001
Ajay Kumar3e51d602014-07-31 23:12:12 +05301002static const struct drm_display_mode auo_b133htn01_mode = {
1003 .clock = 150660,
1004 .hdisplay = 1920,
1005 .hsync_start = 1920 + 172,
1006 .hsync_end = 1920 + 172 + 80,
1007 .htotal = 1920 + 172 + 80 + 60,
1008 .vdisplay = 1080,
1009 .vsync_start = 1080 + 25,
1010 .vsync_end = 1080 + 25 + 10,
1011 .vtotal = 1080 + 25 + 10 + 10,
Ajay Kumar3e51d602014-07-31 23:12:12 +05301012};
1013
1014static const struct panel_desc auo_b133htn01 = {
1015 .modes = &auo_b133htn01_mode,
1016 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001017 .bpc = 6,
Ajay Kumar3e51d602014-07-31 23:12:12 +05301018 .size = {
1019 .width = 293,
1020 .height = 165,
1021 },
1022 .delay = {
1023 .prepare = 105,
1024 .enable = 20,
1025 .unprepare = 50,
1026 },
1027};
1028
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02001029static const struct display_timing auo_g070vvn01_timings = {
1030 .pixelclock = { 33300000, 34209000, 45000000 },
1031 .hactive = { 800, 800, 800 },
1032 .hfront_porch = { 20, 40, 200 },
1033 .hback_porch = { 87, 40, 1 },
1034 .hsync_len = { 1, 48, 87 },
1035 .vactive = { 480, 480, 480 },
1036 .vfront_porch = { 5, 13, 200 },
1037 .vback_porch = { 31, 31, 29 },
1038 .vsync_len = { 1, 1, 3 },
1039};
1040
1041static const struct panel_desc auo_g070vvn01 = {
1042 .timings = &auo_g070vvn01_timings,
1043 .num_timings = 1,
1044 .bpc = 8,
1045 .size = {
1046 .width = 152,
1047 .height = 91,
1048 },
1049 .delay = {
1050 .prepare = 200,
1051 .enable = 50,
1052 .disable = 50,
1053 .unprepare = 1000,
1054 },
1055};
1056
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001057static const struct drm_display_mode auo_g101evn010_mode = {
1058 .clock = 68930,
1059 .hdisplay = 1280,
1060 .hsync_start = 1280 + 82,
1061 .hsync_end = 1280 + 82 + 2,
1062 .htotal = 1280 + 82 + 2 + 84,
1063 .vdisplay = 800,
1064 .vsync_start = 800 + 8,
1065 .vsync_end = 800 + 8 + 2,
1066 .vtotal = 800 + 8 + 2 + 6,
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001067};
1068
1069static const struct panel_desc auo_g101evn010 = {
1070 .modes = &auo_g101evn010_mode,
1071 .num_modes = 1,
1072 .bpc = 6,
1073 .size = {
1074 .width = 216,
1075 .height = 135,
1076 },
Tomi Valkeinen27a46fb2020-04-17 14:40:43 +03001077 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1078 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001079};
1080
Christoph Fritz4451c282017-12-16 14:13:36 +01001081static const struct drm_display_mode auo_g104sn02_mode = {
1082 .clock = 40000,
1083 .hdisplay = 800,
1084 .hsync_start = 800 + 40,
1085 .hsync_end = 800 + 40 + 216,
1086 .htotal = 800 + 40 + 216 + 128,
1087 .vdisplay = 600,
1088 .vsync_start = 600 + 10,
1089 .vsync_end = 600 + 10 + 35,
1090 .vtotal = 600 + 10 + 35 + 2,
Christoph Fritz4451c282017-12-16 14:13:36 +01001091};
1092
1093static const struct panel_desc auo_g104sn02 = {
1094 .modes = &auo_g104sn02_mode,
1095 .num_modes = 1,
1096 .bpc = 8,
1097 .size = {
1098 .width = 211,
1099 .height = 158,
1100 },
1101};
1102
Sebastian Reichel03e909a2020-04-15 19:27:25 +02001103static const struct drm_display_mode auo_g121ean01_mode = {
1104 .clock = 66700,
1105 .hdisplay = 1280,
1106 .hsync_start = 1280 + 58,
1107 .hsync_end = 1280 + 58 + 8,
1108 .htotal = 1280 + 58 + 8 + 70,
1109 .vdisplay = 800,
1110 .vsync_start = 800 + 6,
1111 .vsync_end = 800 + 6 + 4,
1112 .vtotal = 800 + 6 + 4 + 10,
Sebastian Reichel03e909a2020-04-15 19:27:25 +02001113};
1114
1115static const struct panel_desc auo_g121ean01 = {
1116 .modes = &auo_g121ean01_mode,
1117 .num_modes = 1,
1118 .bpc = 8,
1119 .size = {
1120 .width = 261,
1121 .height = 163,
1122 },
1123 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1124 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1125};
1126
Lucas Stach697035c2016-11-30 14:09:55 +01001127static const struct display_timing auo_g133han01_timings = {
1128 .pixelclock = { 134000000, 141200000, 149000000 },
1129 .hactive = { 1920, 1920, 1920 },
1130 .hfront_porch = { 39, 58, 77 },
1131 .hback_porch = { 59, 88, 117 },
1132 .hsync_len = { 28, 42, 56 },
1133 .vactive = { 1080, 1080, 1080 },
1134 .vfront_porch = { 3, 8, 11 },
1135 .vback_porch = { 5, 14, 19 },
1136 .vsync_len = { 4, 14, 19 },
1137};
1138
1139static const struct panel_desc auo_g133han01 = {
1140 .timings = &auo_g133han01_timings,
1141 .num_timings = 1,
1142 .bpc = 8,
1143 .size = {
1144 .width = 293,
1145 .height = 165,
1146 },
1147 .delay = {
1148 .prepare = 200,
1149 .enable = 50,
1150 .disable = 50,
1151 .unprepare = 1000,
1152 },
1153 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001154 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach697035c2016-11-30 14:09:55 +01001155};
1156
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02001157static const struct drm_display_mode auo_g156xtn01_mode = {
1158 .clock = 76000,
1159 .hdisplay = 1366,
1160 .hsync_start = 1366 + 33,
1161 .hsync_end = 1366 + 33 + 67,
1162 .htotal = 1560,
1163 .vdisplay = 768,
1164 .vsync_start = 768 + 4,
1165 .vsync_end = 768 + 4 + 4,
1166 .vtotal = 806,
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02001167};
1168
1169static const struct panel_desc auo_g156xtn01 = {
1170 .modes = &auo_g156xtn01_mode,
1171 .num_modes = 1,
1172 .bpc = 8,
1173 .size = {
1174 .width = 344,
1175 .height = 194,
1176 },
1177 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1178 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1179};
1180
Lucas Stach8c31f602016-11-30 14:09:56 +01001181static const struct display_timing auo_g185han01_timings = {
1182 .pixelclock = { 120000000, 144000000, 175000000 },
1183 .hactive = { 1920, 1920, 1920 },
Lucas Stachf8c6bfc2019-07-10 15:07:40 +02001184 .hfront_porch = { 36, 120, 148 },
1185 .hback_porch = { 24, 88, 108 },
1186 .hsync_len = { 20, 48, 64 },
Lucas Stach8c31f602016-11-30 14:09:56 +01001187 .vactive = { 1080, 1080, 1080 },
1188 .vfront_porch = { 6, 10, 40 },
1189 .vback_porch = { 2, 5, 20 },
1190 .vsync_len = { 2, 5, 20 },
1191};
1192
1193static const struct panel_desc auo_g185han01 = {
1194 .timings = &auo_g185han01_timings,
1195 .num_timings = 1,
1196 .bpc = 8,
1197 .size = {
1198 .width = 409,
1199 .height = 230,
1200 },
1201 .delay = {
1202 .prepare = 50,
1203 .enable = 200,
1204 .disable = 110,
1205 .unprepare = 1000,
1206 },
1207 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001208 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8c31f602016-11-30 14:09:56 +01001209};
1210
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02001211static const struct display_timing auo_g190ean01_timings = {
1212 .pixelclock = { 90000000, 108000000, 135000000 },
1213 .hactive = { 1280, 1280, 1280 },
1214 .hfront_porch = { 126, 184, 1266 },
1215 .hback_porch = { 84, 122, 844 },
1216 .hsync_len = { 70, 102, 704 },
1217 .vactive = { 1024, 1024, 1024 },
1218 .vfront_porch = { 4, 26, 76 },
1219 .vback_porch = { 2, 8, 25 },
1220 .vsync_len = { 2, 8, 25 },
1221};
1222
1223static const struct panel_desc auo_g190ean01 = {
1224 .timings = &auo_g190ean01_timings,
1225 .num_timings = 1,
1226 .bpc = 8,
1227 .size = {
1228 .width = 376,
1229 .height = 301,
1230 },
1231 .delay = {
1232 .prepare = 50,
1233 .enable = 200,
1234 .disable = 110,
1235 .unprepare = 1000,
1236 },
1237 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1238 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1239};
1240
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001241static const struct display_timing auo_p320hvn03_timings = {
1242 .pixelclock = { 106000000, 148500000, 164000000 },
1243 .hactive = { 1920, 1920, 1920 },
1244 .hfront_porch = { 25, 50, 130 },
1245 .hback_porch = { 25, 50, 130 },
1246 .hsync_len = { 20, 40, 105 },
1247 .vactive = { 1080, 1080, 1080 },
1248 .vfront_porch = { 8, 17, 150 },
1249 .vback_porch = { 8, 17, 150 },
1250 .vsync_len = { 4, 11, 100 },
1251};
1252
1253static const struct panel_desc auo_p320hvn03 = {
1254 .timings = &auo_p320hvn03_timings,
1255 .num_timings = 1,
1256 .bpc = 8,
1257 .size = {
1258 .width = 698,
1259 .height = 393,
1260 },
1261 .delay = {
1262 .prepare = 1,
1263 .enable = 450,
1264 .unprepare = 500,
1265 },
Lucas Stach2554f152018-04-11 17:27:41 +02001266 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001267 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001268};
1269
Haixia Shi7ee933a2016-10-11 14:59:16 -07001270static const struct drm_display_mode auo_t215hvn01_mode = {
1271 .clock = 148800,
1272 .hdisplay = 1920,
1273 .hsync_start = 1920 + 88,
1274 .hsync_end = 1920 + 88 + 44,
1275 .htotal = 1920 + 88 + 44 + 148,
1276 .vdisplay = 1080,
1277 .vsync_start = 1080 + 4,
1278 .vsync_end = 1080 + 4 + 5,
1279 .vtotal = 1080 + 4 + 5 + 36,
Haixia Shi7ee933a2016-10-11 14:59:16 -07001280};
1281
1282static const struct panel_desc auo_t215hvn01 = {
1283 .modes = &auo_t215hvn01_mode,
1284 .num_modes = 1,
1285 .bpc = 8,
1286 .size = {
1287 .width = 430,
1288 .height = 270,
1289 },
1290 .delay = {
1291 .disable = 5,
1292 .unprepare = 1000,
1293 }
1294};
1295
Philipp Zabeld47df632014-12-18 16:43:43 +01001296static const struct drm_display_mode avic_tm070ddh03_mode = {
1297 .clock = 51200,
1298 .hdisplay = 1024,
1299 .hsync_start = 1024 + 160,
1300 .hsync_end = 1024 + 160 + 4,
1301 .htotal = 1024 + 160 + 4 + 156,
1302 .vdisplay = 600,
1303 .vsync_start = 600 + 17,
1304 .vsync_end = 600 + 17 + 1,
1305 .vtotal = 600 + 17 + 1 + 17,
Philipp Zabeld47df632014-12-18 16:43:43 +01001306};
1307
1308static const struct panel_desc avic_tm070ddh03 = {
1309 .modes = &avic_tm070ddh03_mode,
1310 .num_modes = 1,
1311 .bpc = 8,
1312 .size = {
1313 .width = 154,
1314 .height = 90,
1315 },
1316 .delay = {
1317 .prepare = 20,
1318 .enable = 200,
1319 .disable = 200,
1320 },
1321};
1322
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08001323static const struct drm_display_mode bananapi_s070wv20_ct16_mode = {
1324 .clock = 30000,
1325 .hdisplay = 800,
1326 .hsync_start = 800 + 40,
1327 .hsync_end = 800 + 40 + 48,
1328 .htotal = 800 + 40 + 48 + 40,
1329 .vdisplay = 480,
1330 .vsync_start = 480 + 13,
1331 .vsync_end = 480 + 13 + 3,
1332 .vtotal = 480 + 13 + 3 + 29,
1333};
1334
1335static const struct panel_desc bananapi_s070wv20_ct16 = {
1336 .modes = &bananapi_s070wv20_ct16_mode,
1337 .num_modes = 1,
1338 .bpc = 6,
1339 .size = {
1340 .width = 154,
1341 .height = 86,
1342 },
1343};
1344
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001345static const struct drm_display_mode boe_hv070wsa_mode = {
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001346 .clock = 42105,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001347 .hdisplay = 1024,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001348 .hsync_start = 1024 + 30,
1349 .hsync_end = 1024 + 30 + 30,
1350 .htotal = 1024 + 30 + 30 + 30,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001351 .vdisplay = 600,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001352 .vsync_start = 600 + 10,
1353 .vsync_end = 600 + 10 + 10,
1354 .vtotal = 600 + 10 + 10 + 10,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001355};
1356
1357static const struct panel_desc boe_hv070wsa = {
1358 .modes = &boe_hv070wsa_mode,
1359 .num_modes = 1,
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001360 .bpc = 8,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001361 .size = {
1362 .width = 154,
1363 .height = 90,
1364 },
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001365 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1366 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1367 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001368};
1369
Caesar Wangcac1a412016-12-14 11:19:56 +08001370static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
1371 {
1372 .clock = 71900,
1373 .hdisplay = 1280,
1374 .hsync_start = 1280 + 48,
1375 .hsync_end = 1280 + 48 + 32,
1376 .htotal = 1280 + 48 + 32 + 80,
1377 .vdisplay = 800,
1378 .vsync_start = 800 + 3,
1379 .vsync_end = 800 + 3 + 5,
1380 .vtotal = 800 + 3 + 5 + 24,
Caesar Wangcac1a412016-12-14 11:19:56 +08001381 },
1382 {
1383 .clock = 57500,
1384 .hdisplay = 1280,
1385 .hsync_start = 1280 + 48,
1386 .hsync_end = 1280 + 48 + 32,
1387 .htotal = 1280 + 48 + 32 + 80,
1388 .vdisplay = 800,
1389 .vsync_start = 800 + 3,
1390 .vsync_end = 800 + 3 + 5,
1391 .vtotal = 800 + 3 + 5 + 24,
Caesar Wangcac1a412016-12-14 11:19:56 +08001392 },
1393};
1394
1395static const struct panel_desc boe_nv101wxmn51 = {
1396 .modes = boe_nv101wxmn51_modes,
1397 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
1398 .bpc = 8,
1399 .size = {
1400 .width = 217,
1401 .height = 136,
1402 },
1403 .delay = {
1404 .prepare = 210,
1405 .enable = 50,
1406 .unprepare = 160,
1407 },
1408};
1409
Douglas Andersona96ee0f2020-11-09 17:00:58 -08001410static const struct drm_display_mode boe_nv110wtm_n61_modes[] = {
1411 {
1412 .clock = 207800,
1413 .hdisplay = 2160,
1414 .hsync_start = 2160 + 48,
1415 .hsync_end = 2160 + 48 + 32,
1416 .htotal = 2160 + 48 + 32 + 100,
1417 .vdisplay = 1440,
1418 .vsync_start = 1440 + 3,
1419 .vsync_end = 1440 + 3 + 6,
1420 .vtotal = 1440 + 3 + 6 + 31,
1421 },
1422 {
1423 .clock = 138500,
1424 .hdisplay = 2160,
1425 .hsync_start = 2160 + 48,
1426 .hsync_end = 2160 + 48 + 32,
1427 .htotal = 2160 + 48 + 32 + 100,
1428 .vdisplay = 1440,
1429 .vsync_start = 1440 + 3,
1430 .vsync_end = 1440 + 3 + 6,
1431 .vtotal = 1440 + 3 + 6 + 31,
1432 },
1433};
1434
1435static const struct panel_desc boe_nv110wtm_n61 = {
1436 .modes = boe_nv110wtm_n61_modes,
1437 .num_modes = ARRAY_SIZE(boe_nv110wtm_n61_modes),
1438 .bpc = 8,
1439 .size = {
1440 .width = 233,
1441 .height = 155,
1442 },
1443 .delay = {
1444 .hpd_absent_delay = 200,
1445 .prepare_to_enable = 80,
1446 .unprepare = 500,
1447 },
1448 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1449 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1450 .connector_type = DRM_MODE_CONNECTOR_eDP,
1451};
1452
Douglas Andersoncfe40d02020-05-08 15:59:02 -07001453/* Also used for boe_nv133fhm_n62 */
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001454static const struct drm_display_mode boe_nv133fhm_n61_modes = {
1455 .clock = 147840,
1456 .hdisplay = 1920,
1457 .hsync_start = 1920 + 48,
1458 .hsync_end = 1920 + 48 + 32,
1459 .htotal = 1920 + 48 + 32 + 200,
1460 .vdisplay = 1080,
1461 .vsync_start = 1080 + 3,
1462 .vsync_end = 1080 + 3 + 6,
1463 .vtotal = 1080 + 3 + 6 + 31,
Stephen Boydab6fd5d2020-11-06 10:23:33 -08001464 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001465};
1466
Douglas Andersoncfe40d02020-05-08 15:59:02 -07001467/* Also used for boe_nv133fhm_n62 */
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001468static const struct panel_desc boe_nv133fhm_n61 = {
1469 .modes = &boe_nv133fhm_n61_modes,
1470 .num_modes = 1,
Douglas Anderson9694d9c2020-05-08 15:59:00 -07001471 .bpc = 6,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001472 .size = {
Douglas Anderson9694d9c2020-05-08 15:59:00 -07001473 .width = 294,
1474 .height = 165,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001475 },
1476 .delay = {
Douglas Anderson667d73d2020-07-16 13:21:22 -07001477 /*
1478 * When power is first given to the panel there's a short
1479 * spike on the HPD line. It was explained that this spike
1480 * was until the TCON data download was complete. On
1481 * one system this was measured at 8 ms. We'll put 15 ms
1482 * in the prepare delay just to be safe and take it away
1483 * from the hpd_absent_delay (which would otherwise be 200 ms)
1484 * to handle this. That means:
1485 * - If HPD isn't hooked up you still have 200 ms delay.
1486 * - If HPD is hooked up we won't try to look at it for the
1487 * first 15 ms.
1488 */
1489 .prepare = 15,
1490 .hpd_absent_delay = 185,
1491
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001492 .unprepare = 500,
1493 },
1494 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1495 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1496 .connector_type = DRM_MODE_CONNECTOR_eDP,
1497};
1498
Tobias Schramma5119812020-01-09 12:29:52 +01001499static const struct drm_display_mode boe_nv140fhmn49_modes[] = {
1500 {
1501 .clock = 148500,
1502 .hdisplay = 1920,
1503 .hsync_start = 1920 + 48,
1504 .hsync_end = 1920 + 48 + 32,
1505 .htotal = 2200,
1506 .vdisplay = 1080,
1507 .vsync_start = 1080 + 3,
1508 .vsync_end = 1080 + 3 + 5,
1509 .vtotal = 1125,
Tobias Schramma5119812020-01-09 12:29:52 +01001510 },
1511};
1512
1513static const struct panel_desc boe_nv140fhmn49 = {
1514 .modes = boe_nv140fhmn49_modes,
1515 .num_modes = ARRAY_SIZE(boe_nv140fhmn49_modes),
1516 .bpc = 6,
1517 .size = {
1518 .width = 309,
1519 .height = 174,
1520 },
1521 .delay = {
1522 .prepare = 210,
1523 .enable = 50,
1524 .unprepare = 160,
1525 },
1526 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1527 .connector_type = DRM_MODE_CONNECTOR_eDP,
1528};
1529
Giulio Benettie58edce2018-07-31 01:11:16 +02001530static const struct drm_display_mode cdtech_s043wq26h_ct7_mode = {
1531 .clock = 9000,
1532 .hdisplay = 480,
1533 .hsync_start = 480 + 5,
1534 .hsync_end = 480 + 5 + 5,
1535 .htotal = 480 + 5 + 5 + 40,
1536 .vdisplay = 272,
1537 .vsync_start = 272 + 8,
1538 .vsync_end = 272 + 8 + 8,
1539 .vtotal = 272 + 8 + 8 + 8,
Giulio Benettie58edce2018-07-31 01:11:16 +02001540 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1541};
1542
1543static const struct panel_desc cdtech_s043wq26h_ct7 = {
1544 .modes = &cdtech_s043wq26h_ct7_mode,
1545 .num_modes = 1,
1546 .bpc = 8,
1547 .size = {
1548 .width = 95,
1549 .height = 54,
1550 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001551 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Giulio Benettie58edce2018-07-31 01:11:16 +02001552};
1553
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001554/* S070PWS19HP-FC21 2017/04/22 */
1555static const struct drm_display_mode cdtech_s070pws19hp_fc21_mode = {
1556 .clock = 51200,
1557 .hdisplay = 1024,
1558 .hsync_start = 1024 + 160,
1559 .hsync_end = 1024 + 160 + 20,
1560 .htotal = 1024 + 160 + 20 + 140,
1561 .vdisplay = 600,
1562 .vsync_start = 600 + 12,
1563 .vsync_end = 600 + 12 + 3,
1564 .vtotal = 600 + 12 + 3 + 20,
1565 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1566};
1567
1568static const struct panel_desc cdtech_s070pws19hp_fc21 = {
1569 .modes = &cdtech_s070pws19hp_fc21_mode,
1570 .num_modes = 1,
1571 .bpc = 6,
1572 .size = {
1573 .width = 154,
1574 .height = 86,
1575 },
1576 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001577 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001578 .connector_type = DRM_MODE_CONNECTOR_DPI,
1579};
1580
1581/* S070SWV29HG-DC44 2017/09/21 */
1582static const struct drm_display_mode cdtech_s070swv29hg_dc44_mode = {
1583 .clock = 33300,
1584 .hdisplay = 800,
1585 .hsync_start = 800 + 210,
1586 .hsync_end = 800 + 210 + 2,
1587 .htotal = 800 + 210 + 2 + 44,
1588 .vdisplay = 480,
1589 .vsync_start = 480 + 22,
1590 .vsync_end = 480 + 22 + 2,
1591 .vtotal = 480 + 22 + 2 + 21,
1592 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1593};
1594
1595static const struct panel_desc cdtech_s070swv29hg_dc44 = {
1596 .modes = &cdtech_s070swv29hg_dc44_mode,
1597 .num_modes = 1,
1598 .bpc = 6,
1599 .size = {
1600 .width = 154,
1601 .height = 86,
1602 },
1603 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001604 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001605 .connector_type = DRM_MODE_CONNECTOR_DPI,
1606};
1607
Giulio Benetti982f9442018-07-31 01:11:14 +02001608static const struct drm_display_mode cdtech_s070wv95_ct16_mode = {
1609 .clock = 35000,
1610 .hdisplay = 800,
1611 .hsync_start = 800 + 40,
1612 .hsync_end = 800 + 40 + 40,
1613 .htotal = 800 + 40 + 40 + 48,
1614 .vdisplay = 480,
1615 .vsync_start = 480 + 29,
1616 .vsync_end = 480 + 29 + 13,
1617 .vtotal = 480 + 29 + 13 + 3,
Giulio Benetti982f9442018-07-31 01:11:14 +02001618 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1619};
1620
1621static const struct panel_desc cdtech_s070wv95_ct16 = {
1622 .modes = &cdtech_s070wv95_ct16_mode,
1623 .num_modes = 1,
1624 .bpc = 8,
1625 .size = {
1626 .width = 154,
1627 .height = 85,
1628 },
1629};
1630
Marek Vasut07c913c2020-07-28 22:12:42 +02001631static const struct display_timing chefree_ch101olhlwh_002_timing = {
1632 .pixelclock = { 68900000, 71100000, 73400000 },
1633 .hactive = { 1280, 1280, 1280 },
1634 .hfront_porch = { 65, 80, 95 },
1635 .hback_porch = { 64, 79, 94 },
1636 .hsync_len = { 1, 1, 1 },
1637 .vactive = { 800, 800, 800 },
1638 .vfront_porch = { 7, 11, 14 },
1639 .vback_porch = { 7, 11, 14 },
1640 .vsync_len = { 1, 1, 1 },
1641 .flags = DISPLAY_FLAGS_DE_HIGH,
1642};
1643
1644static const struct panel_desc chefree_ch101olhlwh_002 = {
1645 .timings = &chefree_ch101olhlwh_002_timing,
1646 .num_timings = 1,
1647 .bpc = 8,
1648 .size = {
1649 .width = 217,
1650 .height = 135,
1651 },
1652 .delay = {
1653 .enable = 200,
1654 .disable = 200,
1655 },
1656 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1657 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1658 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1659};
1660
Randy Li2cb35c82016-09-20 03:02:51 +08001661static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
1662 .clock = 66770,
1663 .hdisplay = 800,
1664 .hsync_start = 800 + 49,
1665 .hsync_end = 800 + 49 + 33,
1666 .htotal = 800 + 49 + 33 + 17,
1667 .vdisplay = 1280,
1668 .vsync_start = 1280 + 1,
1669 .vsync_end = 1280 + 1 + 7,
1670 .vtotal = 1280 + 1 + 7 + 15,
Randy Li2cb35c82016-09-20 03:02:51 +08001671 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1672};
1673
1674static const struct panel_desc chunghwa_claa070wp03xg = {
1675 .modes = &chunghwa_claa070wp03xg_mode,
1676 .num_modes = 1,
1677 .bpc = 6,
1678 .size = {
1679 .width = 94,
1680 .height = 150,
1681 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001682 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001683 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001684 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Randy Li2cb35c82016-09-20 03:02:51 +08001685};
1686
Stephen Warren4c930752014-01-07 16:46:26 -07001687static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
1688 .clock = 72070,
1689 .hdisplay = 1366,
1690 .hsync_start = 1366 + 58,
1691 .hsync_end = 1366 + 58 + 58,
1692 .htotal = 1366 + 58 + 58 + 58,
1693 .vdisplay = 768,
1694 .vsync_start = 768 + 4,
1695 .vsync_end = 768 + 4 + 4,
1696 .vtotal = 768 + 4 + 4 + 4,
Stephen Warren4c930752014-01-07 16:46:26 -07001697};
1698
1699static const struct panel_desc chunghwa_claa101wa01a = {
1700 .modes = &chunghwa_claa101wa01a_mode,
1701 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001702 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -07001703 .size = {
1704 .width = 220,
1705 .height = 120,
1706 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001707 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001708 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001709 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Stephen Warren4c930752014-01-07 16:46:26 -07001710};
1711
Thierry Reding280921d2013-08-30 15:10:14 +02001712static const struct drm_display_mode chunghwa_claa101wb01_mode = {
1713 .clock = 69300,
1714 .hdisplay = 1366,
1715 .hsync_start = 1366 + 48,
1716 .hsync_end = 1366 + 48 + 32,
1717 .htotal = 1366 + 48 + 32 + 20,
1718 .vdisplay = 768,
1719 .vsync_start = 768 + 16,
1720 .vsync_end = 768 + 16 + 8,
1721 .vtotal = 768 + 16 + 8 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02001722};
1723
1724static const struct panel_desc chunghwa_claa101wb01 = {
1725 .modes = &chunghwa_claa101wb01_mode,
1726 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001727 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +02001728 .size = {
1729 .width = 223,
1730 .height = 125,
1731 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001732 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001733 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001734 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +02001735};
1736
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001737static const struct drm_display_mode dataimage_scf0700c48ggu18_mode = {
1738 .clock = 33260,
1739 .hdisplay = 800,
1740 .hsync_start = 800 + 40,
1741 .hsync_end = 800 + 40 + 128,
1742 .htotal = 800 + 40 + 128 + 88,
1743 .vdisplay = 480,
1744 .vsync_start = 480 + 10,
1745 .vsync_end = 480 + 10 + 2,
1746 .vtotal = 480 + 10 + 2 + 33,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001747 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1748};
1749
1750static const struct panel_desc dataimage_scf0700c48ggu18 = {
1751 .modes = &dataimage_scf0700c48ggu18_mode,
1752 .num_modes = 1,
1753 .bpc = 8,
1754 .size = {
1755 .width = 152,
1756 .height = 91,
1757 },
1758 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001759 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001760};
1761
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001762static const struct display_timing dlc_dlc0700yzg_1_timing = {
1763 .pixelclock = { 45000000, 51200000, 57000000 },
1764 .hactive = { 1024, 1024, 1024 },
1765 .hfront_porch = { 100, 106, 113 },
1766 .hback_porch = { 100, 106, 113 },
1767 .hsync_len = { 100, 108, 114 },
1768 .vactive = { 600, 600, 600 },
1769 .vfront_porch = { 8, 11, 15 },
1770 .vback_porch = { 8, 11, 15 },
1771 .vsync_len = { 9, 13, 15 },
1772 .flags = DISPLAY_FLAGS_DE_HIGH,
1773};
1774
1775static const struct panel_desc dlc_dlc0700yzg_1 = {
1776 .timings = &dlc_dlc0700yzg_1_timing,
1777 .num_timings = 1,
1778 .bpc = 6,
1779 .size = {
1780 .width = 154,
1781 .height = 86,
1782 },
1783 .delay = {
1784 .prepare = 30,
1785 .enable = 200,
1786 .disable = 200,
1787 },
1788 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001789 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001790};
1791
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001792static const struct display_timing dlc_dlc1010gig_timing = {
1793 .pixelclock = { 68900000, 71100000, 73400000 },
1794 .hactive = { 1280, 1280, 1280 },
1795 .hfront_porch = { 43, 53, 63 },
1796 .hback_porch = { 43, 53, 63 },
1797 .hsync_len = { 44, 54, 64 },
1798 .vactive = { 800, 800, 800 },
1799 .vfront_porch = { 5, 8, 11 },
1800 .vback_porch = { 5, 8, 11 },
1801 .vsync_len = { 5, 7, 11 },
1802 .flags = DISPLAY_FLAGS_DE_HIGH,
1803};
1804
1805static const struct panel_desc dlc_dlc1010gig = {
1806 .timings = &dlc_dlc1010gig_timing,
1807 .num_timings = 1,
1808 .bpc = 8,
1809 .size = {
1810 .width = 216,
1811 .height = 135,
1812 },
1813 .delay = {
1814 .prepare = 60,
1815 .enable = 150,
1816 .disable = 100,
1817 .unprepare = 60,
1818 },
1819 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001820 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001821};
1822
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001823static const struct drm_display_mode edt_et035012dm6_mode = {
1824 .clock = 6500,
1825 .hdisplay = 320,
1826 .hsync_start = 320 + 20,
1827 .hsync_end = 320 + 20 + 30,
1828 .htotal = 320 + 20 + 68,
1829 .vdisplay = 240,
1830 .vsync_start = 240 + 4,
1831 .vsync_end = 240 + 4 + 4,
1832 .vtotal = 240 + 4 + 4 + 14,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001833 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1834};
1835
1836static const struct panel_desc edt_et035012dm6 = {
1837 .modes = &edt_et035012dm6_mode,
1838 .num_modes = 1,
1839 .bpc = 8,
1840 .size = {
1841 .width = 70,
1842 .height = 52,
1843 },
1844 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001845 .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001846};
1847
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00001848static const struct drm_display_mode edt_etm043080dh6gp_mode = {
1849 .clock = 10870,
1850 .hdisplay = 480,
1851 .hsync_start = 480 + 8,
1852 .hsync_end = 480 + 8 + 4,
1853 .htotal = 480 + 8 + 4 + 41,
1854
1855 /*
1856 * IWG22M: Y resolution changed for "dc_linuxfb" module crashing while
1857 * fb_align
1858 */
1859
1860 .vdisplay = 288,
1861 .vsync_start = 288 + 2,
1862 .vsync_end = 288 + 2 + 4,
1863 .vtotal = 288 + 2 + 4 + 10,
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00001864};
1865
1866static const struct panel_desc edt_etm043080dh6gp = {
1867 .modes = &edt_etm043080dh6gp_mode,
1868 .num_modes = 1,
1869 .bpc = 8,
1870 .size = {
1871 .width = 100,
1872 .height = 65,
1873 },
1874 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1875 .connector_type = DRM_MODE_CONNECTOR_DPI,
1876};
1877
Marek Vasutfd819bf2019-02-19 15:04:38 +01001878static const struct drm_display_mode edt_etm0430g0dh6_mode = {
1879 .clock = 9000,
1880 .hdisplay = 480,
1881 .hsync_start = 480 + 2,
1882 .hsync_end = 480 + 2 + 41,
1883 .htotal = 480 + 2 + 41 + 2,
1884 .vdisplay = 272,
1885 .vsync_start = 272 + 2,
1886 .vsync_end = 272 + 2 + 10,
1887 .vtotal = 272 + 2 + 10 + 2,
Marek Vasutfd819bf2019-02-19 15:04:38 +01001888 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1889};
1890
1891static const struct panel_desc edt_etm0430g0dh6 = {
1892 .modes = &edt_etm0430g0dh6_mode,
1893 .num_modes = 1,
1894 .bpc = 6,
1895 .size = {
1896 .width = 95,
1897 .height = 54,
1898 },
1899};
1900
Stefan Agner26ab0062014-05-15 11:38:45 +02001901static const struct drm_display_mode edt_et057090dhu_mode = {
1902 .clock = 25175,
1903 .hdisplay = 640,
1904 .hsync_start = 640 + 16,
1905 .hsync_end = 640 + 16 + 30,
1906 .htotal = 640 + 16 + 30 + 114,
1907 .vdisplay = 480,
1908 .vsync_start = 480 + 10,
1909 .vsync_end = 480 + 10 + 3,
1910 .vtotal = 480 + 10 + 3 + 32,
Stefan Agner26ab0062014-05-15 11:38:45 +02001911 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1912};
1913
1914static const struct panel_desc edt_et057090dhu = {
1915 .modes = &edt_et057090dhu_mode,
1916 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001917 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +02001918 .size = {
1919 .width = 115,
1920 .height = 86,
1921 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08001922 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001923 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Dmitry Osipenko75e73222020-06-22 01:27:41 +03001924 .connector_type = DRM_MODE_CONNECTOR_DPI,
Stefan Agner26ab0062014-05-15 11:38:45 +02001925};
1926
Philipp Zabelfff5de42014-05-15 12:25:47 +02001927static const struct drm_display_mode edt_etm0700g0dh6_mode = {
1928 .clock = 33260,
1929 .hdisplay = 800,
1930 .hsync_start = 800 + 40,
1931 .hsync_end = 800 + 40 + 128,
1932 .htotal = 800 + 40 + 128 + 88,
1933 .vdisplay = 480,
1934 .vsync_start = 480 + 10,
1935 .vsync_end = 480 + 10 + 2,
1936 .vtotal = 480 + 10 + 2 + 33,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001937 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1938};
1939
1940static const struct panel_desc edt_etm0700g0dh6 = {
1941 .modes = &edt_etm0700g0dh6_mode,
1942 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001943 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001944 .size = {
1945 .width = 152,
1946 .height = 91,
1947 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08001948 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001949 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Biju Das281edb92020-10-20 10:49:10 +01001950 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001951};
1952
Jan Tuerkaa7e6452018-06-19 11:55:44 +02001953static const struct panel_desc edt_etm0700g0bdh6 = {
1954 .modes = &edt_etm0700g0dh6_mode,
1955 .num_modes = 1,
1956 .bpc = 6,
1957 .size = {
1958 .width = 152,
1959 .height = 91,
1960 },
1961 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001962 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Jan Tuerkaa7e6452018-06-19 11:55:44 +02001963};
1964
Marco Felsch9158e3c2019-04-16 12:06:45 +02001965static const struct display_timing evervision_vgg804821_timing = {
1966 .pixelclock = { 27600000, 33300000, 50000000 },
1967 .hactive = { 800, 800, 800 },
1968 .hfront_porch = { 40, 66, 70 },
1969 .hback_porch = { 40, 67, 70 },
1970 .hsync_len = { 40, 67, 70 },
1971 .vactive = { 480, 480, 480 },
1972 .vfront_porch = { 6, 10, 10 },
1973 .vback_porch = { 7, 11, 11 },
1974 .vsync_len = { 7, 11, 11 },
1975 .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH |
1976 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
1977 DISPLAY_FLAGS_SYNC_NEGEDGE,
1978};
1979
1980static const struct panel_desc evervision_vgg804821 = {
1981 .timings = &evervision_vgg804821_timing,
1982 .num_timings = 1,
1983 .bpc = 8,
1984 .size = {
1985 .width = 108,
1986 .height = 64,
1987 },
1988 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001989 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Marco Felsch9158e3c2019-04-16 12:06:45 +02001990};
1991
Boris BREZILLON102932b2014-06-05 15:53:32 +02001992static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
1993 .clock = 32260,
1994 .hdisplay = 800,
1995 .hsync_start = 800 + 168,
1996 .hsync_end = 800 + 168 + 64,
1997 .htotal = 800 + 168 + 64 + 88,
1998 .vdisplay = 480,
1999 .vsync_start = 480 + 37,
2000 .vsync_end = 480 + 37 + 2,
2001 .vtotal = 480 + 37 + 2 + 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02002002};
2003
2004static const struct panel_desc foxlink_fl500wvr00_a0t = {
2005 .modes = &foxlink_fl500wvr00_a0t_mode,
2006 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002007 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02002008 .size = {
2009 .width = 108,
2010 .height = 65,
2011 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +02002012 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +02002013};
2014
Paul Cercueil795db2a2020-07-16 14:56:47 +02002015static const struct drm_display_mode frida_frd350h54004_modes[] = {
2016 { /* 60 Hz */
2017 .clock = 6000,
2018 .hdisplay = 320,
2019 .hsync_start = 320 + 44,
2020 .hsync_end = 320 + 44 + 16,
2021 .htotal = 320 + 44 + 16 + 20,
2022 .vdisplay = 240,
2023 .vsync_start = 240 + 2,
2024 .vsync_end = 240 + 2 + 6,
2025 .vtotal = 240 + 2 + 6 + 2,
2026 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2027 },
2028 { /* 50 Hz */
2029 .clock = 5400,
2030 .hdisplay = 320,
2031 .hsync_start = 320 + 56,
2032 .hsync_end = 320 + 56 + 16,
2033 .htotal = 320 + 56 + 16 + 40,
2034 .vdisplay = 240,
2035 .vsync_start = 240 + 2,
2036 .vsync_end = 240 + 2 + 6,
2037 .vtotal = 240 + 2 + 6 + 2,
2038 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2039 },
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002040};
2041
2042static const struct panel_desc frida_frd350h54004 = {
Paul Cercueil795db2a2020-07-16 14:56:47 +02002043 .modes = frida_frd350h54004_modes,
2044 .num_modes = ARRAY_SIZE(frida_frd350h54004_modes),
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002045 .bpc = 8,
2046 .size = {
2047 .width = 77,
2048 .height = 64,
2049 },
2050 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002051 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002052 .connector_type = DRM_MODE_CONNECTOR_DPI,
2053};
2054
Jagan Teki3be20712019-05-07 18:37:07 +05302055static const struct drm_display_mode friendlyarm_hd702e_mode = {
2056 .clock = 67185,
2057 .hdisplay = 800,
2058 .hsync_start = 800 + 20,
2059 .hsync_end = 800 + 20 + 24,
2060 .htotal = 800 + 20 + 24 + 20,
2061 .vdisplay = 1280,
2062 .vsync_start = 1280 + 4,
2063 .vsync_end = 1280 + 4 + 8,
2064 .vtotal = 1280 + 4 + 8 + 4,
Jagan Teki3be20712019-05-07 18:37:07 +05302065 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2066};
2067
2068static const struct panel_desc friendlyarm_hd702e = {
2069 .modes = &friendlyarm_hd702e_mode,
2070 .num_modes = 1,
2071 .size = {
2072 .width = 94,
2073 .height = 151,
2074 },
2075};
2076
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002077static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
2078 .clock = 9000,
2079 .hdisplay = 480,
2080 .hsync_start = 480 + 5,
2081 .hsync_end = 480 + 5 + 1,
2082 .htotal = 480 + 5 + 1 + 40,
2083 .vdisplay = 272,
2084 .vsync_start = 272 + 8,
2085 .vsync_end = 272 + 8 + 1,
2086 .vtotal = 272 + 8 + 1 + 8,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002087};
2088
2089static const struct panel_desc giantplus_gpg482739qs5 = {
2090 .modes = &giantplus_gpg482739qs5_mode,
2091 .num_modes = 1,
2092 .bpc = 8,
2093 .size = {
2094 .width = 95,
2095 .height = 54,
2096 },
Philipp Zabel33536a02015-02-11 18:50:07 +01002097 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002098};
2099
Paul Cercueil2c6574a2019-06-06 00:22:47 +02002100static const struct display_timing giantplus_gpm940b0_timing = {
2101 .pixelclock = { 13500000, 27000000, 27500000 },
2102 .hactive = { 320, 320, 320 },
2103 .hfront_porch = { 14, 686, 718 },
2104 .hback_porch = { 50, 70, 255 },
2105 .hsync_len = { 1, 1, 1 },
2106 .vactive = { 240, 240, 240 },
2107 .vfront_porch = { 1, 1, 179 },
2108 .vback_porch = { 1, 21, 31 },
2109 .vsync_len = { 1, 1, 6 },
2110 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
2111};
2112
2113static const struct panel_desc giantplus_gpm940b0 = {
2114 .timings = &giantplus_gpm940b0_timing,
2115 .num_timings = 1,
2116 .bpc = 8,
2117 .size = {
2118 .width = 60,
2119 .height = 45,
2120 },
2121 .bus_format = MEDIA_BUS_FMT_RGB888_3X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002122 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Paul Cercueil2c6574a2019-06-06 00:22:47 +02002123};
2124
Philipp Zabelab077252014-12-11 18:32:46 +01002125static const struct display_timing hannstar_hsd070pww1_timing = {
2126 .pixelclock = { 64300000, 71100000, 82000000 },
2127 .hactive = { 1280, 1280, 1280 },
2128 .hfront_porch = { 1, 1, 10 },
2129 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +02002130 /*
2131 * According to the data sheet, the minimum horizontal blanking interval
2132 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
2133 * minimum working horizontal blanking interval to be 60 clocks.
2134 */
2135 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +01002136 .vactive = { 800, 800, 800 },
2137 .vfront_porch = { 1, 1, 10 },
2138 .vback_porch = { 1, 1, 10 },
2139 .vsync_len = { 1, 21, 203 },
2140 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +02002141};
2142
2143static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +01002144 .timings = &hannstar_hsd070pww1_timing,
2145 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +02002146 .bpc = 6,
2147 .size = {
2148 .width = 151,
2149 .height = 94,
2150 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +02002151 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002152 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabela8532052014-10-23 16:31:06 +02002153};
2154
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002155static const struct display_timing hannstar_hsd100pxn1_timing = {
2156 .pixelclock = { 55000000, 65000000, 75000000 },
2157 .hactive = { 1024, 1024, 1024 },
2158 .hfront_porch = { 40, 40, 40 },
2159 .hback_porch = { 220, 220, 220 },
2160 .hsync_len = { 20, 60, 100 },
2161 .vactive = { 768, 768, 768 },
2162 .vfront_porch = { 7, 7, 7 },
2163 .vback_porch = { 21, 21, 21 },
2164 .vsync_len = { 10, 10, 10 },
2165 .flags = DISPLAY_FLAGS_DE_HIGH,
2166};
2167
2168static const struct panel_desc hannstar_hsd100pxn1 = {
2169 .timings = &hannstar_hsd100pxn1_timing,
2170 .num_timings = 1,
2171 .bpc = 6,
2172 .size = {
2173 .width = 203,
2174 .height = 152,
2175 },
Philipp Zabel4946b042015-05-20 11:34:08 +02002176 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002177 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002178};
2179
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002180static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
2181 .clock = 33333,
2182 .hdisplay = 800,
2183 .hsync_start = 800 + 85,
2184 .hsync_end = 800 + 85 + 86,
2185 .htotal = 800 + 85 + 86 + 85,
2186 .vdisplay = 480,
2187 .vsync_start = 480 + 16,
2188 .vsync_end = 480 + 16 + 13,
2189 .vtotal = 480 + 16 + 13 + 16,
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002190};
2191
2192static const struct panel_desc hitachi_tx23d38vm0caa = {
2193 .modes = &hitachi_tx23d38vm0caa_mode,
2194 .num_modes = 1,
2195 .bpc = 6,
2196 .size = {
2197 .width = 195,
2198 .height = 117,
2199 },
Philipp Zabel6c684e32017-10-11 14:59:58 +02002200 .delay = {
2201 .enable = 160,
2202 .disable = 160,
2203 },
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002204};
2205
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002206static const struct drm_display_mode innolux_at043tn24_mode = {
2207 .clock = 9000,
2208 .hdisplay = 480,
2209 .hsync_start = 480 + 2,
2210 .hsync_end = 480 + 2 + 41,
2211 .htotal = 480 + 2 + 41 + 2,
2212 .vdisplay = 272,
2213 .vsync_start = 272 + 2,
Philipp Zabela4831592017-10-11 14:59:56 +02002214 .vsync_end = 272 + 2 + 10,
2215 .vtotal = 272 + 2 + 10 + 2,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002216 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2217};
2218
2219static const struct panel_desc innolux_at043tn24 = {
2220 .modes = &innolux_at043tn24_mode,
2221 .num_modes = 1,
2222 .bpc = 8,
2223 .size = {
2224 .width = 95,
2225 .height = 54,
2226 },
2227 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002228 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002229};
2230
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002231static const struct drm_display_mode innolux_at070tn92_mode = {
2232 .clock = 33333,
2233 .hdisplay = 800,
2234 .hsync_start = 800 + 210,
2235 .hsync_end = 800 + 210 + 20,
2236 .htotal = 800 + 210 + 20 + 46,
2237 .vdisplay = 480,
2238 .vsync_start = 480 + 22,
2239 .vsync_end = 480 + 22 + 10,
2240 .vtotal = 480 + 22 + 23 + 10,
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002241};
2242
2243static const struct panel_desc innolux_at070tn92 = {
2244 .modes = &innolux_at070tn92_mode,
2245 .num_modes = 1,
2246 .size = {
2247 .width = 154,
2248 .height = 86,
2249 },
2250 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2251};
2252
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002253static const struct display_timing innolux_g070y2_l01_timing = {
2254 .pixelclock = { 28000000, 29500000, 32000000 },
2255 .hactive = { 800, 800, 800 },
2256 .hfront_porch = { 61, 91, 141 },
2257 .hback_porch = { 60, 90, 140 },
2258 .hsync_len = { 12, 12, 12 },
2259 .vactive = { 480, 480, 480 },
2260 .vfront_porch = { 4, 9, 30 },
2261 .vback_porch = { 4, 8, 28 },
2262 .vsync_len = { 2, 2, 2 },
2263 .flags = DISPLAY_FLAGS_DE_HIGH,
2264};
2265
2266static const struct panel_desc innolux_g070y2_l01 = {
2267 .timings = &innolux_g070y2_l01_timing,
2268 .num_timings = 1,
2269 .bpc = 6,
2270 .size = {
2271 .width = 152,
2272 .height = 91,
2273 },
2274 .delay = {
2275 .prepare = 10,
2276 .enable = 100,
2277 .disable = 100,
2278 .unprepare = 800,
2279 },
2280 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002281 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002282};
2283
Michael Olbrich1e29b842016-08-15 14:32:02 +02002284static const struct display_timing innolux_g101ice_l01_timing = {
2285 .pixelclock = { 60400000, 71100000, 74700000 },
2286 .hactive = { 1280, 1280, 1280 },
2287 .hfront_porch = { 41, 80, 100 },
2288 .hback_porch = { 40, 79, 99 },
2289 .hsync_len = { 1, 1, 1 },
2290 .vactive = { 800, 800, 800 },
2291 .vfront_porch = { 5, 11, 14 },
2292 .vback_porch = { 4, 11, 14 },
2293 .vsync_len = { 1, 1, 1 },
2294 .flags = DISPLAY_FLAGS_DE_HIGH,
2295};
2296
2297static const struct panel_desc innolux_g101ice_l01 = {
2298 .timings = &innolux_g101ice_l01_timing,
2299 .num_timings = 1,
2300 .bpc = 8,
2301 .size = {
2302 .width = 217,
2303 .height = 135,
2304 },
2305 .delay = {
2306 .enable = 200,
2307 .disable = 200,
2308 },
2309 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002310 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Michael Olbrich1e29b842016-08-15 14:32:02 +02002311};
2312
Lucas Stach4ae13e42016-11-30 14:09:54 +01002313static const struct display_timing innolux_g121i1_l01_timing = {
2314 .pixelclock = { 67450000, 71000000, 74550000 },
2315 .hactive = { 1280, 1280, 1280 },
2316 .hfront_porch = { 40, 80, 160 },
2317 .hback_porch = { 39, 79, 159 },
2318 .hsync_len = { 1, 1, 1 },
2319 .vactive = { 800, 800, 800 },
2320 .vfront_porch = { 5, 11, 100 },
2321 .vback_porch = { 4, 11, 99 },
2322 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01002323};
2324
2325static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01002326 .timings = &innolux_g121i1_l01_timing,
2327 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01002328 .bpc = 6,
2329 .size = {
2330 .width = 261,
2331 .height = 163,
2332 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01002333 .delay = {
2334 .enable = 200,
2335 .disable = 20,
2336 },
2337 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002338 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stachd731f662014-11-06 17:44:33 +01002339};
2340
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002341static const struct drm_display_mode innolux_g121x1_l03_mode = {
2342 .clock = 65000,
2343 .hdisplay = 1024,
2344 .hsync_start = 1024 + 0,
2345 .hsync_end = 1024 + 1,
2346 .htotal = 1024 + 0 + 1 + 320,
2347 .vdisplay = 768,
2348 .vsync_start = 768 + 38,
2349 .vsync_end = 768 + 38 + 1,
2350 .vtotal = 768 + 38 + 1 + 0,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05002351 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002352};
2353
2354static const struct panel_desc innolux_g121x1_l03 = {
2355 .modes = &innolux_g121x1_l03_mode,
2356 .num_modes = 1,
2357 .bpc = 6,
2358 .size = {
2359 .width = 246,
2360 .height = 185,
2361 },
2362 .delay = {
2363 .enable = 200,
2364 .unprepare = 200,
2365 .disable = 400,
2366 },
2367};
2368
Douglas Andersond719cbe2019-07-11 13:34:54 -07002369/*
2370 * Datasheet specifies that at 60 Hz refresh rate:
2371 * - total horizontal time: { 1506, 1592, 1716 }
2372 * - total vertical time: { 788, 800, 868 }
2373 *
2374 * ...but doesn't go into exactly how that should be split into a front
2375 * porch, back porch, or sync length. For now we'll leave a single setting
2376 * here which allows a bit of tweaking of the pixel clock at the expense of
2377 * refresh rate.
2378 */
2379static const struct display_timing innolux_n116bge_timing = {
2380 .pixelclock = { 72600000, 76420000, 80240000 },
2381 .hactive = { 1366, 1366, 1366 },
2382 .hfront_porch = { 136, 136, 136 },
2383 .hback_porch = { 60, 60, 60 },
2384 .hsync_len = { 30, 30, 30 },
2385 .vactive = { 768, 768, 768 },
2386 .vfront_porch = { 8, 8, 8 },
2387 .vback_porch = { 12, 12, 12 },
2388 .vsync_len = { 12, 12, 12 },
2389 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002390};
2391
2392static const struct panel_desc innolux_n116bge = {
Douglas Andersond719cbe2019-07-11 13:34:54 -07002393 .timings = &innolux_n116bge_timing,
2394 .num_timings = 1,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002395 .bpc = 6,
2396 .size = {
2397 .width = 256,
2398 .height = 144,
2399 },
2400};
2401
Lukas F. Hartmanna14c6b02020-11-24 18:26:04 +01002402static const struct drm_display_mode innolux_n125hce_gn1_mode = {
2403 .clock = 162000,
2404 .hdisplay = 1920,
2405 .hsync_start = 1920 + 40,
2406 .hsync_end = 1920 + 40 + 40,
2407 .htotal = 1920 + 40 + 40 + 80,
2408 .vdisplay = 1080,
2409 .vsync_start = 1080 + 4,
2410 .vsync_end = 1080 + 4 + 4,
2411 .vtotal = 1080 + 4 + 4 + 24,
2412};
2413
2414static const struct panel_desc innolux_n125hce_gn1 = {
2415 .modes = &innolux_n125hce_gn1_mode,
2416 .num_modes = 1,
2417 .bpc = 8,
2418 .size = {
2419 .width = 276,
2420 .height = 155,
2421 },
2422 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2423 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
2424 .connector_type = DRM_MODE_CONNECTOR_eDP,
2425};
2426
Alban Bedelea447392014-07-22 08:38:55 +02002427static const struct drm_display_mode innolux_n156bge_l21_mode = {
2428 .clock = 69300,
2429 .hdisplay = 1366,
2430 .hsync_start = 1366 + 16,
2431 .hsync_end = 1366 + 16 + 34,
2432 .htotal = 1366 + 16 + 34 + 50,
2433 .vdisplay = 768,
2434 .vsync_start = 768 + 2,
2435 .vsync_end = 768 + 2 + 6,
2436 .vtotal = 768 + 2 + 6 + 12,
Alban Bedelea447392014-07-22 08:38:55 +02002437};
2438
2439static const struct panel_desc innolux_n156bge_l21 = {
2440 .modes = &innolux_n156bge_l21_mode,
2441 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002442 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02002443 .size = {
2444 .width = 344,
2445 .height = 193,
2446 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03002447 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002448 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03002449 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alban Bedelea447392014-07-22 08:38:55 +02002450};
2451
Douglas Anderson8f054b62018-10-25 15:21:34 -07002452static const struct drm_display_mode innolux_p120zdg_bf1_mode = {
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302453 .clock = 206016,
2454 .hdisplay = 2160,
2455 .hsync_start = 2160 + 48,
2456 .hsync_end = 2160 + 48 + 32,
2457 .htotal = 2160 + 48 + 32 + 80,
2458 .vdisplay = 1440,
2459 .vsync_start = 1440 + 3,
2460 .vsync_end = 1440 + 3 + 10,
2461 .vtotal = 1440 + 3 + 10 + 27,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302462 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2463};
2464
Douglas Anderson8f054b62018-10-25 15:21:34 -07002465static const struct panel_desc innolux_p120zdg_bf1 = {
2466 .modes = &innolux_p120zdg_bf1_mode,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302467 .num_modes = 1,
2468 .bpc = 8,
2469 .size = {
Douglas Anderson8f054b62018-10-25 15:21:34 -07002470 .width = 254,
2471 .height = 169,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302472 },
Sean Paul22fd99e2018-08-13 17:30:40 -04002473 .delay = {
Douglas Anderson625d3b52018-10-25 15:21:31 -07002474 .hpd_absent_delay = 200,
Sean Paul22fd99e2018-08-13 17:30:40 -04002475 .unprepare = 500,
2476 },
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302477};
2478
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002479static const struct drm_display_mode innolux_zj070na_01p_mode = {
2480 .clock = 51501,
2481 .hdisplay = 1024,
2482 .hsync_start = 1024 + 128,
2483 .hsync_end = 1024 + 128 + 64,
2484 .htotal = 1024 + 128 + 64 + 128,
2485 .vdisplay = 600,
2486 .vsync_start = 600 + 16,
2487 .vsync_end = 600 + 16 + 4,
2488 .vtotal = 600 + 16 + 4 + 16,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002489};
2490
2491static const struct panel_desc innolux_zj070na_01p = {
2492 .modes = &innolux_zj070na_01p_mode,
2493 .num_modes = 1,
2494 .bpc = 6,
2495 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02002496 .width = 154,
2497 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002498 },
2499};
2500
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07002501static const struct drm_display_mode ivo_m133nwf4_r0_mode = {
2502 .clock = 138778,
2503 .hdisplay = 1920,
2504 .hsync_start = 1920 + 24,
2505 .hsync_end = 1920 + 24 + 48,
2506 .htotal = 1920 + 24 + 48 + 88,
2507 .vdisplay = 1080,
2508 .vsync_start = 1080 + 3,
2509 .vsync_end = 1080 + 3 + 12,
2510 .vtotal = 1080 + 3 + 12 + 17,
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07002511 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2512};
2513
2514static const struct panel_desc ivo_m133nwf4_r0 = {
2515 .modes = &ivo_m133nwf4_r0_mode,
2516 .num_modes = 1,
2517 .bpc = 8,
2518 .size = {
2519 .width = 294,
2520 .height = 165,
2521 },
2522 .delay = {
2523 .hpd_absent_delay = 200,
2524 .unprepare = 500,
2525 },
2526 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2527 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
2528 .connector_type = DRM_MODE_CONNECTOR_eDP,
2529};
2530
Douglas Andersonfc26a372020-08-21 08:35:15 -07002531static const struct drm_display_mode kingdisplay_kd116n21_30nv_a010_mode = {
2532 .clock = 81000,
2533 .hdisplay = 1366,
2534 .hsync_start = 1366 + 40,
2535 .hsync_end = 1366 + 40 + 32,
2536 .htotal = 1366 + 40 + 32 + 62,
2537 .vdisplay = 768,
2538 .vsync_start = 768 + 5,
2539 .vsync_end = 768 + 5 + 5,
2540 .vtotal = 768 + 5 + 5 + 122,
2541 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2542};
2543
2544static const struct panel_desc kingdisplay_kd116n21_30nv_a010 = {
2545 .modes = &kingdisplay_kd116n21_30nv_a010_mode,
2546 .num_modes = 1,
2547 .bpc = 6,
2548 .size = {
2549 .width = 256,
2550 .height = 144,
2551 },
2552 .delay = {
2553 .hpd_absent_delay = 200,
2554 },
2555 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2556 .connector_type = DRM_MODE_CONNECTOR_eDP,
2557};
2558
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02002559static const struct display_timing koe_tx14d24vm1bpa_timing = {
2560 .pixelclock = { 5580000, 5850000, 6200000 },
2561 .hactive = { 320, 320, 320 },
2562 .hfront_porch = { 30, 30, 30 },
2563 .hback_porch = { 30, 30, 30 },
2564 .hsync_len = { 1, 5, 17 },
2565 .vactive = { 240, 240, 240 },
2566 .vfront_porch = { 6, 6, 6 },
2567 .vback_porch = { 5, 5, 5 },
2568 .vsync_len = { 1, 2, 11 },
2569 .flags = DISPLAY_FLAGS_DE_HIGH,
2570};
2571
2572static const struct panel_desc koe_tx14d24vm1bpa = {
2573 .timings = &koe_tx14d24vm1bpa_timing,
2574 .num_timings = 1,
2575 .bpc = 6,
2576 .size = {
2577 .width = 115,
2578 .height = 86,
2579 },
2580};
2581
Liu Ying8a070522020-06-01 14:11:20 +08002582static const struct display_timing koe_tx26d202vm0bwa_timing = {
2583 .pixelclock = { 151820000, 156720000, 159780000 },
2584 .hactive = { 1920, 1920, 1920 },
2585 .hfront_porch = { 105, 130, 142 },
2586 .hback_porch = { 45, 70, 82 },
2587 .hsync_len = { 30, 30, 30 },
2588 .vactive = { 1200, 1200, 1200},
2589 .vfront_porch = { 3, 5, 10 },
2590 .vback_porch = { 2, 5, 10 },
2591 .vsync_len = { 5, 5, 5 },
2592};
2593
2594static const struct panel_desc koe_tx26d202vm0bwa = {
2595 .timings = &koe_tx26d202vm0bwa_timing,
2596 .num_timings = 1,
2597 .bpc = 8,
2598 .size = {
2599 .width = 217,
2600 .height = 136,
2601 },
2602 .delay = {
2603 .prepare = 1000,
2604 .enable = 1000,
2605 .unprepare = 1000,
2606 .disable = 1000,
2607 },
2608 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002609 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Liu Ying8a070522020-06-01 14:11:20 +08002610 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2611};
2612
Jagan Teki8cfe8342018-02-04 23:19:28 +05302613static const struct display_timing koe_tx31d200vm0baa_timing = {
2614 .pixelclock = { 39600000, 43200000, 48000000 },
2615 .hactive = { 1280, 1280, 1280 },
2616 .hfront_porch = { 16, 36, 56 },
2617 .hback_porch = { 16, 36, 56 },
2618 .hsync_len = { 8, 8, 8 },
2619 .vactive = { 480, 480, 480 },
Stefan Agnerc9b6be72018-04-19 23:20:03 +02002620 .vfront_porch = { 6, 21, 33 },
2621 .vback_porch = { 6, 21, 33 },
Jagan Teki8cfe8342018-02-04 23:19:28 +05302622 .vsync_len = { 8, 8, 8 },
2623 .flags = DISPLAY_FLAGS_DE_HIGH,
2624};
2625
2626static const struct panel_desc koe_tx31d200vm0baa = {
2627 .timings = &koe_tx31d200vm0baa_timing,
2628 .num_timings = 1,
2629 .bpc = 6,
2630 .size = {
2631 .width = 292,
2632 .height = 109,
2633 },
2634 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002635 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Jagan Teki8cfe8342018-02-04 23:19:28 +05302636};
2637
Lucas Stach8def22e2015-12-02 19:41:11 +01002638static const struct display_timing kyo_tcg121xglp_timing = {
2639 .pixelclock = { 52000000, 65000000, 71000000 },
2640 .hactive = { 1024, 1024, 1024 },
2641 .hfront_porch = { 2, 2, 2 },
2642 .hback_porch = { 2, 2, 2 },
2643 .hsync_len = { 86, 124, 244 },
2644 .vactive = { 768, 768, 768 },
2645 .vfront_porch = { 2, 2, 2 },
2646 .vback_porch = { 2, 2, 2 },
2647 .vsync_len = { 6, 34, 73 },
2648 .flags = DISPLAY_FLAGS_DE_HIGH,
2649};
2650
2651static const struct panel_desc kyo_tcg121xglp = {
2652 .timings = &kyo_tcg121xglp_timing,
2653 .num_timings = 1,
2654 .bpc = 8,
2655 .size = {
2656 .width = 246,
2657 .height = 184,
2658 },
2659 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002660 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8def22e2015-12-02 19:41:11 +01002661};
2662
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002663static const struct drm_display_mode lemaker_bl035_rgb_002_mode = {
2664 .clock = 7000,
2665 .hdisplay = 320,
2666 .hsync_start = 320 + 20,
2667 .hsync_end = 320 + 20 + 30,
2668 .htotal = 320 + 20 + 30 + 38,
2669 .vdisplay = 240,
2670 .vsync_start = 240 + 4,
2671 .vsync_end = 240 + 4 + 3,
2672 .vtotal = 240 + 4 + 3 + 15,
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002673};
2674
2675static const struct panel_desc lemaker_bl035_rgb_002 = {
2676 .modes = &lemaker_bl035_rgb_002_mode,
2677 .num_modes = 1,
2678 .size = {
2679 .width = 70,
2680 .height = 52,
2681 },
2682 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2683 .bus_flags = DRM_BUS_FLAG_DE_LOW,
2684};
2685
Heiko Schocherdd015002015-05-22 10:25:57 +02002686static const struct drm_display_mode lg_lb070wv8_mode = {
2687 .clock = 33246,
2688 .hdisplay = 800,
2689 .hsync_start = 800 + 88,
2690 .hsync_end = 800 + 88 + 80,
2691 .htotal = 800 + 88 + 80 + 88,
2692 .vdisplay = 480,
2693 .vsync_start = 480 + 10,
2694 .vsync_end = 480 + 10 + 25,
2695 .vtotal = 480 + 10 + 25 + 10,
Heiko Schocherdd015002015-05-22 10:25:57 +02002696};
2697
2698static const struct panel_desc lg_lb070wv8 = {
2699 .modes = &lg_lb070wv8_mode,
2700 .num_modes = 1,
Laurent Pincharta6ae2fe2020-07-12 01:53:17 +03002701 .bpc = 8,
Heiko Schocherdd015002015-05-22 10:25:57 +02002702 .size = {
2703 .width = 151,
2704 .height = 91,
2705 },
2706 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002707 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Heiko Schocherdd015002015-05-22 10:25:57 +02002708};
2709
Yakir Yangc5ece402016-06-28 12:51:15 +08002710static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
2711 .clock = 200000,
2712 .hdisplay = 1536,
2713 .hsync_start = 1536 + 12,
2714 .hsync_end = 1536 + 12 + 16,
2715 .htotal = 1536 + 12 + 16 + 48,
2716 .vdisplay = 2048,
2717 .vsync_start = 2048 + 8,
2718 .vsync_end = 2048 + 8 + 4,
2719 .vtotal = 2048 + 8 + 4 + 8,
Yakir Yangc5ece402016-06-28 12:51:15 +08002720 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2721};
2722
2723static const struct panel_desc lg_lp079qx1_sp0v = {
2724 .modes = &lg_lp079qx1_sp0v_mode,
2725 .num_modes = 1,
2726 .size = {
2727 .width = 129,
2728 .height = 171,
2729 },
2730};
2731
Yakir Yang0355dde2016-06-12 10:56:02 +08002732static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
2733 .clock = 205210,
2734 .hdisplay = 2048,
2735 .hsync_start = 2048 + 150,
2736 .hsync_end = 2048 + 150 + 5,
2737 .htotal = 2048 + 150 + 5 + 5,
2738 .vdisplay = 1536,
2739 .vsync_start = 1536 + 3,
2740 .vsync_end = 1536 + 3 + 1,
2741 .vtotal = 1536 + 3 + 1 + 9,
Yakir Yang0355dde2016-06-12 10:56:02 +08002742};
2743
2744static const struct panel_desc lg_lp097qx1_spa1 = {
2745 .modes = &lg_lp097qx1_spa1_mode,
2746 .num_modes = 1,
2747 .size = {
2748 .width = 208,
2749 .height = 147,
2750 },
2751};
2752
Jitao Shi690d8fa2016-02-22 19:01:44 +08002753static const struct drm_display_mode lg_lp120up1_mode = {
2754 .clock = 162300,
2755 .hdisplay = 1920,
2756 .hsync_start = 1920 + 40,
2757 .hsync_end = 1920 + 40 + 40,
2758 .htotal = 1920 + 40 + 40+ 80,
2759 .vdisplay = 1280,
2760 .vsync_start = 1280 + 4,
2761 .vsync_end = 1280 + 4 + 4,
2762 .vtotal = 1280 + 4 + 4 + 12,
Jitao Shi690d8fa2016-02-22 19:01:44 +08002763};
2764
2765static const struct panel_desc lg_lp120up1 = {
2766 .modes = &lg_lp120up1_mode,
2767 .num_modes = 1,
2768 .bpc = 8,
2769 .size = {
2770 .width = 267,
2771 .height = 183,
2772 },
Enric Balletbo i Serrad53139b2020-04-16 18:44:03 +02002773 .connector_type = DRM_MODE_CONNECTOR_eDP,
Jitao Shi690d8fa2016-02-22 19:01:44 +08002774};
2775
Thierry Redingec7c5652013-11-15 15:59:32 +01002776static const struct drm_display_mode lg_lp129qe_mode = {
2777 .clock = 285250,
2778 .hdisplay = 2560,
2779 .hsync_start = 2560 + 48,
2780 .hsync_end = 2560 + 48 + 32,
2781 .htotal = 2560 + 48 + 32 + 80,
2782 .vdisplay = 1700,
2783 .vsync_start = 1700 + 3,
2784 .vsync_end = 1700 + 3 + 10,
2785 .vtotal = 1700 + 3 + 10 + 36,
Thierry Redingec7c5652013-11-15 15:59:32 +01002786};
2787
2788static const struct panel_desc lg_lp129qe = {
2789 .modes = &lg_lp129qe_mode,
2790 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002791 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01002792 .size = {
2793 .width = 272,
2794 .height = 181,
2795 },
2796};
2797
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01002798static const struct display_timing logictechno_lt161010_2nh_timing = {
2799 .pixelclock = { 26400000, 33300000, 46800000 },
2800 .hactive = { 800, 800, 800 },
2801 .hfront_porch = { 16, 210, 354 },
2802 .hback_porch = { 46, 46, 46 },
2803 .hsync_len = { 1, 20, 40 },
2804 .vactive = { 480, 480, 480 },
2805 .vfront_porch = { 7, 22, 147 },
2806 .vback_porch = { 23, 23, 23 },
2807 .vsync_len = { 1, 10, 20 },
2808 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2809 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
2810 DISPLAY_FLAGS_SYNC_POSEDGE,
2811};
2812
2813static const struct panel_desc logictechno_lt161010_2nh = {
2814 .timings = &logictechno_lt161010_2nh_timing,
2815 .num_timings = 1,
2816 .size = {
2817 .width = 154,
2818 .height = 86,
2819 },
2820 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2821 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
2822 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
2823 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
2824 .connector_type = DRM_MODE_CONNECTOR_DPI,
2825};
2826
2827static const struct display_timing logictechno_lt170410_2whc_timing = {
2828 .pixelclock = { 68900000, 71100000, 73400000 },
2829 .hactive = { 1280, 1280, 1280 },
2830 .hfront_porch = { 23, 60, 71 },
2831 .hback_porch = { 23, 60, 71 },
2832 .hsync_len = { 15, 40, 47 },
2833 .vactive = { 800, 800, 800 },
2834 .vfront_porch = { 5, 7, 10 },
2835 .vback_porch = { 5, 7, 10 },
2836 .vsync_len = { 6, 9, 12 },
2837 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2838 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
2839 DISPLAY_FLAGS_SYNC_POSEDGE,
2840};
2841
2842static const struct panel_desc logictechno_lt170410_2whc = {
2843 .timings = &logictechno_lt170410_2whc_timing,
2844 .num_timings = 1,
2845 .size = {
2846 .width = 217,
2847 .height = 136,
2848 },
2849 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002850 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01002851 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2852};
2853
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002854static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
2855 .clock = 30400,
2856 .hdisplay = 800,
2857 .hsync_start = 800 + 0,
2858 .hsync_end = 800 + 1,
2859 .htotal = 800 + 0 + 1 + 160,
2860 .vdisplay = 480,
2861 .vsync_start = 480 + 0,
2862 .vsync_end = 480 + 48 + 1,
2863 .vtotal = 480 + 48 + 1 + 0,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002864 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2865};
2866
Adam Ford0d354082019-10-16 08:51:45 -05002867static const struct drm_display_mode logicpd_type_28_mode = {
Ville Syrjäläf873c5d2020-03-02 22:34:40 +02002868 .clock = 9107,
Adam Ford0d354082019-10-16 08:51:45 -05002869 .hdisplay = 480,
2870 .hsync_start = 480 + 3,
2871 .hsync_end = 480 + 3 + 42,
2872 .htotal = 480 + 3 + 42 + 2,
2873
2874 .vdisplay = 272,
2875 .vsync_start = 272 + 2,
2876 .vsync_end = 272 + 2 + 11,
2877 .vtotal = 272 + 2 + 11 + 3,
Adam Ford0d354082019-10-16 08:51:45 -05002878 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2879};
2880
2881static const struct panel_desc logicpd_type_28 = {
2882 .modes = &logicpd_type_28_mode,
2883 .num_modes = 1,
2884 .bpc = 8,
2885 .size = {
2886 .width = 105,
2887 .height = 67,
2888 },
2889 .delay = {
2890 .prepare = 200,
2891 .enable = 200,
2892 .unprepare = 200,
2893 .disable = 200,
2894 },
2895 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2896 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
2897 DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
Adam Fordefb94792020-06-15 08:19:34 -05002898 .connector_type = DRM_MODE_CONNECTOR_DPI,
Adam Ford0d354082019-10-16 08:51:45 -05002899};
2900
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002901static const struct panel_desc mitsubishi_aa070mc01 = {
2902 .modes = &mitsubishi_aa070mc01_mode,
2903 .num_modes = 1,
2904 .bpc = 8,
2905 .size = {
2906 .width = 152,
2907 .height = 91,
2908 },
2909
2910 .delay = {
2911 .enable = 200,
2912 .unprepare = 200,
2913 .disable = 400,
2914 },
2915 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002916 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002917 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
2918};
2919
Lucas Stach01bacc132017-06-08 20:07:55 +02002920static const struct display_timing nec_nl12880bc20_05_timing = {
2921 .pixelclock = { 67000000, 71000000, 75000000 },
2922 .hactive = { 1280, 1280, 1280 },
2923 .hfront_porch = { 2, 30, 30 },
2924 .hback_porch = { 6, 100, 100 },
2925 .hsync_len = { 2, 30, 30 },
2926 .vactive = { 800, 800, 800 },
2927 .vfront_porch = { 5, 5, 5 },
2928 .vback_porch = { 11, 11, 11 },
2929 .vsync_len = { 7, 7, 7 },
2930};
2931
2932static const struct panel_desc nec_nl12880bc20_05 = {
2933 .timings = &nec_nl12880bc20_05_timing,
2934 .num_timings = 1,
2935 .bpc = 8,
2936 .size = {
2937 .width = 261,
2938 .height = 163,
2939 },
2940 .delay = {
2941 .enable = 50,
2942 .disable = 50,
2943 },
2944 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002945 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach01bacc132017-06-08 20:07:55 +02002946};
2947
jianwei wangc6e87f92015-07-29 16:30:02 +08002948static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
2949 .clock = 10870,
2950 .hdisplay = 480,
2951 .hsync_start = 480 + 2,
2952 .hsync_end = 480 + 2 + 41,
2953 .htotal = 480 + 2 + 41 + 2,
2954 .vdisplay = 272,
2955 .vsync_start = 272 + 2,
2956 .vsync_end = 272 + 2 + 4,
2957 .vtotal = 272 + 2 + 4 + 2,
Stefan Agner4bc390c2015-11-17 19:10:29 -08002958 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08002959};
2960
2961static const struct panel_desc nec_nl4827hc19_05b = {
2962 .modes = &nec_nl4827hc19_05b_mode,
2963 .num_modes = 1,
2964 .bpc = 8,
2965 .size = {
2966 .width = 95,
2967 .height = 54,
2968 },
Stefan Agner2c806612016-02-08 12:50:13 -08002969 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002970 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08002971};
2972
Maxime Riparde6c2f062016-09-06 16:46:17 +02002973static const struct drm_display_mode netron_dy_e231732_mode = {
2974 .clock = 66000,
2975 .hdisplay = 1024,
2976 .hsync_start = 1024 + 160,
2977 .hsync_end = 1024 + 160 + 70,
2978 .htotal = 1024 + 160 + 70 + 90,
2979 .vdisplay = 600,
2980 .vsync_start = 600 + 127,
2981 .vsync_end = 600 + 127 + 20,
2982 .vtotal = 600 + 127 + 20 + 3,
Maxime Riparde6c2f062016-09-06 16:46:17 +02002983};
2984
2985static const struct panel_desc netron_dy_e231732 = {
2986 .modes = &netron_dy_e231732_mode,
2987 .num_modes = 1,
2988 .size = {
2989 .width = 154,
2990 .height = 87,
2991 },
2992 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2993};
2994
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08002995static const struct drm_display_mode neweast_wjfh116008a_modes[] = {
2996 {
2997 .clock = 138500,
2998 .hdisplay = 1920,
2999 .hsync_start = 1920 + 48,
3000 .hsync_end = 1920 + 48 + 32,
3001 .htotal = 1920 + 48 + 32 + 80,
3002 .vdisplay = 1080,
3003 .vsync_start = 1080 + 3,
3004 .vsync_end = 1080 + 3 + 5,
3005 .vtotal = 1080 + 3 + 5 + 23,
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08003006 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3007 }, {
3008 .clock = 110920,
3009 .hdisplay = 1920,
3010 .hsync_start = 1920 + 48,
3011 .hsync_end = 1920 + 48 + 32,
3012 .htotal = 1920 + 48 + 32 + 80,
3013 .vdisplay = 1080,
3014 .vsync_start = 1080 + 3,
3015 .vsync_end = 1080 + 3 + 5,
3016 .vtotal = 1080 + 3 + 5 + 23,
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08003017 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3018 }
3019};
3020
3021static const struct panel_desc neweast_wjfh116008a = {
3022 .modes = neweast_wjfh116008a_modes,
3023 .num_modes = 2,
3024 .bpc = 6,
3025 .size = {
3026 .width = 260,
3027 .height = 150,
3028 },
3029 .delay = {
3030 .prepare = 110,
3031 .enable = 20,
3032 .unprepare = 500,
3033 },
3034 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3035 .connector_type = DRM_MODE_CONNECTOR_eDP,
3036};
3037
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003038static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
3039 .clock = 9000,
3040 .hdisplay = 480,
3041 .hsync_start = 480 + 2,
3042 .hsync_end = 480 + 2 + 41,
3043 .htotal = 480 + 2 + 41 + 2,
3044 .vdisplay = 272,
3045 .vsync_start = 272 + 2,
3046 .vsync_end = 272 + 2 + 10,
3047 .vtotal = 272 + 2 + 10 + 2,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003048 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3049};
3050
3051static const struct panel_desc newhaven_nhd_43_480272ef_atxl = {
3052 .modes = &newhaven_nhd_43_480272ef_atxl_mode,
3053 .num_modes = 1,
3054 .bpc = 8,
3055 .size = {
3056 .width = 95,
3057 .height = 54,
3058 },
3059 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003060 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3061 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Tomi Valkeinen8a4f5e12020-06-09 13:28:09 +03003062 .connector_type = DRM_MODE_CONNECTOR_DPI,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003063};
3064
Lucas Stach4177fa62017-06-08 20:07:57 +02003065static const struct display_timing nlt_nl192108ac18_02d_timing = {
3066 .pixelclock = { 130000000, 148350000, 163000000 },
3067 .hactive = { 1920, 1920, 1920 },
3068 .hfront_porch = { 80, 100, 100 },
3069 .hback_porch = { 100, 120, 120 },
3070 .hsync_len = { 50, 60, 60 },
3071 .vactive = { 1080, 1080, 1080 },
3072 .vfront_porch = { 12, 30, 30 },
3073 .vback_porch = { 4, 10, 10 },
3074 .vsync_len = { 4, 5, 5 },
3075};
3076
3077static const struct panel_desc nlt_nl192108ac18_02d = {
3078 .timings = &nlt_nl192108ac18_02d_timing,
3079 .num_timings = 1,
3080 .bpc = 8,
3081 .size = {
3082 .width = 344,
3083 .height = 194,
3084 },
3085 .delay = {
3086 .unprepare = 500,
3087 },
3088 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003089 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach4177fa62017-06-08 20:07:57 +02003090};
3091
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02003092static const struct drm_display_mode nvd_9128_mode = {
3093 .clock = 29500,
3094 .hdisplay = 800,
3095 .hsync_start = 800 + 130,
3096 .hsync_end = 800 + 130 + 98,
3097 .htotal = 800 + 0 + 130 + 98,
3098 .vdisplay = 480,
3099 .vsync_start = 480 + 10,
3100 .vsync_end = 480 + 10 + 50,
3101 .vtotal = 480 + 0 + 10 + 50,
3102};
3103
3104static const struct panel_desc nvd_9128 = {
3105 .modes = &nvd_9128_mode,
3106 .num_modes = 1,
3107 .bpc = 8,
3108 .size = {
3109 .width = 156,
3110 .height = 88,
3111 },
3112 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003113 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02003114};
3115
Gary Bissona99fb622015-06-10 18:44:23 +02003116static const struct display_timing okaya_rs800480t_7x0gp_timing = {
3117 .pixelclock = { 30000000, 30000000, 40000000 },
3118 .hactive = { 800, 800, 800 },
3119 .hfront_porch = { 40, 40, 40 },
3120 .hback_porch = { 40, 40, 40 },
3121 .hsync_len = { 1, 48, 48 },
3122 .vactive = { 480, 480, 480 },
3123 .vfront_porch = { 13, 13, 13 },
3124 .vback_porch = { 29, 29, 29 },
3125 .vsync_len = { 3, 3, 3 },
3126 .flags = DISPLAY_FLAGS_DE_HIGH,
3127};
3128
3129static const struct panel_desc okaya_rs800480t_7x0gp = {
3130 .timings = &okaya_rs800480t_7x0gp_timing,
3131 .num_timings = 1,
3132 .bpc = 6,
3133 .size = {
3134 .width = 154,
3135 .height = 87,
3136 },
3137 .delay = {
3138 .prepare = 41,
3139 .enable = 50,
3140 .unprepare = 41,
3141 .disable = 50,
3142 },
3143 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3144};
3145
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003146static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
3147 .clock = 9000,
3148 .hdisplay = 480,
3149 .hsync_start = 480 + 5,
3150 .hsync_end = 480 + 5 + 30,
3151 .htotal = 480 + 5 + 30 + 10,
3152 .vdisplay = 272,
3153 .vsync_start = 272 + 8,
3154 .vsync_end = 272 + 8 + 5,
3155 .vtotal = 272 + 8 + 5 + 3,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003156};
3157
3158static const struct panel_desc olimex_lcd_olinuxino_43ts = {
3159 .modes = &olimex_lcd_olinuxino_43ts_mode,
3160 .num_modes = 1,
3161 .size = {
Jonathan Liu30c6d7ab92017-07-20 20:29:43 +10003162 .width = 95,
3163 .height = 54,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003164 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10003165 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003166};
3167
Eric Anholte8b6f562016-03-24 17:23:48 -07003168/*
3169 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
3170 * pixel clocks, but this is the timing that was being used in the Adafruit
3171 * installation instructions.
3172 */
3173static const struct drm_display_mode ontat_yx700wv03_mode = {
3174 .clock = 29500,
3175 .hdisplay = 800,
3176 .hsync_start = 824,
3177 .hsync_end = 896,
3178 .htotal = 992,
3179 .vdisplay = 480,
3180 .vsync_start = 483,
3181 .vsync_end = 493,
3182 .vtotal = 500,
Eric Anholte8b6f562016-03-24 17:23:48 -07003183 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3184};
3185
3186/*
3187 * Specification at:
3188 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
3189 */
3190static const struct panel_desc ontat_yx700wv03 = {
3191 .modes = &ontat_yx700wv03_mode,
3192 .num_modes = 1,
3193 .bpc = 8,
3194 .size = {
3195 .width = 154,
3196 .height = 83,
3197 },
Eric Anholt5651e5e2018-03-09 15:33:32 -08003198 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Eric Anholte8b6f562016-03-24 17:23:48 -07003199};
3200
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003201static const struct drm_display_mode ortustech_com37h3m_mode = {
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003202 .clock = 22230,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003203 .hdisplay = 480,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003204 .hsync_start = 480 + 40,
3205 .hsync_end = 480 + 40 + 10,
3206 .htotal = 480 + 40 + 10 + 40,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003207 .vdisplay = 640,
3208 .vsync_start = 640 + 4,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003209 .vsync_end = 640 + 4 + 2,
3210 .vtotal = 640 + 4 + 2 + 4,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003211 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3212};
3213
3214static const struct panel_desc ortustech_com37h3m = {
3215 .modes = &ortustech_com37h3m_mode,
3216 .num_modes = 1,
3217 .bpc = 8,
3218 .size = {
3219 .width = 56, /* 56.16mm */
3220 .height = 75, /* 74.88mm */
3221 },
3222 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003223 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003224 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
3225};
3226
Philipp Zabel725c9d42015-02-11 18:50:11 +01003227static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
3228 .clock = 25000,
3229 .hdisplay = 480,
3230 .hsync_start = 480 + 10,
3231 .hsync_end = 480 + 10 + 10,
3232 .htotal = 480 + 10 + 10 + 15,
3233 .vdisplay = 800,
3234 .vsync_start = 800 + 3,
3235 .vsync_end = 800 + 3 + 3,
3236 .vtotal = 800 + 3 + 3 + 3,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003237};
3238
3239static const struct panel_desc ortustech_com43h4m85ulc = {
3240 .modes = &ortustech_com43h4m85ulc_mode,
3241 .num_modes = 1,
Laurent Pinchart3b809512020-08-24 03:32:54 +03003242 .bpc = 6,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003243 .size = {
3244 .width = 56,
3245 .height = 93,
3246 },
Laurent Pinchartf098f162020-08-13 01:02:44 +03003247 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003248 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Laurent Pinchart2ccedf42020-03-09 20:42:10 +02003249 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003250};
3251
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003252static const struct drm_display_mode osddisplays_osd070t1718_19ts_mode = {
3253 .clock = 33000,
3254 .hdisplay = 800,
3255 .hsync_start = 800 + 210,
3256 .hsync_end = 800 + 210 + 30,
3257 .htotal = 800 + 210 + 30 + 16,
3258 .vdisplay = 480,
3259 .vsync_start = 480 + 22,
3260 .vsync_end = 480 + 22 + 13,
3261 .vtotal = 480 + 22 + 13 + 10,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003262 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3263};
3264
3265static const struct panel_desc osddisplays_osd070t1718_19ts = {
3266 .modes = &osddisplays_osd070t1718_19ts_mode,
3267 .num_modes = 1,
3268 .bpc = 8,
3269 .size = {
3270 .width = 152,
3271 .height = 91,
3272 },
3273 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Tomi Valkeinenfb0629e2019-11-14 11:39:50 +02003274 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3275 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Laurent Pincharta793f0e2019-09-04 16:37:23 +03003276 .connector_type = DRM_MODE_CONNECTOR_DPI,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003277};
3278
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003279static const struct drm_display_mode pda_91_00156_a0_mode = {
3280 .clock = 33300,
3281 .hdisplay = 800,
3282 .hsync_start = 800 + 1,
3283 .hsync_end = 800 + 1 + 64,
3284 .htotal = 800 + 1 + 64 + 64,
3285 .vdisplay = 480,
3286 .vsync_start = 480 + 1,
3287 .vsync_end = 480 + 1 + 23,
3288 .vtotal = 480 + 1 + 23 + 22,
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003289};
3290
3291static const struct panel_desc pda_91_00156_a0 = {
3292 .modes = &pda_91_00156_a0_mode,
3293 .num_modes = 1,
3294 .size = {
3295 .width = 152,
3296 .height = 91,
3297 },
3298 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3299};
3300
Marek Vasutd69de692020-07-28 14:12:46 +02003301static const struct drm_display_mode powertip_ph800480t013_idf02_mode = {
3302 .clock = 24750,
3303 .hdisplay = 800,
3304 .hsync_start = 800 + 54,
3305 .hsync_end = 800 + 54 + 2,
3306 .htotal = 800 + 54 + 2 + 44,
3307 .vdisplay = 480,
3308 .vsync_start = 480 + 49,
3309 .vsync_end = 480 + 49 + 2,
3310 .vtotal = 480 + 49 + 2 + 22,
3311};
3312
3313static const struct panel_desc powertip_ph800480t013_idf02 = {
3314 .modes = &powertip_ph800480t013_idf02_mode,
3315 .num_modes = 1,
3316 .size = {
3317 .width = 152,
3318 .height = 91,
3319 },
3320 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
3321 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
3322 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
3323 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3324 .connector_type = DRM_MODE_CONNECTOR_DPI,
3325};
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003326
Josh Wud2a6f0f2015-10-08 17:42:41 +02003327static const struct drm_display_mode qd43003c0_40_mode = {
3328 .clock = 9000,
3329 .hdisplay = 480,
3330 .hsync_start = 480 + 8,
3331 .hsync_end = 480 + 8 + 4,
3332 .htotal = 480 + 8 + 4 + 39,
3333 .vdisplay = 272,
3334 .vsync_start = 272 + 4,
3335 .vsync_end = 272 + 4 + 10,
3336 .vtotal = 272 + 4 + 10 + 2,
Josh Wud2a6f0f2015-10-08 17:42:41 +02003337};
3338
3339static const struct panel_desc qd43003c0_40 = {
3340 .modes = &qd43003c0_40_mode,
3341 .num_modes = 1,
3342 .bpc = 8,
3343 .size = {
3344 .width = 95,
3345 .height = 53,
3346 },
3347 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3348};
3349
Jagan Teki23167fa2018-06-07 19:16:48 +05303350static const struct display_timing rocktech_rk070er9427_timing = {
3351 .pixelclock = { 26400000, 33300000, 46800000 },
3352 .hactive = { 800, 800, 800 },
3353 .hfront_porch = { 16, 210, 354 },
3354 .hback_porch = { 46, 46, 46 },
3355 .hsync_len = { 1, 1, 1 },
3356 .vactive = { 480, 480, 480 },
3357 .vfront_porch = { 7, 22, 147 },
3358 .vback_porch = { 23, 23, 23 },
3359 .vsync_len = { 1, 1, 1 },
3360 .flags = DISPLAY_FLAGS_DE_HIGH,
3361};
3362
3363static const struct panel_desc rocktech_rk070er9427 = {
3364 .timings = &rocktech_rk070er9427_timing,
3365 .num_timings = 1,
3366 .bpc = 6,
3367 .size = {
3368 .width = 154,
3369 .height = 86,
3370 },
3371 .delay = {
3372 .prepare = 41,
3373 .enable = 50,
3374 .unprepare = 41,
3375 .disable = 50,
3376 },
3377 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3378};
3379
Jyri Sarhaf3050472020-02-11 14:17:18 +02003380static const struct drm_display_mode rocktech_rk101ii01d_ct_mode = {
3381 .clock = 71100,
3382 .hdisplay = 1280,
3383 .hsync_start = 1280 + 48,
3384 .hsync_end = 1280 + 48 + 32,
3385 .htotal = 1280 + 48 + 32 + 80,
3386 .vdisplay = 800,
3387 .vsync_start = 800 + 2,
3388 .vsync_end = 800 + 2 + 5,
3389 .vtotal = 800 + 2 + 5 + 16,
Jyri Sarhaf3050472020-02-11 14:17:18 +02003390};
3391
3392static const struct panel_desc rocktech_rk101ii01d_ct = {
3393 .modes = &rocktech_rk101ii01d_ct_mode,
3394 .num_modes = 1,
3395 .size = {
3396 .width = 217,
3397 .height = 136,
3398 },
3399 .delay = {
3400 .prepare = 50,
3401 .disable = 50,
3402 },
3403 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
3404 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3405 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3406};
3407
Yakir Yang0330eaf2016-06-12 10:56:13 +08003408static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
3409 .clock = 271560,
3410 .hdisplay = 2560,
3411 .hsync_start = 2560 + 48,
3412 .hsync_end = 2560 + 48 + 32,
3413 .htotal = 2560 + 48 + 32 + 80,
3414 .vdisplay = 1600,
3415 .vsync_start = 1600 + 2,
3416 .vsync_end = 1600 + 2 + 5,
3417 .vtotal = 1600 + 2 + 5 + 57,
Yakir Yang0330eaf2016-06-12 10:56:13 +08003418};
3419
3420static const struct panel_desc samsung_lsn122dl01_c01 = {
3421 .modes = &samsung_lsn122dl01_c01_mode,
3422 .num_modes = 1,
3423 .size = {
3424 .width = 263,
3425 .height = 164,
3426 },
3427};
3428
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003429static const struct drm_display_mode samsung_ltn101nt05_mode = {
3430 .clock = 54030,
3431 .hdisplay = 1024,
3432 .hsync_start = 1024 + 24,
3433 .hsync_end = 1024 + 24 + 136,
3434 .htotal = 1024 + 24 + 136 + 160,
3435 .vdisplay = 600,
3436 .vsync_start = 600 + 3,
3437 .vsync_end = 600 + 3 + 6,
3438 .vtotal = 600 + 3 + 6 + 61,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003439};
3440
3441static const struct panel_desc samsung_ltn101nt05 = {
3442 .modes = &samsung_ltn101nt05_mode,
3443 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07003444 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003445 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02003446 .width = 223,
3447 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003448 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03003449 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003450 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03003451 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003452};
3453
Stéphane Marchesin0c934302015-03-18 10:52:18 +01003454static const struct drm_display_mode samsung_ltn140at29_301_mode = {
3455 .clock = 76300,
3456 .hdisplay = 1366,
3457 .hsync_start = 1366 + 64,
3458 .hsync_end = 1366 + 64 + 48,
3459 .htotal = 1366 + 64 + 48 + 128,
3460 .vdisplay = 768,
3461 .vsync_start = 768 + 2,
3462 .vsync_end = 768 + 2 + 5,
3463 .vtotal = 768 + 2 + 5 + 17,
Stéphane Marchesin0c934302015-03-18 10:52:18 +01003464};
3465
3466static const struct panel_desc samsung_ltn140at29_301 = {
3467 .modes = &samsung_ltn140at29_301_mode,
3468 .num_modes = 1,
3469 .bpc = 6,
3470 .size = {
3471 .width = 320,
3472 .height = 187,
3473 },
3474};
3475
Miquel Raynal44c58c52020-01-09 19:40:37 +01003476static const struct display_timing satoz_sat050at40h12r2_timing = {
3477 .pixelclock = {33300000, 33300000, 50000000},
3478 .hactive = {800, 800, 800},
3479 .hfront_porch = {16, 210, 354},
3480 .hback_porch = {46, 46, 46},
3481 .hsync_len = {1, 1, 40},
3482 .vactive = {480, 480, 480},
3483 .vfront_porch = {7, 22, 147},
3484 .vback_porch = {23, 23, 23},
3485 .vsync_len = {1, 1, 20},
3486};
3487
3488static const struct panel_desc satoz_sat050at40h12r2 = {
3489 .timings = &satoz_sat050at40h12r2_timing,
3490 .num_timings = 1,
3491 .bpc = 8,
3492 .size = {
3493 .width = 108,
3494 .height = 65,
3495 },
Laurent Pinchart34ca6b52020-06-30 02:33:18 +03003496 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Miquel Raynal44c58c52020-01-09 19:40:37 +01003497 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3498};
3499
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07003500static const struct drm_display_mode sharp_ld_d5116z01b_mode = {
3501 .clock = 168480,
3502 .hdisplay = 1920,
3503 .hsync_start = 1920 + 48,
3504 .hsync_end = 1920 + 48 + 32,
3505 .htotal = 1920 + 48 + 32 + 80,
3506 .vdisplay = 1280,
3507 .vsync_start = 1280 + 3,
3508 .vsync_end = 1280 + 3 + 10,
3509 .vtotal = 1280 + 3 + 10 + 57,
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07003510 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3511};
3512
3513static const struct panel_desc sharp_ld_d5116z01b = {
3514 .modes = &sharp_ld_d5116z01b_mode,
3515 .num_modes = 1,
3516 .bpc = 8,
3517 .size = {
3518 .width = 260,
3519 .height = 120,
3520 },
3521 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3522 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
3523};
3524
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003525static const struct drm_display_mode sharp_lq070y3dg3b_mode = {
3526 .clock = 33260,
3527 .hdisplay = 800,
3528 .hsync_start = 800 + 64,
3529 .hsync_end = 800 + 64 + 128,
3530 .htotal = 800 + 64 + 128 + 64,
3531 .vdisplay = 480,
3532 .vsync_start = 480 + 8,
3533 .vsync_end = 480 + 8 + 2,
3534 .vtotal = 480 + 8 + 2 + 35,
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003535 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3536};
3537
3538static const struct panel_desc sharp_lq070y3dg3b = {
3539 .modes = &sharp_lq070y3dg3b_mode,
3540 .num_modes = 1,
3541 .bpc = 8,
3542 .size = {
3543 .width = 152, /* 152.4mm */
3544 .height = 91, /* 91.4mm */
3545 },
3546 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003547 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003548 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
3549};
3550
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003551static const struct drm_display_mode sharp_lq035q7db03_mode = {
3552 .clock = 5500,
3553 .hdisplay = 240,
3554 .hsync_start = 240 + 16,
3555 .hsync_end = 240 + 16 + 7,
3556 .htotal = 240 + 16 + 7 + 5,
3557 .vdisplay = 320,
3558 .vsync_start = 320 + 9,
3559 .vsync_end = 320 + 9 + 1,
3560 .vtotal = 320 + 9 + 1 + 7,
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003561};
3562
3563static const struct panel_desc sharp_lq035q7db03 = {
3564 .modes = &sharp_lq035q7db03_mode,
3565 .num_modes = 1,
3566 .bpc = 6,
3567 .size = {
3568 .width = 54,
3569 .height = 72,
3570 },
3571 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3572};
3573
Joshua Clayton592aa022016-07-06 15:59:16 -07003574static const struct display_timing sharp_lq101k1ly04_timing = {
3575 .pixelclock = { 60000000, 65000000, 80000000 },
3576 .hactive = { 1280, 1280, 1280 },
3577 .hfront_porch = { 20, 20, 20 },
3578 .hback_porch = { 20, 20, 20 },
3579 .hsync_len = { 10, 10, 10 },
3580 .vactive = { 800, 800, 800 },
3581 .vfront_porch = { 4, 4, 4 },
3582 .vback_porch = { 4, 4, 4 },
3583 .vsync_len = { 4, 4, 4 },
3584 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3585};
3586
3587static const struct panel_desc sharp_lq101k1ly04 = {
3588 .timings = &sharp_lq101k1ly04_timing,
3589 .num_timings = 1,
3590 .bpc = 8,
3591 .size = {
3592 .width = 217,
3593 .height = 136,
3594 },
3595 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003596 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Joshua Clayton592aa022016-07-06 15:59:16 -07003597};
3598
Sean Paul9f7bae22018-02-08 12:48:52 -05003599static const struct display_timing sharp_lq123p1jx31_timing = {
3600 .pixelclock = { 252750000, 252750000, 266604720 },
3601 .hactive = { 2400, 2400, 2400 },
3602 .hfront_porch = { 48, 48, 48 },
3603 .hback_porch = { 80, 80, 84 },
3604 .hsync_len = { 32, 32, 32 },
3605 .vactive = { 1600, 1600, 1600 },
3606 .vfront_porch = { 3, 3, 3 },
3607 .vback_porch = { 33, 33, 120 },
3608 .vsync_len = { 10, 10, 10 },
3609 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Yakir Yang739c7de2016-06-12 10:56:35 +08003610};
3611
3612static const struct panel_desc sharp_lq123p1jx31 = {
Sean Paul9f7bae22018-02-08 12:48:52 -05003613 .timings = &sharp_lq123p1jx31_timing,
3614 .num_timings = 1,
zain wang5466a632016-11-19 10:27:16 +08003615 .bpc = 8,
Yakir Yang739c7de2016-06-12 10:56:35 +08003616 .size = {
3617 .width = 259,
3618 .height = 173,
3619 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08003620 .delay = {
3621 .prepare = 110,
3622 .enable = 50,
3623 .unprepare = 550,
3624 },
Yakir Yang739c7de2016-06-12 10:56:35 +08003625};
3626
Paul Cercueil656b7592020-08-11 02:22:38 +02003627static const struct drm_display_mode sharp_ls020b1dd01d_modes[] = {
Paul Cercueile6c21e62020-08-11 02:22:40 +02003628 { /* 50 Hz */
3629 .clock = 3000,
3630 .hdisplay = 240,
3631 .hsync_start = 240 + 58,
3632 .hsync_end = 240 + 58 + 1,
3633 .htotal = 240 + 58 + 1 + 1,
3634 .vdisplay = 160,
3635 .vsync_start = 160 + 24,
3636 .vsync_end = 160 + 24 + 10,
3637 .vtotal = 160 + 24 + 10 + 6,
3638 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
3639 },
Paul Cercueil656b7592020-08-11 02:22:38 +02003640 { /* 60 Hz */
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003641 .clock = 3000,
Paul Cercueil656b7592020-08-11 02:22:38 +02003642 .hdisplay = 240,
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003643 .hsync_start = 240 + 8,
3644 .hsync_end = 240 + 8 + 1,
3645 .htotal = 240 + 8 + 1 + 1,
Paul Cercueil656b7592020-08-11 02:22:38 +02003646 .vdisplay = 160,
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003647 .vsync_start = 160 + 24,
3648 .vsync_end = 160 + 24 + 10,
3649 .vtotal = 160 + 24 + 10 + 6,
Paul Cercueil656b7592020-08-11 02:22:38 +02003650 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
3651 },
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003652};
3653
3654static const struct panel_desc sharp_ls020b1dd01d = {
Paul Cercueil656b7592020-08-11 02:22:38 +02003655 .modes = sharp_ls020b1dd01d_modes,
3656 .num_modes = ARRAY_SIZE(sharp_ls020b1dd01d_modes),
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003657 .bpc = 6,
3658 .size = {
3659 .width = 42,
3660 .height = 28,
3661 },
3662 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
3663 .bus_flags = DRM_BUS_FLAG_DE_HIGH
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003664 | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003665 | DRM_BUS_FLAG_SHARP_SIGNALS,
3666};
3667
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003668static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
3669 .clock = 33300,
3670 .hdisplay = 800,
3671 .hsync_start = 800 + 1,
3672 .hsync_end = 800 + 1 + 64,
3673 .htotal = 800 + 1 + 64 + 64,
3674 .vdisplay = 480,
3675 .vsync_start = 480 + 1,
3676 .vsync_end = 480 + 1 + 23,
3677 .vtotal = 480 + 1 + 23 + 22,
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003678};
3679
3680static const struct panel_desc shelly_sca07010_bfn_lnn = {
3681 .modes = &shelly_sca07010_bfn_lnn_mode,
3682 .num_modes = 1,
3683 .size = {
3684 .width = 152,
3685 .height = 91,
3686 },
3687 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3688};
3689
Pascal Roeleven105235e2020-03-20 12:21:33 +01003690static const struct drm_display_mode starry_kr070pe2t_mode = {
3691 .clock = 33000,
3692 .hdisplay = 800,
3693 .hsync_start = 800 + 209,
3694 .hsync_end = 800 + 209 + 1,
3695 .htotal = 800 + 209 + 1 + 45,
3696 .vdisplay = 480,
3697 .vsync_start = 480 + 22,
3698 .vsync_end = 480 + 22 + 1,
3699 .vtotal = 480 + 22 + 1 + 22,
Pascal Roeleven105235e2020-03-20 12:21:33 +01003700};
3701
3702static const struct panel_desc starry_kr070pe2t = {
3703 .modes = &starry_kr070pe2t_mode,
3704 .num_modes = 1,
3705 .bpc = 8,
3706 .size = {
3707 .width = 152,
3708 .height = 86,
3709 },
3710 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3711 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Laurent Pinchart41fad302020-06-30 02:33:17 +03003712 .connector_type = DRM_MODE_CONNECTOR_DPI,
Pascal Roeleven105235e2020-03-20 12:21:33 +01003713};
3714
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003715static const struct drm_display_mode starry_kr122ea0sra_mode = {
3716 .clock = 147000,
3717 .hdisplay = 1920,
3718 .hsync_start = 1920 + 16,
3719 .hsync_end = 1920 + 16 + 16,
3720 .htotal = 1920 + 16 + 16 + 32,
3721 .vdisplay = 1200,
3722 .vsync_start = 1200 + 15,
3723 .vsync_end = 1200 + 15 + 2,
3724 .vtotal = 1200 + 15 + 2 + 18,
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003725 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3726};
3727
3728static const struct panel_desc starry_kr122ea0sra = {
3729 .modes = &starry_kr122ea0sra_mode,
3730 .num_modes = 1,
3731 .size = {
3732 .width = 263,
3733 .height = 164,
3734 },
Brian Norrisc46b9242016-08-26 14:32:14 -07003735 .delay = {
3736 .prepare = 10 + 200,
3737 .enable = 50,
3738 .unprepare = 10 + 500,
3739 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003740};
3741
Jyri Sarha42161532019-03-22 10:33:36 +02003742static const struct drm_display_mode tfc_s9700rtwv43tr_01b_mode = {
3743 .clock = 30000,
3744 .hdisplay = 800,
3745 .hsync_start = 800 + 39,
3746 .hsync_end = 800 + 39 + 47,
3747 .htotal = 800 + 39 + 47 + 39,
3748 .vdisplay = 480,
3749 .vsync_start = 480 + 13,
3750 .vsync_end = 480 + 13 + 2,
3751 .vtotal = 480 + 13 + 2 + 29,
Jyri Sarha42161532019-03-22 10:33:36 +02003752};
3753
3754static const struct panel_desc tfc_s9700rtwv43tr_01b = {
3755 .modes = &tfc_s9700rtwv43tr_01b_mode,
3756 .num_modes = 1,
3757 .bpc = 8,
3758 .size = {
3759 .width = 155,
3760 .height = 90,
3761 },
3762 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003763 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Jyri Sarha42161532019-03-22 10:33:36 +02003764};
3765
Gary Bissonadb973e2016-12-02 09:52:08 +01003766static const struct display_timing tianma_tm070jdhg30_timing = {
3767 .pixelclock = { 62600000, 68200000, 78100000 },
3768 .hactive = { 1280, 1280, 1280 },
3769 .hfront_porch = { 15, 64, 159 },
3770 .hback_porch = { 5, 5, 5 },
3771 .hsync_len = { 1, 1, 256 },
3772 .vactive = { 800, 800, 800 },
3773 .vfront_porch = { 3, 40, 99 },
3774 .vback_porch = { 2, 2, 2 },
3775 .vsync_len = { 1, 1, 128 },
3776 .flags = DISPLAY_FLAGS_DE_HIGH,
3777};
3778
3779static const struct panel_desc tianma_tm070jdhg30 = {
3780 .timings = &tianma_tm070jdhg30_timing,
3781 .num_timings = 1,
3782 .bpc = 8,
3783 .size = {
3784 .width = 151,
3785 .height = 95,
3786 },
3787 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003788 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Gary Bissonadb973e2016-12-02 09:52:08 +01003789};
3790
Max Merchelb3bfcdf2020-06-12 09:22:19 +02003791static const struct panel_desc tianma_tm070jvhg33 = {
3792 .timings = &tianma_tm070jdhg30_timing,
3793 .num_timings = 1,
3794 .bpc = 8,
3795 .size = {
3796 .width = 150,
3797 .height = 94,
3798 },
3799 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3800 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3801};
3802
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003803static const struct display_timing tianma_tm070rvhg71_timing = {
3804 .pixelclock = { 27700000, 29200000, 39600000 },
3805 .hactive = { 800, 800, 800 },
3806 .hfront_porch = { 12, 40, 212 },
3807 .hback_porch = { 88, 88, 88 },
3808 .hsync_len = { 1, 1, 40 },
3809 .vactive = { 480, 480, 480 },
3810 .vfront_porch = { 1, 13, 88 },
3811 .vback_porch = { 32, 32, 32 },
3812 .vsync_len = { 1, 1, 3 },
3813 .flags = DISPLAY_FLAGS_DE_HIGH,
3814};
3815
3816static const struct panel_desc tianma_tm070rvhg71 = {
3817 .timings = &tianma_tm070rvhg71_timing,
3818 .num_timings = 1,
3819 .bpc = 8,
3820 .size = {
3821 .width = 154,
3822 .height = 86,
3823 },
3824 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003825 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003826};
3827
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003828static const struct drm_display_mode ti_nspire_cx_lcd_mode[] = {
3829 {
3830 .clock = 10000,
3831 .hdisplay = 320,
3832 .hsync_start = 320 + 50,
3833 .hsync_end = 320 + 50 + 6,
3834 .htotal = 320 + 50 + 6 + 38,
3835 .vdisplay = 240,
3836 .vsync_start = 240 + 3,
3837 .vsync_end = 240 + 3 + 1,
3838 .vtotal = 240 + 3 + 1 + 17,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003839 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3840 },
3841};
3842
3843static const struct panel_desc ti_nspire_cx_lcd_panel = {
3844 .modes = ti_nspire_cx_lcd_mode,
3845 .num_modes = 1,
3846 .bpc = 8,
3847 .size = {
3848 .width = 65,
3849 .height = 49,
3850 },
3851 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003852 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003853};
3854
3855static const struct drm_display_mode ti_nspire_classic_lcd_mode[] = {
3856 {
3857 .clock = 10000,
3858 .hdisplay = 320,
3859 .hsync_start = 320 + 6,
3860 .hsync_end = 320 + 6 + 6,
3861 .htotal = 320 + 6 + 6 + 6,
3862 .vdisplay = 240,
3863 .vsync_start = 240 + 0,
3864 .vsync_end = 240 + 0 + 1,
3865 .vtotal = 240 + 0 + 1 + 0,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003866 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3867 },
3868};
3869
3870static const struct panel_desc ti_nspire_classic_lcd_panel = {
3871 .modes = ti_nspire_classic_lcd_mode,
3872 .num_modes = 1,
3873 /* The grayscale panel has 8 bit for the color .. Y (black) */
3874 .bpc = 8,
3875 .size = {
3876 .width = 71,
3877 .height = 53,
3878 },
3879 /* This is the grayscale bus format */
3880 .bus_format = MEDIA_BUS_FMT_Y8_1X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003881 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003882};
3883
Lucas Stach06e733e2017-10-18 19:22:40 +02003884static const struct drm_display_mode toshiba_lt089ac29000_mode = {
3885 .clock = 79500,
3886 .hdisplay = 1280,
3887 .hsync_start = 1280 + 192,
3888 .hsync_end = 1280 + 192 + 128,
3889 .htotal = 1280 + 192 + 128 + 64,
3890 .vdisplay = 768,
3891 .vsync_start = 768 + 20,
3892 .vsync_end = 768 + 20 + 7,
3893 .vtotal = 768 + 20 + 7 + 3,
Lucas Stach06e733e2017-10-18 19:22:40 +02003894};
3895
3896static const struct panel_desc toshiba_lt089ac29000 = {
3897 .modes = &toshiba_lt089ac29000_mode,
3898 .num_modes = 1,
3899 .size = {
3900 .width = 194,
3901 .height = 116,
3902 },
Boris Brezillon9781bd12020-01-28 14:55:13 +01003903 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003904 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003905 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach06e733e2017-10-18 19:22:40 +02003906};
3907
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303908static const struct drm_display_mode tpk_f07a_0102_mode = {
3909 .clock = 33260,
3910 .hdisplay = 800,
3911 .hsync_start = 800 + 40,
3912 .hsync_end = 800 + 40 + 128,
3913 .htotal = 800 + 40 + 128 + 88,
3914 .vdisplay = 480,
3915 .vsync_start = 480 + 10,
3916 .vsync_end = 480 + 10 + 2,
3917 .vtotal = 480 + 10 + 2 + 33,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303918};
3919
3920static const struct panel_desc tpk_f07a_0102 = {
3921 .modes = &tpk_f07a_0102_mode,
3922 .num_modes = 1,
3923 .size = {
3924 .width = 152,
3925 .height = 91,
3926 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003927 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303928};
3929
3930static const struct drm_display_mode tpk_f10a_0102_mode = {
3931 .clock = 45000,
3932 .hdisplay = 1024,
3933 .hsync_start = 1024 + 176,
3934 .hsync_end = 1024 + 176 + 5,
3935 .htotal = 1024 + 176 + 5 + 88,
3936 .vdisplay = 600,
3937 .vsync_start = 600 + 20,
3938 .vsync_end = 600 + 20 + 5,
3939 .vtotal = 600 + 20 + 5 + 25,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303940};
3941
3942static const struct panel_desc tpk_f10a_0102 = {
3943 .modes = &tpk_f10a_0102_mode,
3944 .num_modes = 1,
3945 .size = {
3946 .width = 223,
3947 .height = 125,
3948 },
3949};
3950
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01003951static const struct display_timing urt_umsh_8596md_timing = {
3952 .pixelclock = { 33260000, 33260000, 33260000 },
3953 .hactive = { 800, 800, 800 },
3954 .hfront_porch = { 41, 41, 41 },
3955 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
3956 .hsync_len = { 71, 128, 128 },
3957 .vactive = { 480, 480, 480 },
3958 .vfront_porch = { 10, 10, 10 },
3959 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
3960 .vsync_len = { 2, 2, 2 },
3961 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
3962 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
3963};
3964
3965static const struct panel_desc urt_umsh_8596md_lvds = {
3966 .timings = &urt_umsh_8596md_timing,
3967 .num_timings = 1,
3968 .bpc = 6,
3969 .size = {
3970 .width = 152,
3971 .height = 91,
3972 },
3973 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003974 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01003975};
3976
3977static const struct panel_desc urt_umsh_8596md_parallel = {
3978 .timings = &urt_umsh_8596md_timing,
3979 .num_timings = 1,
3980 .bpc = 6,
3981 .size = {
3982 .width = 152,
3983 .height = 91,
3984 },
3985 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3986};
3987
Fabio Estevam04206182019-02-18 21:27:06 -03003988static const struct drm_display_mode vl050_8048nt_c01_mode = {
3989 .clock = 33333,
3990 .hdisplay = 800,
3991 .hsync_start = 800 + 210,
3992 .hsync_end = 800 + 210 + 20,
3993 .htotal = 800 + 210 + 20 + 46,
3994 .vdisplay = 480,
3995 .vsync_start = 480 + 22,
3996 .vsync_end = 480 + 22 + 10,
3997 .vtotal = 480 + 22 + 10 + 23,
Fabio Estevam04206182019-02-18 21:27:06 -03003998 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
3999};
4000
4001static const struct panel_desc vl050_8048nt_c01 = {
4002 .modes = &vl050_8048nt_c01_mode,
4003 .num_modes = 1,
4004 .bpc = 8,
4005 .size = {
4006 .width = 120,
4007 .height = 76,
4008 },
4009 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02004010 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Fabio Estevam04206182019-02-18 21:27:06 -03004011};
4012
Richard Genoude4bac402017-03-27 12:33:23 +02004013static const struct drm_display_mode winstar_wf35ltiacd_mode = {
4014 .clock = 6410,
4015 .hdisplay = 320,
4016 .hsync_start = 320 + 20,
4017 .hsync_end = 320 + 20 + 30,
4018 .htotal = 320 + 20 + 30 + 38,
4019 .vdisplay = 240,
4020 .vsync_start = 240 + 4,
4021 .vsync_end = 240 + 4 + 3,
4022 .vtotal = 240 + 4 + 3 + 15,
Richard Genoude4bac402017-03-27 12:33:23 +02004023 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4024};
4025
4026static const struct panel_desc winstar_wf35ltiacd = {
4027 .modes = &winstar_wf35ltiacd_mode,
4028 .num_modes = 1,
4029 .bpc = 8,
4030 .size = {
4031 .width = 70,
4032 .height = 53,
4033 },
4034 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
4035};
4036
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05304037static const struct drm_display_mode yes_optoelectronics_ytc700tlag_05_201c_mode = {
4038 .clock = 51200,
4039 .hdisplay = 1024,
4040 .hsync_start = 1024 + 100,
4041 .hsync_end = 1024 + 100 + 100,
4042 .htotal = 1024 + 100 + 100 + 120,
4043 .vdisplay = 600,
4044 .vsync_start = 600 + 10,
4045 .vsync_end = 600 + 10 + 10,
4046 .vtotal = 600 + 10 + 10 + 15,
4047 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
4048};
4049
4050static const struct panel_desc yes_optoelectronics_ytc700tlag_05_201c = {
4051 .modes = &yes_optoelectronics_ytc700tlag_05_201c_mode,
4052 .num_modes = 1,
4053 .bpc = 6,
4054 .size = {
4055 .width = 154,
4056 .height = 90,
4057 },
4058 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
4059 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
4060 .connector_type = DRM_MODE_CONNECTOR_LVDS,
4061};
4062
Linus Walleijfcec4162018-10-26 13:13:34 +02004063static const struct drm_display_mode arm_rtsm_mode[] = {
4064 {
4065 .clock = 65000,
4066 .hdisplay = 1024,
4067 .hsync_start = 1024 + 24,
4068 .hsync_end = 1024 + 24 + 136,
4069 .htotal = 1024 + 24 + 136 + 160,
4070 .vdisplay = 768,
4071 .vsync_start = 768 + 3,
4072 .vsync_end = 768 + 3 + 6,
4073 .vtotal = 768 + 3 + 6 + 29,
Linus Walleijfcec4162018-10-26 13:13:34 +02004074 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4075 },
4076};
4077
4078static const struct panel_desc arm_rtsm = {
4079 .modes = arm_rtsm_mode,
4080 .num_modes = 1,
4081 .bpc = 8,
4082 .size = {
4083 .width = 400,
4084 .height = 300,
4085 },
4086 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
4087};
4088
Thierry Reding280921d2013-08-30 15:10:14 +02004089static const struct of_device_id platform_of_match[] = {
4090 {
Jagan Tekibca684e2020-08-29 22:03:28 +05304091 .compatible = "ampire,am-1280800n3tzqw-t00h",
4092 .data = &ampire_am_1280800n3tzqw_t00h,
4093 }, {
Yannick Fertre966fea72017-03-28 11:44:49 +02004094 .compatible = "ampire,am-480272h3tmqw-t01h",
4095 .data = &ampire_am_480272h3tmqw_t01h,
4096 }, {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01004097 .compatible = "ampire,am800480r3tmqwa1h",
4098 .data = &ampire_am800480r3tmqwa1h,
4099 }, {
Linus Walleijfcec4162018-10-26 13:13:34 +02004100 .compatible = "arm,rtsm-display",
4101 .data = &arm_rtsm,
4102 }, {
Sébastien Szymanskic479450f2019-05-07 17:27:12 +02004103 .compatible = "armadeus,st0700-adapt",
4104 .data = &armadeus_st0700_adapt,
4105 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004106 .compatible = "auo,b101aw03",
4107 .data = &auo_b101aw03,
4108 }, {
Huang Lina531bc32015-02-28 10:18:58 +08004109 .compatible = "auo,b101ean01",
4110 .data = &auo_b101ean01,
4111 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04004112 .compatible = "auo,b101xtn01",
4113 .data = &auo_b101xtn01,
4114 }, {
Rob Clarkda4582862020-01-08 15:53:56 -08004115 .compatible = "auo,b116xa01",
4116 .data = &auo_b116xak01,
4117 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05304118 .compatible = "auo,b116xw03",
4119 .data = &auo_b116xw03,
4120 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05304121 .compatible = "auo,b133htn01",
4122 .data = &auo_b133htn01,
4123 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07004124 .compatible = "auo,b133xtn01",
4125 .data = &auo_b133xtn01,
4126 }, {
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02004127 .compatible = "auo,g070vvn01",
4128 .data = &auo_g070vvn01,
4129 }, {
Alex Gonzalez4fb86402018-10-25 17:09:30 +02004130 .compatible = "auo,g101evn010",
4131 .data = &auo_g101evn010,
4132 }, {
Christoph Fritz4451c282017-12-16 14:13:36 +01004133 .compatible = "auo,g104sn02",
4134 .data = &auo_g104sn02,
4135 }, {
Sebastian Reichel03e909a2020-04-15 19:27:25 +02004136 .compatible = "auo,g121ean01",
4137 .data = &auo_g121ean01,
4138 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01004139 .compatible = "auo,g133han01",
4140 .data = &auo_g133han01,
4141 }, {
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02004142 .compatible = "auo,g156xtn01",
4143 .data = &auo_g156xtn01,
4144 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01004145 .compatible = "auo,g185han01",
4146 .data = &auo_g185han01,
4147 }, {
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02004148 .compatible = "auo,g190ean01",
4149 .data = &auo_g190ean01,
4150 }, {
Lucas Stach70c0d5b2017-06-08 20:07:58 +02004151 .compatible = "auo,p320hvn03",
4152 .data = &auo_p320hvn03,
4153 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07004154 .compatible = "auo,t215hvn01",
4155 .data = &auo_t215hvn01,
4156 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01004157 .compatible = "avic,tm070ddh03",
4158 .data = &avic_tm070ddh03,
4159 }, {
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08004160 .compatible = "bananapi,s070wv20-ct16",
4161 .data = &bananapi_s070wv20_ct16,
4162 }, {
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02004163 .compatible = "boe,hv070wsa-100",
4164 .data = &boe_hv070wsa
4165 }, {
Caesar Wangcac1a412016-12-14 11:19:56 +08004166 .compatible = "boe,nv101wxmn51",
4167 .data = &boe_nv101wxmn51,
4168 }, {
Douglas Andersona96ee0f2020-11-09 17:00:58 -08004169 .compatible = "boe,nv110wtm-n61",
4170 .data = &boe_nv110wtm_n61,
4171 }, {
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07004172 .compatible = "boe,nv133fhm-n61",
4173 .data = &boe_nv133fhm_n61,
4174 }, {
Douglas Andersoncfe40d02020-05-08 15:59:02 -07004175 .compatible = "boe,nv133fhm-n62",
4176 .data = &boe_nv133fhm_n61,
4177 }, {
Tobias Schramma5119812020-01-09 12:29:52 +01004178 .compatible = "boe,nv140fhmn49",
4179 .data = &boe_nv140fhmn49,
4180 }, {
Giulio Benettie58edce2018-07-31 01:11:16 +02004181 .compatible = "cdtech,s043wq26h-ct7",
4182 .data = &cdtech_s043wq26h_ct7,
4183 }, {
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02004184 .compatible = "cdtech,s070pws19hp-fc21",
4185 .data = &cdtech_s070pws19hp_fc21,
4186 }, {
4187 .compatible = "cdtech,s070swv29hg-dc44",
4188 .data = &cdtech_s070swv29hg_dc44,
4189 }, {
Giulio Benetti982f9442018-07-31 01:11:14 +02004190 .compatible = "cdtech,s070wv95-ct16",
4191 .data = &cdtech_s070wv95_ct16,
4192 }, {
Marek Vasut07c913c2020-07-28 22:12:42 +02004193 .compatible = "chefree,ch101olhlwh-002",
4194 .data = &chefree_ch101olhlwh_002,
4195 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08004196 .compatible = "chunghwa,claa070wp03xg",
4197 .data = &chunghwa_claa070wp03xg,
4198 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07004199 .compatible = "chunghwa,claa101wa01a",
4200 .data = &chunghwa_claa101wa01a
4201 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004202 .compatible = "chunghwa,claa101wb01",
4203 .data = &chunghwa_claa101wb01
4204 }, {
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02004205 .compatible = "dataimage,scf0700c48ggu18",
4206 .data = &dataimage_scf0700c48ggu18,
4207 }, {
Philipp Zabel0ca0c822018-05-23 11:25:04 +02004208 .compatible = "dlc,dlc0700yzg-1",
4209 .data = &dlc_dlc0700yzg_1,
4210 }, {
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02004211 .compatible = "dlc,dlc1010gig",
4212 .data = &dlc_dlc1010gig,
4213 }, {
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02004214 .compatible = "edt,et035012dm6",
4215 .data = &edt_et035012dm6,
4216 }, {
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00004217 .compatible = "edt,etm043080dh6gp",
4218 .data = &edt_etm043080dh6gp,
4219 }, {
Marek Vasutfd819bf2019-02-19 15:04:38 +01004220 .compatible = "edt,etm0430g0dh6",
4221 .data = &edt_etm0430g0dh6,
4222 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02004223 .compatible = "edt,et057090dhu",
4224 .data = &edt_et057090dhu,
4225 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02004226 .compatible = "edt,et070080dh6",
4227 .data = &edt_etm0700g0dh6,
4228 }, {
4229 .compatible = "edt,etm0700g0dh6",
4230 .data = &edt_etm0700g0dh6,
4231 }, {
Jan Tuerkaa7e6452018-06-19 11:55:44 +02004232 .compatible = "edt,etm0700g0bdh6",
4233 .data = &edt_etm0700g0bdh6,
4234 }, {
Jan Tuerkaad34de2018-06-19 11:55:45 +02004235 .compatible = "edt,etm0700g0edh6",
4236 .data = &edt_etm0700g0bdh6,
4237 }, {
Marco Felsch9158e3c2019-04-16 12:06:45 +02004238 .compatible = "evervision,vgg804821",
4239 .data = &evervision_vgg804821,
4240 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02004241 .compatible = "foxlink,fl500wvr00-a0t",
4242 .data = &foxlink_fl500wvr00_a0t,
4243 }, {
Paul Cercueil7b6bd842020-01-13 13:17:41 -03004244 .compatible = "frida,frd350h54004",
4245 .data = &frida_frd350h54004,
4246 }, {
Jagan Teki3be20712019-05-07 18:37:07 +05304247 .compatible = "friendlyarm,hd702e",
4248 .data = &friendlyarm_hd702e,
4249 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01004250 .compatible = "giantplus,gpg482739qs5",
4251 .data = &giantplus_gpg482739qs5
4252 }, {
Paul Cercueil2c6574a2019-06-06 00:22:47 +02004253 .compatible = "giantplus,gpm940b0",
4254 .data = &giantplus_gpm940b0,
4255 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02004256 .compatible = "hannstar,hsd070pww1",
4257 .data = &hannstar_hsd070pww1,
4258 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07004259 .compatible = "hannstar,hsd100pxn1",
4260 .data = &hannstar_hsd100pxn1,
4261 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01004262 .compatible = "hit,tx23d38vm0caa",
4263 .data = &hitachi_tx23d38vm0caa
4264 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01004265 .compatible = "innolux,at043tn24",
4266 .data = &innolux_at043tn24,
4267 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02004268 .compatible = "innolux,at070tn92",
4269 .data = &innolux_at070tn92,
4270 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02004271 .compatible = "innolux,g070y2-l01",
4272 .data = &innolux_g070y2_l01,
4273 }, {
4274 .compatible = "innolux,g101ice-l01",
Michael Olbrich1e29b842016-08-15 14:32:02 +02004275 .data = &innolux_g101ice_l01
4276 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02004277 .compatible = "innolux,g121i1-l01",
Lucas Stachd731f662014-11-06 17:44:33 +01004278 .data = &innolux_g121i1_l01
4279 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05004280 .compatible = "innolux,g121x1-l03",
4281 .data = &innolux_g121x1_l03,
4282 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02004283 .compatible = "innolux,n116bge",
4284 .data = &innolux_n116bge,
4285 }, {
Lukas F. Hartmanna14c6b02020-11-24 18:26:04 +01004286 .compatible = "innolux,n125hce-gn1",
4287 .data = &innolux_n125hce_gn1,
4288 }, {
Alban Bedelea447392014-07-22 08:38:55 +02004289 .compatible = "innolux,n156bge-l21",
4290 .data = &innolux_n156bge_l21,
4291 }, {
Douglas Anderson8f054b62018-10-25 15:21:34 -07004292 .compatible = "innolux,p120zdg-bf1",
4293 .data = &innolux_p120zdg_bf1,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05304294 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01004295 .compatible = "innolux,zj070na-01p",
4296 .data = &innolux_zj070na_01p,
4297 }, {
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07004298 .compatible = "ivo,m133nwf4-r0",
4299 .data = &ivo_m133nwf4_r0,
4300 }, {
Douglas Andersonfc26a372020-08-21 08:35:15 -07004301 .compatible = "kingdisplay,kd116n21-30nv-a010",
4302 .data = &kingdisplay_kd116n21_30nv_a010,
4303 }, {
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02004304 .compatible = "koe,tx14d24vm1bpa",
4305 .data = &koe_tx14d24vm1bpa,
4306 }, {
Liu Ying8a070522020-06-01 14:11:20 +08004307 .compatible = "koe,tx26d202vm0bwa",
4308 .data = &koe_tx26d202vm0bwa,
4309 }, {
Jagan Teki8cfe8342018-02-04 23:19:28 +05304310 .compatible = "koe,tx31d200vm0baa",
4311 .data = &koe_tx31d200vm0baa,
4312 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01004313 .compatible = "kyo,tcg121xglp",
4314 .data = &kyo_tcg121xglp,
4315 }, {
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01004316 .compatible = "lemaker,bl035-rgb-002",
4317 .data = &lemaker_bl035_rgb_002,
4318 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02004319 .compatible = "lg,lb070wv8",
4320 .data = &lg_lb070wv8,
4321 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08004322 .compatible = "lg,lp079qx1-sp0v",
4323 .data = &lg_lp079qx1_sp0v,
4324 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08004325 .compatible = "lg,lp097qx1-spa1",
4326 .data = &lg_lp097qx1_spa1,
4327 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08004328 .compatible = "lg,lp120up1",
4329 .data = &lg_lp120up1,
4330 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01004331 .compatible = "lg,lp129qe",
4332 .data = &lg_lp129qe,
4333 }, {
Adam Ford0d354082019-10-16 08:51:45 -05004334 .compatible = "logicpd,type28",
4335 .data = &logicpd_type_28,
4336 }, {
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01004337 .compatible = "logictechno,lt161010-2nhc",
4338 .data = &logictechno_lt161010_2nh,
4339 }, {
4340 .compatible = "logictechno,lt161010-2nhr",
4341 .data = &logictechno_lt161010_2nh,
4342 }, {
4343 .compatible = "logictechno,lt170410-2whc",
4344 .data = &logictechno_lt170410_2whc,
4345 }, {
Lukasz Majewski65c766c2017-10-21 00:18:37 +02004346 .compatible = "mitsubishi,aa070mc01-ca1",
4347 .data = &mitsubishi_aa070mc01,
4348 }, {
Lucas Stach01bacc132017-06-08 20:07:55 +02004349 .compatible = "nec,nl12880bc20-05",
4350 .data = &nec_nl12880bc20_05,
4351 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08004352 .compatible = "nec,nl4827hc19-05b",
4353 .data = &nec_nl4827hc19_05b,
4354 }, {
Maxime Riparde6c2f062016-09-06 16:46:17 +02004355 .compatible = "netron-dy,e231732",
4356 .data = &netron_dy_e231732,
4357 }, {
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08004358 .compatible = "neweast,wjfh116008a",
4359 .data = &neweast_wjfh116008a,
4360 }, {
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03004361 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
4362 .data = &newhaven_nhd_43_480272ef_atxl,
4363 }, {
Lucas Stach4177fa62017-06-08 20:07:57 +02004364 .compatible = "nlt,nl192108ac18-02d",
4365 .data = &nlt_nl192108ac18_02d,
4366 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02004367 .compatible = "nvd,9128",
4368 .data = &nvd_9128,
4369 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02004370 .compatible = "okaya,rs800480t-7x0gp",
4371 .data = &okaya_rs800480t_7x0gp,
4372 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01004373 .compatible = "olimex,lcd-olinuxino-43-ts",
4374 .data = &olimex_lcd_olinuxino_43ts,
4375 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07004376 .compatible = "ontat,yx700wv03",
4377 .data = &ontat_yx700wv03,
4378 }, {
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02004379 .compatible = "ortustech,com37h3m05dtc",
4380 .data = &ortustech_com37h3m,
4381 }, {
4382 .compatible = "ortustech,com37h3m99dtc",
4383 .data = &ortustech_com37h3m,
4384 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01004385 .compatible = "ortustech,com43h4m85ulc",
4386 .data = &ortustech_com43h4m85ulc,
4387 }, {
Laurent Pinchart163f7a32018-12-07 22:13:44 +02004388 .compatible = "osddisplays,osd070t1718-19ts",
4389 .data = &osddisplays_osd070t1718_19ts,
4390 }, {
Eugen Hristev4ba3e562019-01-14 09:43:31 +00004391 .compatible = "pda,91-00156-a0",
4392 .data = &pda_91_00156_a0,
4393 }, {
Marek Vasutd69de692020-07-28 14:12:46 +02004394 .compatible = "powertip,ph800480t013-idf02",
4395 .data = &powertip_ph800480t013_idf02,
4396 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02004397 .compatible = "qiaodian,qd43003c0-40",
4398 .data = &qd43003c0_40,
4399 }, {
Jagan Teki23167fa2018-06-07 19:16:48 +05304400 .compatible = "rocktech,rk070er9427",
4401 .data = &rocktech_rk070er9427,
4402 }, {
Jyri Sarhaf3050472020-02-11 14:17:18 +02004403 .compatible = "rocktech,rk101ii01d-ct",
4404 .data = &rocktech_rk101ii01d_ct,
4405 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08004406 .compatible = "samsung,lsn122dl01-c01",
4407 .data = &samsung_lsn122dl01_c01,
4408 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01004409 .compatible = "samsung,ltn101nt05",
4410 .data = &samsung_ltn101nt05,
4411 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01004412 .compatible = "samsung,ltn140at29-301",
4413 .data = &samsung_ltn140at29_301,
4414 }, {
Miquel Raynal44c58c52020-01-09 19:40:37 +01004415 .compatible = "satoz,sat050at40h12r2",
4416 .data = &satoz_sat050at40h12r2,
4417 }, {
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07004418 .compatible = "sharp,ld-d5116z01b",
4419 .data = &sharp_ld_d5116z01b,
4420 }, {
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03004421 .compatible = "sharp,lq035q7db03",
4422 .data = &sharp_lq035q7db03,
4423 }, {
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02004424 .compatible = "sharp,lq070y3dg3b",
4425 .data = &sharp_lq070y3dg3b,
4426 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07004427 .compatible = "sharp,lq101k1ly04",
4428 .data = &sharp_lq101k1ly04,
4429 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08004430 .compatible = "sharp,lq123p1jx31",
4431 .data = &sharp_lq123p1jx31,
4432 }, {
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02004433 .compatible = "sharp,ls020b1dd01d",
4434 .data = &sharp_ls020b1dd01d,
4435 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01004436 .compatible = "shelly,sca07010-bfn-lnn",
4437 .data = &shelly_sca07010_bfn_lnn,
4438 }, {
Pascal Roeleven105235e2020-03-20 12:21:33 +01004439 .compatible = "starry,kr070pe2t",
4440 .data = &starry_kr070pe2t,
4441 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07004442 .compatible = "starry,kr122ea0sra",
4443 .data = &starry_kr122ea0sra,
4444 }, {
Jyri Sarha42161532019-03-22 10:33:36 +02004445 .compatible = "tfc,s9700rtwv43tr-01b",
4446 .data = &tfc_s9700rtwv43tr_01b,
4447 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01004448 .compatible = "tianma,tm070jdhg30",
4449 .data = &tianma_tm070jdhg30,
4450 }, {
Max Merchelb3bfcdf2020-06-12 09:22:19 +02004451 .compatible = "tianma,tm070jvhg33",
4452 .data = &tianma_tm070jvhg33,
4453 }, {
Lukasz Majewski870a0b12017-11-07 16:30:58 +01004454 .compatible = "tianma,tm070rvhg71",
4455 .data = &tianma_tm070rvhg71,
4456 }, {
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004457 .compatible = "ti,nspire-cx-lcd-panel",
4458 .data = &ti_nspire_cx_lcd_panel,
4459 }, {
4460 .compatible = "ti,nspire-classic-lcd-panel",
4461 .data = &ti_nspire_classic_lcd_panel,
4462 }, {
Lucas Stach06e733e2017-10-18 19:22:40 +02004463 .compatible = "toshiba,lt089ac29000",
4464 .data = &toshiba_lt089ac29000,
4465 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304466 .compatible = "tpk,f07a-0102",
4467 .data = &tpk_f07a_0102,
4468 }, {
4469 .compatible = "tpk,f10a-0102",
4470 .data = &tpk_f10a_0102,
4471 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01004472 .compatible = "urt,umsh-8596md-t",
4473 .data = &urt_umsh_8596md_parallel,
4474 }, {
4475 .compatible = "urt,umsh-8596md-1t",
4476 .data = &urt_umsh_8596md_parallel,
4477 }, {
4478 .compatible = "urt,umsh-8596md-7t",
4479 .data = &urt_umsh_8596md_parallel,
4480 }, {
4481 .compatible = "urt,umsh-8596md-11t",
4482 .data = &urt_umsh_8596md_lvds,
4483 }, {
4484 .compatible = "urt,umsh-8596md-19t",
4485 .data = &urt_umsh_8596md_lvds,
4486 }, {
4487 .compatible = "urt,umsh-8596md-20t",
4488 .data = &urt_umsh_8596md_parallel,
4489 }, {
Fabio Estevam04206182019-02-18 21:27:06 -03004490 .compatible = "vxt,vl050-8048nt-c01",
4491 .data = &vl050_8048nt_c01,
4492 }, {
Richard Genoude4bac402017-03-27 12:33:23 +02004493 .compatible = "winstar,wf35ltiacd",
4494 .data = &winstar_wf35ltiacd,
4495 }, {
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05304496 .compatible = "yes-optoelectronics,ytc700tlag-05-201c",
4497 .data = &yes_optoelectronics_ytc700tlag_05_201c,
4498 }, {
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +01004499 /* Must be the last entry */
4500 .compatible = "panel-dpi",
4501 .data = &panel_dpi,
4502 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004503 /* sentinel */
4504 }
4505};
4506MODULE_DEVICE_TABLE(of, platform_of_match);
4507
4508static int panel_simple_platform_probe(struct platform_device *pdev)
4509{
4510 const struct of_device_id *id;
4511
4512 id = of_match_node(platform_of_match, pdev->dev.of_node);
4513 if (!id)
4514 return -ENODEV;
4515
4516 return panel_simple_probe(&pdev->dev, id->data);
4517}
4518
4519static int panel_simple_platform_remove(struct platform_device *pdev)
4520{
4521 return panel_simple_remove(&pdev->dev);
4522}
4523
Thierry Redingd02fd932014-04-29 17:21:21 +02004524static void panel_simple_platform_shutdown(struct platform_device *pdev)
4525{
4526 panel_simple_shutdown(&pdev->dev);
4527}
4528
Thierry Reding280921d2013-08-30 15:10:14 +02004529static struct platform_driver panel_simple_platform_driver = {
4530 .driver = {
4531 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02004532 .of_match_table = platform_of_match,
4533 },
4534 .probe = panel_simple_platform_probe,
4535 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004536 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004537};
4538
Thierry Reding210fcd92013-11-22 19:27:11 +01004539struct panel_desc_dsi {
4540 struct panel_desc desc;
4541
Thierry Reding462658b2014-03-14 11:24:57 +01004542 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004543 enum mipi_dsi_pixel_format format;
4544 unsigned int lanes;
4545};
4546
Thierry Redingd718d792015-04-08 16:52:33 +02004547static const struct drm_display_mode auo_b080uan01_mode = {
4548 .clock = 154500,
4549 .hdisplay = 1200,
4550 .hsync_start = 1200 + 62,
4551 .hsync_end = 1200 + 62 + 4,
4552 .htotal = 1200 + 62 + 4 + 62,
4553 .vdisplay = 1920,
4554 .vsync_start = 1920 + 9,
4555 .vsync_end = 1920 + 9 + 2,
4556 .vtotal = 1920 + 9 + 2 + 8,
Thierry Redingd718d792015-04-08 16:52:33 +02004557};
4558
4559static const struct panel_desc_dsi auo_b080uan01 = {
4560 .desc = {
4561 .modes = &auo_b080uan01_mode,
4562 .num_modes = 1,
4563 .bpc = 8,
4564 .size = {
4565 .width = 108,
4566 .height = 272,
4567 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004568 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Redingd718d792015-04-08 16:52:33 +02004569 },
4570 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
4571 .format = MIPI_DSI_FMT_RGB888,
4572 .lanes = 4,
4573};
4574
Chris Zhongc8521962015-11-20 16:15:37 +08004575static const struct drm_display_mode boe_tv080wum_nl0_mode = {
4576 .clock = 160000,
4577 .hdisplay = 1200,
4578 .hsync_start = 1200 + 120,
4579 .hsync_end = 1200 + 120 + 20,
4580 .htotal = 1200 + 120 + 20 + 21,
4581 .vdisplay = 1920,
4582 .vsync_start = 1920 + 21,
4583 .vsync_end = 1920 + 21 + 3,
4584 .vtotal = 1920 + 21 + 3 + 18,
Chris Zhongc8521962015-11-20 16:15:37 +08004585 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4586};
4587
4588static const struct panel_desc_dsi boe_tv080wum_nl0 = {
4589 .desc = {
4590 .modes = &boe_tv080wum_nl0_mode,
4591 .num_modes = 1,
4592 .size = {
4593 .width = 107,
4594 .height = 172,
4595 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004596 .connector_type = DRM_MODE_CONNECTOR_DSI,
Chris Zhongc8521962015-11-20 16:15:37 +08004597 },
4598 .flags = MIPI_DSI_MODE_VIDEO |
4599 MIPI_DSI_MODE_VIDEO_BURST |
4600 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
4601 .format = MIPI_DSI_FMT_RGB888,
4602 .lanes = 4,
4603};
4604
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004605static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
4606 .clock = 71000,
4607 .hdisplay = 800,
4608 .hsync_start = 800 + 32,
4609 .hsync_end = 800 + 32 + 1,
4610 .htotal = 800 + 32 + 1 + 57,
4611 .vdisplay = 1280,
4612 .vsync_start = 1280 + 28,
4613 .vsync_end = 1280 + 28 + 1,
4614 .vtotal = 1280 + 28 + 1 + 14,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004615};
4616
4617static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
4618 .desc = {
4619 .modes = &lg_ld070wx3_sl01_mode,
4620 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004621 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004622 .size = {
4623 .width = 94,
4624 .height = 151,
4625 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004626 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004627 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004628 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004629 .format = MIPI_DSI_FMT_RGB888,
4630 .lanes = 4,
4631};
4632
Alexandre Courbot499ce852014-01-21 18:57:09 +09004633static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
4634 .clock = 67000,
4635 .hdisplay = 720,
4636 .hsync_start = 720 + 12,
4637 .hsync_end = 720 + 12 + 4,
4638 .htotal = 720 + 12 + 4 + 112,
4639 .vdisplay = 1280,
4640 .vsync_start = 1280 + 8,
4641 .vsync_end = 1280 + 8 + 4,
4642 .vtotal = 1280 + 8 + 4 + 12,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004643};
4644
4645static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
4646 .desc = {
4647 .modes = &lg_lh500wx1_sd03_mode,
4648 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004649 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004650 .size = {
4651 .width = 62,
4652 .height = 110,
4653 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004654 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004655 },
4656 .flags = MIPI_DSI_MODE_VIDEO,
4657 .format = MIPI_DSI_FMT_RGB888,
4658 .lanes = 4,
4659};
4660
Thierry Reding280921d2013-08-30 15:10:14 +02004661static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
4662 .clock = 157200,
4663 .hdisplay = 1920,
4664 .hsync_start = 1920 + 154,
4665 .hsync_end = 1920 + 154 + 16,
4666 .htotal = 1920 + 154 + 16 + 32,
4667 .vdisplay = 1200,
4668 .vsync_start = 1200 + 17,
4669 .vsync_end = 1200 + 17 + 2,
4670 .vtotal = 1200 + 17 + 2 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02004671};
4672
Thierry Reding210fcd92013-11-22 19:27:11 +01004673static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
4674 .desc = {
4675 .modes = &panasonic_vvx10f004b00_mode,
4676 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004677 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01004678 .size = {
4679 .width = 217,
4680 .height = 136,
4681 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004682 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Reding280921d2013-08-30 15:10:14 +02004683 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004684 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
4685 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01004686 .format = MIPI_DSI_FMT_RGB888,
4687 .lanes = 4,
4688};
4689
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004690static const struct drm_display_mode lg_acx467akm_7_mode = {
4691 .clock = 150000,
4692 .hdisplay = 1080,
4693 .hsync_start = 1080 + 2,
4694 .hsync_end = 1080 + 2 + 2,
4695 .htotal = 1080 + 2 + 2 + 2,
4696 .vdisplay = 1920,
4697 .vsync_start = 1920 + 2,
4698 .vsync_end = 1920 + 2 + 2,
4699 .vtotal = 1920 + 2 + 2 + 2,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004700};
4701
4702static const struct panel_desc_dsi lg_acx467akm_7 = {
4703 .desc = {
4704 .modes = &lg_acx467akm_7_mode,
4705 .num_modes = 1,
4706 .bpc = 8,
4707 .size = {
4708 .width = 62,
4709 .height = 110,
4710 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004711 .connector_type = DRM_MODE_CONNECTOR_DSI,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004712 },
4713 .flags = 0,
4714 .format = MIPI_DSI_FMT_RGB888,
4715 .lanes = 4,
4716};
4717
Peter Ujfalusi62967232019-02-26 09:55:21 +02004718static const struct drm_display_mode osd101t2045_53ts_mode = {
4719 .clock = 154500,
4720 .hdisplay = 1920,
4721 .hsync_start = 1920 + 112,
4722 .hsync_end = 1920 + 112 + 16,
4723 .htotal = 1920 + 112 + 16 + 32,
4724 .vdisplay = 1200,
4725 .vsync_start = 1200 + 16,
4726 .vsync_end = 1200 + 16 + 2,
4727 .vtotal = 1200 + 16 + 2 + 16,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004728 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
4729};
4730
4731static const struct panel_desc_dsi osd101t2045_53ts = {
4732 .desc = {
4733 .modes = &osd101t2045_53ts_mode,
4734 .num_modes = 1,
4735 .bpc = 8,
4736 .size = {
4737 .width = 217,
4738 .height = 136,
4739 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004740 .connector_type = DRM_MODE_CONNECTOR_DSI,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004741 },
4742 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
4743 MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
4744 MIPI_DSI_MODE_EOT_PACKET,
4745 .format = MIPI_DSI_FMT_RGB888,
4746 .lanes = 4,
4747};
4748
Thierry Reding210fcd92013-11-22 19:27:11 +01004749static const struct of_device_id dsi_of_match[] = {
4750 {
Thierry Redingd718d792015-04-08 16:52:33 +02004751 .compatible = "auo,b080uan01",
4752 .data = &auo_b080uan01
4753 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08004754 .compatible = "boe,tv080wum-nl0",
4755 .data = &boe_tv080wum_nl0
4756 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004757 .compatible = "lg,ld070wx3-sl01",
4758 .data = &lg_ld070wx3_sl01
4759 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09004760 .compatible = "lg,lh500wx1-sd03",
4761 .data = &lg_lh500wx1_sd03
4762 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01004763 .compatible = "panasonic,vvx10f004b00",
4764 .data = &panasonic_vvx10f004b00
4765 }, {
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004766 .compatible = "lg,acx467akm-7",
4767 .data = &lg_acx467akm_7
4768 }, {
Peter Ujfalusi62967232019-02-26 09:55:21 +02004769 .compatible = "osddisplays,osd101t2045-53ts",
4770 .data = &osd101t2045_53ts
4771 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01004772 /* sentinel */
4773 }
4774};
4775MODULE_DEVICE_TABLE(of, dsi_of_match);
4776
4777static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
4778{
4779 const struct panel_desc_dsi *desc;
4780 const struct of_device_id *id;
4781 int err;
4782
4783 id = of_match_node(dsi_of_match, dsi->dev.of_node);
4784 if (!id)
4785 return -ENODEV;
4786
4787 desc = id->data;
4788
4789 err = panel_simple_probe(&dsi->dev, &desc->desc);
4790 if (err < 0)
4791 return err;
4792
Thierry Reding462658b2014-03-14 11:24:57 +01004793 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004794 dsi->format = desc->format;
4795 dsi->lanes = desc->lanes;
4796
Peter Ujfalusi7ad9db62019-02-26 10:11:53 +02004797 err = mipi_dsi_attach(dsi);
4798 if (err) {
4799 struct panel_simple *panel = dev_get_drvdata(&dsi->dev);
4800
4801 drm_panel_remove(&panel->base);
4802 }
4803
4804 return err;
Thierry Reding210fcd92013-11-22 19:27:11 +01004805}
4806
4807static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
4808{
4809 int err;
4810
4811 err = mipi_dsi_detach(dsi);
4812 if (err < 0)
4813 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
4814
4815 return panel_simple_remove(&dsi->dev);
4816}
4817
Thierry Redingd02fd932014-04-29 17:21:21 +02004818static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
4819{
4820 panel_simple_shutdown(&dsi->dev);
4821}
4822
Thierry Reding210fcd92013-11-22 19:27:11 +01004823static struct mipi_dsi_driver panel_simple_dsi_driver = {
4824 .driver = {
4825 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01004826 .of_match_table = dsi_of_match,
4827 },
4828 .probe = panel_simple_dsi_probe,
4829 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004830 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004831};
4832
4833static int __init panel_simple_init(void)
4834{
Thierry Reding210fcd92013-11-22 19:27:11 +01004835 int err;
4836
4837 err = platform_driver_register(&panel_simple_platform_driver);
4838 if (err < 0)
4839 return err;
4840
4841 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
4842 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
Qinglang Miaof2e66f22020-10-31 09:18:56 +08004843 if (err < 0) {
4844 platform_driver_unregister(&panel_simple_platform_driver);
Thierry Reding210fcd92013-11-22 19:27:11 +01004845 return err;
Qinglang Miaof2e66f22020-10-31 09:18:56 +08004846 }
Thierry Reding210fcd92013-11-22 19:27:11 +01004847 }
4848
4849 return 0;
Thierry Reding280921d2013-08-30 15:10:14 +02004850}
4851module_init(panel_simple_init);
4852
4853static void __exit panel_simple_exit(void)
4854{
Thierry Reding210fcd92013-11-22 19:27:11 +01004855 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
4856 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
4857
Thierry Reding280921d2013-08-30 15:10:14 +02004858 platform_driver_unregister(&panel_simple_platform_driver);
4859}
4860module_exit(panel_simple_exit);
4861
4862MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
4863MODULE_DESCRIPTION("DRM Driver for Simple Panels");
4864MODULE_LICENSE("GPL and additional rights");