blob: 9e46db5e359c7a16f563476f2528b81d6c77db7b [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>
Thierry Reding280921d2013-08-30 15:10:14 +020026#include <linux/module.h>
Thierry Reding280921d2013-08-30 15:10:14 +020027#include <linux/of_platform.h>
28#include <linux/platform_device.h>
Douglas Anderson3235b0f2021-04-16 15:39:30 -070029#include <linux/pm_runtime.h>
Thierry Reding280921d2013-08-30 15:10:14 +020030#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 /**
Douglas Anderson131f9092020-11-09 17:00:55 -080095 * @delay.enable: Time for the panel to display a valid frame.
96 *
97 * The time (in milliseconds) that it takes for the panel to
98 * display the first valid frame after starting to receive
99 * video data.
100 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530101 unsigned int enable;
Douglas Anderson131f9092020-11-09 17:00:55 -0800102
103 /**
104 * @delay.disable: Time for the panel to turn the display off.
105 *
106 * The time (in milliseconds) that it takes for the panel to
107 * turn the display off (no content is visible).
108 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530109 unsigned int disable;
Douglas Anderson131f9092020-11-09 17:00:55 -0800110
111 /**
112 * @delay.unprepare: Time to power down completely.
113 *
114 * The time (in milliseconds) that it takes for the panel
115 * to power itself down completely.
Douglas Andersone5e30df2020-11-09 17:00:56 -0800116 *
117 * This time is used to prevent a future "prepare" from
118 * starting until at least this many milliseconds has passed.
119 * If at prepare time less time has passed since unprepare
120 * finished, the driver waits for the remaining time.
Douglas Anderson131f9092020-11-09 17:00:55 -0800121 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530122 unsigned int unprepare;
123 } delay;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200124
Douglas Andersona00fa422020-12-01 12:59:12 -0800125 /** @bus_format: See MEDIA_BUS_FMT_... defines. */
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200126 u32 bus_format;
Douglas Andersona00fa422020-12-01 12:59:12 -0800127
128 /** @bus_flags: See DRM_BUS_FLAG_... defines. */
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800129 u32 bus_flags;
Douglas Andersona00fa422020-12-01 12:59:12 -0800130
131 /** @connector_type: LVDS, eDP, DSI, DPI, etc. */
Laurent Pinchart9a2654c2019-09-04 16:28:03 +0300132 int connector_type;
Thierry Reding280921d2013-08-30 15:10:14 +0200133};
134
Thierry Reding280921d2013-08-30 15:10:14 +0200135struct panel_simple {
136 struct drm_panel base;
137 bool enabled;
138
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700139 bool prepared;
140
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800141 ktime_t prepared_time;
Douglas Andersone5e30df2020-11-09 17:00:56 -0800142 ktime_t unprepared_time;
143
Thierry Reding280921d2013-08-30 15:10:14 +0200144 const struct panel_desc *desc;
145
Thierry Reding280921d2013-08-30 15:10:14 +0200146 struct regulator *supply;
147 struct i2c_adapter *ddc;
148
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900149 struct gpio_desc *enable_gpio;
Sean Paulb8a29482019-07-11 13:34:53 -0700150
Douglas Anderson63358e22021-04-23 09:59:04 -0700151 struct edid *edid;
152
Sean Paulb8a29482019-07-11 13:34:53 -0700153 struct drm_display_mode override_mode;
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300154
155 enum drm_panel_orientation orientation;
Thierry Reding280921d2013-08-30 15:10:14 +0200156};
157
158static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
159{
160 return container_of(panel, struct panel_simple, base);
161}
162
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100163static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
164 struct drm_connector *connector)
Thierry Reding280921d2013-08-30 15:10:14 +0200165{
Thierry Reding280921d2013-08-30 15:10:14 +0200166 struct drm_display_mode *mode;
167 unsigned int i, num = 0;
168
Philipp Zabela5d3e622014-12-11 18:32:45 +0100169 for (i = 0; i < panel->desc->num_timings; i++) {
170 const struct display_timing *dt = &panel->desc->timings[i];
171 struct videomode vm;
172
173 videomode_from_timing(dt, &vm);
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100174 mode = drm_mode_create(connector->dev);
Philipp Zabela5d3e622014-12-11 18:32:45 +0100175 if (!mode) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100176 dev_err(panel->base.dev, "failed to add mode %ux%u\n",
Philipp Zabela5d3e622014-12-11 18:32:45 +0100177 dt->hactive.typ, dt->vactive.typ);
178 continue;
179 }
180
181 drm_display_mode_from_videomode(&vm, mode);
Boris Brezilloncda55372016-04-15 18:23:33 +0200182
183 mode->type |= DRM_MODE_TYPE_DRIVER;
184
Chen-Yu Tsai230c5b42016-10-24 21:21:15 +0800185 if (panel->desc->num_timings == 1)
Boris Brezilloncda55372016-04-15 18:23:33 +0200186 mode->type |= DRM_MODE_TYPE_PREFERRED;
187
Philipp Zabela5d3e622014-12-11 18:32:45 +0100188 drm_mode_probed_add(connector, mode);
189 num++;
190 }
191
Sean Paulb8a29482019-07-11 13:34:53 -0700192 return num;
193}
194
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100195static unsigned int panel_simple_get_display_modes(struct panel_simple *panel,
196 struct drm_connector *connector)
Sean Paulb8a29482019-07-11 13:34:53 -0700197{
Sean Paulb8a29482019-07-11 13:34:53 -0700198 struct drm_display_mode *mode;
199 unsigned int i, num = 0;
200
Thierry Reding280921d2013-08-30 15:10:14 +0200201 for (i = 0; i < panel->desc->num_modes; i++) {
202 const struct drm_display_mode *m = &panel->desc->modes[i];
203
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100204 mode = drm_mode_duplicate(connector->dev, m);
Thierry Reding280921d2013-08-30 15:10:14 +0200205 if (!mode) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100206 dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
Ville Syrjälä04256622020-04-28 20:19:27 +0300207 m->hdisplay, m->vdisplay,
208 drm_mode_vrefresh(m));
Thierry Reding280921d2013-08-30 15:10:14 +0200209 continue;
210 }
211
Boris Brezilloncda55372016-04-15 18:23:33 +0200212 mode->type |= DRM_MODE_TYPE_DRIVER;
213
214 if (panel->desc->num_modes == 1)
215 mode->type |= DRM_MODE_TYPE_PREFERRED;
216
Thierry Reding280921d2013-08-30 15:10:14 +0200217 drm_mode_set_name(mode);
218
219 drm_mode_probed_add(connector, mode);
220 num++;
221 }
222
Sean Paulb8a29482019-07-11 13:34:53 -0700223 return num;
224}
225
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100226static int panel_simple_get_non_edid_modes(struct panel_simple *panel,
227 struct drm_connector *connector)
Sean Paulb8a29482019-07-11 13:34:53 -0700228{
Sean Paulb8a29482019-07-11 13:34:53 -0700229 struct drm_display_mode *mode;
230 bool has_override = panel->override_mode.type;
231 unsigned int num = 0;
232
233 if (!panel->desc)
234 return 0;
235
236 if (has_override) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100237 mode = drm_mode_duplicate(connector->dev,
238 &panel->override_mode);
Sean Paulb8a29482019-07-11 13:34:53 -0700239 if (mode) {
240 drm_mode_probed_add(connector, mode);
241 num = 1;
242 } else {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100243 dev_err(panel->base.dev, "failed to add override mode\n");
Sean Paulb8a29482019-07-11 13:34:53 -0700244 }
245 }
246
247 /* Only add timings if override was not there or failed to validate */
248 if (num == 0 && panel->desc->num_timings)
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100249 num = panel_simple_get_timings_modes(panel, connector);
Sean Paulb8a29482019-07-11 13:34:53 -0700250
251 /*
252 * Only add fixed modes if timings/override added no mode.
253 *
254 * We should only ever have either the display timings specified
255 * or a fixed mode. Anything else is rather bogus.
256 */
257 WARN_ON(panel->desc->num_timings && panel->desc->num_modes);
258 if (num == 0)
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100259 num = panel_simple_get_display_modes(panel, connector);
Sean Paulb8a29482019-07-11 13:34:53 -0700260
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700261 connector->display_info.bpc = panel->desc->bpc;
Thierry Reding280921d2013-08-30 15:10:14 +0200262 connector->display_info.width_mm = panel->desc->size.width;
263 connector->display_info.height_mm = panel->desc->size.height;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200264 if (panel->desc->bus_format)
265 drm_display_info_set_bus_formats(&connector->display_info,
266 &panel->desc->bus_format, 1);
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800267 connector->display_info.bus_flags = panel->desc->bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200268
269 return num;
270}
271
Douglas Andersone5e30df2020-11-09 17:00:56 -0800272static void panel_simple_wait(ktime_t start_ktime, unsigned int min_ms)
273{
274 ktime_t now_ktime, min_ktime;
275
276 if (!min_ms)
277 return;
278
279 min_ktime = ktime_add(start_ktime, ms_to_ktime(min_ms));
280 now_ktime = ktime_get();
281
282 if (ktime_before(now_ktime, min_ktime))
283 msleep(ktime_to_ms(ktime_sub(min_ktime, now_ktime)) + 1);
284}
285
Thierry Reding280921d2013-08-30 15:10:14 +0200286static int panel_simple_disable(struct drm_panel *panel)
287{
288 struct panel_simple *p = to_panel_simple(panel);
289
290 if (!p->enabled)
291 return 0;
292
Ajay Kumarf673c372014-07-31 23:12:11 +0530293 if (p->desc->delay.disable)
294 msleep(p->desc->delay.disable);
295
Thierry Reding280921d2013-08-30 15:10:14 +0200296 p->enabled = false;
297
298 return 0;
299}
300
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700301static int panel_simple_suspend(struct device *dev)
302{
303 struct panel_simple *p = dev_get_drvdata(dev);
304
305 gpiod_set_value_cansleep(p->enable_gpio, 0);
306 regulator_disable(p->supply);
307 p->unprepared_time = ktime_get();
308
Douglas Anderson63358e22021-04-23 09:59:04 -0700309 kfree(p->edid);
310 p->edid = NULL;
311
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700312 return 0;
313}
314
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530315static int panel_simple_unprepare(struct drm_panel *panel)
316{
Ajay Kumar613a6332014-07-31 23:12:10 +0530317 struct panel_simple *p = to_panel_simple(panel);
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700318 int ret;
Ajay Kumar613a6332014-07-31 23:12:10 +0530319
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700320 /* Unpreparing when already unprepared is a no-op */
321 if (!p->prepared)
Ajay Kumar613a6332014-07-31 23:12:10 +0530322 return 0;
323
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700324 pm_runtime_mark_last_busy(panel->dev);
325 ret = pm_runtime_put_autosuspend(panel->dev);
326 if (ret < 0)
327 return ret;
328 p->prepared = false;
Ajay Kumar613a6332014-07-31 23:12:10 +0530329
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530330 return 0;
331}
332
Douglas Andersonb6d5ffc2021-09-14 13:21:56 -0700333static int panel_simple_resume(struct device *dev)
Douglas Anderson48834e62020-05-07 14:34:57 -0700334{
Douglas Andersonb6d5ffc2021-09-14 13:21:56 -0700335 struct panel_simple *p = dev_get_drvdata(dev);
Douglas Anderson48834e62020-05-07 14:34:57 -0700336 int err;
337
Douglas Andersone5e30df2020-11-09 17:00:56 -0800338 panel_simple_wait(p->unprepared_time, p->desc->delay.unprepare);
339
Thierry Reding280921d2013-08-30 15:10:14 +0200340 err = regulator_enable(p->supply);
341 if (err < 0) {
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700342 dev_err(dev, "failed to enable supply: %d\n", err);
Thierry Reding280921d2013-08-30 15:10:14 +0200343 return err;
344 }
345
Fabio Estevam756b9182017-07-16 21:05:39 -0300346 gpiod_set_value_cansleep(p->enable_gpio, 1);
Thierry Reding280921d2013-08-30 15:10:14 +0200347
Douglas Andersonb6d5ffc2021-09-14 13:21:56 -0700348 if (p->desc->delay.prepare)
349 msleep(p->desc->delay.prepare);
Douglas Anderson48834e62020-05-07 14:34:57 -0700350
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800351 p->prepared_time = ktime_get();
Ajay Kumar613a6332014-07-31 23:12:10 +0530352
353 return 0;
Douglas Anderson87b49712021-01-15 14:44:18 -0800354}
355
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700356static int panel_simple_prepare(struct drm_panel *panel)
357{
358 struct panel_simple *p = to_panel_simple(panel);
359 int ret;
360
361 /* Preparing when already prepared is a no-op */
362 if (p->prepared)
363 return 0;
364
365 ret = pm_runtime_get_sync(panel->dev);
366 if (ret < 0) {
367 pm_runtime_put_autosuspend(panel->dev);
368 return ret;
369 }
370
371 p->prepared = true;
372
373 return 0;
374}
375
Ajay Kumar613a6332014-07-31 23:12:10 +0530376static int panel_simple_enable(struct drm_panel *panel)
377{
378 struct panel_simple *p = to_panel_simple(panel);
379
380 if (p->enabled)
381 return 0;
382
Ajay Kumarf673c372014-07-31 23:12:11 +0530383 if (p->desc->delay.enable)
384 msleep(p->desc->delay.enable);
385
Thierry Reding280921d2013-08-30 15:10:14 +0200386 p->enabled = true;
387
388 return 0;
389}
390
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100391static int panel_simple_get_modes(struct drm_panel *panel,
392 struct drm_connector *connector)
Thierry Reding280921d2013-08-30 15:10:14 +0200393{
394 struct panel_simple *p = to_panel_simple(panel);
395 int num = 0;
396
397 /* probe EDID if a DDC bus is available */
398 if (p->ddc) {
Douglas Anderson31e25392021-04-23 09:59:03 -0700399 pm_runtime_get_sync(panel->dev);
400
Douglas Anderson63358e22021-04-23 09:59:04 -0700401 if (!p->edid)
402 p->edid = drm_get_edid(connector, p->ddc);
403
404 if (p->edid)
405 num += drm_add_edid_modes(connector, p->edid);
Douglas Anderson31e25392021-04-23 09:59:03 -0700406
407 pm_runtime_mark_last_busy(panel->dev);
408 pm_runtime_put_autosuspend(panel->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200409 }
410
411 /* add hard-coded panel modes */
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100412 num += panel_simple_get_non_edid_modes(p, connector);
Thierry Reding280921d2013-08-30 15:10:14 +0200413
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300414 /* set up connector's "panel orientation" property */
415 drm_connector_set_panel_orientation(connector, p->orientation);
416
Thierry Reding280921d2013-08-30 15:10:14 +0200417 return num;
418}
419
Philipp Zabela5d3e622014-12-11 18:32:45 +0100420static int panel_simple_get_timings(struct drm_panel *panel,
421 unsigned int num_timings,
422 struct display_timing *timings)
423{
424 struct panel_simple *p = to_panel_simple(panel);
425 unsigned int i;
426
427 if (p->desc->num_timings < num_timings)
428 num_timings = p->desc->num_timings;
429
430 if (timings)
431 for (i = 0; i < num_timings; i++)
432 timings[i] = p->desc->timings[i];
433
434 return p->desc->num_timings;
435}
436
Thierry Reding280921d2013-08-30 15:10:14 +0200437static const struct drm_panel_funcs panel_simple_funcs = {
438 .disable = panel_simple_disable,
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530439 .unprepare = panel_simple_unprepare,
440 .prepare = panel_simple_prepare,
Thierry Reding280921d2013-08-30 15:10:14 +0200441 .enable = panel_simple_enable,
442 .get_modes = panel_simple_get_modes,
Philipp Zabela5d3e622014-12-11 18:32:45 +0100443 .get_timings = panel_simple_get_timings,
Thierry Reding280921d2013-08-30 15:10:14 +0200444};
445
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100446static struct panel_desc panel_dpi;
447
448static int panel_dpi_probe(struct device *dev,
449 struct panel_simple *panel)
450{
451 struct display_timing *timing;
452 const struct device_node *np;
453 struct panel_desc *desc;
454 unsigned int bus_flags;
455 struct videomode vm;
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100456 int ret;
457
458 np = dev->of_node;
459 desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
460 if (!desc)
461 return -ENOMEM;
462
463 timing = devm_kzalloc(dev, sizeof(*timing), GFP_KERNEL);
464 if (!timing)
465 return -ENOMEM;
466
467 ret = of_get_display_timing(np, "panel-timing", timing);
468 if (ret < 0) {
469 dev_err(dev, "%pOF: no panel-timing node found for \"panel-dpi\" binding\n",
470 np);
471 return ret;
472 }
473
474 desc->timings = timing;
475 desc->num_timings = 1;
476
477 of_property_read_u32(np, "width-mm", &desc->size.width);
478 of_property_read_u32(np, "height-mm", &desc->size.height);
479
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100480 /* Extract bus_flags from display_timing */
481 bus_flags = 0;
482 vm.flags = timing->flags;
483 drm_bus_flags_from_videomode(&vm, &bus_flags);
484 desc->bus_flags = bus_flags;
485
486 /* We do not know the connector for the DT node, so guess it */
487 desc->connector_type = DRM_MODE_CONNECTOR_DPI;
488
489 panel->desc = desc;
490
491 return 0;
492}
493
Sean Paulb8a29482019-07-11 13:34:53 -0700494#define PANEL_SIMPLE_BOUNDS_CHECK(to_check, bounds, field) \
495 (to_check->field.typ >= bounds->field.min && \
496 to_check->field.typ <= bounds->field.max)
Douglas Andersone362cc62019-07-12 09:33:33 -0700497static void panel_simple_parse_panel_timing_node(struct device *dev,
498 struct panel_simple *panel,
499 const struct display_timing *ot)
Sean Paulb8a29482019-07-11 13:34:53 -0700500{
501 const struct panel_desc *desc = panel->desc;
502 struct videomode vm;
503 unsigned int i;
504
505 if (WARN_ON(desc->num_modes)) {
506 dev_err(dev, "Reject override mode: panel has a fixed mode\n");
507 return;
508 }
509 if (WARN_ON(!desc->num_timings)) {
510 dev_err(dev, "Reject override mode: no timings specified\n");
511 return;
512 }
513
514 for (i = 0; i < panel->desc->num_timings; i++) {
515 const struct display_timing *dt = &panel->desc->timings[i];
516
517 if (!PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hactive) ||
518 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hfront_porch) ||
519 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hback_porch) ||
520 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hsync_len) ||
521 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vactive) ||
522 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vfront_porch) ||
523 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vback_porch) ||
524 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vsync_len))
525 continue;
526
527 if (ot->flags != dt->flags)
528 continue;
529
530 videomode_from_timing(ot, &vm);
531 drm_display_mode_from_videomode(&vm, &panel->override_mode);
532 panel->override_mode.type |= DRM_MODE_TYPE_DRIVER |
533 DRM_MODE_TYPE_PREFERRED;
534 break;
535 }
536
537 if (WARN_ON(!panel->override_mode.type))
538 dev_err(dev, "Reject override mode: No display_timing found\n");
539}
540
Douglas Anderson5f04e7c2021-09-14 13:21:54 -0700541static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
Thierry Reding280921d2013-08-30 15:10:14 +0200542{
Thierry Reding280921d2013-08-30 15:10:14 +0200543 struct panel_simple *panel;
Sean Paulb8a29482019-07-11 13:34:53 -0700544 struct display_timing dt;
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100545 struct device_node *ddc;
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200546 int connector_type;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200547 u32 bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200548 int err;
549
550 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
551 if (!panel)
552 return -ENOMEM;
553
554 panel->enabled = false;
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800555 panel->prepared_time = 0;
Thierry Reding280921d2013-08-30 15:10:14 +0200556 panel->desc = desc;
557
558 panel->supply = devm_regulator_get(dev, "power");
559 if (IS_ERR(panel->supply))
560 return PTR_ERR(panel->supply);
561
Alexandre Courbota61400d2014-10-23 17:16:58 +0900562 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
563 GPIOD_OUT_LOW);
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900564 if (IS_ERR(panel->enable_gpio)) {
565 err = PTR_ERR(panel->enable_gpio);
Fabio Estevamb8e93802017-06-30 18:14:46 -0300566 if (err != -EPROBE_DEFER)
567 dev_err(dev, "failed to request GPIO: %d\n", err);
Alexandre Courbot9746c612014-07-25 23:47:25 +0900568 return err;
569 }
Thierry Reding280921d2013-08-30 15:10:14 +0200570
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300571 err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
572 if (err) {
573 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
574 return err;
575 }
576
Thierry Reding280921d2013-08-30 15:10:14 +0200577 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
578 if (ddc) {
579 panel->ddc = of_find_i2c_adapter_by_node(ddc);
580 of_node_put(ddc);
581
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100582 if (!panel->ddc)
583 return -EPROBE_DEFER;
Thierry Reding280921d2013-08-30 15:10:14 +0200584 }
585
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100586 if (desc == &panel_dpi) {
587 /* Handle the generic panel-dpi binding */
588 err = panel_dpi_probe(dev, panel);
589 if (err)
590 goto free_ddc;
591 } else {
592 if (!of_get_display_timing(dev->of_node, "panel-timing", &dt))
593 panel_simple_parse_panel_timing_node(dev, panel, &dt);
594 }
Sean Paulb8a29482019-07-11 13:34:53 -0700595
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200596 connector_type = desc->connector_type;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200597 /* Catch common mistakes for panels. */
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200598 switch (connector_type) {
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200599 case 0:
600 dev_warn(dev, "Specify missing connector_type\n");
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200601 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200602 break;
603 case DRM_MODE_CONNECTOR_LVDS:
Laurent Pinchartc4715832020-06-30 02:33:19 +0300604 WARN_ON(desc->bus_flags &
605 ~(DRM_BUS_FLAG_DE_LOW |
606 DRM_BUS_FLAG_DE_HIGH |
607 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
608 DRM_BUS_FLAG_DATA_LSB_TO_MSB));
Laurent Pinchart1185c402020-06-30 02:33:20 +0300609 WARN_ON(desc->bus_format != MEDIA_BUS_FMT_RGB666_1X7X3_SPWG &&
610 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_SPWG &&
611 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA);
612 WARN_ON(desc->bus_format == MEDIA_BUS_FMT_RGB666_1X7X3_SPWG &&
613 desc->bpc != 6);
614 WARN_ON((desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_SPWG ||
615 desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA) &&
616 desc->bpc != 8);
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200617 break;
618 case DRM_MODE_CONNECTOR_eDP:
Douglas Anderson5f04e7c2021-09-14 13:21:54 -0700619 dev_warn(dev, "eDP panels moved to panel-edp\n");
620 err = -EINVAL;
621 goto free_ddc;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200622 case DRM_MODE_CONNECTOR_DSI:
623 if (desc->bpc != 6 && desc->bpc != 8)
624 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
625 break;
626 case DRM_MODE_CONNECTOR_DPI:
627 bus_flags = DRM_BUS_FLAG_DE_LOW |
628 DRM_BUS_FLAG_DE_HIGH |
629 DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE |
630 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
631 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
632 DRM_BUS_FLAG_DATA_LSB_TO_MSB |
633 DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE |
634 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE;
635 if (desc->bus_flags & ~bus_flags)
636 dev_warn(dev, "Unexpected bus_flags(%d)\n", desc->bus_flags & ~bus_flags);
637 if (!(desc->bus_flags & bus_flags))
638 dev_warn(dev, "Specify missing bus_flags\n");
639 if (desc->bus_format == 0)
640 dev_warn(dev, "Specify missing bus_format\n");
641 if (desc->bpc != 6 && desc->bpc != 8)
642 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
643 break;
644 default:
645 dev_warn(dev, "Specify a valid connector_type: %d\n", desc->connector_type);
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200646 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200647 break;
Laurent Pinchart1185c402020-06-30 02:33:20 +0300648 }
Laurent Pinchartc4715832020-06-30 02:33:19 +0300649
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700650 dev_set_drvdata(dev, panel);
651
652 /*
653 * We use runtime PM for prepare / unprepare since those power the panel
654 * on and off and those can be very slow operations. This is important
655 * to optimize powering the panel on briefly to read the EDID before
656 * fully enabling the panel.
657 */
658 pm_runtime_enable(dev);
659 pm_runtime_set_autosuspend_delay(dev, 1000);
660 pm_runtime_use_autosuspend(dev);
661
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200662 drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type);
Thierry Reding280921d2013-08-30 15:10:14 +0200663
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100664 err = drm_panel_of_backlight(&panel->base);
665 if (err)
Douglas Anderson70e12562021-04-23 09:58:47 -0700666 goto disable_pm_runtime;
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100667
Bernard Zhaoc3ee8c62020-08-01 20:02:13 +0800668 drm_panel_add(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200669
Thierry Reding280921d2013-08-30 15:10:14 +0200670 return 0;
671
Douglas Anderson70e12562021-04-23 09:58:47 -0700672disable_pm_runtime:
Douglas Andersona596fcd2021-05-17 13:08:58 -0700673 pm_runtime_dont_use_autosuspend(dev);
Douglas Anderson70e12562021-04-23 09:58:47 -0700674 pm_runtime_disable(dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200675free_ddc:
Douglas Anderson5f04e7c2021-09-14 13:21:54 -0700676 if (panel->ddc)
Thierry Reding280921d2013-08-30 15:10:14 +0200677 put_device(&panel->ddc->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200678
679 return err;
680}
681
682static int panel_simple_remove(struct device *dev)
683{
684 struct panel_simple *panel = dev_get_drvdata(dev);
685
Thierry Reding280921d2013-08-30 15:10:14 +0200686 drm_panel_remove(&panel->base);
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100687 drm_panel_disable(&panel->base);
688 drm_panel_unprepare(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200689
Douglas Andersona596fcd2021-05-17 13:08:58 -0700690 pm_runtime_dont_use_autosuspend(dev);
Douglas Anderson70e12562021-04-23 09:58:47 -0700691 pm_runtime_disable(dev);
Douglas Anderson5f04e7c2021-09-14 13:21:54 -0700692 if (panel->ddc)
Thierry Reding280921d2013-08-30 15:10:14 +0200693 put_device(&panel->ddc->dev);
694
Thierry Reding280921d2013-08-30 15:10:14 +0200695 return 0;
696}
697
Thierry Redingd02fd932014-04-29 17:21:21 +0200698static void panel_simple_shutdown(struct device *dev)
699{
700 struct panel_simple *panel = dev_get_drvdata(dev);
701
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100702 drm_panel_disable(&panel->base);
703 drm_panel_unprepare(&panel->base);
Thierry Redingd02fd932014-04-29 17:21:21 +0200704}
705
Jagan Tekibca684e2020-08-29 22:03:28 +0530706static const struct drm_display_mode ampire_am_1280800n3tzqw_t00h_mode = {
707 .clock = 71100,
708 .hdisplay = 1280,
709 .hsync_start = 1280 + 40,
710 .hsync_end = 1280 + 40 + 80,
711 .htotal = 1280 + 40 + 80 + 40,
712 .vdisplay = 800,
713 .vsync_start = 800 + 3,
714 .vsync_end = 800 + 3 + 10,
715 .vtotal = 800 + 3 + 10 + 10,
716 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
717};
718
719static const struct panel_desc ampire_am_1280800n3tzqw_t00h = {
720 .modes = &ampire_am_1280800n3tzqw_t00h_mode,
721 .num_modes = 1,
722 .bpc = 6,
723 .size = {
724 .width = 217,
725 .height = 136,
726 },
727 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
728 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
729 .connector_type = DRM_MODE_CONNECTOR_LVDS,
730};
731
Yannick Fertre966fea72017-03-28 11:44:49 +0200732static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
733 .clock = 9000,
734 .hdisplay = 480,
735 .hsync_start = 480 + 2,
736 .hsync_end = 480 + 2 + 41,
737 .htotal = 480 + 2 + 41 + 2,
738 .vdisplay = 272,
739 .vsync_start = 272 + 2,
740 .vsync_end = 272 + 2 + 10,
741 .vtotal = 272 + 2 + 10 + 2,
Yannick Fertre966fea72017-03-28 11:44:49 +0200742 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
743};
744
745static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
746 .modes = &ampire_am_480272h3tmqw_t01h_mode,
747 .num_modes = 1,
748 .bpc = 8,
749 .size = {
750 .width = 105,
751 .height = 67,
752 },
753 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
754};
755
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100756static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
757 .clock = 33333,
758 .hdisplay = 800,
759 .hsync_start = 800 + 0,
760 .hsync_end = 800 + 0 + 255,
761 .htotal = 800 + 0 + 255 + 0,
762 .vdisplay = 480,
763 .vsync_start = 480 + 2,
764 .vsync_end = 480 + 2 + 45,
765 .vtotal = 480 + 2 + 45 + 0,
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100766 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
767};
768
769static const struct panel_desc ampire_am800480r3tmqwa1h = {
770 .modes = &ampire_am800480r3tmqwa1h_mode,
771 .num_modes = 1,
772 .bpc = 6,
773 .size = {
774 .width = 152,
775 .height = 91,
776 },
777 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
778};
779
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200780static const struct display_timing santek_st0700i5y_rbslw_f_timing = {
781 .pixelclock = { 26400000, 33300000, 46800000 },
782 .hactive = { 800, 800, 800 },
783 .hfront_porch = { 16, 210, 354 },
784 .hback_porch = { 45, 36, 6 },
785 .hsync_len = { 1, 10, 40 },
786 .vactive = { 480, 480, 480 },
787 .vfront_porch = { 7, 22, 147 },
788 .vback_porch = { 22, 13, 3 },
789 .vsync_len = { 1, 10, 20 },
790 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
791 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE
792};
793
794static const struct panel_desc armadeus_st0700_adapt = {
795 .timings = &santek_st0700i5y_rbslw_f_timing,
796 .num_timings = 1,
797 .bpc = 6,
798 .size = {
799 .width = 154,
800 .height = 86,
801 },
802 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +0200803 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200804};
805
Thierry Reding280921d2013-08-30 15:10:14 +0200806static const struct drm_display_mode auo_b101aw03_mode = {
807 .clock = 51450,
808 .hdisplay = 1024,
809 .hsync_start = 1024 + 156,
810 .hsync_end = 1024 + 156 + 8,
811 .htotal = 1024 + 156 + 8 + 156,
812 .vdisplay = 600,
813 .vsync_start = 600 + 16,
814 .vsync_end = 600 + 16 + 6,
815 .vtotal = 600 + 16 + 6 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +0200816};
817
818static const struct panel_desc auo_b101aw03 = {
819 .modes = &auo_b101aw03_mode,
820 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700821 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200822 .size = {
823 .width = 223,
824 .height = 125,
825 },
Dmitry Osipenko85560822020-06-22 01:27:42 +0300826 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +0300827 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +0300828 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +0200829};
830
Rob Clarkdac746e2014-08-01 17:01:06 -0400831static const struct drm_display_mode auo_b101xtn01_mode = {
832 .clock = 72000,
833 .hdisplay = 1366,
834 .hsync_start = 1366 + 20,
835 .hsync_end = 1366 + 20 + 70,
836 .htotal = 1366 + 20 + 70,
837 .vdisplay = 768,
838 .vsync_start = 768 + 14,
839 .vsync_end = 768 + 14 + 42,
840 .vtotal = 768 + 14 + 42,
Rob Clarkdac746e2014-08-01 17:01:06 -0400841 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
842};
843
844static const struct panel_desc auo_b101xtn01 = {
845 .modes = &auo_b101xtn01_mode,
846 .num_modes = 1,
847 .bpc = 6,
848 .size = {
849 .width = 223,
850 .height = 125,
851 },
852};
853
Lukasz Majewskibccfaff2018-05-14 21:08:49 +0200854static const struct display_timing auo_g070vvn01_timings = {
855 .pixelclock = { 33300000, 34209000, 45000000 },
856 .hactive = { 800, 800, 800 },
857 .hfront_porch = { 20, 40, 200 },
858 .hback_porch = { 87, 40, 1 },
859 .hsync_len = { 1, 48, 87 },
860 .vactive = { 480, 480, 480 },
861 .vfront_porch = { 5, 13, 200 },
862 .vback_porch = { 31, 31, 29 },
863 .vsync_len = { 1, 1, 3 },
864};
865
866static const struct panel_desc auo_g070vvn01 = {
867 .timings = &auo_g070vvn01_timings,
868 .num_timings = 1,
869 .bpc = 8,
870 .size = {
871 .width = 152,
872 .height = 91,
873 },
874 .delay = {
875 .prepare = 200,
876 .enable = 50,
877 .disable = 50,
878 .unprepare = 1000,
879 },
880};
881
Alex Gonzalez4fb86402018-10-25 17:09:30 +0200882static const struct drm_display_mode auo_g101evn010_mode = {
883 .clock = 68930,
884 .hdisplay = 1280,
885 .hsync_start = 1280 + 82,
886 .hsync_end = 1280 + 82 + 2,
887 .htotal = 1280 + 82 + 2 + 84,
888 .vdisplay = 800,
889 .vsync_start = 800 + 8,
890 .vsync_end = 800 + 8 + 2,
891 .vtotal = 800 + 8 + 2 + 6,
Alex Gonzalez4fb86402018-10-25 17:09:30 +0200892};
893
894static const struct panel_desc auo_g101evn010 = {
895 .modes = &auo_g101evn010_mode,
896 .num_modes = 1,
897 .bpc = 6,
898 .size = {
899 .width = 216,
900 .height = 135,
901 },
Tomi Valkeinen27a46fb2020-04-17 14:40:43 +0300902 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
903 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alex Gonzalez4fb86402018-10-25 17:09:30 +0200904};
905
Christoph Fritz4451c282017-12-16 14:13:36 +0100906static const struct drm_display_mode auo_g104sn02_mode = {
907 .clock = 40000,
908 .hdisplay = 800,
909 .hsync_start = 800 + 40,
910 .hsync_end = 800 + 40 + 216,
911 .htotal = 800 + 40 + 216 + 128,
912 .vdisplay = 600,
913 .vsync_start = 600 + 10,
914 .vsync_end = 600 + 10 + 35,
915 .vtotal = 600 + 10 + 35 + 2,
Christoph Fritz4451c282017-12-16 14:13:36 +0100916};
917
918static const struct panel_desc auo_g104sn02 = {
919 .modes = &auo_g104sn02_mode,
920 .num_modes = 1,
921 .bpc = 8,
922 .size = {
923 .width = 211,
924 .height = 158,
925 },
Stefan Riedmuellera3050f22021-06-21 17:09:28 +0200926 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
927 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Christoph Fritz4451c282017-12-16 14:13:36 +0100928};
929
Sebastian Reichel03e909a2020-04-15 19:27:25 +0200930static const struct drm_display_mode auo_g121ean01_mode = {
931 .clock = 66700,
932 .hdisplay = 1280,
933 .hsync_start = 1280 + 58,
934 .hsync_end = 1280 + 58 + 8,
935 .htotal = 1280 + 58 + 8 + 70,
936 .vdisplay = 800,
937 .vsync_start = 800 + 6,
938 .vsync_end = 800 + 6 + 4,
939 .vtotal = 800 + 6 + 4 + 10,
Sebastian Reichel03e909a2020-04-15 19:27:25 +0200940};
941
942static const struct panel_desc auo_g121ean01 = {
943 .modes = &auo_g121ean01_mode,
944 .num_modes = 1,
945 .bpc = 8,
946 .size = {
947 .width = 261,
948 .height = 163,
949 },
950 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
951 .connector_type = DRM_MODE_CONNECTOR_LVDS,
952};
953
Lucas Stach697035c2016-11-30 14:09:55 +0100954static const struct display_timing auo_g133han01_timings = {
955 .pixelclock = { 134000000, 141200000, 149000000 },
956 .hactive = { 1920, 1920, 1920 },
957 .hfront_porch = { 39, 58, 77 },
958 .hback_porch = { 59, 88, 117 },
959 .hsync_len = { 28, 42, 56 },
960 .vactive = { 1080, 1080, 1080 },
961 .vfront_porch = { 3, 8, 11 },
962 .vback_porch = { 5, 14, 19 },
963 .vsync_len = { 4, 14, 19 },
964};
965
966static const struct panel_desc auo_g133han01 = {
967 .timings = &auo_g133han01_timings,
968 .num_timings = 1,
969 .bpc = 8,
970 .size = {
971 .width = 293,
972 .height = 165,
973 },
974 .delay = {
975 .prepare = 200,
976 .enable = 50,
977 .disable = 50,
978 .unprepare = 1000,
979 },
980 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +0300981 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach697035c2016-11-30 14:09:55 +0100982};
983
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +0200984static const struct drm_display_mode auo_g156xtn01_mode = {
985 .clock = 76000,
986 .hdisplay = 1366,
987 .hsync_start = 1366 + 33,
988 .hsync_end = 1366 + 33 + 67,
989 .htotal = 1560,
990 .vdisplay = 768,
991 .vsync_start = 768 + 4,
992 .vsync_end = 768 + 4 + 4,
993 .vtotal = 806,
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +0200994};
995
996static const struct panel_desc auo_g156xtn01 = {
997 .modes = &auo_g156xtn01_mode,
998 .num_modes = 1,
999 .bpc = 8,
1000 .size = {
1001 .width = 344,
1002 .height = 194,
1003 },
1004 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1005 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1006};
1007
Lucas Stach8c31f602016-11-30 14:09:56 +01001008static const struct display_timing auo_g185han01_timings = {
1009 .pixelclock = { 120000000, 144000000, 175000000 },
1010 .hactive = { 1920, 1920, 1920 },
Lucas Stachf8c6bfc2019-07-10 15:07:40 +02001011 .hfront_porch = { 36, 120, 148 },
1012 .hback_porch = { 24, 88, 108 },
1013 .hsync_len = { 20, 48, 64 },
Lucas Stach8c31f602016-11-30 14:09:56 +01001014 .vactive = { 1080, 1080, 1080 },
1015 .vfront_porch = { 6, 10, 40 },
1016 .vback_porch = { 2, 5, 20 },
1017 .vsync_len = { 2, 5, 20 },
1018};
1019
1020static const struct panel_desc auo_g185han01 = {
1021 .timings = &auo_g185han01_timings,
1022 .num_timings = 1,
1023 .bpc = 8,
1024 .size = {
1025 .width = 409,
1026 .height = 230,
1027 },
1028 .delay = {
1029 .prepare = 50,
1030 .enable = 200,
1031 .disable = 110,
1032 .unprepare = 1000,
1033 },
1034 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001035 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8c31f602016-11-30 14:09:56 +01001036};
1037
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02001038static const struct display_timing auo_g190ean01_timings = {
1039 .pixelclock = { 90000000, 108000000, 135000000 },
1040 .hactive = { 1280, 1280, 1280 },
1041 .hfront_porch = { 126, 184, 1266 },
1042 .hback_porch = { 84, 122, 844 },
1043 .hsync_len = { 70, 102, 704 },
1044 .vactive = { 1024, 1024, 1024 },
1045 .vfront_porch = { 4, 26, 76 },
1046 .vback_porch = { 2, 8, 25 },
1047 .vsync_len = { 2, 8, 25 },
1048};
1049
1050static const struct panel_desc auo_g190ean01 = {
1051 .timings = &auo_g190ean01_timings,
1052 .num_timings = 1,
1053 .bpc = 8,
1054 .size = {
1055 .width = 376,
1056 .height = 301,
1057 },
1058 .delay = {
1059 .prepare = 50,
1060 .enable = 200,
1061 .disable = 110,
1062 .unprepare = 1000,
1063 },
1064 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1065 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1066};
1067
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001068static const struct display_timing auo_p320hvn03_timings = {
1069 .pixelclock = { 106000000, 148500000, 164000000 },
1070 .hactive = { 1920, 1920, 1920 },
1071 .hfront_porch = { 25, 50, 130 },
1072 .hback_porch = { 25, 50, 130 },
1073 .hsync_len = { 20, 40, 105 },
1074 .vactive = { 1080, 1080, 1080 },
1075 .vfront_porch = { 8, 17, 150 },
1076 .vback_porch = { 8, 17, 150 },
1077 .vsync_len = { 4, 11, 100 },
1078};
1079
1080static const struct panel_desc auo_p320hvn03 = {
1081 .timings = &auo_p320hvn03_timings,
1082 .num_timings = 1,
1083 .bpc = 8,
1084 .size = {
1085 .width = 698,
1086 .height = 393,
1087 },
1088 .delay = {
1089 .prepare = 1,
1090 .enable = 450,
1091 .unprepare = 500,
1092 },
Lucas Stach2554f152018-04-11 17:27:41 +02001093 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001094 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001095};
1096
Haixia Shi7ee933a2016-10-11 14:59:16 -07001097static const struct drm_display_mode auo_t215hvn01_mode = {
1098 .clock = 148800,
1099 .hdisplay = 1920,
1100 .hsync_start = 1920 + 88,
1101 .hsync_end = 1920 + 88 + 44,
1102 .htotal = 1920 + 88 + 44 + 148,
1103 .vdisplay = 1080,
1104 .vsync_start = 1080 + 4,
1105 .vsync_end = 1080 + 4 + 5,
1106 .vtotal = 1080 + 4 + 5 + 36,
Haixia Shi7ee933a2016-10-11 14:59:16 -07001107};
1108
1109static const struct panel_desc auo_t215hvn01 = {
1110 .modes = &auo_t215hvn01_mode,
1111 .num_modes = 1,
1112 .bpc = 8,
1113 .size = {
1114 .width = 430,
1115 .height = 270,
1116 },
1117 .delay = {
1118 .disable = 5,
1119 .unprepare = 1000,
1120 }
1121};
1122
Philipp Zabeld47df632014-12-18 16:43:43 +01001123static const struct drm_display_mode avic_tm070ddh03_mode = {
1124 .clock = 51200,
1125 .hdisplay = 1024,
1126 .hsync_start = 1024 + 160,
1127 .hsync_end = 1024 + 160 + 4,
1128 .htotal = 1024 + 160 + 4 + 156,
1129 .vdisplay = 600,
1130 .vsync_start = 600 + 17,
1131 .vsync_end = 600 + 17 + 1,
1132 .vtotal = 600 + 17 + 1 + 17,
Philipp Zabeld47df632014-12-18 16:43:43 +01001133};
1134
1135static const struct panel_desc avic_tm070ddh03 = {
1136 .modes = &avic_tm070ddh03_mode,
1137 .num_modes = 1,
1138 .bpc = 8,
1139 .size = {
1140 .width = 154,
1141 .height = 90,
1142 },
1143 .delay = {
1144 .prepare = 20,
1145 .enable = 200,
1146 .disable = 200,
1147 },
1148};
1149
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08001150static const struct drm_display_mode bananapi_s070wv20_ct16_mode = {
1151 .clock = 30000,
1152 .hdisplay = 800,
1153 .hsync_start = 800 + 40,
1154 .hsync_end = 800 + 40 + 48,
1155 .htotal = 800 + 40 + 48 + 40,
1156 .vdisplay = 480,
1157 .vsync_start = 480 + 13,
1158 .vsync_end = 480 + 13 + 3,
1159 .vtotal = 480 + 13 + 3 + 29,
1160};
1161
1162static const struct panel_desc bananapi_s070wv20_ct16 = {
1163 .modes = &bananapi_s070wv20_ct16_mode,
1164 .num_modes = 1,
1165 .bpc = 6,
1166 .size = {
1167 .width = 154,
1168 .height = 86,
1169 },
1170};
1171
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001172static const struct drm_display_mode boe_hv070wsa_mode = {
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001173 .clock = 42105,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001174 .hdisplay = 1024,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001175 .hsync_start = 1024 + 30,
1176 .hsync_end = 1024 + 30 + 30,
1177 .htotal = 1024 + 30 + 30 + 30,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001178 .vdisplay = 600,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001179 .vsync_start = 600 + 10,
1180 .vsync_end = 600 + 10 + 10,
1181 .vtotal = 600 + 10 + 10 + 10,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001182};
1183
1184static const struct panel_desc boe_hv070wsa = {
1185 .modes = &boe_hv070wsa_mode,
1186 .num_modes = 1,
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001187 .bpc = 8,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001188 .size = {
1189 .width = 154,
1190 .height = 90,
1191 },
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001192 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1193 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1194 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001195};
1196
Giulio Benettie58edce2018-07-31 01:11:16 +02001197static const struct drm_display_mode cdtech_s043wq26h_ct7_mode = {
1198 .clock = 9000,
1199 .hdisplay = 480,
1200 .hsync_start = 480 + 5,
1201 .hsync_end = 480 + 5 + 5,
1202 .htotal = 480 + 5 + 5 + 40,
1203 .vdisplay = 272,
1204 .vsync_start = 272 + 8,
1205 .vsync_end = 272 + 8 + 8,
1206 .vtotal = 272 + 8 + 8 + 8,
Giulio Benettie58edce2018-07-31 01:11:16 +02001207 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1208};
1209
1210static const struct panel_desc cdtech_s043wq26h_ct7 = {
1211 .modes = &cdtech_s043wq26h_ct7_mode,
1212 .num_modes = 1,
1213 .bpc = 8,
1214 .size = {
1215 .width = 95,
1216 .height = 54,
1217 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001218 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Giulio Benettie58edce2018-07-31 01:11:16 +02001219};
1220
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001221/* S070PWS19HP-FC21 2017/04/22 */
1222static const struct drm_display_mode cdtech_s070pws19hp_fc21_mode = {
1223 .clock = 51200,
1224 .hdisplay = 1024,
1225 .hsync_start = 1024 + 160,
1226 .hsync_end = 1024 + 160 + 20,
1227 .htotal = 1024 + 160 + 20 + 140,
1228 .vdisplay = 600,
1229 .vsync_start = 600 + 12,
1230 .vsync_end = 600 + 12 + 3,
1231 .vtotal = 600 + 12 + 3 + 20,
1232 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1233};
1234
1235static const struct panel_desc cdtech_s070pws19hp_fc21 = {
1236 .modes = &cdtech_s070pws19hp_fc21_mode,
1237 .num_modes = 1,
1238 .bpc = 6,
1239 .size = {
1240 .width = 154,
1241 .height = 86,
1242 },
1243 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001244 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001245 .connector_type = DRM_MODE_CONNECTOR_DPI,
1246};
1247
1248/* S070SWV29HG-DC44 2017/09/21 */
1249static const struct drm_display_mode cdtech_s070swv29hg_dc44_mode = {
1250 .clock = 33300,
1251 .hdisplay = 800,
1252 .hsync_start = 800 + 210,
1253 .hsync_end = 800 + 210 + 2,
1254 .htotal = 800 + 210 + 2 + 44,
1255 .vdisplay = 480,
1256 .vsync_start = 480 + 22,
1257 .vsync_end = 480 + 22 + 2,
1258 .vtotal = 480 + 22 + 2 + 21,
1259 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1260};
1261
1262static const struct panel_desc cdtech_s070swv29hg_dc44 = {
1263 .modes = &cdtech_s070swv29hg_dc44_mode,
1264 .num_modes = 1,
1265 .bpc = 6,
1266 .size = {
1267 .width = 154,
1268 .height = 86,
1269 },
1270 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001271 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001272 .connector_type = DRM_MODE_CONNECTOR_DPI,
1273};
1274
Giulio Benetti982f9442018-07-31 01:11:14 +02001275static const struct drm_display_mode cdtech_s070wv95_ct16_mode = {
1276 .clock = 35000,
1277 .hdisplay = 800,
1278 .hsync_start = 800 + 40,
1279 .hsync_end = 800 + 40 + 40,
1280 .htotal = 800 + 40 + 40 + 48,
1281 .vdisplay = 480,
1282 .vsync_start = 480 + 29,
1283 .vsync_end = 480 + 29 + 13,
1284 .vtotal = 480 + 29 + 13 + 3,
Giulio Benetti982f9442018-07-31 01:11:14 +02001285 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1286};
1287
1288static const struct panel_desc cdtech_s070wv95_ct16 = {
1289 .modes = &cdtech_s070wv95_ct16_mode,
1290 .num_modes = 1,
1291 .bpc = 8,
1292 .size = {
1293 .width = 154,
1294 .height = 85,
1295 },
1296};
1297
Marek Vasut07c913c2020-07-28 22:12:42 +02001298static const struct display_timing chefree_ch101olhlwh_002_timing = {
1299 .pixelclock = { 68900000, 71100000, 73400000 },
1300 .hactive = { 1280, 1280, 1280 },
1301 .hfront_porch = { 65, 80, 95 },
1302 .hback_porch = { 64, 79, 94 },
1303 .hsync_len = { 1, 1, 1 },
1304 .vactive = { 800, 800, 800 },
1305 .vfront_porch = { 7, 11, 14 },
1306 .vback_porch = { 7, 11, 14 },
1307 .vsync_len = { 1, 1, 1 },
1308 .flags = DISPLAY_FLAGS_DE_HIGH,
1309};
1310
1311static const struct panel_desc chefree_ch101olhlwh_002 = {
1312 .timings = &chefree_ch101olhlwh_002_timing,
1313 .num_timings = 1,
1314 .bpc = 8,
1315 .size = {
1316 .width = 217,
1317 .height = 135,
1318 },
1319 .delay = {
1320 .enable = 200,
1321 .disable = 200,
1322 },
1323 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1324 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1325 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1326};
1327
Randy Li2cb35c82016-09-20 03:02:51 +08001328static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
1329 .clock = 66770,
1330 .hdisplay = 800,
1331 .hsync_start = 800 + 49,
1332 .hsync_end = 800 + 49 + 33,
1333 .htotal = 800 + 49 + 33 + 17,
1334 .vdisplay = 1280,
1335 .vsync_start = 1280 + 1,
1336 .vsync_end = 1280 + 1 + 7,
1337 .vtotal = 1280 + 1 + 7 + 15,
Randy Li2cb35c82016-09-20 03:02:51 +08001338 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1339};
1340
1341static const struct panel_desc chunghwa_claa070wp03xg = {
1342 .modes = &chunghwa_claa070wp03xg_mode,
1343 .num_modes = 1,
1344 .bpc = 6,
1345 .size = {
1346 .width = 94,
1347 .height = 150,
1348 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001349 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001350 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001351 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Randy Li2cb35c82016-09-20 03:02:51 +08001352};
1353
Stephen Warren4c930752014-01-07 16:46:26 -07001354static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
1355 .clock = 72070,
1356 .hdisplay = 1366,
1357 .hsync_start = 1366 + 58,
1358 .hsync_end = 1366 + 58 + 58,
1359 .htotal = 1366 + 58 + 58 + 58,
1360 .vdisplay = 768,
1361 .vsync_start = 768 + 4,
1362 .vsync_end = 768 + 4 + 4,
1363 .vtotal = 768 + 4 + 4 + 4,
Stephen Warren4c930752014-01-07 16:46:26 -07001364};
1365
1366static const struct panel_desc chunghwa_claa101wa01a = {
1367 .modes = &chunghwa_claa101wa01a_mode,
1368 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001369 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -07001370 .size = {
1371 .width = 220,
1372 .height = 120,
1373 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001374 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001375 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001376 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Stephen Warren4c930752014-01-07 16:46:26 -07001377};
1378
Thierry Reding280921d2013-08-30 15:10:14 +02001379static const struct drm_display_mode chunghwa_claa101wb01_mode = {
1380 .clock = 69300,
1381 .hdisplay = 1366,
1382 .hsync_start = 1366 + 48,
1383 .hsync_end = 1366 + 48 + 32,
1384 .htotal = 1366 + 48 + 32 + 20,
1385 .vdisplay = 768,
1386 .vsync_start = 768 + 16,
1387 .vsync_end = 768 + 16 + 8,
1388 .vtotal = 768 + 16 + 8 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02001389};
1390
1391static const struct panel_desc chunghwa_claa101wb01 = {
1392 .modes = &chunghwa_claa101wb01_mode,
1393 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001394 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +02001395 .size = {
1396 .width = 223,
1397 .height = 125,
1398 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001399 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001400 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001401 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +02001402};
1403
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001404static const struct drm_display_mode dataimage_scf0700c48ggu18_mode = {
1405 .clock = 33260,
1406 .hdisplay = 800,
1407 .hsync_start = 800 + 40,
1408 .hsync_end = 800 + 40 + 128,
1409 .htotal = 800 + 40 + 128 + 88,
1410 .vdisplay = 480,
1411 .vsync_start = 480 + 10,
1412 .vsync_end = 480 + 10 + 2,
1413 .vtotal = 480 + 10 + 2 + 33,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001414 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1415};
1416
1417static const struct panel_desc dataimage_scf0700c48ggu18 = {
1418 .modes = &dataimage_scf0700c48ggu18_mode,
1419 .num_modes = 1,
1420 .bpc = 8,
1421 .size = {
1422 .width = 152,
1423 .height = 91,
1424 },
1425 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001426 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001427};
1428
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001429static const struct display_timing dlc_dlc0700yzg_1_timing = {
1430 .pixelclock = { 45000000, 51200000, 57000000 },
1431 .hactive = { 1024, 1024, 1024 },
1432 .hfront_porch = { 100, 106, 113 },
1433 .hback_porch = { 100, 106, 113 },
1434 .hsync_len = { 100, 108, 114 },
1435 .vactive = { 600, 600, 600 },
1436 .vfront_porch = { 8, 11, 15 },
1437 .vback_porch = { 8, 11, 15 },
1438 .vsync_len = { 9, 13, 15 },
1439 .flags = DISPLAY_FLAGS_DE_HIGH,
1440};
1441
1442static const struct panel_desc dlc_dlc0700yzg_1 = {
1443 .timings = &dlc_dlc0700yzg_1_timing,
1444 .num_timings = 1,
1445 .bpc = 6,
1446 .size = {
1447 .width = 154,
1448 .height = 86,
1449 },
1450 .delay = {
1451 .prepare = 30,
1452 .enable = 200,
1453 .disable = 200,
1454 },
1455 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001456 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001457};
1458
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001459static const struct display_timing dlc_dlc1010gig_timing = {
1460 .pixelclock = { 68900000, 71100000, 73400000 },
1461 .hactive = { 1280, 1280, 1280 },
1462 .hfront_porch = { 43, 53, 63 },
1463 .hback_porch = { 43, 53, 63 },
1464 .hsync_len = { 44, 54, 64 },
1465 .vactive = { 800, 800, 800 },
1466 .vfront_porch = { 5, 8, 11 },
1467 .vback_porch = { 5, 8, 11 },
1468 .vsync_len = { 5, 7, 11 },
1469 .flags = DISPLAY_FLAGS_DE_HIGH,
1470};
1471
1472static const struct panel_desc dlc_dlc1010gig = {
1473 .timings = &dlc_dlc1010gig_timing,
1474 .num_timings = 1,
1475 .bpc = 8,
1476 .size = {
1477 .width = 216,
1478 .height = 135,
1479 },
1480 .delay = {
1481 .prepare = 60,
1482 .enable = 150,
1483 .disable = 100,
1484 .unprepare = 60,
1485 },
1486 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001487 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001488};
1489
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001490static const struct drm_display_mode edt_et035012dm6_mode = {
1491 .clock = 6500,
1492 .hdisplay = 320,
1493 .hsync_start = 320 + 20,
1494 .hsync_end = 320 + 20 + 30,
1495 .htotal = 320 + 20 + 68,
1496 .vdisplay = 240,
1497 .vsync_start = 240 + 4,
1498 .vsync_end = 240 + 4 + 4,
1499 .vtotal = 240 + 4 + 4 + 14,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001500 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1501};
1502
1503static const struct panel_desc edt_et035012dm6 = {
1504 .modes = &edt_et035012dm6_mode,
1505 .num_modes = 1,
1506 .bpc = 8,
1507 .size = {
1508 .width = 70,
1509 .height = 52,
1510 },
1511 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001512 .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001513};
1514
Stefan Riedmuellerf08a2a12021-07-09 22:03:49 +02001515static const struct drm_display_mode edt_etm0350g0dh6_mode = {
1516 .clock = 6520,
1517 .hdisplay = 320,
1518 .hsync_start = 320 + 20,
1519 .hsync_end = 320 + 20 + 68,
1520 .htotal = 320 + 20 + 68,
1521 .vdisplay = 240,
1522 .vsync_start = 240 + 4,
1523 .vsync_end = 240 + 4 + 18,
1524 .vtotal = 240 + 4 + 18,
1525 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1526};
1527
1528static const struct panel_desc edt_etm0350g0dh6 = {
1529 .modes = &edt_etm0350g0dh6_mode,
1530 .num_modes = 1,
1531 .bpc = 6,
1532 .size = {
1533 .width = 70,
1534 .height = 53,
1535 },
1536 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1537 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
1538 .connector_type = DRM_MODE_CONNECTOR_DPI,
1539};
1540
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00001541static const struct drm_display_mode edt_etm043080dh6gp_mode = {
1542 .clock = 10870,
1543 .hdisplay = 480,
1544 .hsync_start = 480 + 8,
1545 .hsync_end = 480 + 8 + 4,
1546 .htotal = 480 + 8 + 4 + 41,
1547
1548 /*
1549 * IWG22M: Y resolution changed for "dc_linuxfb" module crashing while
1550 * fb_align
1551 */
1552
1553 .vdisplay = 288,
1554 .vsync_start = 288 + 2,
1555 .vsync_end = 288 + 2 + 4,
1556 .vtotal = 288 + 2 + 4 + 10,
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00001557};
1558
1559static const struct panel_desc edt_etm043080dh6gp = {
1560 .modes = &edt_etm043080dh6gp_mode,
1561 .num_modes = 1,
1562 .bpc = 8,
1563 .size = {
1564 .width = 100,
1565 .height = 65,
1566 },
1567 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1568 .connector_type = DRM_MODE_CONNECTOR_DPI,
1569};
1570
Marek Vasutfd819bf2019-02-19 15:04:38 +01001571static const struct drm_display_mode edt_etm0430g0dh6_mode = {
1572 .clock = 9000,
1573 .hdisplay = 480,
1574 .hsync_start = 480 + 2,
1575 .hsync_end = 480 + 2 + 41,
1576 .htotal = 480 + 2 + 41 + 2,
1577 .vdisplay = 272,
1578 .vsync_start = 272 + 2,
1579 .vsync_end = 272 + 2 + 10,
1580 .vtotal = 272 + 2 + 10 + 2,
Marek Vasutfd819bf2019-02-19 15:04:38 +01001581 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1582};
1583
1584static const struct panel_desc edt_etm0430g0dh6 = {
1585 .modes = &edt_etm0430g0dh6_mode,
1586 .num_modes = 1,
1587 .bpc = 6,
1588 .size = {
1589 .width = 95,
1590 .height = 54,
1591 },
Stefan Riedmueller4824a5f2021-06-21 17:09:30 +02001592 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1593 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Stefan Riedmuellerd112e102021-06-21 17:09:29 +02001594 .connector_type = DRM_MODE_CONNECTOR_DPI,
Marek Vasutfd819bf2019-02-19 15:04:38 +01001595};
1596
Stefan Agner26ab0062014-05-15 11:38:45 +02001597static const struct drm_display_mode edt_et057090dhu_mode = {
1598 .clock = 25175,
1599 .hdisplay = 640,
1600 .hsync_start = 640 + 16,
1601 .hsync_end = 640 + 16 + 30,
1602 .htotal = 640 + 16 + 30 + 114,
1603 .vdisplay = 480,
1604 .vsync_start = 480 + 10,
1605 .vsync_end = 480 + 10 + 3,
1606 .vtotal = 480 + 10 + 3 + 32,
Stefan Agner26ab0062014-05-15 11:38:45 +02001607 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1608};
1609
1610static const struct panel_desc edt_et057090dhu = {
1611 .modes = &edt_et057090dhu_mode,
1612 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001613 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +02001614 .size = {
1615 .width = 115,
1616 .height = 86,
1617 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08001618 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001619 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Dmitry Osipenko75e73222020-06-22 01:27:41 +03001620 .connector_type = DRM_MODE_CONNECTOR_DPI,
Stefan Agner26ab0062014-05-15 11:38:45 +02001621};
1622
Philipp Zabelfff5de42014-05-15 12:25:47 +02001623static const struct drm_display_mode edt_etm0700g0dh6_mode = {
1624 .clock = 33260,
1625 .hdisplay = 800,
1626 .hsync_start = 800 + 40,
1627 .hsync_end = 800 + 40 + 128,
1628 .htotal = 800 + 40 + 128 + 88,
1629 .vdisplay = 480,
1630 .vsync_start = 480 + 10,
1631 .vsync_end = 480 + 10 + 2,
1632 .vtotal = 480 + 10 + 2 + 33,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001633 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1634};
1635
1636static const struct panel_desc edt_etm0700g0dh6 = {
1637 .modes = &edt_etm0700g0dh6_mode,
1638 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001639 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001640 .size = {
1641 .width = 152,
1642 .height = 91,
1643 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08001644 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001645 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Biju Das281edb92020-10-20 10:49:10 +01001646 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001647};
1648
Jan Tuerkaa7e6452018-06-19 11:55:44 +02001649static const struct panel_desc edt_etm0700g0bdh6 = {
1650 .modes = &edt_etm0700g0dh6_mode,
1651 .num_modes = 1,
1652 .bpc = 6,
1653 .size = {
1654 .width = 152,
1655 .height = 91,
1656 },
1657 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001658 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Stefan Riedmuellerd112e102021-06-21 17:09:29 +02001659 .connector_type = DRM_MODE_CONNECTOR_DPI,
Jan Tuerkaa7e6452018-06-19 11:55:44 +02001660};
1661
Stefan Riedmuellere46f73f2021-07-09 22:03:48 +02001662static const struct drm_display_mode edt_etmv570g2dhu_mode = {
1663 .clock = 25175,
1664 .hdisplay = 640,
1665 .hsync_start = 640,
1666 .hsync_end = 640 + 16,
1667 .htotal = 640 + 16 + 30 + 114,
1668 .vdisplay = 480,
1669 .vsync_start = 480 + 10,
1670 .vsync_end = 480 + 10 + 3,
1671 .vtotal = 480 + 10 + 3 + 35,
1672 .flags = DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_PHSYNC,
1673};
1674
1675static const struct panel_desc edt_etmv570g2dhu = {
1676 .modes = &edt_etmv570g2dhu_mode,
1677 .num_modes = 1,
1678 .bpc = 6,
1679 .size = {
1680 .width = 115,
1681 .height = 86,
1682 },
1683 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1684 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
1685 .connector_type = DRM_MODE_CONNECTOR_DPI,
1686};
1687
Alistair Francis9746f5f2021-08-01 10:47:00 +10001688static const struct display_timing eink_vb3300_kca_timing = {
1689 .pixelclock = { 40000000, 40000000, 40000000 },
1690 .hactive = { 334, 334, 334 },
1691 .hfront_porch = { 1, 1, 1 },
1692 .hback_porch = { 1, 1, 1 },
1693 .hsync_len = { 1, 1, 1 },
1694 .vactive = { 1405, 1405, 1405 },
1695 .vfront_porch = { 1, 1, 1 },
1696 .vback_porch = { 1, 1, 1 },
1697 .vsync_len = { 1, 1, 1 },
1698 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
1699 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
1700};
1701
1702static const struct panel_desc eink_vb3300_kca = {
1703 .timings = &eink_vb3300_kca_timing,
1704 .num_timings = 1,
1705 .bpc = 6,
1706 .size = {
1707 .width = 157,
1708 .height = 209,
1709 },
1710 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1711 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
1712 .connector_type = DRM_MODE_CONNECTOR_DPI,
1713};
1714
Marco Felsch9158e3c2019-04-16 12:06:45 +02001715static const struct display_timing evervision_vgg804821_timing = {
1716 .pixelclock = { 27600000, 33300000, 50000000 },
1717 .hactive = { 800, 800, 800 },
1718 .hfront_porch = { 40, 66, 70 },
1719 .hback_porch = { 40, 67, 70 },
1720 .hsync_len = { 40, 67, 70 },
1721 .vactive = { 480, 480, 480 },
1722 .vfront_porch = { 6, 10, 10 },
1723 .vback_porch = { 7, 11, 11 },
1724 .vsync_len = { 7, 11, 11 },
1725 .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH |
1726 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
1727 DISPLAY_FLAGS_SYNC_NEGEDGE,
1728};
1729
1730static const struct panel_desc evervision_vgg804821 = {
1731 .timings = &evervision_vgg804821_timing,
1732 .num_timings = 1,
1733 .bpc = 8,
1734 .size = {
1735 .width = 108,
1736 .height = 64,
1737 },
1738 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001739 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Marco Felsch9158e3c2019-04-16 12:06:45 +02001740};
1741
Boris BREZILLON102932b2014-06-05 15:53:32 +02001742static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
1743 .clock = 32260,
1744 .hdisplay = 800,
1745 .hsync_start = 800 + 168,
1746 .hsync_end = 800 + 168 + 64,
1747 .htotal = 800 + 168 + 64 + 88,
1748 .vdisplay = 480,
1749 .vsync_start = 480 + 37,
1750 .vsync_end = 480 + 37 + 2,
1751 .vtotal = 480 + 37 + 2 + 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001752};
1753
1754static const struct panel_desc foxlink_fl500wvr00_a0t = {
1755 .modes = &foxlink_fl500wvr00_a0t_mode,
1756 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001757 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001758 .size = {
1759 .width = 108,
1760 .height = 65,
1761 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +02001762 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001763};
1764
Paul Cercueil795db2a2020-07-16 14:56:47 +02001765static const struct drm_display_mode frida_frd350h54004_modes[] = {
1766 { /* 60 Hz */
1767 .clock = 6000,
1768 .hdisplay = 320,
1769 .hsync_start = 320 + 44,
1770 .hsync_end = 320 + 44 + 16,
1771 .htotal = 320 + 44 + 16 + 20,
1772 .vdisplay = 240,
1773 .vsync_start = 240 + 2,
1774 .vsync_end = 240 + 2 + 6,
1775 .vtotal = 240 + 2 + 6 + 2,
1776 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1777 },
1778 { /* 50 Hz */
1779 .clock = 5400,
1780 .hdisplay = 320,
1781 .hsync_start = 320 + 56,
1782 .hsync_end = 320 + 56 + 16,
1783 .htotal = 320 + 56 + 16 + 40,
1784 .vdisplay = 240,
1785 .vsync_start = 240 + 2,
1786 .vsync_end = 240 + 2 + 6,
1787 .vtotal = 240 + 2 + 6 + 2,
1788 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1789 },
Paul Cercueil7b6bd842020-01-13 13:17:41 -03001790};
1791
1792static const struct panel_desc frida_frd350h54004 = {
Paul Cercueil795db2a2020-07-16 14:56:47 +02001793 .modes = frida_frd350h54004_modes,
1794 .num_modes = ARRAY_SIZE(frida_frd350h54004_modes),
Paul Cercueil7b6bd842020-01-13 13:17:41 -03001795 .bpc = 8,
1796 .size = {
1797 .width = 77,
1798 .height = 64,
1799 },
1800 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001801 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Paul Cercueil7b6bd842020-01-13 13:17:41 -03001802 .connector_type = DRM_MODE_CONNECTOR_DPI,
1803};
1804
Jagan Teki3be20712019-05-07 18:37:07 +05301805static const struct drm_display_mode friendlyarm_hd702e_mode = {
1806 .clock = 67185,
1807 .hdisplay = 800,
1808 .hsync_start = 800 + 20,
1809 .hsync_end = 800 + 20 + 24,
1810 .htotal = 800 + 20 + 24 + 20,
1811 .vdisplay = 1280,
1812 .vsync_start = 1280 + 4,
1813 .vsync_end = 1280 + 4 + 8,
1814 .vtotal = 1280 + 4 + 8 + 4,
Jagan Teki3be20712019-05-07 18:37:07 +05301815 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1816};
1817
1818static const struct panel_desc friendlyarm_hd702e = {
1819 .modes = &friendlyarm_hd702e_mode,
1820 .num_modes = 1,
1821 .size = {
1822 .width = 94,
1823 .height = 151,
1824 },
1825};
1826
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001827static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
1828 .clock = 9000,
1829 .hdisplay = 480,
1830 .hsync_start = 480 + 5,
1831 .hsync_end = 480 + 5 + 1,
1832 .htotal = 480 + 5 + 1 + 40,
1833 .vdisplay = 272,
1834 .vsync_start = 272 + 8,
1835 .vsync_end = 272 + 8 + 1,
1836 .vtotal = 272 + 8 + 1 + 8,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001837};
1838
1839static const struct panel_desc giantplus_gpg482739qs5 = {
1840 .modes = &giantplus_gpg482739qs5_mode,
1841 .num_modes = 1,
1842 .bpc = 8,
1843 .size = {
1844 .width = 95,
1845 .height = 54,
1846 },
Philipp Zabel33536a02015-02-11 18:50:07 +01001847 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01001848};
1849
Paul Cercueil2c6574a2019-06-06 00:22:47 +02001850static const struct display_timing giantplus_gpm940b0_timing = {
1851 .pixelclock = { 13500000, 27000000, 27500000 },
1852 .hactive = { 320, 320, 320 },
1853 .hfront_porch = { 14, 686, 718 },
1854 .hback_porch = { 50, 70, 255 },
1855 .hsync_len = { 1, 1, 1 },
1856 .vactive = { 240, 240, 240 },
1857 .vfront_porch = { 1, 1, 179 },
1858 .vback_porch = { 1, 21, 31 },
1859 .vsync_len = { 1, 1, 6 },
1860 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
1861};
1862
1863static const struct panel_desc giantplus_gpm940b0 = {
1864 .timings = &giantplus_gpm940b0_timing,
1865 .num_timings = 1,
1866 .bpc = 8,
1867 .size = {
1868 .width = 60,
1869 .height = 45,
1870 },
1871 .bus_format = MEDIA_BUS_FMT_RGB888_3X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001872 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Paul Cercueil2c6574a2019-06-06 00:22:47 +02001873};
1874
Philipp Zabelab077252014-12-11 18:32:46 +01001875static const struct display_timing hannstar_hsd070pww1_timing = {
1876 .pixelclock = { 64300000, 71100000, 82000000 },
1877 .hactive = { 1280, 1280, 1280 },
1878 .hfront_porch = { 1, 1, 10 },
1879 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +02001880 /*
1881 * According to the data sheet, the minimum horizontal blanking interval
1882 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
1883 * minimum working horizontal blanking interval to be 60 clocks.
1884 */
1885 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +01001886 .vactive = { 800, 800, 800 },
1887 .vfront_porch = { 1, 1, 10 },
1888 .vback_porch = { 1, 1, 10 },
1889 .vsync_len = { 1, 21, 203 },
1890 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +02001891};
1892
1893static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +01001894 .timings = &hannstar_hsd070pww1_timing,
1895 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +02001896 .bpc = 6,
1897 .size = {
1898 .width = 151,
1899 .height = 94,
1900 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +02001901 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001902 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabela8532052014-10-23 16:31:06 +02001903};
1904
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001905static const struct display_timing hannstar_hsd100pxn1_timing = {
1906 .pixelclock = { 55000000, 65000000, 75000000 },
1907 .hactive = { 1024, 1024, 1024 },
1908 .hfront_porch = { 40, 40, 40 },
1909 .hback_porch = { 220, 220, 220 },
1910 .hsync_len = { 20, 60, 100 },
1911 .vactive = { 768, 768, 768 },
1912 .vfront_porch = { 7, 7, 7 },
1913 .vback_porch = { 21, 21, 21 },
1914 .vsync_len = { 10, 10, 10 },
1915 .flags = DISPLAY_FLAGS_DE_HIGH,
1916};
1917
1918static const struct panel_desc hannstar_hsd100pxn1 = {
1919 .timings = &hannstar_hsd100pxn1_timing,
1920 .num_timings = 1,
1921 .bpc = 6,
1922 .size = {
1923 .width = 203,
1924 .height = 152,
1925 },
Philipp Zabel4946b042015-05-20 11:34:08 +02001926 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001927 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Eric Nelsonc0d607e2015-04-13 15:09:26 -07001928};
1929
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001930static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
1931 .clock = 33333,
1932 .hdisplay = 800,
1933 .hsync_start = 800 + 85,
1934 .hsync_end = 800 + 85 + 86,
1935 .htotal = 800 + 85 + 86 + 85,
1936 .vdisplay = 480,
1937 .vsync_start = 480 + 16,
1938 .vsync_end = 480 + 16 + 13,
1939 .vtotal = 480 + 16 + 13 + 16,
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001940};
1941
1942static const struct panel_desc hitachi_tx23d38vm0caa = {
1943 .modes = &hitachi_tx23d38vm0caa_mode,
1944 .num_modes = 1,
1945 .bpc = 6,
1946 .size = {
1947 .width = 195,
1948 .height = 117,
1949 },
Philipp Zabel6c684e32017-10-11 14:59:58 +02001950 .delay = {
1951 .enable = 160,
1952 .disable = 160,
1953 },
Lucas Stach61ac0bf2014-11-06 17:44:35 +01001954};
1955
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001956static const struct drm_display_mode innolux_at043tn24_mode = {
1957 .clock = 9000,
1958 .hdisplay = 480,
1959 .hsync_start = 480 + 2,
1960 .hsync_end = 480 + 2 + 41,
1961 .htotal = 480 + 2 + 41 + 2,
1962 .vdisplay = 272,
1963 .vsync_start = 272 + 2,
Philipp Zabela4831592017-10-11 14:59:56 +02001964 .vsync_end = 272 + 2 + 10,
1965 .vtotal = 272 + 2 + 10 + 2,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001966 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1967};
1968
1969static const struct panel_desc innolux_at043tn24 = {
1970 .modes = &innolux_at043tn24_mode,
1971 .num_modes = 1,
1972 .bpc = 8,
1973 .size = {
1974 .width = 95,
1975 .height = 54,
1976 },
1977 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001978 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01001979};
1980
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02001981static const struct drm_display_mode innolux_at070tn92_mode = {
1982 .clock = 33333,
1983 .hdisplay = 800,
1984 .hsync_start = 800 + 210,
1985 .hsync_end = 800 + 210 + 20,
1986 .htotal = 800 + 210 + 20 + 46,
1987 .vdisplay = 480,
1988 .vsync_start = 480 + 22,
1989 .vsync_end = 480 + 22 + 10,
1990 .vtotal = 480 + 22 + 23 + 10,
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02001991};
1992
1993static const struct panel_desc innolux_at070tn92 = {
1994 .modes = &innolux_at070tn92_mode,
1995 .num_modes = 1,
1996 .size = {
1997 .width = 154,
1998 .height = 86,
1999 },
2000 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2001};
2002
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002003static const struct display_timing innolux_g070y2_l01_timing = {
2004 .pixelclock = { 28000000, 29500000, 32000000 },
2005 .hactive = { 800, 800, 800 },
2006 .hfront_porch = { 61, 91, 141 },
2007 .hback_porch = { 60, 90, 140 },
2008 .hsync_len = { 12, 12, 12 },
2009 .vactive = { 480, 480, 480 },
2010 .vfront_porch = { 4, 9, 30 },
2011 .vback_porch = { 4, 8, 28 },
2012 .vsync_len = { 2, 2, 2 },
2013 .flags = DISPLAY_FLAGS_DE_HIGH,
2014};
2015
2016static const struct panel_desc innolux_g070y2_l01 = {
2017 .timings = &innolux_g070y2_l01_timing,
2018 .num_timings = 1,
2019 .bpc = 6,
2020 .size = {
2021 .width = 152,
2022 .height = 91,
2023 },
2024 .delay = {
2025 .prepare = 10,
2026 .enable = 100,
2027 .disable = 100,
2028 .unprepare = 800,
2029 },
2030 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002031 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002032};
2033
Oleksij Rempel57a06e92021-10-14 11:52:02 +02002034static const struct drm_display_mode innolux_g070y2_t02_mode = {
2035 .clock = 33333,
2036 .hdisplay = 800,
2037 .hsync_start = 800 + 210,
2038 .hsync_end = 800 + 210 + 20,
2039 .htotal = 800 + 210 + 20 + 46,
2040 .vdisplay = 480,
2041 .vsync_start = 480 + 22,
2042 .vsync_end = 480 + 22 + 10,
2043 .vtotal = 480 + 22 + 23 + 10,
2044};
2045
2046static const struct panel_desc innolux_g070y2_t02 = {
2047 .modes = &innolux_g070y2_t02_mode,
2048 .num_modes = 1,
2049 .bpc = 8,
2050 .size = {
2051 .width = 152,
2052 .height = 92,
2053 },
2054 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2055 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
2056 .connector_type = DRM_MODE_CONNECTOR_DPI,
2057};
2058
Michael Olbrich1e29b842016-08-15 14:32:02 +02002059static const struct display_timing innolux_g101ice_l01_timing = {
2060 .pixelclock = { 60400000, 71100000, 74700000 },
2061 .hactive = { 1280, 1280, 1280 },
2062 .hfront_porch = { 41, 80, 100 },
2063 .hback_porch = { 40, 79, 99 },
2064 .hsync_len = { 1, 1, 1 },
2065 .vactive = { 800, 800, 800 },
2066 .vfront_porch = { 5, 11, 14 },
2067 .vback_porch = { 4, 11, 14 },
2068 .vsync_len = { 1, 1, 1 },
2069 .flags = DISPLAY_FLAGS_DE_HIGH,
2070};
2071
2072static const struct panel_desc innolux_g101ice_l01 = {
2073 .timings = &innolux_g101ice_l01_timing,
2074 .num_timings = 1,
2075 .bpc = 8,
2076 .size = {
2077 .width = 217,
2078 .height = 135,
2079 },
2080 .delay = {
2081 .enable = 200,
2082 .disable = 200,
2083 },
2084 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002085 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Michael Olbrich1e29b842016-08-15 14:32:02 +02002086};
2087
Lucas Stach4ae13e42016-11-30 14:09:54 +01002088static const struct display_timing innolux_g121i1_l01_timing = {
2089 .pixelclock = { 67450000, 71000000, 74550000 },
2090 .hactive = { 1280, 1280, 1280 },
2091 .hfront_porch = { 40, 80, 160 },
2092 .hback_porch = { 39, 79, 159 },
2093 .hsync_len = { 1, 1, 1 },
2094 .vactive = { 800, 800, 800 },
2095 .vfront_porch = { 5, 11, 100 },
2096 .vback_porch = { 4, 11, 99 },
2097 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01002098};
2099
2100static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01002101 .timings = &innolux_g121i1_l01_timing,
2102 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01002103 .bpc = 6,
2104 .size = {
2105 .width = 261,
2106 .height = 163,
2107 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01002108 .delay = {
2109 .enable = 200,
2110 .disable = 20,
2111 },
2112 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002113 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stachd731f662014-11-06 17:44:33 +01002114};
2115
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002116static const struct drm_display_mode innolux_g121x1_l03_mode = {
2117 .clock = 65000,
2118 .hdisplay = 1024,
2119 .hsync_start = 1024 + 0,
2120 .hsync_end = 1024 + 1,
2121 .htotal = 1024 + 0 + 1 + 320,
2122 .vdisplay = 768,
2123 .vsync_start = 768 + 38,
2124 .vsync_end = 768 + 38 + 1,
2125 .vtotal = 768 + 38 + 1 + 0,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05002126 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002127};
2128
2129static const struct panel_desc innolux_g121x1_l03 = {
2130 .modes = &innolux_g121x1_l03_mode,
2131 .num_modes = 1,
2132 .bpc = 6,
2133 .size = {
2134 .width = 246,
2135 .height = 185,
2136 },
2137 .delay = {
2138 .enable = 200,
2139 .unprepare = 200,
2140 .disable = 400,
2141 },
2142};
2143
Alban Bedelea447392014-07-22 08:38:55 +02002144static const struct drm_display_mode innolux_n156bge_l21_mode = {
2145 .clock = 69300,
2146 .hdisplay = 1366,
2147 .hsync_start = 1366 + 16,
2148 .hsync_end = 1366 + 16 + 34,
2149 .htotal = 1366 + 16 + 34 + 50,
2150 .vdisplay = 768,
2151 .vsync_start = 768 + 2,
2152 .vsync_end = 768 + 2 + 6,
2153 .vtotal = 768 + 2 + 6 + 12,
Alban Bedelea447392014-07-22 08:38:55 +02002154};
2155
2156static const struct panel_desc innolux_n156bge_l21 = {
2157 .modes = &innolux_n156bge_l21_mode,
2158 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002159 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02002160 .size = {
2161 .width = 344,
2162 .height = 193,
2163 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03002164 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002165 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03002166 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alban Bedelea447392014-07-22 08:38:55 +02002167};
2168
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002169static const struct drm_display_mode innolux_zj070na_01p_mode = {
2170 .clock = 51501,
2171 .hdisplay = 1024,
2172 .hsync_start = 1024 + 128,
2173 .hsync_end = 1024 + 128 + 64,
2174 .htotal = 1024 + 128 + 64 + 128,
2175 .vdisplay = 600,
2176 .vsync_start = 600 + 16,
2177 .vsync_end = 600 + 16 + 4,
2178 .vtotal = 600 + 16 + 4 + 16,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002179};
2180
2181static const struct panel_desc innolux_zj070na_01p = {
2182 .modes = &innolux_zj070na_01p_mode,
2183 .num_modes = 1,
2184 .bpc = 6,
2185 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02002186 .width = 154,
2187 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002188 },
2189};
2190
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02002191static const struct display_timing koe_tx14d24vm1bpa_timing = {
2192 .pixelclock = { 5580000, 5850000, 6200000 },
2193 .hactive = { 320, 320, 320 },
2194 .hfront_porch = { 30, 30, 30 },
2195 .hback_porch = { 30, 30, 30 },
2196 .hsync_len = { 1, 5, 17 },
2197 .vactive = { 240, 240, 240 },
2198 .vfront_porch = { 6, 6, 6 },
2199 .vback_porch = { 5, 5, 5 },
2200 .vsync_len = { 1, 2, 11 },
2201 .flags = DISPLAY_FLAGS_DE_HIGH,
2202};
2203
2204static const struct panel_desc koe_tx14d24vm1bpa = {
2205 .timings = &koe_tx14d24vm1bpa_timing,
2206 .num_timings = 1,
2207 .bpc = 6,
2208 .size = {
2209 .width = 115,
2210 .height = 86,
2211 },
2212};
2213
Liu Ying8a070522020-06-01 14:11:20 +08002214static const struct display_timing koe_tx26d202vm0bwa_timing = {
2215 .pixelclock = { 151820000, 156720000, 159780000 },
2216 .hactive = { 1920, 1920, 1920 },
2217 .hfront_porch = { 105, 130, 142 },
2218 .hback_porch = { 45, 70, 82 },
2219 .hsync_len = { 30, 30, 30 },
2220 .vactive = { 1200, 1200, 1200},
2221 .vfront_porch = { 3, 5, 10 },
2222 .vback_porch = { 2, 5, 10 },
2223 .vsync_len = { 5, 5, 5 },
2224};
2225
2226static const struct panel_desc koe_tx26d202vm0bwa = {
2227 .timings = &koe_tx26d202vm0bwa_timing,
2228 .num_timings = 1,
2229 .bpc = 8,
2230 .size = {
2231 .width = 217,
2232 .height = 136,
2233 },
2234 .delay = {
2235 .prepare = 1000,
2236 .enable = 1000,
2237 .unprepare = 1000,
2238 .disable = 1000,
2239 },
2240 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002241 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Liu Ying8a070522020-06-01 14:11:20 +08002242 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2243};
2244
Jagan Teki8cfe8342018-02-04 23:19:28 +05302245static const struct display_timing koe_tx31d200vm0baa_timing = {
2246 .pixelclock = { 39600000, 43200000, 48000000 },
2247 .hactive = { 1280, 1280, 1280 },
2248 .hfront_porch = { 16, 36, 56 },
2249 .hback_porch = { 16, 36, 56 },
2250 .hsync_len = { 8, 8, 8 },
2251 .vactive = { 480, 480, 480 },
Stefan Agnerc9b6be72018-04-19 23:20:03 +02002252 .vfront_porch = { 6, 21, 33 },
2253 .vback_porch = { 6, 21, 33 },
Jagan Teki8cfe8342018-02-04 23:19:28 +05302254 .vsync_len = { 8, 8, 8 },
2255 .flags = DISPLAY_FLAGS_DE_HIGH,
2256};
2257
2258static const struct panel_desc koe_tx31d200vm0baa = {
2259 .timings = &koe_tx31d200vm0baa_timing,
2260 .num_timings = 1,
2261 .bpc = 6,
2262 .size = {
2263 .width = 292,
2264 .height = 109,
2265 },
2266 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002267 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Jagan Teki8cfe8342018-02-04 23:19:28 +05302268};
2269
Lucas Stach8def22e2015-12-02 19:41:11 +01002270static const struct display_timing kyo_tcg121xglp_timing = {
2271 .pixelclock = { 52000000, 65000000, 71000000 },
2272 .hactive = { 1024, 1024, 1024 },
2273 .hfront_porch = { 2, 2, 2 },
2274 .hback_porch = { 2, 2, 2 },
2275 .hsync_len = { 86, 124, 244 },
2276 .vactive = { 768, 768, 768 },
2277 .vfront_porch = { 2, 2, 2 },
2278 .vback_porch = { 2, 2, 2 },
2279 .vsync_len = { 6, 34, 73 },
2280 .flags = DISPLAY_FLAGS_DE_HIGH,
2281};
2282
2283static const struct panel_desc kyo_tcg121xglp = {
2284 .timings = &kyo_tcg121xglp_timing,
2285 .num_timings = 1,
2286 .bpc = 8,
2287 .size = {
2288 .width = 246,
2289 .height = 184,
2290 },
2291 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002292 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8def22e2015-12-02 19:41:11 +01002293};
2294
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002295static const struct drm_display_mode lemaker_bl035_rgb_002_mode = {
2296 .clock = 7000,
2297 .hdisplay = 320,
2298 .hsync_start = 320 + 20,
2299 .hsync_end = 320 + 20 + 30,
2300 .htotal = 320 + 20 + 30 + 38,
2301 .vdisplay = 240,
2302 .vsync_start = 240 + 4,
2303 .vsync_end = 240 + 4 + 3,
2304 .vtotal = 240 + 4 + 3 + 15,
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002305};
2306
2307static const struct panel_desc lemaker_bl035_rgb_002 = {
2308 .modes = &lemaker_bl035_rgb_002_mode,
2309 .num_modes = 1,
2310 .size = {
2311 .width = 70,
2312 .height = 52,
2313 },
2314 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2315 .bus_flags = DRM_BUS_FLAG_DE_LOW,
2316};
2317
Heiko Schocherdd015002015-05-22 10:25:57 +02002318static const struct drm_display_mode lg_lb070wv8_mode = {
2319 .clock = 33246,
2320 .hdisplay = 800,
2321 .hsync_start = 800 + 88,
2322 .hsync_end = 800 + 88 + 80,
2323 .htotal = 800 + 88 + 80 + 88,
2324 .vdisplay = 480,
2325 .vsync_start = 480 + 10,
2326 .vsync_end = 480 + 10 + 25,
2327 .vtotal = 480 + 10 + 25 + 10,
Heiko Schocherdd015002015-05-22 10:25:57 +02002328};
2329
2330static const struct panel_desc lg_lb070wv8 = {
2331 .modes = &lg_lb070wv8_mode,
2332 .num_modes = 1,
Laurent Pincharta6ae2fe2020-07-12 01:53:17 +03002333 .bpc = 8,
Heiko Schocherdd015002015-05-22 10:25:57 +02002334 .size = {
2335 .width = 151,
2336 .height = 91,
2337 },
2338 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002339 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Heiko Schocherdd015002015-05-22 10:25:57 +02002340};
2341
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01002342static const struct display_timing logictechno_lt161010_2nh_timing = {
2343 .pixelclock = { 26400000, 33300000, 46800000 },
2344 .hactive = { 800, 800, 800 },
2345 .hfront_porch = { 16, 210, 354 },
2346 .hback_porch = { 46, 46, 46 },
2347 .hsync_len = { 1, 20, 40 },
2348 .vactive = { 480, 480, 480 },
2349 .vfront_porch = { 7, 22, 147 },
2350 .vback_porch = { 23, 23, 23 },
2351 .vsync_len = { 1, 10, 20 },
2352 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2353 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
2354 DISPLAY_FLAGS_SYNC_POSEDGE,
2355};
2356
2357static const struct panel_desc logictechno_lt161010_2nh = {
2358 .timings = &logictechno_lt161010_2nh_timing,
2359 .num_timings = 1,
2360 .size = {
2361 .width = 154,
2362 .height = 86,
2363 },
2364 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2365 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
2366 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
2367 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
2368 .connector_type = DRM_MODE_CONNECTOR_DPI,
2369};
2370
2371static const struct display_timing logictechno_lt170410_2whc_timing = {
2372 .pixelclock = { 68900000, 71100000, 73400000 },
2373 .hactive = { 1280, 1280, 1280 },
2374 .hfront_porch = { 23, 60, 71 },
2375 .hback_porch = { 23, 60, 71 },
2376 .hsync_len = { 15, 40, 47 },
2377 .vactive = { 800, 800, 800 },
2378 .vfront_porch = { 5, 7, 10 },
2379 .vback_porch = { 5, 7, 10 },
2380 .vsync_len = { 6, 9, 12 },
2381 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2382 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
2383 DISPLAY_FLAGS_SYNC_POSEDGE,
2384};
2385
2386static const struct panel_desc logictechno_lt170410_2whc = {
2387 .timings = &logictechno_lt170410_2whc_timing,
2388 .num_timings = 1,
2389 .size = {
2390 .width = 217,
2391 .height = 136,
2392 },
2393 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002394 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01002395 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2396};
2397
Søren Andersen19f036e2021-09-30 12:05:01 +02002398static const struct drm_display_mode logictechno_lttd800480070_l2rt_mode = {
2399 .clock = 33000,
2400 .hdisplay = 800,
2401 .hsync_start = 800 + 112,
2402 .hsync_end = 800 + 112 + 3,
2403 .htotal = 800 + 112 + 3 + 85,
2404 .vdisplay = 480,
2405 .vsync_start = 480 + 38,
2406 .vsync_end = 480 + 38 + 3,
2407 .vtotal = 480 + 38 + 3 + 29,
2408 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2409};
2410
2411static const struct panel_desc logictechno_lttd800480070_l2rt = {
2412 .modes = &logictechno_lttd800480070_l2rt_mode,
2413 .num_modes = 1,
2414 .bpc = 8,
2415 .size = {
2416 .width = 154,
2417 .height = 86,
2418 },
2419 .delay = {
2420 .prepare = 45,
2421 .enable = 100,
2422 .disable = 100,
2423 .unprepare = 45
2424 },
2425 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2426 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
2427 .connector_type = DRM_MODE_CONNECTOR_DPI,
2428};
2429
Søren Andersen0c044f72021-08-05 13:19:44 +02002430static const struct drm_display_mode logictechno_lttd800480070_l6wh_rt_mode = {
2431 .clock = 33000,
2432 .hdisplay = 800,
2433 .hsync_start = 800 + 154,
2434 .hsync_end = 800 + 154 + 3,
2435 .htotal = 800 + 154 + 3 + 43,
2436 .vdisplay = 480,
2437 .vsync_start = 480 + 47,
2438 .vsync_end = 480 + 47 + 3,
2439 .vtotal = 480 + 47 + 3 + 20,
2440 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2441};
2442
2443static const struct panel_desc logictechno_lttd800480070_l6wh_rt = {
2444 .modes = &logictechno_lttd800480070_l6wh_rt_mode,
2445 .num_modes = 1,
2446 .bpc = 8,
2447 .size = {
2448 .width = 154,
2449 .height = 86,
2450 },
2451 .delay = {
2452 .prepare = 45,
2453 .enable = 100,
2454 .disable = 100,
2455 .unprepare = 45
2456 },
2457 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2458 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
2459 .connector_type = DRM_MODE_CONNECTOR_DPI,
2460};
2461
Adam Ford0d354082019-10-16 08:51:45 -05002462static const struct drm_display_mode logicpd_type_28_mode = {
Ville Syrjäläf873c5d2020-03-02 22:34:40 +02002463 .clock = 9107,
Adam Ford0d354082019-10-16 08:51:45 -05002464 .hdisplay = 480,
2465 .hsync_start = 480 + 3,
2466 .hsync_end = 480 + 3 + 42,
2467 .htotal = 480 + 3 + 42 + 2,
2468
2469 .vdisplay = 272,
2470 .vsync_start = 272 + 2,
2471 .vsync_end = 272 + 2 + 11,
2472 .vtotal = 272 + 2 + 11 + 3,
Adam Ford0d354082019-10-16 08:51:45 -05002473 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2474};
2475
2476static const struct panel_desc logicpd_type_28 = {
2477 .modes = &logicpd_type_28_mode,
2478 .num_modes = 1,
2479 .bpc = 8,
2480 .size = {
2481 .width = 105,
2482 .height = 67,
2483 },
2484 .delay = {
2485 .prepare = 200,
2486 .enable = 200,
2487 .unprepare = 200,
2488 .disable = 200,
2489 },
2490 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2491 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
2492 DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
Adam Fordefb94792020-06-15 08:19:34 -05002493 .connector_type = DRM_MODE_CONNECTOR_DPI,
Adam Ford0d354082019-10-16 08:51:45 -05002494};
2495
Douglas Andersonc8527b92021-09-01 13:19:22 -07002496static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
2497 .clock = 30400,
2498 .hdisplay = 800,
2499 .hsync_start = 800 + 0,
2500 .hsync_end = 800 + 1,
2501 .htotal = 800 + 0 + 1 + 160,
2502 .vdisplay = 480,
2503 .vsync_start = 480 + 0,
2504 .vsync_end = 480 + 48 + 1,
2505 .vtotal = 480 + 48 + 1 + 0,
2506 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2507};
2508
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002509static const struct panel_desc mitsubishi_aa070mc01 = {
2510 .modes = &mitsubishi_aa070mc01_mode,
2511 .num_modes = 1,
2512 .bpc = 8,
2513 .size = {
2514 .width = 152,
2515 .height = 91,
2516 },
2517
2518 .delay = {
2519 .enable = 200,
2520 .unprepare = 200,
2521 .disable = 400,
2522 },
2523 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002524 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002525 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
2526};
2527
Sam Ravnborg81162f42021-08-05 13:19:43 +02002528static const struct display_timing multi_inno_mi1010ait_1cp_timing = {
2529 .pixelclock = { 68900000, 70000000, 73400000 },
2530 .hactive = { 1280, 1280, 1280 },
2531 .hfront_porch = { 30, 60, 71 },
2532 .hback_porch = { 30, 60, 71 },
2533 .hsync_len = { 10, 10, 48 },
2534 .vactive = { 800, 800, 800 },
2535 .vfront_porch = { 5, 10, 10 },
2536 .vback_porch = { 5, 10, 10 },
2537 .vsync_len = { 5, 6, 13 },
2538 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2539 DISPLAY_FLAGS_DE_HIGH,
2540};
2541
2542static const struct panel_desc multi_inno_mi1010ait_1cp = {
2543 .timings = &multi_inno_mi1010ait_1cp_timing,
2544 .num_timings = 1,
2545 .bpc = 8,
2546 .size = {
2547 .width = 217,
2548 .height = 136,
2549 },
2550 .delay = {
2551 .enable = 50,
2552 .disable = 50,
2553 },
2554 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
2555 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
2556 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2557};
2558
Lucas Stach01bacc132017-06-08 20:07:55 +02002559static const struct display_timing nec_nl12880bc20_05_timing = {
2560 .pixelclock = { 67000000, 71000000, 75000000 },
2561 .hactive = { 1280, 1280, 1280 },
2562 .hfront_porch = { 2, 30, 30 },
2563 .hback_porch = { 6, 100, 100 },
2564 .hsync_len = { 2, 30, 30 },
2565 .vactive = { 800, 800, 800 },
2566 .vfront_porch = { 5, 5, 5 },
2567 .vback_porch = { 11, 11, 11 },
2568 .vsync_len = { 7, 7, 7 },
2569};
2570
2571static const struct panel_desc nec_nl12880bc20_05 = {
2572 .timings = &nec_nl12880bc20_05_timing,
2573 .num_timings = 1,
2574 .bpc = 8,
2575 .size = {
2576 .width = 261,
2577 .height = 163,
2578 },
2579 .delay = {
2580 .enable = 50,
2581 .disable = 50,
2582 },
2583 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002584 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach01bacc132017-06-08 20:07:55 +02002585};
2586
jianwei wangc6e87f92015-07-29 16:30:02 +08002587static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
2588 .clock = 10870,
2589 .hdisplay = 480,
2590 .hsync_start = 480 + 2,
2591 .hsync_end = 480 + 2 + 41,
2592 .htotal = 480 + 2 + 41 + 2,
2593 .vdisplay = 272,
2594 .vsync_start = 272 + 2,
2595 .vsync_end = 272 + 2 + 4,
2596 .vtotal = 272 + 2 + 4 + 2,
Stefan Agner4bc390c2015-11-17 19:10:29 -08002597 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08002598};
2599
2600static const struct panel_desc nec_nl4827hc19_05b = {
2601 .modes = &nec_nl4827hc19_05b_mode,
2602 .num_modes = 1,
2603 .bpc = 8,
2604 .size = {
2605 .width = 95,
2606 .height = 54,
2607 },
Stefan Agner2c806612016-02-08 12:50:13 -08002608 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002609 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08002610};
2611
Maxime Riparde6c2f062016-09-06 16:46:17 +02002612static const struct drm_display_mode netron_dy_e231732_mode = {
2613 .clock = 66000,
2614 .hdisplay = 1024,
2615 .hsync_start = 1024 + 160,
2616 .hsync_end = 1024 + 160 + 70,
2617 .htotal = 1024 + 160 + 70 + 90,
2618 .vdisplay = 600,
2619 .vsync_start = 600 + 127,
2620 .vsync_end = 600 + 127 + 20,
2621 .vtotal = 600 + 127 + 20 + 3,
Maxime Riparde6c2f062016-09-06 16:46:17 +02002622};
2623
2624static const struct panel_desc netron_dy_e231732 = {
2625 .modes = &netron_dy_e231732_mode,
2626 .num_modes = 1,
2627 .size = {
2628 .width = 154,
2629 .height = 87,
2630 },
2631 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2632};
2633
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03002634static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
2635 .clock = 9000,
2636 .hdisplay = 480,
2637 .hsync_start = 480 + 2,
2638 .hsync_end = 480 + 2 + 41,
2639 .htotal = 480 + 2 + 41 + 2,
2640 .vdisplay = 272,
2641 .vsync_start = 272 + 2,
2642 .vsync_end = 272 + 2 + 10,
2643 .vtotal = 272 + 2 + 10 + 2,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03002644 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2645};
2646
2647static const struct panel_desc newhaven_nhd_43_480272ef_atxl = {
2648 .modes = &newhaven_nhd_43_480272ef_atxl_mode,
2649 .num_modes = 1,
2650 .bpc = 8,
2651 .size = {
2652 .width = 95,
2653 .height = 54,
2654 },
2655 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002656 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
2657 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Tomi Valkeinen8a4f5e12020-06-09 13:28:09 +03002658 .connector_type = DRM_MODE_CONNECTOR_DPI,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03002659};
2660
Lucas Stach4177fa62017-06-08 20:07:57 +02002661static const struct display_timing nlt_nl192108ac18_02d_timing = {
2662 .pixelclock = { 130000000, 148350000, 163000000 },
2663 .hactive = { 1920, 1920, 1920 },
2664 .hfront_porch = { 80, 100, 100 },
2665 .hback_porch = { 100, 120, 120 },
2666 .hsync_len = { 50, 60, 60 },
2667 .vactive = { 1080, 1080, 1080 },
2668 .vfront_porch = { 12, 30, 30 },
2669 .vback_porch = { 4, 10, 10 },
2670 .vsync_len = { 4, 5, 5 },
2671};
2672
2673static const struct panel_desc nlt_nl192108ac18_02d = {
2674 .timings = &nlt_nl192108ac18_02d_timing,
2675 .num_timings = 1,
2676 .bpc = 8,
2677 .size = {
2678 .width = 344,
2679 .height = 194,
2680 },
2681 .delay = {
2682 .unprepare = 500,
2683 },
2684 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002685 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach4177fa62017-06-08 20:07:57 +02002686};
2687
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02002688static const struct drm_display_mode nvd_9128_mode = {
2689 .clock = 29500,
2690 .hdisplay = 800,
2691 .hsync_start = 800 + 130,
2692 .hsync_end = 800 + 130 + 98,
2693 .htotal = 800 + 0 + 130 + 98,
2694 .vdisplay = 480,
2695 .vsync_start = 480 + 10,
2696 .vsync_end = 480 + 10 + 50,
2697 .vtotal = 480 + 0 + 10 + 50,
2698};
2699
2700static const struct panel_desc nvd_9128 = {
2701 .modes = &nvd_9128_mode,
2702 .num_modes = 1,
2703 .bpc = 8,
2704 .size = {
2705 .width = 156,
2706 .height = 88,
2707 },
2708 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002709 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02002710};
2711
Gary Bissona99fb622015-06-10 18:44:23 +02002712static const struct display_timing okaya_rs800480t_7x0gp_timing = {
2713 .pixelclock = { 30000000, 30000000, 40000000 },
2714 .hactive = { 800, 800, 800 },
2715 .hfront_porch = { 40, 40, 40 },
2716 .hback_porch = { 40, 40, 40 },
2717 .hsync_len = { 1, 48, 48 },
2718 .vactive = { 480, 480, 480 },
2719 .vfront_porch = { 13, 13, 13 },
2720 .vback_porch = { 29, 29, 29 },
2721 .vsync_len = { 3, 3, 3 },
2722 .flags = DISPLAY_FLAGS_DE_HIGH,
2723};
2724
2725static const struct panel_desc okaya_rs800480t_7x0gp = {
2726 .timings = &okaya_rs800480t_7x0gp_timing,
2727 .num_timings = 1,
2728 .bpc = 6,
2729 .size = {
2730 .width = 154,
2731 .height = 87,
2732 },
2733 .delay = {
2734 .prepare = 41,
2735 .enable = 50,
2736 .unprepare = 41,
2737 .disable = 50,
2738 },
2739 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2740};
2741
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002742static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
2743 .clock = 9000,
2744 .hdisplay = 480,
2745 .hsync_start = 480 + 5,
2746 .hsync_end = 480 + 5 + 30,
2747 .htotal = 480 + 5 + 30 + 10,
2748 .vdisplay = 272,
2749 .vsync_start = 272 + 8,
2750 .vsync_end = 272 + 8 + 5,
2751 .vtotal = 272 + 8 + 5 + 3,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002752};
2753
2754static const struct panel_desc olimex_lcd_olinuxino_43ts = {
2755 .modes = &olimex_lcd_olinuxino_43ts_mode,
2756 .num_modes = 1,
2757 .size = {
Jonathan Liu30c6d7ab92017-07-20 20:29:43 +10002758 .width = 95,
2759 .height = 54,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002760 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10002761 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01002762};
2763
Eric Anholte8b6f562016-03-24 17:23:48 -07002764/*
2765 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
2766 * pixel clocks, but this is the timing that was being used in the Adafruit
2767 * installation instructions.
2768 */
2769static const struct drm_display_mode ontat_yx700wv03_mode = {
2770 .clock = 29500,
2771 .hdisplay = 800,
2772 .hsync_start = 824,
2773 .hsync_end = 896,
2774 .htotal = 992,
2775 .vdisplay = 480,
2776 .vsync_start = 483,
2777 .vsync_end = 493,
2778 .vtotal = 500,
Eric Anholte8b6f562016-03-24 17:23:48 -07002779 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2780};
2781
2782/*
2783 * Specification at:
2784 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
2785 */
2786static const struct panel_desc ontat_yx700wv03 = {
2787 .modes = &ontat_yx700wv03_mode,
2788 .num_modes = 1,
2789 .bpc = 8,
2790 .size = {
2791 .width = 154,
2792 .height = 83,
2793 },
Eric Anholt5651e5e2018-03-09 15:33:32 -08002794 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Eric Anholte8b6f562016-03-24 17:23:48 -07002795};
2796
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02002797static const struct drm_display_mode ortustech_com37h3m_mode = {
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01002798 .clock = 22230,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02002799 .hdisplay = 480,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01002800 .hsync_start = 480 + 40,
2801 .hsync_end = 480 + 40 + 10,
2802 .htotal = 480 + 40 + 10 + 40,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02002803 .vdisplay = 640,
2804 .vsync_start = 640 + 4,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01002805 .vsync_end = 640 + 4 + 2,
2806 .vtotal = 640 + 4 + 2 + 4,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02002807 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2808};
2809
2810static const struct panel_desc ortustech_com37h3m = {
2811 .modes = &ortustech_com37h3m_mode,
2812 .num_modes = 1,
2813 .bpc = 8,
2814 .size = {
2815 .width = 56, /* 56.16mm */
2816 .height = 75, /* 74.88mm */
2817 },
2818 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002819 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02002820 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
2821};
2822
Philipp Zabel725c9d42015-02-11 18:50:11 +01002823static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
2824 .clock = 25000,
2825 .hdisplay = 480,
2826 .hsync_start = 480 + 10,
2827 .hsync_end = 480 + 10 + 10,
2828 .htotal = 480 + 10 + 10 + 15,
2829 .vdisplay = 800,
2830 .vsync_start = 800 + 3,
2831 .vsync_end = 800 + 3 + 3,
2832 .vtotal = 800 + 3 + 3 + 3,
Philipp Zabel725c9d42015-02-11 18:50:11 +01002833};
2834
2835static const struct panel_desc ortustech_com43h4m85ulc = {
2836 .modes = &ortustech_com43h4m85ulc_mode,
2837 .num_modes = 1,
Laurent Pinchart3b809512020-08-24 03:32:54 +03002838 .bpc = 6,
Philipp Zabel725c9d42015-02-11 18:50:11 +01002839 .size = {
2840 .width = 56,
2841 .height = 93,
2842 },
Laurent Pinchartf098f162020-08-13 01:02:44 +03002843 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002844 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Laurent Pinchart2ccedf42020-03-09 20:42:10 +02002845 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabel725c9d42015-02-11 18:50:11 +01002846};
2847
Laurent Pinchart163f7a32018-12-07 22:13:44 +02002848static const struct drm_display_mode osddisplays_osd070t1718_19ts_mode = {
2849 .clock = 33000,
2850 .hdisplay = 800,
2851 .hsync_start = 800 + 210,
2852 .hsync_end = 800 + 210 + 30,
2853 .htotal = 800 + 210 + 30 + 16,
2854 .vdisplay = 480,
2855 .vsync_start = 480 + 22,
2856 .vsync_end = 480 + 22 + 13,
2857 .vtotal = 480 + 22 + 13 + 10,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02002858 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2859};
2860
2861static const struct panel_desc osddisplays_osd070t1718_19ts = {
2862 .modes = &osddisplays_osd070t1718_19ts_mode,
2863 .num_modes = 1,
2864 .bpc = 8,
2865 .size = {
2866 .width = 152,
2867 .height = 91,
2868 },
2869 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Tomi Valkeinenfb0629e2019-11-14 11:39:50 +02002870 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
2871 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Laurent Pincharta793f0e2019-09-04 16:37:23 +03002872 .connector_type = DRM_MODE_CONNECTOR_DPI,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02002873};
2874
Eugen Hristev4ba3e562019-01-14 09:43:31 +00002875static const struct drm_display_mode pda_91_00156_a0_mode = {
2876 .clock = 33300,
2877 .hdisplay = 800,
2878 .hsync_start = 800 + 1,
2879 .hsync_end = 800 + 1 + 64,
2880 .htotal = 800 + 1 + 64 + 64,
2881 .vdisplay = 480,
2882 .vsync_start = 480 + 1,
2883 .vsync_end = 480 + 1 + 23,
2884 .vtotal = 480 + 1 + 23 + 22,
Eugen Hristev4ba3e562019-01-14 09:43:31 +00002885};
2886
2887static const struct panel_desc pda_91_00156_a0 = {
2888 .modes = &pda_91_00156_a0_mode,
2889 .num_modes = 1,
2890 .size = {
2891 .width = 152,
2892 .height = 91,
2893 },
2894 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2895};
2896
Marek Vasutd69de692020-07-28 14:12:46 +02002897static const struct drm_display_mode powertip_ph800480t013_idf02_mode = {
2898 .clock = 24750,
2899 .hdisplay = 800,
2900 .hsync_start = 800 + 54,
2901 .hsync_end = 800 + 54 + 2,
2902 .htotal = 800 + 54 + 2 + 44,
2903 .vdisplay = 480,
2904 .vsync_start = 480 + 49,
2905 .vsync_end = 480 + 49 + 2,
2906 .vtotal = 480 + 49 + 2 + 22,
2907};
2908
2909static const struct panel_desc powertip_ph800480t013_idf02 = {
2910 .modes = &powertip_ph800480t013_idf02_mode,
2911 .num_modes = 1,
2912 .size = {
2913 .width = 152,
2914 .height = 91,
2915 },
2916 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
2917 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
2918 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
2919 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2920 .connector_type = DRM_MODE_CONNECTOR_DPI,
2921};
Eugen Hristev4ba3e562019-01-14 09:43:31 +00002922
Josh Wud2a6f0f2015-10-08 17:42:41 +02002923static const struct drm_display_mode qd43003c0_40_mode = {
2924 .clock = 9000,
2925 .hdisplay = 480,
2926 .hsync_start = 480 + 8,
2927 .hsync_end = 480 + 8 + 4,
2928 .htotal = 480 + 8 + 4 + 39,
2929 .vdisplay = 272,
2930 .vsync_start = 272 + 4,
2931 .vsync_end = 272 + 4 + 10,
2932 .vtotal = 272 + 4 + 10 + 2,
Josh Wud2a6f0f2015-10-08 17:42:41 +02002933};
2934
2935static const struct panel_desc qd43003c0_40 = {
2936 .modes = &qd43003c0_40_mode,
2937 .num_modes = 1,
2938 .bpc = 8,
2939 .size = {
2940 .width = 95,
2941 .height = 53,
2942 },
2943 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2944};
2945
Artjom Vejsel49179e62021-08-04 03:23:53 +03002946static const struct drm_display_mode qishenglong_gopher2b_lcd_modes[] = {
2947 { /* 60 Hz */
2948 .clock = 10800,
2949 .hdisplay = 480,
2950 .hsync_start = 480 + 77,
2951 .hsync_end = 480 + 77 + 41,
2952 .htotal = 480 + 77 + 41 + 2,
2953 .vdisplay = 272,
2954 .vsync_start = 272 + 16,
2955 .vsync_end = 272 + 16 + 10,
2956 .vtotal = 272 + 16 + 10 + 2,
2957 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2958 },
2959 { /* 50 Hz */
2960 .clock = 10800,
2961 .hdisplay = 480,
2962 .hsync_start = 480 + 17,
2963 .hsync_end = 480 + 17 + 41,
2964 .htotal = 480 + 17 + 41 + 2,
2965 .vdisplay = 272,
2966 .vsync_start = 272 + 116,
2967 .vsync_end = 272 + 116 + 10,
2968 .vtotal = 272 + 116 + 10 + 2,
2969 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2970 },
2971};
2972
2973static const struct panel_desc qishenglong_gopher2b_lcd = {
2974 .modes = qishenglong_gopher2b_lcd_modes,
2975 .num_modes = ARRAY_SIZE(qishenglong_gopher2b_lcd_modes),
2976 .bpc = 8,
2977 .size = {
2978 .width = 95,
2979 .height = 54,
2980 },
2981 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2982 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
2983 .connector_type = DRM_MODE_CONNECTOR_DPI,
2984};
2985
Jagan Teki23167fa2018-06-07 19:16:48 +05302986static const struct display_timing rocktech_rk070er9427_timing = {
2987 .pixelclock = { 26400000, 33300000, 46800000 },
2988 .hactive = { 800, 800, 800 },
2989 .hfront_porch = { 16, 210, 354 },
2990 .hback_porch = { 46, 46, 46 },
2991 .hsync_len = { 1, 1, 1 },
2992 .vactive = { 480, 480, 480 },
2993 .vfront_porch = { 7, 22, 147 },
2994 .vback_porch = { 23, 23, 23 },
2995 .vsync_len = { 1, 1, 1 },
2996 .flags = DISPLAY_FLAGS_DE_HIGH,
2997};
2998
2999static const struct panel_desc rocktech_rk070er9427 = {
3000 .timings = &rocktech_rk070er9427_timing,
3001 .num_timings = 1,
3002 .bpc = 6,
3003 .size = {
3004 .width = 154,
3005 .height = 86,
3006 },
3007 .delay = {
3008 .prepare = 41,
3009 .enable = 50,
3010 .unprepare = 41,
3011 .disable = 50,
3012 },
3013 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3014};
3015
Jyri Sarhaf3050472020-02-11 14:17:18 +02003016static const struct drm_display_mode rocktech_rk101ii01d_ct_mode = {
3017 .clock = 71100,
3018 .hdisplay = 1280,
3019 .hsync_start = 1280 + 48,
3020 .hsync_end = 1280 + 48 + 32,
3021 .htotal = 1280 + 48 + 32 + 80,
3022 .vdisplay = 800,
3023 .vsync_start = 800 + 2,
3024 .vsync_end = 800 + 2 + 5,
3025 .vtotal = 800 + 2 + 5 + 16,
Jyri Sarhaf3050472020-02-11 14:17:18 +02003026};
3027
3028static const struct panel_desc rocktech_rk101ii01d_ct = {
3029 .modes = &rocktech_rk101ii01d_ct_mode,
3030 .num_modes = 1,
3031 .size = {
3032 .width = 217,
3033 .height = 136,
3034 },
3035 .delay = {
3036 .prepare = 50,
3037 .disable = 50,
3038 },
3039 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
3040 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3041 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3042};
3043
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003044static const struct drm_display_mode samsung_ltn101nt05_mode = {
3045 .clock = 54030,
3046 .hdisplay = 1024,
3047 .hsync_start = 1024 + 24,
3048 .hsync_end = 1024 + 24 + 136,
3049 .htotal = 1024 + 24 + 136 + 160,
3050 .vdisplay = 600,
3051 .vsync_start = 600 + 3,
3052 .vsync_end = 600 + 3 + 6,
3053 .vtotal = 600 + 3 + 6 + 61,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003054};
3055
3056static const struct panel_desc samsung_ltn101nt05 = {
3057 .modes = &samsung_ltn101nt05_mode,
3058 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07003059 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003060 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02003061 .width = 223,
3062 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003063 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03003064 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003065 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03003066 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003067};
3068
Miquel Raynal44c58c52020-01-09 19:40:37 +01003069static const struct display_timing satoz_sat050at40h12r2_timing = {
3070 .pixelclock = {33300000, 33300000, 50000000},
3071 .hactive = {800, 800, 800},
3072 .hfront_porch = {16, 210, 354},
3073 .hback_porch = {46, 46, 46},
3074 .hsync_len = {1, 1, 40},
3075 .vactive = {480, 480, 480},
3076 .vfront_porch = {7, 22, 147},
3077 .vback_porch = {23, 23, 23},
3078 .vsync_len = {1, 1, 20},
3079};
3080
3081static const struct panel_desc satoz_sat050at40h12r2 = {
3082 .timings = &satoz_sat050at40h12r2_timing,
3083 .num_timings = 1,
3084 .bpc = 8,
3085 .size = {
3086 .width = 108,
3087 .height = 65,
3088 },
Laurent Pinchart34ca6b52020-06-30 02:33:18 +03003089 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Miquel Raynal44c58c52020-01-09 19:40:37 +01003090 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3091};
3092
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003093static const struct drm_display_mode sharp_lq070y3dg3b_mode = {
3094 .clock = 33260,
3095 .hdisplay = 800,
3096 .hsync_start = 800 + 64,
3097 .hsync_end = 800 + 64 + 128,
3098 .htotal = 800 + 64 + 128 + 64,
3099 .vdisplay = 480,
3100 .vsync_start = 480 + 8,
3101 .vsync_end = 480 + 8 + 2,
3102 .vtotal = 480 + 8 + 2 + 35,
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003103 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3104};
3105
3106static const struct panel_desc sharp_lq070y3dg3b = {
3107 .modes = &sharp_lq070y3dg3b_mode,
3108 .num_modes = 1,
3109 .bpc = 8,
3110 .size = {
3111 .width = 152, /* 152.4mm */
3112 .height = 91, /* 91.4mm */
3113 },
3114 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003115 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003116 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
3117};
3118
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003119static const struct drm_display_mode sharp_lq035q7db03_mode = {
3120 .clock = 5500,
3121 .hdisplay = 240,
3122 .hsync_start = 240 + 16,
3123 .hsync_end = 240 + 16 + 7,
3124 .htotal = 240 + 16 + 7 + 5,
3125 .vdisplay = 320,
3126 .vsync_start = 320 + 9,
3127 .vsync_end = 320 + 9 + 1,
3128 .vtotal = 320 + 9 + 1 + 7,
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003129};
3130
3131static const struct panel_desc sharp_lq035q7db03 = {
3132 .modes = &sharp_lq035q7db03_mode,
3133 .num_modes = 1,
3134 .bpc = 6,
3135 .size = {
3136 .width = 54,
3137 .height = 72,
3138 },
3139 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3140};
3141
Joshua Clayton592aa022016-07-06 15:59:16 -07003142static const struct display_timing sharp_lq101k1ly04_timing = {
3143 .pixelclock = { 60000000, 65000000, 80000000 },
3144 .hactive = { 1280, 1280, 1280 },
3145 .hfront_porch = { 20, 20, 20 },
3146 .hback_porch = { 20, 20, 20 },
3147 .hsync_len = { 10, 10, 10 },
3148 .vactive = { 800, 800, 800 },
3149 .vfront_porch = { 4, 4, 4 },
3150 .vback_porch = { 4, 4, 4 },
3151 .vsync_len = { 4, 4, 4 },
3152 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3153};
3154
3155static const struct panel_desc sharp_lq101k1ly04 = {
3156 .timings = &sharp_lq101k1ly04_timing,
3157 .num_timings = 1,
3158 .bpc = 8,
3159 .size = {
3160 .width = 217,
3161 .height = 136,
3162 },
3163 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003164 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Joshua Clayton592aa022016-07-06 15:59:16 -07003165};
3166
Paul Cercueil656b7592020-08-11 02:22:38 +02003167static const struct drm_display_mode sharp_ls020b1dd01d_modes[] = {
Paul Cercueile6c21e62020-08-11 02:22:40 +02003168 { /* 50 Hz */
3169 .clock = 3000,
3170 .hdisplay = 240,
3171 .hsync_start = 240 + 58,
3172 .hsync_end = 240 + 58 + 1,
3173 .htotal = 240 + 58 + 1 + 1,
3174 .vdisplay = 160,
3175 .vsync_start = 160 + 24,
3176 .vsync_end = 160 + 24 + 10,
3177 .vtotal = 160 + 24 + 10 + 6,
3178 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
3179 },
Paul Cercueil656b7592020-08-11 02:22:38 +02003180 { /* 60 Hz */
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003181 .clock = 3000,
Paul Cercueil656b7592020-08-11 02:22:38 +02003182 .hdisplay = 240,
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003183 .hsync_start = 240 + 8,
3184 .hsync_end = 240 + 8 + 1,
3185 .htotal = 240 + 8 + 1 + 1,
Paul Cercueil656b7592020-08-11 02:22:38 +02003186 .vdisplay = 160,
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003187 .vsync_start = 160 + 24,
3188 .vsync_end = 160 + 24 + 10,
3189 .vtotal = 160 + 24 + 10 + 6,
Paul Cercueil656b7592020-08-11 02:22:38 +02003190 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
3191 },
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003192};
3193
3194static const struct panel_desc sharp_ls020b1dd01d = {
Paul Cercueil656b7592020-08-11 02:22:38 +02003195 .modes = sharp_ls020b1dd01d_modes,
3196 .num_modes = ARRAY_SIZE(sharp_ls020b1dd01d_modes),
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003197 .bpc = 6,
3198 .size = {
3199 .width = 42,
3200 .height = 28,
3201 },
3202 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
3203 .bus_flags = DRM_BUS_FLAG_DE_HIGH
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003204 | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003205 | DRM_BUS_FLAG_SHARP_SIGNALS,
3206};
3207
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003208static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
3209 .clock = 33300,
3210 .hdisplay = 800,
3211 .hsync_start = 800 + 1,
3212 .hsync_end = 800 + 1 + 64,
3213 .htotal = 800 + 1 + 64 + 64,
3214 .vdisplay = 480,
3215 .vsync_start = 480 + 1,
3216 .vsync_end = 480 + 1 + 23,
3217 .vtotal = 480 + 1 + 23 + 22,
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003218};
3219
3220static const struct panel_desc shelly_sca07010_bfn_lnn = {
3221 .modes = &shelly_sca07010_bfn_lnn_mode,
3222 .num_modes = 1,
3223 .size = {
3224 .width = 152,
3225 .height = 91,
3226 },
3227 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3228};
3229
Pascal Roeleven105235e2020-03-20 12:21:33 +01003230static const struct drm_display_mode starry_kr070pe2t_mode = {
3231 .clock = 33000,
3232 .hdisplay = 800,
3233 .hsync_start = 800 + 209,
3234 .hsync_end = 800 + 209 + 1,
3235 .htotal = 800 + 209 + 1 + 45,
3236 .vdisplay = 480,
3237 .vsync_start = 480 + 22,
3238 .vsync_end = 480 + 22 + 1,
3239 .vtotal = 480 + 22 + 1 + 22,
Pascal Roeleven105235e2020-03-20 12:21:33 +01003240};
3241
3242static const struct panel_desc starry_kr070pe2t = {
3243 .modes = &starry_kr070pe2t_mode,
3244 .num_modes = 1,
3245 .bpc = 8,
3246 .size = {
3247 .width = 152,
3248 .height = 86,
3249 },
3250 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3251 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Laurent Pinchart41fad302020-06-30 02:33:17 +03003252 .connector_type = DRM_MODE_CONNECTOR_DPI,
Pascal Roeleven105235e2020-03-20 12:21:33 +01003253};
3254
Marek Vasut938db2762021-11-27 04:19:09 +01003255static const struct display_timing tsd_tst043015cmhx_timing = {
3256 .pixelclock = { 5000000, 9000000, 12000000 },
3257 .hactive = { 480, 480, 480 },
3258 .hfront_porch = { 4, 5, 65 },
3259 .hback_porch = { 36, 40, 255 },
3260 .hsync_len = { 1, 1, 1 },
3261 .vactive = { 272, 272, 272 },
3262 .vfront_porch = { 2, 8, 97 },
3263 .vback_porch = { 3, 8, 31 },
3264 .vsync_len = { 1, 1, 1 },
3265
3266 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
3267 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
3268};
3269
3270static const struct panel_desc tsd_tst043015cmhx = {
3271 .timings = &tsd_tst043015cmhx_timing,
3272 .num_timings = 1,
3273 .bpc = 8,
3274 .size = {
3275 .width = 105,
3276 .height = 67,
3277 },
3278 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3279 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
3280};
3281
Jyri Sarha42161532019-03-22 10:33:36 +02003282static const struct drm_display_mode tfc_s9700rtwv43tr_01b_mode = {
3283 .clock = 30000,
3284 .hdisplay = 800,
3285 .hsync_start = 800 + 39,
3286 .hsync_end = 800 + 39 + 47,
3287 .htotal = 800 + 39 + 47 + 39,
3288 .vdisplay = 480,
3289 .vsync_start = 480 + 13,
3290 .vsync_end = 480 + 13 + 2,
3291 .vtotal = 480 + 13 + 2 + 29,
Jyri Sarha42161532019-03-22 10:33:36 +02003292};
3293
3294static const struct panel_desc tfc_s9700rtwv43tr_01b = {
3295 .modes = &tfc_s9700rtwv43tr_01b_mode,
3296 .num_modes = 1,
3297 .bpc = 8,
3298 .size = {
3299 .width = 155,
3300 .height = 90,
3301 },
3302 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003303 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Jyri Sarha42161532019-03-22 10:33:36 +02003304};
3305
Gary Bissonadb973e2016-12-02 09:52:08 +01003306static const struct display_timing tianma_tm070jdhg30_timing = {
3307 .pixelclock = { 62600000, 68200000, 78100000 },
3308 .hactive = { 1280, 1280, 1280 },
3309 .hfront_porch = { 15, 64, 159 },
3310 .hback_porch = { 5, 5, 5 },
3311 .hsync_len = { 1, 1, 256 },
3312 .vactive = { 800, 800, 800 },
3313 .vfront_porch = { 3, 40, 99 },
3314 .vback_porch = { 2, 2, 2 },
3315 .vsync_len = { 1, 1, 128 },
3316 .flags = DISPLAY_FLAGS_DE_HIGH,
3317};
3318
3319static const struct panel_desc tianma_tm070jdhg30 = {
3320 .timings = &tianma_tm070jdhg30_timing,
3321 .num_timings = 1,
3322 .bpc = 8,
3323 .size = {
3324 .width = 151,
3325 .height = 95,
3326 },
3327 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003328 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Gary Bissonadb973e2016-12-02 09:52:08 +01003329};
3330
Max Merchelb3bfcdf2020-06-12 09:22:19 +02003331static const struct panel_desc tianma_tm070jvhg33 = {
3332 .timings = &tianma_tm070jdhg30_timing,
3333 .num_timings = 1,
3334 .bpc = 8,
3335 .size = {
3336 .width = 150,
3337 .height = 94,
3338 },
3339 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3340 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3341};
3342
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003343static const struct display_timing tianma_tm070rvhg71_timing = {
3344 .pixelclock = { 27700000, 29200000, 39600000 },
3345 .hactive = { 800, 800, 800 },
3346 .hfront_porch = { 12, 40, 212 },
3347 .hback_porch = { 88, 88, 88 },
3348 .hsync_len = { 1, 1, 40 },
3349 .vactive = { 480, 480, 480 },
3350 .vfront_porch = { 1, 13, 88 },
3351 .vback_porch = { 32, 32, 32 },
3352 .vsync_len = { 1, 1, 3 },
3353 .flags = DISPLAY_FLAGS_DE_HIGH,
3354};
3355
3356static const struct panel_desc tianma_tm070rvhg71 = {
3357 .timings = &tianma_tm070rvhg71_timing,
3358 .num_timings = 1,
3359 .bpc = 8,
3360 .size = {
3361 .width = 154,
3362 .height = 86,
3363 },
3364 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003365 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003366};
3367
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003368static const struct drm_display_mode ti_nspire_cx_lcd_mode[] = {
3369 {
3370 .clock = 10000,
3371 .hdisplay = 320,
3372 .hsync_start = 320 + 50,
3373 .hsync_end = 320 + 50 + 6,
3374 .htotal = 320 + 50 + 6 + 38,
3375 .vdisplay = 240,
3376 .vsync_start = 240 + 3,
3377 .vsync_end = 240 + 3 + 1,
3378 .vtotal = 240 + 3 + 1 + 17,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003379 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3380 },
3381};
3382
3383static const struct panel_desc ti_nspire_cx_lcd_panel = {
3384 .modes = ti_nspire_cx_lcd_mode,
3385 .num_modes = 1,
3386 .bpc = 8,
3387 .size = {
3388 .width = 65,
3389 .height = 49,
3390 },
3391 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003392 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003393};
3394
3395static const struct drm_display_mode ti_nspire_classic_lcd_mode[] = {
3396 {
3397 .clock = 10000,
3398 .hdisplay = 320,
3399 .hsync_start = 320 + 6,
3400 .hsync_end = 320 + 6 + 6,
3401 .htotal = 320 + 6 + 6 + 6,
3402 .vdisplay = 240,
3403 .vsync_start = 240 + 0,
3404 .vsync_end = 240 + 0 + 1,
3405 .vtotal = 240 + 0 + 1 + 0,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003406 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3407 },
3408};
3409
3410static const struct panel_desc ti_nspire_classic_lcd_panel = {
3411 .modes = ti_nspire_classic_lcd_mode,
3412 .num_modes = 1,
3413 /* The grayscale panel has 8 bit for the color .. Y (black) */
3414 .bpc = 8,
3415 .size = {
3416 .width = 71,
3417 .height = 53,
3418 },
3419 /* This is the grayscale bus format */
3420 .bus_format = MEDIA_BUS_FMT_Y8_1X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003421 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003422};
3423
Lucas Stach06e733e2017-10-18 19:22:40 +02003424static const struct drm_display_mode toshiba_lt089ac29000_mode = {
3425 .clock = 79500,
3426 .hdisplay = 1280,
3427 .hsync_start = 1280 + 192,
3428 .hsync_end = 1280 + 192 + 128,
3429 .htotal = 1280 + 192 + 128 + 64,
3430 .vdisplay = 768,
3431 .vsync_start = 768 + 20,
3432 .vsync_end = 768 + 20 + 7,
3433 .vtotal = 768 + 20 + 7 + 3,
Lucas Stach06e733e2017-10-18 19:22:40 +02003434};
3435
3436static const struct panel_desc toshiba_lt089ac29000 = {
3437 .modes = &toshiba_lt089ac29000_mode,
3438 .num_modes = 1,
3439 .size = {
3440 .width = 194,
3441 .height = 116,
3442 },
Boris Brezillon9781bd12020-01-28 14:55:13 +01003443 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003444 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003445 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach06e733e2017-10-18 19:22:40 +02003446};
3447
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303448static const struct drm_display_mode tpk_f07a_0102_mode = {
3449 .clock = 33260,
3450 .hdisplay = 800,
3451 .hsync_start = 800 + 40,
3452 .hsync_end = 800 + 40 + 128,
3453 .htotal = 800 + 40 + 128 + 88,
3454 .vdisplay = 480,
3455 .vsync_start = 480 + 10,
3456 .vsync_end = 480 + 10 + 2,
3457 .vtotal = 480 + 10 + 2 + 33,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303458};
3459
3460static const struct panel_desc tpk_f07a_0102 = {
3461 .modes = &tpk_f07a_0102_mode,
3462 .num_modes = 1,
3463 .size = {
3464 .width = 152,
3465 .height = 91,
3466 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003467 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303468};
3469
3470static const struct drm_display_mode tpk_f10a_0102_mode = {
3471 .clock = 45000,
3472 .hdisplay = 1024,
3473 .hsync_start = 1024 + 176,
3474 .hsync_end = 1024 + 176 + 5,
3475 .htotal = 1024 + 176 + 5 + 88,
3476 .vdisplay = 600,
3477 .vsync_start = 600 + 20,
3478 .vsync_end = 600 + 20 + 5,
3479 .vtotal = 600 + 20 + 5 + 25,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303480};
3481
3482static const struct panel_desc tpk_f10a_0102 = {
3483 .modes = &tpk_f10a_0102_mode,
3484 .num_modes = 1,
3485 .size = {
3486 .width = 223,
3487 .height = 125,
3488 },
3489};
3490
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01003491static const struct display_timing urt_umsh_8596md_timing = {
3492 .pixelclock = { 33260000, 33260000, 33260000 },
3493 .hactive = { 800, 800, 800 },
3494 .hfront_porch = { 41, 41, 41 },
3495 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
3496 .hsync_len = { 71, 128, 128 },
3497 .vactive = { 480, 480, 480 },
3498 .vfront_porch = { 10, 10, 10 },
3499 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
3500 .vsync_len = { 2, 2, 2 },
3501 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
3502 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
3503};
3504
3505static const struct panel_desc urt_umsh_8596md_lvds = {
3506 .timings = &urt_umsh_8596md_timing,
3507 .num_timings = 1,
3508 .bpc = 6,
3509 .size = {
3510 .width = 152,
3511 .height = 91,
3512 },
3513 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003514 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01003515};
3516
3517static const struct panel_desc urt_umsh_8596md_parallel = {
3518 .timings = &urt_umsh_8596md_timing,
3519 .num_timings = 1,
3520 .bpc = 6,
3521 .size = {
3522 .width = 152,
3523 .height = 91,
3524 },
3525 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3526};
3527
Nikola Pavlica1a84a302021-10-11 23:27:31 +02003528static const struct drm_display_mode vivax_tpc9150_panel_mode = {
3529 .clock = 60000,
3530 .hdisplay = 1024,
3531 .hsync_start = 1024 + 160,
3532 .hsync_end = 1024 + 160 + 100,
3533 .htotal = 1024 + 160 + 100 + 60,
3534 .vdisplay = 600,
3535 .vsync_start = 600 + 12,
3536 .vsync_end = 600 + 12 + 10,
3537 .vtotal = 600 + 12 + 10 + 13,
3538};
3539
3540static const struct panel_desc vivax_tpc9150_panel = {
3541 .modes = &vivax_tpc9150_panel_mode,
3542 .num_modes = 1,
3543 .bpc = 6,
3544 .size = {
3545 .width = 200,
3546 .height = 115,
3547 },
3548 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
3549 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
3550 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3551};
3552
Fabio Estevam04206182019-02-18 21:27:06 -03003553static const struct drm_display_mode vl050_8048nt_c01_mode = {
3554 .clock = 33333,
3555 .hdisplay = 800,
3556 .hsync_start = 800 + 210,
3557 .hsync_end = 800 + 210 + 20,
3558 .htotal = 800 + 210 + 20 + 46,
3559 .vdisplay = 480,
3560 .vsync_start = 480 + 22,
3561 .vsync_end = 480 + 22 + 10,
3562 .vtotal = 480 + 22 + 10 + 23,
Fabio Estevam04206182019-02-18 21:27:06 -03003563 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
3564};
3565
3566static const struct panel_desc vl050_8048nt_c01 = {
3567 .modes = &vl050_8048nt_c01_mode,
3568 .num_modes = 1,
3569 .bpc = 8,
3570 .size = {
3571 .width = 120,
3572 .height = 76,
3573 },
3574 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003575 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Fabio Estevam04206182019-02-18 21:27:06 -03003576};
3577
Richard Genoude4bac402017-03-27 12:33:23 +02003578static const struct drm_display_mode winstar_wf35ltiacd_mode = {
3579 .clock = 6410,
3580 .hdisplay = 320,
3581 .hsync_start = 320 + 20,
3582 .hsync_end = 320 + 20 + 30,
3583 .htotal = 320 + 20 + 30 + 38,
3584 .vdisplay = 240,
3585 .vsync_start = 240 + 4,
3586 .vsync_end = 240 + 4 + 3,
3587 .vtotal = 240 + 4 + 3 + 15,
Richard Genoude4bac402017-03-27 12:33:23 +02003588 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3589};
3590
3591static const struct panel_desc winstar_wf35ltiacd = {
3592 .modes = &winstar_wf35ltiacd_mode,
3593 .num_modes = 1,
3594 .bpc = 8,
3595 .size = {
3596 .width = 70,
3597 .height = 53,
3598 },
3599 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3600};
3601
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05303602static const struct drm_display_mode yes_optoelectronics_ytc700tlag_05_201c_mode = {
3603 .clock = 51200,
3604 .hdisplay = 1024,
3605 .hsync_start = 1024 + 100,
3606 .hsync_end = 1024 + 100 + 100,
3607 .htotal = 1024 + 100 + 100 + 120,
3608 .vdisplay = 600,
3609 .vsync_start = 600 + 10,
3610 .vsync_end = 600 + 10 + 10,
3611 .vtotal = 600 + 10 + 10 + 15,
3612 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3613};
3614
3615static const struct panel_desc yes_optoelectronics_ytc700tlag_05_201c = {
3616 .modes = &yes_optoelectronics_ytc700tlag_05_201c_mode,
3617 .num_modes = 1,
Jagan Teki44379b92021-07-25 23:17:37 +05303618 .bpc = 8,
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05303619 .size = {
3620 .width = 154,
3621 .height = 90,
3622 },
3623 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
3624 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3625 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3626};
3627
Linus Walleijfcec4162018-10-26 13:13:34 +02003628static const struct drm_display_mode arm_rtsm_mode[] = {
3629 {
3630 .clock = 65000,
3631 .hdisplay = 1024,
3632 .hsync_start = 1024 + 24,
3633 .hsync_end = 1024 + 24 + 136,
3634 .htotal = 1024 + 24 + 136 + 160,
3635 .vdisplay = 768,
3636 .vsync_start = 768 + 3,
3637 .vsync_end = 768 + 3 + 6,
3638 .vtotal = 768 + 3 + 6 + 29,
Linus Walleijfcec4162018-10-26 13:13:34 +02003639 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3640 },
3641};
3642
3643static const struct panel_desc arm_rtsm = {
3644 .modes = arm_rtsm_mode,
3645 .num_modes = 1,
3646 .bpc = 8,
3647 .size = {
3648 .width = 400,
3649 .height = 300,
3650 },
3651 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3652};
3653
Thierry Reding280921d2013-08-30 15:10:14 +02003654static const struct of_device_id platform_of_match[] = {
3655 {
Jagan Tekibca684e2020-08-29 22:03:28 +05303656 .compatible = "ampire,am-1280800n3tzqw-t00h",
3657 .data = &ampire_am_1280800n3tzqw_t00h,
3658 }, {
Yannick Fertre966fea72017-03-28 11:44:49 +02003659 .compatible = "ampire,am-480272h3tmqw-t01h",
3660 .data = &ampire_am_480272h3tmqw_t01h,
3661 }, {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01003662 .compatible = "ampire,am800480r3tmqwa1h",
3663 .data = &ampire_am800480r3tmqwa1h,
3664 }, {
Linus Walleijfcec4162018-10-26 13:13:34 +02003665 .compatible = "arm,rtsm-display",
3666 .data = &arm_rtsm,
3667 }, {
Sébastien Szymanskic479450f2019-05-07 17:27:12 +02003668 .compatible = "armadeus,st0700-adapt",
3669 .data = &armadeus_st0700_adapt,
3670 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02003671 .compatible = "auo,b101aw03",
3672 .data = &auo_b101aw03,
3673 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04003674 .compatible = "auo,b101xtn01",
3675 .data = &auo_b101xtn01,
3676 }, {
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02003677 .compatible = "auo,g070vvn01",
3678 .data = &auo_g070vvn01,
3679 }, {
Alex Gonzalez4fb86402018-10-25 17:09:30 +02003680 .compatible = "auo,g101evn010",
3681 .data = &auo_g101evn010,
3682 }, {
Christoph Fritz4451c282017-12-16 14:13:36 +01003683 .compatible = "auo,g104sn02",
3684 .data = &auo_g104sn02,
3685 }, {
Sebastian Reichel03e909a2020-04-15 19:27:25 +02003686 .compatible = "auo,g121ean01",
3687 .data = &auo_g121ean01,
3688 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01003689 .compatible = "auo,g133han01",
3690 .data = &auo_g133han01,
3691 }, {
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02003692 .compatible = "auo,g156xtn01",
3693 .data = &auo_g156xtn01,
3694 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01003695 .compatible = "auo,g185han01",
3696 .data = &auo_g185han01,
3697 }, {
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02003698 .compatible = "auo,g190ean01",
3699 .data = &auo_g190ean01,
3700 }, {
Lucas Stach70c0d5b2017-06-08 20:07:58 +02003701 .compatible = "auo,p320hvn03",
3702 .data = &auo_p320hvn03,
3703 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07003704 .compatible = "auo,t215hvn01",
3705 .data = &auo_t215hvn01,
3706 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01003707 .compatible = "avic,tm070ddh03",
3708 .data = &avic_tm070ddh03,
3709 }, {
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08003710 .compatible = "bananapi,s070wv20-ct16",
3711 .data = &bananapi_s070wv20_ct16,
3712 }, {
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02003713 .compatible = "boe,hv070wsa-100",
3714 .data = &boe_hv070wsa
3715 }, {
Giulio Benettie58edce2018-07-31 01:11:16 +02003716 .compatible = "cdtech,s043wq26h-ct7",
3717 .data = &cdtech_s043wq26h_ct7,
3718 }, {
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02003719 .compatible = "cdtech,s070pws19hp-fc21",
3720 .data = &cdtech_s070pws19hp_fc21,
3721 }, {
3722 .compatible = "cdtech,s070swv29hg-dc44",
3723 .data = &cdtech_s070swv29hg_dc44,
3724 }, {
Giulio Benetti982f9442018-07-31 01:11:14 +02003725 .compatible = "cdtech,s070wv95-ct16",
3726 .data = &cdtech_s070wv95_ct16,
3727 }, {
Marek Vasut07c913c2020-07-28 22:12:42 +02003728 .compatible = "chefree,ch101olhlwh-002",
3729 .data = &chefree_ch101olhlwh_002,
3730 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08003731 .compatible = "chunghwa,claa070wp03xg",
3732 .data = &chunghwa_claa070wp03xg,
3733 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07003734 .compatible = "chunghwa,claa101wa01a",
3735 .data = &chunghwa_claa101wa01a
3736 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02003737 .compatible = "chunghwa,claa101wb01",
3738 .data = &chunghwa_claa101wb01
3739 }, {
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02003740 .compatible = "dataimage,scf0700c48ggu18",
3741 .data = &dataimage_scf0700c48ggu18,
3742 }, {
Philipp Zabel0ca0c822018-05-23 11:25:04 +02003743 .compatible = "dlc,dlc0700yzg-1",
3744 .data = &dlc_dlc0700yzg_1,
3745 }, {
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02003746 .compatible = "dlc,dlc1010gig",
3747 .data = &dlc_dlc1010gig,
3748 }, {
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02003749 .compatible = "edt,et035012dm6",
3750 .data = &edt_et035012dm6,
3751 }, {
Stefan Riedmuellerf08a2a12021-07-09 22:03:49 +02003752 .compatible = "edt,etm0350g0dh6",
3753 .data = &edt_etm0350g0dh6,
3754 }, {
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00003755 .compatible = "edt,etm043080dh6gp",
3756 .data = &edt_etm043080dh6gp,
3757 }, {
Marek Vasutfd819bf2019-02-19 15:04:38 +01003758 .compatible = "edt,etm0430g0dh6",
3759 .data = &edt_etm0430g0dh6,
3760 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02003761 .compatible = "edt,et057090dhu",
3762 .data = &edt_et057090dhu,
3763 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02003764 .compatible = "edt,et070080dh6",
3765 .data = &edt_etm0700g0dh6,
3766 }, {
3767 .compatible = "edt,etm0700g0dh6",
3768 .data = &edt_etm0700g0dh6,
3769 }, {
Jan Tuerkaa7e6452018-06-19 11:55:44 +02003770 .compatible = "edt,etm0700g0bdh6",
3771 .data = &edt_etm0700g0bdh6,
3772 }, {
Jan Tuerkaad34de2018-06-19 11:55:45 +02003773 .compatible = "edt,etm0700g0edh6",
3774 .data = &edt_etm0700g0bdh6,
3775 }, {
Stefan Riedmuellere46f73f2021-07-09 22:03:48 +02003776 .compatible = "edt,etmv570g2dhu",
3777 .data = &edt_etmv570g2dhu,
3778 }, {
Alistair Francis9746f5f2021-08-01 10:47:00 +10003779 .compatible = "eink,vb3300-kca",
3780 .data = &eink_vb3300_kca,
3781 }, {
Marco Felsch9158e3c2019-04-16 12:06:45 +02003782 .compatible = "evervision,vgg804821",
3783 .data = &evervision_vgg804821,
3784 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02003785 .compatible = "foxlink,fl500wvr00-a0t",
3786 .data = &foxlink_fl500wvr00_a0t,
3787 }, {
Paul Cercueil7b6bd842020-01-13 13:17:41 -03003788 .compatible = "frida,frd350h54004",
3789 .data = &frida_frd350h54004,
3790 }, {
Jagan Teki3be20712019-05-07 18:37:07 +05303791 .compatible = "friendlyarm,hd702e",
3792 .data = &friendlyarm_hd702e,
3793 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01003794 .compatible = "giantplus,gpg482739qs5",
3795 .data = &giantplus_gpg482739qs5
3796 }, {
Paul Cercueil2c6574a2019-06-06 00:22:47 +02003797 .compatible = "giantplus,gpm940b0",
3798 .data = &giantplus_gpm940b0,
3799 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02003800 .compatible = "hannstar,hsd070pww1",
3801 .data = &hannstar_hsd070pww1,
3802 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07003803 .compatible = "hannstar,hsd100pxn1",
3804 .data = &hannstar_hsd100pxn1,
3805 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01003806 .compatible = "hit,tx23d38vm0caa",
3807 .data = &hitachi_tx23d38vm0caa
3808 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01003809 .compatible = "innolux,at043tn24",
3810 .data = &innolux_at043tn24,
3811 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02003812 .compatible = "innolux,at070tn92",
3813 .data = &innolux_at070tn92,
3814 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02003815 .compatible = "innolux,g070y2-l01",
3816 .data = &innolux_g070y2_l01,
3817 }, {
Oleksij Rempel57a06e92021-10-14 11:52:02 +02003818 .compatible = "innolux,g070y2-t02",
3819 .data = &innolux_g070y2_t02,
3820 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02003821 .compatible = "innolux,g101ice-l01",
Michael Olbrich1e29b842016-08-15 14:32:02 +02003822 .data = &innolux_g101ice_l01
3823 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02003824 .compatible = "innolux,g121i1-l01",
Lucas Stachd731f662014-11-06 17:44:33 +01003825 .data = &innolux_g121i1_l01
3826 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05003827 .compatible = "innolux,g121x1-l03",
3828 .data = &innolux_g121x1_l03,
3829 }, {
Alban Bedelea447392014-07-22 08:38:55 +02003830 .compatible = "innolux,n156bge-l21",
3831 .data = &innolux_n156bge_l21,
3832 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01003833 .compatible = "innolux,zj070na-01p",
3834 .data = &innolux_zj070na_01p,
3835 }, {
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02003836 .compatible = "koe,tx14d24vm1bpa",
3837 .data = &koe_tx14d24vm1bpa,
3838 }, {
Liu Ying8a070522020-06-01 14:11:20 +08003839 .compatible = "koe,tx26d202vm0bwa",
3840 .data = &koe_tx26d202vm0bwa,
3841 }, {
Jagan Teki8cfe8342018-02-04 23:19:28 +05303842 .compatible = "koe,tx31d200vm0baa",
3843 .data = &koe_tx31d200vm0baa,
3844 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01003845 .compatible = "kyo,tcg121xglp",
3846 .data = &kyo_tcg121xglp,
3847 }, {
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01003848 .compatible = "lemaker,bl035-rgb-002",
3849 .data = &lemaker_bl035_rgb_002,
3850 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02003851 .compatible = "lg,lb070wv8",
3852 .data = &lg_lb070wv8,
3853 }, {
Adam Ford0d354082019-10-16 08:51:45 -05003854 .compatible = "logicpd,type28",
3855 .data = &logicpd_type_28,
3856 }, {
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01003857 .compatible = "logictechno,lt161010-2nhc",
3858 .data = &logictechno_lt161010_2nh,
3859 }, {
3860 .compatible = "logictechno,lt161010-2nhr",
3861 .data = &logictechno_lt161010_2nh,
3862 }, {
3863 .compatible = "logictechno,lt170410-2whc",
3864 .data = &logictechno_lt170410_2whc,
3865 }, {
Søren Andersen19f036e2021-09-30 12:05:01 +02003866 .compatible = "logictechno,lttd800480070-l2rt",
3867 .data = &logictechno_lttd800480070_l2rt,
3868 }, {
Søren Andersen0c044f72021-08-05 13:19:44 +02003869 .compatible = "logictechno,lttd800480070-l6wh-rt",
3870 .data = &logictechno_lttd800480070_l6wh_rt,
3871 }, {
Lukasz Majewski65c766c2017-10-21 00:18:37 +02003872 .compatible = "mitsubishi,aa070mc01-ca1",
3873 .data = &mitsubishi_aa070mc01,
3874 }, {
Sam Ravnborg81162f42021-08-05 13:19:43 +02003875 .compatible = "multi-inno,mi1010ait-1cp",
3876 .data = &multi_inno_mi1010ait_1cp,
3877 }, {
Lucas Stach01bacc132017-06-08 20:07:55 +02003878 .compatible = "nec,nl12880bc20-05",
3879 .data = &nec_nl12880bc20_05,
3880 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08003881 .compatible = "nec,nl4827hc19-05b",
3882 .data = &nec_nl4827hc19_05b,
3883 }, {
Maxime Riparde6c2f062016-09-06 16:46:17 +02003884 .compatible = "netron-dy,e231732",
3885 .data = &netron_dy_e231732,
3886 }, {
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003887 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
3888 .data = &newhaven_nhd_43_480272ef_atxl,
3889 }, {
Lucas Stach4177fa62017-06-08 20:07:57 +02003890 .compatible = "nlt,nl192108ac18-02d",
3891 .data = &nlt_nl192108ac18_02d,
3892 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02003893 .compatible = "nvd,9128",
3894 .data = &nvd_9128,
3895 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02003896 .compatible = "okaya,rs800480t-7x0gp",
3897 .data = &okaya_rs800480t_7x0gp,
3898 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003899 .compatible = "olimex,lcd-olinuxino-43-ts",
3900 .data = &olimex_lcd_olinuxino_43ts,
3901 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07003902 .compatible = "ontat,yx700wv03",
3903 .data = &ontat_yx700wv03,
3904 }, {
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003905 .compatible = "ortustech,com37h3m05dtc",
3906 .data = &ortustech_com37h3m,
3907 }, {
3908 .compatible = "ortustech,com37h3m99dtc",
3909 .data = &ortustech_com37h3m,
3910 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01003911 .compatible = "ortustech,com43h4m85ulc",
3912 .data = &ortustech_com43h4m85ulc,
3913 }, {
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003914 .compatible = "osddisplays,osd070t1718-19ts",
3915 .data = &osddisplays_osd070t1718_19ts,
3916 }, {
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003917 .compatible = "pda,91-00156-a0",
3918 .data = &pda_91_00156_a0,
3919 }, {
Marek Vasutd69de692020-07-28 14:12:46 +02003920 .compatible = "powertip,ph800480t013-idf02",
3921 .data = &powertip_ph800480t013_idf02,
3922 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02003923 .compatible = "qiaodian,qd43003c0-40",
3924 .data = &qd43003c0_40,
3925 }, {
Artjom Vejsel49179e62021-08-04 03:23:53 +03003926 .compatible = "qishenglong,gopher2b-lcd",
3927 .data = &qishenglong_gopher2b_lcd,
3928 }, {
Jagan Teki23167fa2018-06-07 19:16:48 +05303929 .compatible = "rocktech,rk070er9427",
3930 .data = &rocktech_rk070er9427,
3931 }, {
Jyri Sarhaf3050472020-02-11 14:17:18 +02003932 .compatible = "rocktech,rk101ii01d-ct",
3933 .data = &rocktech_rk101ii01d_ct,
3934 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003935 .compatible = "samsung,ltn101nt05",
3936 .data = &samsung_ltn101nt05,
3937 }, {
Miquel Raynal44c58c52020-01-09 19:40:37 +01003938 .compatible = "satoz,sat050at40h12r2",
3939 .data = &satoz_sat050at40h12r2,
3940 }, {
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003941 .compatible = "sharp,lq035q7db03",
3942 .data = &sharp_lq035q7db03,
3943 }, {
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003944 .compatible = "sharp,lq070y3dg3b",
3945 .data = &sharp_lq070y3dg3b,
3946 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07003947 .compatible = "sharp,lq101k1ly04",
3948 .data = &sharp_lq101k1ly04,
3949 }, {
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003950 .compatible = "sharp,ls020b1dd01d",
3951 .data = &sharp_ls020b1dd01d,
3952 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003953 .compatible = "shelly,sca07010-bfn-lnn",
3954 .data = &shelly_sca07010_bfn_lnn,
3955 }, {
Pascal Roeleven105235e2020-03-20 12:21:33 +01003956 .compatible = "starry,kr070pe2t",
3957 .data = &starry_kr070pe2t,
3958 }, {
Marek Vasut938db2762021-11-27 04:19:09 +01003959 .compatible = "team-source-display,tst043015cmhx",
3960 .data = &tsd_tst043015cmhx,
3961 }, {
Jyri Sarha42161532019-03-22 10:33:36 +02003962 .compatible = "tfc,s9700rtwv43tr-01b",
3963 .data = &tfc_s9700rtwv43tr_01b,
3964 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01003965 .compatible = "tianma,tm070jdhg30",
3966 .data = &tianma_tm070jdhg30,
3967 }, {
Max Merchelb3bfcdf2020-06-12 09:22:19 +02003968 .compatible = "tianma,tm070jvhg33",
3969 .data = &tianma_tm070jvhg33,
3970 }, {
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003971 .compatible = "tianma,tm070rvhg71",
3972 .data = &tianma_tm070rvhg71,
3973 }, {
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003974 .compatible = "ti,nspire-cx-lcd-panel",
3975 .data = &ti_nspire_cx_lcd_panel,
3976 }, {
3977 .compatible = "ti,nspire-classic-lcd-panel",
3978 .data = &ti_nspire_classic_lcd_panel,
3979 }, {
Lucas Stach06e733e2017-10-18 19:22:40 +02003980 .compatible = "toshiba,lt089ac29000",
3981 .data = &toshiba_lt089ac29000,
3982 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303983 .compatible = "tpk,f07a-0102",
3984 .data = &tpk_f07a_0102,
3985 }, {
3986 .compatible = "tpk,f10a-0102",
3987 .data = &tpk_f10a_0102,
3988 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01003989 .compatible = "urt,umsh-8596md-t",
3990 .data = &urt_umsh_8596md_parallel,
3991 }, {
3992 .compatible = "urt,umsh-8596md-1t",
3993 .data = &urt_umsh_8596md_parallel,
3994 }, {
3995 .compatible = "urt,umsh-8596md-7t",
3996 .data = &urt_umsh_8596md_parallel,
3997 }, {
3998 .compatible = "urt,umsh-8596md-11t",
3999 .data = &urt_umsh_8596md_lvds,
4000 }, {
4001 .compatible = "urt,umsh-8596md-19t",
4002 .data = &urt_umsh_8596md_lvds,
4003 }, {
4004 .compatible = "urt,umsh-8596md-20t",
4005 .data = &urt_umsh_8596md_parallel,
4006 }, {
Nikola Pavlica1a84a302021-10-11 23:27:31 +02004007 .compatible = "vivax,tpc9150-panel",
4008 .data = &vivax_tpc9150_panel,
4009 }, {
Fabio Estevam04206182019-02-18 21:27:06 -03004010 .compatible = "vxt,vl050-8048nt-c01",
4011 .data = &vl050_8048nt_c01,
4012 }, {
Richard Genoude4bac402017-03-27 12:33:23 +02004013 .compatible = "winstar,wf35ltiacd",
4014 .data = &winstar_wf35ltiacd,
4015 }, {
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05304016 .compatible = "yes-optoelectronics,ytc700tlag-05-201c",
4017 .data = &yes_optoelectronics_ytc700tlag_05_201c,
4018 }, {
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +01004019 /* Must be the last entry */
4020 .compatible = "panel-dpi",
4021 .data = &panel_dpi,
4022 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004023 /* sentinel */
4024 }
4025};
4026MODULE_DEVICE_TABLE(of, platform_of_match);
4027
4028static int panel_simple_platform_probe(struct platform_device *pdev)
4029{
4030 const struct of_device_id *id;
4031
4032 id = of_match_node(platform_of_match, pdev->dev.of_node);
4033 if (!id)
4034 return -ENODEV;
4035
Douglas Anderson5f04e7c2021-09-14 13:21:54 -07004036 return panel_simple_probe(&pdev->dev, id->data);
Thierry Reding280921d2013-08-30 15:10:14 +02004037}
4038
4039static int panel_simple_platform_remove(struct platform_device *pdev)
4040{
4041 return panel_simple_remove(&pdev->dev);
4042}
4043
Thierry Redingd02fd932014-04-29 17:21:21 +02004044static void panel_simple_platform_shutdown(struct platform_device *pdev)
4045{
4046 panel_simple_shutdown(&pdev->dev);
4047}
4048
Douglas Anderson3235b0f2021-04-16 15:39:30 -07004049static const struct dev_pm_ops panel_simple_pm_ops = {
4050 SET_RUNTIME_PM_OPS(panel_simple_suspend, panel_simple_resume, NULL)
4051 SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
4052 pm_runtime_force_resume)
4053};
4054
Thierry Reding280921d2013-08-30 15:10:14 +02004055static struct platform_driver panel_simple_platform_driver = {
4056 .driver = {
4057 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02004058 .of_match_table = platform_of_match,
Douglas Anderson3235b0f2021-04-16 15:39:30 -07004059 .pm = &panel_simple_pm_ops,
Thierry Reding280921d2013-08-30 15:10:14 +02004060 },
4061 .probe = panel_simple_platform_probe,
4062 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004063 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004064};
4065
Thierry Reding210fcd92013-11-22 19:27:11 +01004066struct panel_desc_dsi {
4067 struct panel_desc desc;
4068
Thierry Reding462658b2014-03-14 11:24:57 +01004069 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004070 enum mipi_dsi_pixel_format format;
4071 unsigned int lanes;
4072};
4073
Thierry Redingd718d792015-04-08 16:52:33 +02004074static const struct drm_display_mode auo_b080uan01_mode = {
4075 .clock = 154500,
4076 .hdisplay = 1200,
4077 .hsync_start = 1200 + 62,
4078 .hsync_end = 1200 + 62 + 4,
4079 .htotal = 1200 + 62 + 4 + 62,
4080 .vdisplay = 1920,
4081 .vsync_start = 1920 + 9,
4082 .vsync_end = 1920 + 9 + 2,
4083 .vtotal = 1920 + 9 + 2 + 8,
Thierry Redingd718d792015-04-08 16:52:33 +02004084};
4085
4086static const struct panel_desc_dsi auo_b080uan01 = {
4087 .desc = {
4088 .modes = &auo_b080uan01_mode,
4089 .num_modes = 1,
4090 .bpc = 8,
4091 .size = {
4092 .width = 108,
4093 .height = 272,
4094 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004095 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Redingd718d792015-04-08 16:52:33 +02004096 },
4097 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
4098 .format = MIPI_DSI_FMT_RGB888,
4099 .lanes = 4,
4100};
4101
Chris Zhongc8521962015-11-20 16:15:37 +08004102static const struct drm_display_mode boe_tv080wum_nl0_mode = {
4103 .clock = 160000,
4104 .hdisplay = 1200,
4105 .hsync_start = 1200 + 120,
4106 .hsync_end = 1200 + 120 + 20,
4107 .htotal = 1200 + 120 + 20 + 21,
4108 .vdisplay = 1920,
4109 .vsync_start = 1920 + 21,
4110 .vsync_end = 1920 + 21 + 3,
4111 .vtotal = 1920 + 21 + 3 + 18,
Chris Zhongc8521962015-11-20 16:15:37 +08004112 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4113};
4114
4115static const struct panel_desc_dsi boe_tv080wum_nl0 = {
4116 .desc = {
4117 .modes = &boe_tv080wum_nl0_mode,
4118 .num_modes = 1,
4119 .size = {
4120 .width = 107,
4121 .height = 172,
4122 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004123 .connector_type = DRM_MODE_CONNECTOR_DSI,
Chris Zhongc8521962015-11-20 16:15:37 +08004124 },
4125 .flags = MIPI_DSI_MODE_VIDEO |
4126 MIPI_DSI_MODE_VIDEO_BURST |
4127 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
4128 .format = MIPI_DSI_FMT_RGB888,
4129 .lanes = 4,
4130};
4131
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004132static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
4133 .clock = 71000,
4134 .hdisplay = 800,
4135 .hsync_start = 800 + 32,
4136 .hsync_end = 800 + 32 + 1,
4137 .htotal = 800 + 32 + 1 + 57,
4138 .vdisplay = 1280,
4139 .vsync_start = 1280 + 28,
4140 .vsync_end = 1280 + 28 + 1,
4141 .vtotal = 1280 + 28 + 1 + 14,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004142};
4143
4144static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
4145 .desc = {
4146 .modes = &lg_ld070wx3_sl01_mode,
4147 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004148 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004149 .size = {
4150 .width = 94,
4151 .height = 151,
4152 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004153 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004154 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004155 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004156 .format = MIPI_DSI_FMT_RGB888,
4157 .lanes = 4,
4158};
4159
Alexandre Courbot499ce852014-01-21 18:57:09 +09004160static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
4161 .clock = 67000,
4162 .hdisplay = 720,
4163 .hsync_start = 720 + 12,
4164 .hsync_end = 720 + 12 + 4,
4165 .htotal = 720 + 12 + 4 + 112,
4166 .vdisplay = 1280,
4167 .vsync_start = 1280 + 8,
4168 .vsync_end = 1280 + 8 + 4,
4169 .vtotal = 1280 + 8 + 4 + 12,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004170};
4171
4172static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
4173 .desc = {
4174 .modes = &lg_lh500wx1_sd03_mode,
4175 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004176 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004177 .size = {
4178 .width = 62,
4179 .height = 110,
4180 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004181 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004182 },
4183 .flags = MIPI_DSI_MODE_VIDEO,
4184 .format = MIPI_DSI_FMT_RGB888,
4185 .lanes = 4,
4186};
4187
Thierry Reding280921d2013-08-30 15:10:14 +02004188static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
4189 .clock = 157200,
4190 .hdisplay = 1920,
4191 .hsync_start = 1920 + 154,
4192 .hsync_end = 1920 + 154 + 16,
4193 .htotal = 1920 + 154 + 16 + 32,
4194 .vdisplay = 1200,
4195 .vsync_start = 1200 + 17,
4196 .vsync_end = 1200 + 17 + 2,
4197 .vtotal = 1200 + 17 + 2 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02004198};
4199
Thierry Reding210fcd92013-11-22 19:27:11 +01004200static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
4201 .desc = {
4202 .modes = &panasonic_vvx10f004b00_mode,
4203 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004204 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01004205 .size = {
4206 .width = 217,
4207 .height = 136,
4208 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004209 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Reding280921d2013-08-30 15:10:14 +02004210 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004211 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
4212 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01004213 .format = MIPI_DSI_FMT_RGB888,
4214 .lanes = 4,
4215};
4216
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004217static const struct drm_display_mode lg_acx467akm_7_mode = {
4218 .clock = 150000,
4219 .hdisplay = 1080,
4220 .hsync_start = 1080 + 2,
4221 .hsync_end = 1080 + 2 + 2,
4222 .htotal = 1080 + 2 + 2 + 2,
4223 .vdisplay = 1920,
4224 .vsync_start = 1920 + 2,
4225 .vsync_end = 1920 + 2 + 2,
4226 .vtotal = 1920 + 2 + 2 + 2,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004227};
4228
4229static const struct panel_desc_dsi lg_acx467akm_7 = {
4230 .desc = {
4231 .modes = &lg_acx467akm_7_mode,
4232 .num_modes = 1,
4233 .bpc = 8,
4234 .size = {
4235 .width = 62,
4236 .height = 110,
4237 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004238 .connector_type = DRM_MODE_CONNECTOR_DSI,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004239 },
4240 .flags = 0,
4241 .format = MIPI_DSI_FMT_RGB888,
4242 .lanes = 4,
4243};
4244
Peter Ujfalusi62967232019-02-26 09:55:21 +02004245static const struct drm_display_mode osd101t2045_53ts_mode = {
4246 .clock = 154500,
4247 .hdisplay = 1920,
4248 .hsync_start = 1920 + 112,
4249 .hsync_end = 1920 + 112 + 16,
4250 .htotal = 1920 + 112 + 16 + 32,
4251 .vdisplay = 1200,
4252 .vsync_start = 1200 + 16,
4253 .vsync_end = 1200 + 16 + 2,
4254 .vtotal = 1200 + 16 + 2 + 16,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004255 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
4256};
4257
4258static const struct panel_desc_dsi osd101t2045_53ts = {
4259 .desc = {
4260 .modes = &osd101t2045_53ts_mode,
4261 .num_modes = 1,
4262 .bpc = 8,
4263 .size = {
4264 .width = 217,
4265 .height = 136,
4266 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004267 .connector_type = DRM_MODE_CONNECTOR_DSI,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004268 },
4269 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
4270 MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
Nicolas Boichat0f3b68b62021-07-27 09:45:21 +08004271 MIPI_DSI_MODE_NO_EOT_PACKET,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004272 .format = MIPI_DSI_FMT_RGB888,
4273 .lanes = 4,
4274};
4275
Thierry Reding210fcd92013-11-22 19:27:11 +01004276static const struct of_device_id dsi_of_match[] = {
4277 {
Thierry Redingd718d792015-04-08 16:52:33 +02004278 .compatible = "auo,b080uan01",
4279 .data = &auo_b080uan01
4280 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08004281 .compatible = "boe,tv080wum-nl0",
4282 .data = &boe_tv080wum_nl0
4283 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004284 .compatible = "lg,ld070wx3-sl01",
4285 .data = &lg_ld070wx3_sl01
4286 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09004287 .compatible = "lg,lh500wx1-sd03",
4288 .data = &lg_lh500wx1_sd03
4289 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01004290 .compatible = "panasonic,vvx10f004b00",
4291 .data = &panasonic_vvx10f004b00
4292 }, {
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004293 .compatible = "lg,acx467akm-7",
4294 .data = &lg_acx467akm_7
4295 }, {
Peter Ujfalusi62967232019-02-26 09:55:21 +02004296 .compatible = "osddisplays,osd101t2045-53ts",
4297 .data = &osd101t2045_53ts
4298 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01004299 /* sentinel */
4300 }
4301};
4302MODULE_DEVICE_TABLE(of, dsi_of_match);
4303
4304static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
4305{
4306 const struct panel_desc_dsi *desc;
4307 const struct of_device_id *id;
4308 int err;
4309
4310 id = of_match_node(dsi_of_match, dsi->dev.of_node);
4311 if (!id)
4312 return -ENODEV;
4313
4314 desc = id->data;
4315
Douglas Anderson5f04e7c2021-09-14 13:21:54 -07004316 err = panel_simple_probe(&dsi->dev, &desc->desc);
Thierry Reding210fcd92013-11-22 19:27:11 +01004317 if (err < 0)
4318 return err;
4319
Thierry Reding462658b2014-03-14 11:24:57 +01004320 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004321 dsi->format = desc->format;
4322 dsi->lanes = desc->lanes;
4323
Peter Ujfalusi7ad9db62019-02-26 10:11:53 +02004324 err = mipi_dsi_attach(dsi);
4325 if (err) {
Julia Lawall5dd331d2021-02-09 22:13:04 +01004326 struct panel_simple *panel = mipi_dsi_get_drvdata(dsi);
Peter Ujfalusi7ad9db62019-02-26 10:11:53 +02004327
4328 drm_panel_remove(&panel->base);
4329 }
4330
4331 return err;
Thierry Reding210fcd92013-11-22 19:27:11 +01004332}
4333
4334static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
4335{
4336 int err;
4337
4338 err = mipi_dsi_detach(dsi);
4339 if (err < 0)
4340 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
4341
4342 return panel_simple_remove(&dsi->dev);
4343}
4344
Thierry Redingd02fd932014-04-29 17:21:21 +02004345static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
4346{
4347 panel_simple_shutdown(&dsi->dev);
4348}
4349
Thierry Reding210fcd92013-11-22 19:27:11 +01004350static struct mipi_dsi_driver panel_simple_dsi_driver = {
4351 .driver = {
4352 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01004353 .of_match_table = dsi_of_match,
Douglas Anderson3235b0f2021-04-16 15:39:30 -07004354 .pm = &panel_simple_pm_ops,
Thierry Reding210fcd92013-11-22 19:27:11 +01004355 },
4356 .probe = panel_simple_dsi_probe,
4357 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004358 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004359};
4360
4361static int __init panel_simple_init(void)
4362{
Thierry Reding210fcd92013-11-22 19:27:11 +01004363 int err;
4364
4365 err = platform_driver_register(&panel_simple_platform_driver);
4366 if (err < 0)
4367 return err;
4368
4369 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
4370 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
Douglas Anderson74c06c22021-06-11 10:17:41 -07004371 if (err < 0)
Douglas Anderson5f04e7c2021-09-14 13:21:54 -07004372 goto err_did_platform_register;
Thierry Reding210fcd92013-11-22 19:27:11 +01004373 }
4374
4375 return 0;
Douglas Anderson74c06c22021-06-11 10:17:41 -07004376
Douglas Anderson74c06c22021-06-11 10:17:41 -07004377err_did_platform_register:
4378 platform_driver_unregister(&panel_simple_platform_driver);
4379
4380 return err;
Thierry Reding280921d2013-08-30 15:10:14 +02004381}
4382module_init(panel_simple_init);
4383
4384static void __exit panel_simple_exit(void)
4385{
Thierry Reding210fcd92013-11-22 19:27:11 +01004386 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
4387 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
4388
Thierry Reding280921d2013-08-30 15:10:14 +02004389 platform_driver_unregister(&panel_simple_platform_driver);
4390}
4391module_exit(panel_simple_exit);
4392
4393MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
4394MODULE_DESCRIPTION("DRM Driver for Simple Panels");
4395MODULE_LICENSE("GPL and additional rights");