blob: 8e021b57875dd1b8beac43c39ab07bd13980ae38 [file] [log] [blame]
Thierry Reding280921d2013-08-30 15:10:14 +02001/*
2 * Copyright (C) 2013, NVIDIA Corporation. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sub license,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the
12 * next paragraph) shall be included in all copies or substantial portions
13 * of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
Sam Ravnborgcb23eae2019-05-26 20:05:32 +020024#include <linux/delay.h>
Alexandre Courbotcfdf0542014-03-01 14:00:58 +090025#include <linux/gpio/consumer.h>
Douglas Anderson48834e62020-05-07 14:34:57 -070026#include <linux/iopoll.h>
Thierry Reding280921d2013-08-30 15:10:14 +020027#include <linux/module.h>
Thierry Reding280921d2013-08-30 15:10:14 +020028#include <linux/of_platform.h>
29#include <linux/platform_device.h>
Douglas Anderson3235b0f2021-04-16 15:39:30 -070030#include <linux/pm_runtime.h>
Thierry Reding280921d2013-08-30 15:10:14 +020031#include <linux/regulator/consumer.h>
32
Philipp Zabela5d3e622014-12-11 18:32:45 +010033#include <video/display_timing.h>
Sean Paulb8a29482019-07-11 13:34:53 -070034#include <video/of_display_timing.h>
Philipp Zabela5d3e622014-12-11 18:32:45 +010035#include <video/videomode.h>
36
Sam Ravnborgcb23eae2019-05-26 20:05:32 +020037#include <drm/drm_crtc.h>
38#include <drm/drm_device.h>
Douglas Anderson74c06c22021-06-11 10:17:41 -070039#include <drm/drm_dp_aux_bus.h>
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -070040#include <drm/drm_dp_helper.h>
Sam Ravnborgcb23eae2019-05-26 20:05:32 +020041#include <drm/drm_mipi_dsi.h>
42#include <drm/drm_panel.h>
43
Douglas Andersone362cc62019-07-12 09:33:33 -070044/**
Douglas Andersona00fa422020-12-01 12:59:12 -080045 * struct panel_desc - Describes a simple panel.
Douglas Andersone362cc62019-07-12 09:33:33 -070046 */
Thierry Reding280921d2013-08-30 15:10:14 +020047struct panel_desc {
Douglas Andersona00fa422020-12-01 12:59:12 -080048 /**
49 * @modes: Pointer to array of fixed modes appropriate for this panel.
50 *
51 * If only one mode then this can just be the address of the mode.
52 * NOTE: cannot be used with "timings" and also if this is specified
53 * then you cannot override the mode in the device tree.
54 */
Thierry Reding280921d2013-08-30 15:10:14 +020055 const struct drm_display_mode *modes;
Douglas Andersona00fa422020-12-01 12:59:12 -080056
57 /** @num_modes: Number of elements in modes array. */
Thierry Reding280921d2013-08-30 15:10:14 +020058 unsigned int num_modes;
Douglas Andersona00fa422020-12-01 12:59:12 -080059
60 /**
61 * @timings: Pointer to array of display timings
62 *
63 * NOTE: cannot be used with "modes" and also these will be used to
64 * validate a device tree override if one is present.
65 */
Philipp Zabela5d3e622014-12-11 18:32:45 +010066 const struct display_timing *timings;
Douglas Andersona00fa422020-12-01 12:59:12 -080067
68 /** @num_timings: Number of elements in timings array. */
Philipp Zabela5d3e622014-12-11 18:32:45 +010069 unsigned int num_timings;
Thierry Reding280921d2013-08-30 15:10:14 +020070
Douglas Andersona00fa422020-12-01 12:59:12 -080071 /** @bpc: Bits per color. */
Stéphane Marchesin0208d512014-06-19 18:18:28 -070072 unsigned int bpc;
73
Douglas Andersona00fa422020-12-01 12:59:12 -080074 /** @size: Structure containing the physical size of this panel. */
Thierry Reding280921d2013-08-30 15:10:14 +020075 struct {
Douglas Anderson131f9092020-11-09 17:00:55 -080076 /**
77 * @size.width: Width (in mm) of the active display area.
78 */
Thierry Reding280921d2013-08-30 15:10:14 +020079 unsigned int width;
Douglas Anderson131f9092020-11-09 17:00:55 -080080
81 /**
82 * @size.height: Height (in mm) of the active display area.
83 */
Thierry Reding280921d2013-08-30 15:10:14 +020084 unsigned int height;
85 } size;
Ajay Kumarf673c372014-07-31 23:12:11 +053086
Douglas Andersona00fa422020-12-01 12:59:12 -080087 /** @delay: Structure containing various delay values for this panel. */
Ajay Kumarf673c372014-07-31 23:12:11 +053088 struct {
Douglas Anderson131f9092020-11-09 17:00:55 -080089 /**
90 * @delay.prepare: Time for the panel to become ready.
91 *
92 * The time (in milliseconds) that it takes for the panel to
93 * become ready and start receiving video data
94 */
Ajay Kumarf673c372014-07-31 23:12:11 +053095 unsigned int prepare;
Douglas Anderson131f9092020-11-09 17:00:55 -080096
97 /**
98 * @delay.hpd_absent_delay: Time to wait if HPD isn't hooked up.
99 *
100 * Add this to the prepare delay if we know Hot Plug Detect
101 * isn't used.
102 */
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700103 unsigned int hpd_absent_delay;
Douglas Anderson131f9092020-11-09 17:00:55 -0800104
105 /**
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800106 * @delay.prepare_to_enable: Time between prepare and enable.
107 *
108 * The minimum time, in milliseconds, that needs to have passed
109 * between when prepare finished and enable may begin. If at
110 * enable time less time has passed since prepare finished,
111 * the driver waits for the remaining time.
112 *
113 * If a fixed enable delay is also specified, we'll start
114 * counting before delaying for the fixed delay.
115 *
116 * If a fixed prepare delay is also specified, we won't start
117 * counting until after the fixed delay. We can't overlap this
118 * fixed delay with the min time because the fixed delay
119 * doesn't happen at the end of the function if a HPD GPIO was
120 * specified.
121 *
122 * In other words:
123 * prepare()
124 * ...
125 * // do fixed prepare delay
126 * // wait for HPD GPIO if applicable
127 * // start counting for prepare_to_enable
128 *
129 * enable()
130 * // do fixed enable delay
131 * // enforce prepare_to_enable min time
132 */
133 unsigned int prepare_to_enable;
134
135 /**
Douglas Anderson131f9092020-11-09 17:00:55 -0800136 * @delay.enable: Time for the panel to display a valid frame.
137 *
138 * The time (in milliseconds) that it takes for the panel to
139 * display the first valid frame after starting to receive
140 * video data.
141 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530142 unsigned int enable;
Douglas Anderson131f9092020-11-09 17:00:55 -0800143
144 /**
145 * @delay.disable: Time for the panel to turn the display off.
146 *
147 * The time (in milliseconds) that it takes for the panel to
148 * turn the display off (no content is visible).
149 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530150 unsigned int disable;
Douglas Anderson131f9092020-11-09 17:00:55 -0800151
152 /**
153 * @delay.unprepare: Time to power down completely.
154 *
155 * The time (in milliseconds) that it takes for the panel
156 * to power itself down completely.
Douglas Andersone5e30df2020-11-09 17:00:56 -0800157 *
158 * This time is used to prevent a future "prepare" from
159 * starting until at least this many milliseconds has passed.
160 * If at prepare time less time has passed since unprepare
161 * finished, the driver waits for the remaining time.
Douglas Anderson131f9092020-11-09 17:00:55 -0800162 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530163 unsigned int unprepare;
164 } delay;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200165
Douglas Andersona00fa422020-12-01 12:59:12 -0800166 /** @bus_format: See MEDIA_BUS_FMT_... defines. */
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200167 u32 bus_format;
Douglas Andersona00fa422020-12-01 12:59:12 -0800168
169 /** @bus_flags: See DRM_BUS_FLAG_... defines. */
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800170 u32 bus_flags;
Douglas Andersona00fa422020-12-01 12:59:12 -0800171
172 /** @connector_type: LVDS, eDP, DSI, DPI, etc. */
Laurent Pinchart9a2654c2019-09-04 16:28:03 +0300173 int connector_type;
Thierry Reding280921d2013-08-30 15:10:14 +0200174};
175
Thierry Reding280921d2013-08-30 15:10:14 +0200176struct panel_simple {
177 struct drm_panel base;
178 bool enabled;
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700179 bool no_hpd;
Thierry Reding280921d2013-08-30 15:10:14 +0200180
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700181 bool prepared;
182
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800183 ktime_t prepared_time;
Douglas Andersone5e30df2020-11-09 17:00:56 -0800184 ktime_t unprepared_time;
185
Thierry Reding280921d2013-08-30 15:10:14 +0200186 const struct panel_desc *desc;
187
Thierry Reding280921d2013-08-30 15:10:14 +0200188 struct regulator *supply;
189 struct i2c_adapter *ddc;
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -0700190 struct drm_dp_aux *aux;
Thierry Reding280921d2013-08-30 15:10:14 +0200191
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900192 struct gpio_desc *enable_gpio;
Douglas Anderson48834e62020-05-07 14:34:57 -0700193 struct gpio_desc *hpd_gpio;
Sean Paulb8a29482019-07-11 13:34:53 -0700194
Douglas Anderson63358e22021-04-23 09:59:04 -0700195 struct edid *edid;
196
Sean Paulb8a29482019-07-11 13:34:53 -0700197 struct drm_display_mode override_mode;
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300198
199 enum drm_panel_orientation orientation;
Thierry Reding280921d2013-08-30 15:10:14 +0200200};
201
202static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
203{
204 return container_of(panel, struct panel_simple, base);
205}
206
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100207static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
208 struct drm_connector *connector)
Thierry Reding280921d2013-08-30 15:10:14 +0200209{
Thierry Reding280921d2013-08-30 15:10:14 +0200210 struct drm_display_mode *mode;
211 unsigned int i, num = 0;
212
Philipp Zabela5d3e622014-12-11 18:32:45 +0100213 for (i = 0; i < panel->desc->num_timings; i++) {
214 const struct display_timing *dt = &panel->desc->timings[i];
215 struct videomode vm;
216
217 videomode_from_timing(dt, &vm);
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100218 mode = drm_mode_create(connector->dev);
Philipp Zabela5d3e622014-12-11 18:32:45 +0100219 if (!mode) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100220 dev_err(panel->base.dev, "failed to add mode %ux%u\n",
Philipp Zabela5d3e622014-12-11 18:32:45 +0100221 dt->hactive.typ, dt->vactive.typ);
222 continue;
223 }
224
225 drm_display_mode_from_videomode(&vm, mode);
Boris Brezilloncda55372016-04-15 18:23:33 +0200226
227 mode->type |= DRM_MODE_TYPE_DRIVER;
228
Chen-Yu Tsai230c5b42016-10-24 21:21:15 +0800229 if (panel->desc->num_timings == 1)
Boris Brezilloncda55372016-04-15 18:23:33 +0200230 mode->type |= DRM_MODE_TYPE_PREFERRED;
231
Philipp Zabela5d3e622014-12-11 18:32:45 +0100232 drm_mode_probed_add(connector, mode);
233 num++;
234 }
235
Sean Paulb8a29482019-07-11 13:34:53 -0700236 return num;
237}
238
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100239static unsigned int panel_simple_get_display_modes(struct panel_simple *panel,
240 struct drm_connector *connector)
Sean Paulb8a29482019-07-11 13:34:53 -0700241{
Sean Paulb8a29482019-07-11 13:34:53 -0700242 struct drm_display_mode *mode;
243 unsigned int i, num = 0;
244
Thierry Reding280921d2013-08-30 15:10:14 +0200245 for (i = 0; i < panel->desc->num_modes; i++) {
246 const struct drm_display_mode *m = &panel->desc->modes[i];
247
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100248 mode = drm_mode_duplicate(connector->dev, m);
Thierry Reding280921d2013-08-30 15:10:14 +0200249 if (!mode) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100250 dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
Ville Syrjälä04256622020-04-28 20:19:27 +0300251 m->hdisplay, m->vdisplay,
252 drm_mode_vrefresh(m));
Thierry Reding280921d2013-08-30 15:10:14 +0200253 continue;
254 }
255
Boris Brezilloncda55372016-04-15 18:23:33 +0200256 mode->type |= DRM_MODE_TYPE_DRIVER;
257
258 if (panel->desc->num_modes == 1)
259 mode->type |= DRM_MODE_TYPE_PREFERRED;
260
Thierry Reding280921d2013-08-30 15:10:14 +0200261 drm_mode_set_name(mode);
262
263 drm_mode_probed_add(connector, mode);
264 num++;
265 }
266
Sean Paulb8a29482019-07-11 13:34:53 -0700267 return num;
268}
269
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100270static int panel_simple_get_non_edid_modes(struct panel_simple *panel,
271 struct drm_connector *connector)
Sean Paulb8a29482019-07-11 13:34:53 -0700272{
Sean Paulb8a29482019-07-11 13:34:53 -0700273 struct drm_display_mode *mode;
274 bool has_override = panel->override_mode.type;
275 unsigned int num = 0;
276
277 if (!panel->desc)
278 return 0;
279
280 if (has_override) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100281 mode = drm_mode_duplicate(connector->dev,
282 &panel->override_mode);
Sean Paulb8a29482019-07-11 13:34:53 -0700283 if (mode) {
284 drm_mode_probed_add(connector, mode);
285 num = 1;
286 } else {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100287 dev_err(panel->base.dev, "failed to add override mode\n");
Sean Paulb8a29482019-07-11 13:34:53 -0700288 }
289 }
290
291 /* Only add timings if override was not there or failed to validate */
292 if (num == 0 && panel->desc->num_timings)
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100293 num = panel_simple_get_timings_modes(panel, connector);
Sean Paulb8a29482019-07-11 13:34:53 -0700294
295 /*
296 * Only add fixed modes if timings/override added no mode.
297 *
298 * We should only ever have either the display timings specified
299 * or a fixed mode. Anything else is rather bogus.
300 */
301 WARN_ON(panel->desc->num_timings && panel->desc->num_modes);
302 if (num == 0)
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100303 num = panel_simple_get_display_modes(panel, connector);
Sean Paulb8a29482019-07-11 13:34:53 -0700304
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700305 connector->display_info.bpc = panel->desc->bpc;
Thierry Reding280921d2013-08-30 15:10:14 +0200306 connector->display_info.width_mm = panel->desc->size.width;
307 connector->display_info.height_mm = panel->desc->size.height;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200308 if (panel->desc->bus_format)
309 drm_display_info_set_bus_formats(&connector->display_info,
310 &panel->desc->bus_format, 1);
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800311 connector->display_info.bus_flags = panel->desc->bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200312
313 return num;
314}
315
Douglas Andersone5e30df2020-11-09 17:00:56 -0800316static void panel_simple_wait(ktime_t start_ktime, unsigned int min_ms)
317{
318 ktime_t now_ktime, min_ktime;
319
320 if (!min_ms)
321 return;
322
323 min_ktime = ktime_add(start_ktime, ms_to_ktime(min_ms));
324 now_ktime = ktime_get();
325
326 if (ktime_before(now_ktime, min_ktime))
327 msleep(ktime_to_ms(ktime_sub(min_ktime, now_ktime)) + 1);
328}
329
Thierry Reding280921d2013-08-30 15:10:14 +0200330static int panel_simple_disable(struct drm_panel *panel)
331{
332 struct panel_simple *p = to_panel_simple(panel);
333
334 if (!p->enabled)
335 return 0;
336
Ajay Kumarf673c372014-07-31 23:12:11 +0530337 if (p->desc->delay.disable)
338 msleep(p->desc->delay.disable);
339
Thierry Reding280921d2013-08-30 15:10:14 +0200340 p->enabled = false;
341
342 return 0;
343}
344
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700345static int panel_simple_suspend(struct device *dev)
346{
347 struct panel_simple *p = dev_get_drvdata(dev);
348
349 gpiod_set_value_cansleep(p->enable_gpio, 0);
350 regulator_disable(p->supply);
351 p->unprepared_time = ktime_get();
352
Douglas Anderson63358e22021-04-23 09:59:04 -0700353 kfree(p->edid);
354 p->edid = NULL;
355
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700356 return 0;
357}
358
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530359static int panel_simple_unprepare(struct drm_panel *panel)
360{
Ajay Kumar613a6332014-07-31 23:12:10 +0530361 struct panel_simple *p = to_panel_simple(panel);
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700362 int ret;
Ajay Kumar613a6332014-07-31 23:12:10 +0530363
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700364 /* Unpreparing when already unprepared is a no-op */
365 if (!p->prepared)
Ajay Kumar613a6332014-07-31 23:12:10 +0530366 return 0;
367
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700368 pm_runtime_mark_last_busy(panel->dev);
369 ret = pm_runtime_put_autosuspend(panel->dev);
370 if (ret < 0)
371 return ret;
372 p->prepared = false;
Ajay Kumar613a6332014-07-31 23:12:10 +0530373
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530374 return 0;
375}
376
Douglas Anderson5c4381e2021-04-23 09:58:56 -0700377static int panel_simple_get_hpd_gpio(struct device *dev, struct panel_simple *p)
Douglas Anderson48834e62020-05-07 14:34:57 -0700378{
379 int err;
380
381 p->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN);
382 if (IS_ERR(p->hpd_gpio)) {
383 err = PTR_ERR(p->hpd_gpio);
384
Douglas Anderson5c4381e2021-04-23 09:58:56 -0700385 if (err != -EPROBE_DEFER)
Douglas Anderson48834e62020-05-07 14:34:57 -0700386 dev_err(dev, "failed to get 'hpd' GPIO: %d\n", err);
Douglas Anderson5c4381e2021-04-23 09:58:56 -0700387
388 return err;
Douglas Anderson48834e62020-05-07 14:34:57 -0700389 }
390
391 return 0;
392}
393
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700394static int panel_simple_prepare_once(struct panel_simple *p)
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530395{
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700396 struct device *dev = p->base.dev;
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700397 unsigned int delay;
Thierry Reding280921d2013-08-30 15:10:14 +0200398 int err;
Douglas Anderson48834e62020-05-07 14:34:57 -0700399 int hpd_asserted;
Douglas Anderson6ec52622021-01-15 14:44:17 -0800400 unsigned long hpd_wait_us;
Thierry Reding280921d2013-08-30 15:10:14 +0200401
Douglas Andersone5e30df2020-11-09 17:00:56 -0800402 panel_simple_wait(p->unprepared_time, p->desc->delay.unprepare);
403
Thierry Reding280921d2013-08-30 15:10:14 +0200404 err = regulator_enable(p->supply);
405 if (err < 0) {
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700406 dev_err(dev, "failed to enable supply: %d\n", err);
Thierry Reding280921d2013-08-30 15:10:14 +0200407 return err;
408 }
409
Fabio Estevam756b9182017-07-16 21:05:39 -0300410 gpiod_set_value_cansleep(p->enable_gpio, 1);
Thierry Reding280921d2013-08-30 15:10:14 +0200411
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700412 delay = p->desc->delay.prepare;
413 if (p->no_hpd)
414 delay += p->desc->delay.hpd_absent_delay;
415 if (delay)
416 msleep(delay);
Ajay Kumarf673c372014-07-31 23:12:11 +0530417
Douglas Anderson48834e62020-05-07 14:34:57 -0700418 if (p->hpd_gpio) {
Douglas Anderson6ec52622021-01-15 14:44:17 -0800419 if (p->desc->delay.hpd_absent_delay)
420 hpd_wait_us = p->desc->delay.hpd_absent_delay * 1000UL;
421 else
422 hpd_wait_us = 2000000;
423
Douglas Anderson48834e62020-05-07 14:34:57 -0700424 err = readx_poll_timeout(gpiod_get_value_cansleep, p->hpd_gpio,
425 hpd_asserted, hpd_asserted,
Douglas Anderson6ec52622021-01-15 14:44:17 -0800426 1000, hpd_wait_us);
Douglas Anderson48834e62020-05-07 14:34:57 -0700427 if (hpd_asserted < 0)
428 err = hpd_asserted;
429
430 if (err) {
Douglas Anderson87b49712021-01-15 14:44:18 -0800431 if (err != -ETIMEDOUT)
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700432 dev_err(dev,
Douglas Anderson87b49712021-01-15 14:44:18 -0800433 "error waiting for hpd GPIO: %d\n", err);
Douglas Anderson5e7222a2021-01-15 14:44:16 -0800434 goto error;
Douglas Anderson48834e62020-05-07 14:34:57 -0700435 }
436 }
437
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800438 p->prepared_time = ktime_get();
Ajay Kumar613a6332014-07-31 23:12:10 +0530439
440 return 0;
Douglas Anderson5e7222a2021-01-15 14:44:16 -0800441
442error:
443 gpiod_set_value_cansleep(p->enable_gpio, 0);
444 regulator_disable(p->supply);
445 p->unprepared_time = ktime_get();
446
447 return err;
Ajay Kumar613a6332014-07-31 23:12:10 +0530448}
449
Douglas Anderson87b49712021-01-15 14:44:18 -0800450/*
451 * Some panels simply don't always come up and need to be power cycled to
452 * work properly. We'll allow for a handful of retries.
453 */
454#define MAX_PANEL_PREPARE_TRIES 5
455
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700456static int panel_simple_resume(struct device *dev)
Douglas Anderson87b49712021-01-15 14:44:18 -0800457{
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700458 struct panel_simple *p = dev_get_drvdata(dev);
Douglas Anderson87b49712021-01-15 14:44:18 -0800459 int ret;
460 int try;
461
462 for (try = 0; try < MAX_PANEL_PREPARE_TRIES; try++) {
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700463 ret = panel_simple_prepare_once(p);
Douglas Anderson87b49712021-01-15 14:44:18 -0800464 if (ret != -ETIMEDOUT)
465 break;
466 }
467
468 if (ret == -ETIMEDOUT)
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700469 dev_err(dev, "Prepare timeout after %d tries\n", try);
Douglas Anderson87b49712021-01-15 14:44:18 -0800470 else if (try)
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700471 dev_warn(dev, "Prepare needed %d retries\n", try);
Douglas Anderson87b49712021-01-15 14:44:18 -0800472
473 return ret;
474}
475
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700476static int panel_simple_prepare(struct drm_panel *panel)
477{
478 struct panel_simple *p = to_panel_simple(panel);
479 int ret;
480
481 /* Preparing when already prepared is a no-op */
482 if (p->prepared)
483 return 0;
484
485 ret = pm_runtime_get_sync(panel->dev);
486 if (ret < 0) {
487 pm_runtime_put_autosuspend(panel->dev);
488 return ret;
489 }
490
491 p->prepared = true;
492
493 return 0;
494}
495
Ajay Kumar613a6332014-07-31 23:12:10 +0530496static int panel_simple_enable(struct drm_panel *panel)
497{
498 struct panel_simple *p = to_panel_simple(panel);
499
500 if (p->enabled)
501 return 0;
502
Ajay Kumarf673c372014-07-31 23:12:11 +0530503 if (p->desc->delay.enable)
504 msleep(p->desc->delay.enable);
505
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800506 panel_simple_wait(p->prepared_time, p->desc->delay.prepare_to_enable);
507
Thierry Reding280921d2013-08-30 15:10:14 +0200508 p->enabled = true;
509
510 return 0;
511}
512
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100513static int panel_simple_get_modes(struct drm_panel *panel,
514 struct drm_connector *connector)
Thierry Reding280921d2013-08-30 15:10:14 +0200515{
516 struct panel_simple *p = to_panel_simple(panel);
517 int num = 0;
518
519 /* probe EDID if a DDC bus is available */
520 if (p->ddc) {
Douglas Anderson31e25392021-04-23 09:59:03 -0700521 pm_runtime_get_sync(panel->dev);
522
Douglas Anderson63358e22021-04-23 09:59:04 -0700523 if (!p->edid)
524 p->edid = drm_get_edid(connector, p->ddc);
525
526 if (p->edid)
527 num += drm_add_edid_modes(connector, p->edid);
Douglas Anderson31e25392021-04-23 09:59:03 -0700528
529 pm_runtime_mark_last_busy(panel->dev);
530 pm_runtime_put_autosuspend(panel->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200531 }
532
533 /* add hard-coded panel modes */
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100534 num += panel_simple_get_non_edid_modes(p, connector);
Thierry Reding280921d2013-08-30 15:10:14 +0200535
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300536 /* set up connector's "panel orientation" property */
537 drm_connector_set_panel_orientation(connector, p->orientation);
538
Thierry Reding280921d2013-08-30 15:10:14 +0200539 return num;
540}
541
Philipp Zabela5d3e622014-12-11 18:32:45 +0100542static int panel_simple_get_timings(struct drm_panel *panel,
543 unsigned int num_timings,
544 struct display_timing *timings)
545{
546 struct panel_simple *p = to_panel_simple(panel);
547 unsigned int i;
548
549 if (p->desc->num_timings < num_timings)
550 num_timings = p->desc->num_timings;
551
552 if (timings)
553 for (i = 0; i < num_timings; i++)
554 timings[i] = p->desc->timings[i];
555
556 return p->desc->num_timings;
557}
558
Thierry Reding280921d2013-08-30 15:10:14 +0200559static const struct drm_panel_funcs panel_simple_funcs = {
560 .disable = panel_simple_disable,
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530561 .unprepare = panel_simple_unprepare,
562 .prepare = panel_simple_prepare,
Thierry Reding280921d2013-08-30 15:10:14 +0200563 .enable = panel_simple_enable,
564 .get_modes = panel_simple_get_modes,
Philipp Zabela5d3e622014-12-11 18:32:45 +0100565 .get_timings = panel_simple_get_timings,
Thierry Reding280921d2013-08-30 15:10:14 +0200566};
567
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100568static struct panel_desc panel_dpi;
569
570static int panel_dpi_probe(struct device *dev,
571 struct panel_simple *panel)
572{
573 struct display_timing *timing;
574 const struct device_node *np;
575 struct panel_desc *desc;
576 unsigned int bus_flags;
577 struct videomode vm;
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100578 int ret;
579
580 np = dev->of_node;
581 desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
582 if (!desc)
583 return -ENOMEM;
584
585 timing = devm_kzalloc(dev, sizeof(*timing), GFP_KERNEL);
586 if (!timing)
587 return -ENOMEM;
588
589 ret = of_get_display_timing(np, "panel-timing", timing);
590 if (ret < 0) {
591 dev_err(dev, "%pOF: no panel-timing node found for \"panel-dpi\" binding\n",
592 np);
593 return ret;
594 }
595
596 desc->timings = timing;
597 desc->num_timings = 1;
598
599 of_property_read_u32(np, "width-mm", &desc->size.width);
600 of_property_read_u32(np, "height-mm", &desc->size.height);
601
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100602 /* Extract bus_flags from display_timing */
603 bus_flags = 0;
604 vm.flags = timing->flags;
605 drm_bus_flags_from_videomode(&vm, &bus_flags);
606 desc->bus_flags = bus_flags;
607
608 /* We do not know the connector for the DT node, so guess it */
609 desc->connector_type = DRM_MODE_CONNECTOR_DPI;
610
611 panel->desc = desc;
612
613 return 0;
614}
615
Sean Paulb8a29482019-07-11 13:34:53 -0700616#define PANEL_SIMPLE_BOUNDS_CHECK(to_check, bounds, field) \
617 (to_check->field.typ >= bounds->field.min && \
618 to_check->field.typ <= bounds->field.max)
Douglas Andersone362cc62019-07-12 09:33:33 -0700619static void panel_simple_parse_panel_timing_node(struct device *dev,
620 struct panel_simple *panel,
621 const struct display_timing *ot)
Sean Paulb8a29482019-07-11 13:34:53 -0700622{
623 const struct panel_desc *desc = panel->desc;
624 struct videomode vm;
625 unsigned int i;
626
627 if (WARN_ON(desc->num_modes)) {
628 dev_err(dev, "Reject override mode: panel has a fixed mode\n");
629 return;
630 }
631 if (WARN_ON(!desc->num_timings)) {
632 dev_err(dev, "Reject override mode: no timings specified\n");
633 return;
634 }
635
636 for (i = 0; i < panel->desc->num_timings; i++) {
637 const struct display_timing *dt = &panel->desc->timings[i];
638
639 if (!PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hactive) ||
640 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hfront_porch) ||
641 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hback_porch) ||
642 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hsync_len) ||
643 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vactive) ||
644 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vfront_porch) ||
645 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vback_porch) ||
646 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vsync_len))
647 continue;
648
649 if (ot->flags != dt->flags)
650 continue;
651
652 videomode_from_timing(ot, &vm);
653 drm_display_mode_from_videomode(&vm, &panel->override_mode);
654 panel->override_mode.type |= DRM_MODE_TYPE_DRIVER |
655 DRM_MODE_TYPE_PREFERRED;
656 break;
657 }
658
659 if (WARN_ON(!panel->override_mode.type))
660 dev_err(dev, "Reject override mode: No display_timing found\n");
661}
662
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -0700663static int panel_simple_probe(struct device *dev, const struct panel_desc *desc,
664 struct drm_dp_aux *aux)
Thierry Reding280921d2013-08-30 15:10:14 +0200665{
Thierry Reding280921d2013-08-30 15:10:14 +0200666 struct panel_simple *panel;
Sean Paulb8a29482019-07-11 13:34:53 -0700667 struct display_timing dt;
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100668 struct device_node *ddc;
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200669 int connector_type;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200670 u32 bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200671 int err;
672
673 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
674 if (!panel)
675 return -ENOMEM;
676
677 panel->enabled = false;
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800678 panel->prepared_time = 0;
Thierry Reding280921d2013-08-30 15:10:14 +0200679 panel->desc = desc;
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -0700680 panel->aux = aux;
Thierry Reding280921d2013-08-30 15:10:14 +0200681
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700682 panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd");
Douglas Anderson48834e62020-05-07 14:34:57 -0700683 if (!panel->no_hpd) {
Douglas Anderson5c4381e2021-04-23 09:58:56 -0700684 err = panel_simple_get_hpd_gpio(dev, panel);
Douglas Anderson48834e62020-05-07 14:34:57 -0700685 if (err)
686 return err;
687 }
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700688
Thierry Reding280921d2013-08-30 15:10:14 +0200689 panel->supply = devm_regulator_get(dev, "power");
690 if (IS_ERR(panel->supply))
691 return PTR_ERR(panel->supply);
692
Alexandre Courbota61400d2014-10-23 17:16:58 +0900693 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
694 GPIOD_OUT_LOW);
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900695 if (IS_ERR(panel->enable_gpio)) {
696 err = PTR_ERR(panel->enable_gpio);
Fabio Estevamb8e93802017-06-30 18:14:46 -0300697 if (err != -EPROBE_DEFER)
698 dev_err(dev, "failed to request GPIO: %d\n", err);
Alexandre Courbot9746c612014-07-25 23:47:25 +0900699 return err;
700 }
Thierry Reding280921d2013-08-30 15:10:14 +0200701
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300702 err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
703 if (err) {
704 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
705 return err;
706 }
707
Thierry Reding280921d2013-08-30 15:10:14 +0200708 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
709 if (ddc) {
710 panel->ddc = of_find_i2c_adapter_by_node(ddc);
711 of_node_put(ddc);
712
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100713 if (!panel->ddc)
714 return -EPROBE_DEFER;
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -0700715 } else if (aux) {
716 panel->ddc = &aux->ddc;
Thierry Reding280921d2013-08-30 15:10:14 +0200717 }
718
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100719 if (desc == &panel_dpi) {
720 /* Handle the generic panel-dpi binding */
721 err = panel_dpi_probe(dev, panel);
722 if (err)
723 goto free_ddc;
724 } else {
725 if (!of_get_display_timing(dev->of_node, "panel-timing", &dt))
726 panel_simple_parse_panel_timing_node(dev, panel, &dt);
727 }
Sean Paulb8a29482019-07-11 13:34:53 -0700728
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200729 connector_type = desc->connector_type;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200730 /* Catch common mistakes for panels. */
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200731 switch (connector_type) {
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200732 case 0:
733 dev_warn(dev, "Specify missing connector_type\n");
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200734 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200735 break;
736 case DRM_MODE_CONNECTOR_LVDS:
Laurent Pinchartc4715832020-06-30 02:33:19 +0300737 WARN_ON(desc->bus_flags &
738 ~(DRM_BUS_FLAG_DE_LOW |
739 DRM_BUS_FLAG_DE_HIGH |
740 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
741 DRM_BUS_FLAG_DATA_LSB_TO_MSB));
Laurent Pinchart1185c402020-06-30 02:33:20 +0300742 WARN_ON(desc->bus_format != MEDIA_BUS_FMT_RGB666_1X7X3_SPWG &&
743 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_SPWG &&
744 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA);
745 WARN_ON(desc->bus_format == MEDIA_BUS_FMT_RGB666_1X7X3_SPWG &&
746 desc->bpc != 6);
747 WARN_ON((desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_SPWG ||
748 desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA) &&
749 desc->bpc != 8);
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200750 break;
751 case DRM_MODE_CONNECTOR_eDP:
Rajeev Nandan13aceea2021-06-26 22:21:06 +0530752 if (desc->bpc != 6 && desc->bpc != 8 && desc->bpc != 10)
753 dev_warn(dev, "Expected bpc in {6,8,10} but got: %u\n", desc->bpc);
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200754 break;
755 case DRM_MODE_CONNECTOR_DSI:
756 if (desc->bpc != 6 && desc->bpc != 8)
757 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
758 break;
759 case DRM_MODE_CONNECTOR_DPI:
760 bus_flags = DRM_BUS_FLAG_DE_LOW |
761 DRM_BUS_FLAG_DE_HIGH |
762 DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE |
763 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
764 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
765 DRM_BUS_FLAG_DATA_LSB_TO_MSB |
766 DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE |
767 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE;
768 if (desc->bus_flags & ~bus_flags)
769 dev_warn(dev, "Unexpected bus_flags(%d)\n", desc->bus_flags & ~bus_flags);
770 if (!(desc->bus_flags & bus_flags))
771 dev_warn(dev, "Specify missing bus_flags\n");
772 if (desc->bus_format == 0)
773 dev_warn(dev, "Specify missing bus_format\n");
774 if (desc->bpc != 6 && desc->bpc != 8)
775 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
776 break;
777 default:
778 dev_warn(dev, "Specify a valid connector_type: %d\n", desc->connector_type);
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200779 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200780 break;
Laurent Pinchart1185c402020-06-30 02:33:20 +0300781 }
Laurent Pinchartc4715832020-06-30 02:33:19 +0300782
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700783 dev_set_drvdata(dev, panel);
784
785 /*
786 * We use runtime PM for prepare / unprepare since those power the panel
787 * on and off and those can be very slow operations. This is important
788 * to optimize powering the panel on briefly to read the EDID before
789 * fully enabling the panel.
790 */
791 pm_runtime_enable(dev);
792 pm_runtime_set_autosuspend_delay(dev, 1000);
793 pm_runtime_use_autosuspend(dev);
794
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200795 drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type);
Thierry Reding280921d2013-08-30 15:10:14 +0200796
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100797 err = drm_panel_of_backlight(&panel->base);
798 if (err)
Douglas Anderson70e12562021-04-23 09:58:47 -0700799 goto disable_pm_runtime;
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100800
Rajeev Nandanbfd45142021-06-26 22:21:04 +0530801 if (!panel->base.backlight && panel->aux) {
Douglas Anderson5ead9b52021-07-14 09:33:50 -0700802 pm_runtime_get_sync(dev);
Rajeev Nandanbfd45142021-06-26 22:21:04 +0530803 err = drm_panel_dp_aux_backlight(&panel->base, panel->aux);
Douglas Anderson5ead9b52021-07-14 09:33:50 -0700804 pm_runtime_mark_last_busy(dev);
805 pm_runtime_put_autosuspend(dev);
Rajeev Nandanbfd45142021-06-26 22:21:04 +0530806 if (err)
807 goto disable_pm_runtime;
808 }
809
Bernard Zhaoc3ee8c62020-08-01 20:02:13 +0800810 drm_panel_add(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200811
Thierry Reding280921d2013-08-30 15:10:14 +0200812 return 0;
813
Douglas Anderson70e12562021-04-23 09:58:47 -0700814disable_pm_runtime:
Douglas Andersona596fcd2021-05-17 13:08:58 -0700815 pm_runtime_dont_use_autosuspend(dev);
Douglas Anderson70e12562021-04-23 09:58:47 -0700816 pm_runtime_disable(dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200817free_ddc:
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -0700818 if (panel->ddc && (!panel->aux || panel->ddc != &panel->aux->ddc))
Thierry Reding280921d2013-08-30 15:10:14 +0200819 put_device(&panel->ddc->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200820
821 return err;
822}
823
824static int panel_simple_remove(struct device *dev)
825{
826 struct panel_simple *panel = dev_get_drvdata(dev);
827
Thierry Reding280921d2013-08-30 15:10:14 +0200828 drm_panel_remove(&panel->base);
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100829 drm_panel_disable(&panel->base);
830 drm_panel_unprepare(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200831
Douglas Andersona596fcd2021-05-17 13:08:58 -0700832 pm_runtime_dont_use_autosuspend(dev);
Douglas Anderson70e12562021-04-23 09:58:47 -0700833 pm_runtime_disable(dev);
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -0700834 if (panel->ddc && (!panel->aux || panel->ddc != &panel->aux->ddc))
Thierry Reding280921d2013-08-30 15:10:14 +0200835 put_device(&panel->ddc->dev);
836
Thierry Reding280921d2013-08-30 15:10:14 +0200837 return 0;
838}
839
Thierry Redingd02fd932014-04-29 17:21:21 +0200840static void panel_simple_shutdown(struct device *dev)
841{
842 struct panel_simple *panel = dev_get_drvdata(dev);
843
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100844 drm_panel_disable(&panel->base);
845 drm_panel_unprepare(&panel->base);
Thierry Redingd02fd932014-04-29 17:21:21 +0200846}
847
Jagan Tekibca684e2020-08-29 22:03:28 +0530848static const struct drm_display_mode ampire_am_1280800n3tzqw_t00h_mode = {
849 .clock = 71100,
850 .hdisplay = 1280,
851 .hsync_start = 1280 + 40,
852 .hsync_end = 1280 + 40 + 80,
853 .htotal = 1280 + 40 + 80 + 40,
854 .vdisplay = 800,
855 .vsync_start = 800 + 3,
856 .vsync_end = 800 + 3 + 10,
857 .vtotal = 800 + 3 + 10 + 10,
858 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
859};
860
861static const struct panel_desc ampire_am_1280800n3tzqw_t00h = {
862 .modes = &ampire_am_1280800n3tzqw_t00h_mode,
863 .num_modes = 1,
864 .bpc = 6,
865 .size = {
866 .width = 217,
867 .height = 136,
868 },
869 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
870 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
871 .connector_type = DRM_MODE_CONNECTOR_LVDS,
872};
873
Yannick Fertre966fea72017-03-28 11:44:49 +0200874static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
875 .clock = 9000,
876 .hdisplay = 480,
877 .hsync_start = 480 + 2,
878 .hsync_end = 480 + 2 + 41,
879 .htotal = 480 + 2 + 41 + 2,
880 .vdisplay = 272,
881 .vsync_start = 272 + 2,
882 .vsync_end = 272 + 2 + 10,
883 .vtotal = 272 + 2 + 10 + 2,
Yannick Fertre966fea72017-03-28 11:44:49 +0200884 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
885};
886
887static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
888 .modes = &ampire_am_480272h3tmqw_t01h_mode,
889 .num_modes = 1,
890 .bpc = 8,
891 .size = {
892 .width = 105,
893 .height = 67,
894 },
895 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
896};
897
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100898static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
899 .clock = 33333,
900 .hdisplay = 800,
901 .hsync_start = 800 + 0,
902 .hsync_end = 800 + 0 + 255,
903 .htotal = 800 + 0 + 255 + 0,
904 .vdisplay = 480,
905 .vsync_start = 480 + 2,
906 .vsync_end = 480 + 2 + 45,
907 .vtotal = 480 + 2 + 45 + 0,
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100908 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
909};
910
911static const struct panel_desc ampire_am800480r3tmqwa1h = {
912 .modes = &ampire_am800480r3tmqwa1h_mode,
913 .num_modes = 1,
914 .bpc = 6,
915 .size = {
916 .width = 152,
917 .height = 91,
918 },
919 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
920};
921
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200922static const struct display_timing santek_st0700i5y_rbslw_f_timing = {
923 .pixelclock = { 26400000, 33300000, 46800000 },
924 .hactive = { 800, 800, 800 },
925 .hfront_porch = { 16, 210, 354 },
926 .hback_porch = { 45, 36, 6 },
927 .hsync_len = { 1, 10, 40 },
928 .vactive = { 480, 480, 480 },
929 .vfront_porch = { 7, 22, 147 },
930 .vback_porch = { 22, 13, 3 },
931 .vsync_len = { 1, 10, 20 },
932 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
933 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE
934};
935
936static const struct panel_desc armadeus_st0700_adapt = {
937 .timings = &santek_st0700i5y_rbslw_f_timing,
938 .num_timings = 1,
939 .bpc = 6,
940 .size = {
941 .width = 154,
942 .height = 86,
943 },
944 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +0200945 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200946};
947
Thierry Reding280921d2013-08-30 15:10:14 +0200948static const struct drm_display_mode auo_b101aw03_mode = {
949 .clock = 51450,
950 .hdisplay = 1024,
951 .hsync_start = 1024 + 156,
952 .hsync_end = 1024 + 156 + 8,
953 .htotal = 1024 + 156 + 8 + 156,
954 .vdisplay = 600,
955 .vsync_start = 600 + 16,
956 .vsync_end = 600 + 16 + 6,
957 .vtotal = 600 + 16 + 6 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +0200958};
959
960static const struct panel_desc auo_b101aw03 = {
961 .modes = &auo_b101aw03_mode,
962 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700963 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200964 .size = {
965 .width = 223,
966 .height = 125,
967 },
Dmitry Osipenko85560822020-06-22 01:27:42 +0300968 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +0300969 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +0300970 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +0200971};
972
Douglas Anderson374bf822019-07-11 13:34:55 -0700973static const struct display_timing auo_b101ean01_timing = {
974 .pixelclock = { 65300000, 72500000, 75000000 },
975 .hactive = { 1280, 1280, 1280 },
976 .hfront_porch = { 18, 119, 119 },
977 .hback_porch = { 21, 21, 21 },
978 .hsync_len = { 32, 32, 32 },
979 .vactive = { 800, 800, 800 },
980 .vfront_porch = { 4, 4, 4 },
981 .vback_porch = { 8, 8, 8 },
982 .vsync_len = { 18, 20, 20 },
Huang Lina531bc32015-02-28 10:18:58 +0800983};
984
985static const struct panel_desc auo_b101ean01 = {
Douglas Anderson374bf822019-07-11 13:34:55 -0700986 .timings = &auo_b101ean01_timing,
987 .num_timings = 1,
Huang Lina531bc32015-02-28 10:18:58 +0800988 .bpc = 6,
989 .size = {
990 .width = 217,
991 .height = 136,
992 },
993};
994
Rob Clarkdac746e2014-08-01 17:01:06 -0400995static const struct drm_display_mode auo_b101xtn01_mode = {
996 .clock = 72000,
997 .hdisplay = 1366,
998 .hsync_start = 1366 + 20,
999 .hsync_end = 1366 + 20 + 70,
1000 .htotal = 1366 + 20 + 70,
1001 .vdisplay = 768,
1002 .vsync_start = 768 + 14,
1003 .vsync_end = 768 + 14 + 42,
1004 .vtotal = 768 + 14 + 42,
Rob Clarkdac746e2014-08-01 17:01:06 -04001005 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1006};
1007
1008static const struct panel_desc auo_b101xtn01 = {
1009 .modes = &auo_b101xtn01_mode,
1010 .num_modes = 1,
1011 .bpc = 6,
1012 .size = {
1013 .width = 223,
1014 .height = 125,
1015 },
1016};
1017
Rob Clarkda4582862020-01-08 15:53:56 -08001018static const struct drm_display_mode auo_b116xak01_mode = {
1019 .clock = 69300,
1020 .hdisplay = 1366,
1021 .hsync_start = 1366 + 48,
1022 .hsync_end = 1366 + 48 + 32,
1023 .htotal = 1366 + 48 + 32 + 10,
1024 .vdisplay = 768,
1025 .vsync_start = 768 + 4,
1026 .vsync_end = 768 + 4 + 6,
1027 .vtotal = 768 + 4 + 6 + 15,
Rob Clarkda4582862020-01-08 15:53:56 -08001028 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1029};
1030
1031static const struct panel_desc auo_b116xak01 = {
1032 .modes = &auo_b116xak01_mode,
1033 .num_modes = 1,
1034 .bpc = 6,
1035 .size = {
1036 .width = 256,
1037 .height = 144,
1038 },
1039 .delay = {
1040 .hpd_absent_delay = 200,
1041 },
1042 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1043 .connector_type = DRM_MODE_CONNECTOR_eDP,
1044};
1045
Ajay Kumare35e3052014-09-01 15:40:02 +05301046static const struct drm_display_mode auo_b116xw03_mode = {
1047 .clock = 70589,
1048 .hdisplay = 1366,
1049 .hsync_start = 1366 + 40,
1050 .hsync_end = 1366 + 40 + 40,
1051 .htotal = 1366 + 40 + 40 + 32,
1052 .vdisplay = 768,
1053 .vsync_start = 768 + 10,
1054 .vsync_end = 768 + 10 + 12,
1055 .vtotal = 768 + 10 + 12 + 6,
Jitao Shi88d34572020-07-05 17:45:14 +08001056 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
Ajay Kumare35e3052014-09-01 15:40:02 +05301057};
1058
1059static const struct panel_desc auo_b116xw03 = {
1060 .modes = &auo_b116xw03_mode,
1061 .num_modes = 1,
1062 .bpc = 6,
1063 .size = {
1064 .width = 256,
1065 .height = 144,
1066 },
Jitao Shi88d34572020-07-05 17:45:14 +08001067 .delay = {
1068 .enable = 400,
1069 },
1070 .bus_flags = DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
1071 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1072 .connector_type = DRM_MODE_CONNECTOR_eDP,
Ajay Kumare35e3052014-09-01 15:40:02 +05301073};
1074
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07001075static const struct drm_display_mode auo_b133xtn01_mode = {
1076 .clock = 69500,
1077 .hdisplay = 1366,
1078 .hsync_start = 1366 + 48,
1079 .hsync_end = 1366 + 48 + 32,
1080 .htotal = 1366 + 48 + 32 + 20,
1081 .vdisplay = 768,
1082 .vsync_start = 768 + 3,
1083 .vsync_end = 768 + 3 + 6,
1084 .vtotal = 768 + 3 + 6 + 13,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07001085};
1086
1087static const struct panel_desc auo_b133xtn01 = {
1088 .modes = &auo_b133xtn01_mode,
1089 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001090 .bpc = 6,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07001091 .size = {
1092 .width = 293,
1093 .height = 165,
1094 },
1095};
1096
Bjorn Andersson93ea7aa2021-07-26 10:33:00 -07001097static const struct drm_display_mode auo_b133han05_mode = {
1098 .clock = 142600,
1099 .hdisplay = 1920,
1100 .hsync_start = 1920 + 58,
1101 .hsync_end = 1920 + 58 + 42,
1102 .htotal = 1920 + 58 + 42 + 60,
1103 .vdisplay = 1080,
1104 .vsync_start = 1080 + 3,
1105 .vsync_end = 1080 + 3 + 5,
1106 .vtotal = 1080 + 3 + 5 + 54,
1107};
1108
1109static const struct panel_desc auo_b133han05 = {
1110 .modes = &auo_b133han05_mode,
1111 .num_modes = 1,
1112 .bpc = 8,
1113 .size = {
1114 .width = 293,
1115 .height = 165,
1116 },
1117 .delay = {
1118 .prepare = 100,
1119 .enable = 20,
1120 .unprepare = 50,
1121 },
1122 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1123 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1124 .connector_type = DRM_MODE_CONNECTOR_eDP,
1125};
1126
Ajay Kumar3e51d602014-07-31 23:12:12 +05301127static const struct drm_display_mode auo_b133htn01_mode = {
1128 .clock = 150660,
1129 .hdisplay = 1920,
1130 .hsync_start = 1920 + 172,
1131 .hsync_end = 1920 + 172 + 80,
1132 .htotal = 1920 + 172 + 80 + 60,
1133 .vdisplay = 1080,
1134 .vsync_start = 1080 + 25,
1135 .vsync_end = 1080 + 25 + 10,
1136 .vtotal = 1080 + 25 + 10 + 10,
Ajay Kumar3e51d602014-07-31 23:12:12 +05301137};
1138
1139static const struct panel_desc auo_b133htn01 = {
1140 .modes = &auo_b133htn01_mode,
1141 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001142 .bpc = 6,
Ajay Kumar3e51d602014-07-31 23:12:12 +05301143 .size = {
1144 .width = 293,
1145 .height = 165,
1146 },
1147 .delay = {
1148 .prepare = 105,
1149 .enable = 20,
1150 .unprepare = 50,
1151 },
1152};
1153
Bjorn Andersson93ea7aa2021-07-26 10:33:00 -07001154static const struct drm_display_mode auo_b140han06_mode = {
1155 .clock = 141000,
1156 .hdisplay = 1920,
1157 .hsync_start = 1920 + 16,
1158 .hsync_end = 1920 + 16 + 16,
1159 .htotal = 1920 + 16 + 16 + 152,
1160 .vdisplay = 1080,
1161 .vsync_start = 1080 + 3,
1162 .vsync_end = 1080 + 3 + 14,
1163 .vtotal = 1080 + 3 + 14 + 19,
1164};
1165
1166static const struct panel_desc auo_b140han06 = {
1167 .modes = &auo_b140han06_mode,
1168 .num_modes = 1,
1169 .bpc = 8,
1170 .size = {
1171 .width = 309,
1172 .height = 174,
1173 },
1174 .delay = {
1175 .prepare = 100,
1176 .enable = 20,
1177 .unprepare = 50,
1178 },
1179 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1180 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1181 .connector_type = DRM_MODE_CONNECTOR_eDP,
1182};
1183
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02001184static const struct display_timing auo_g070vvn01_timings = {
1185 .pixelclock = { 33300000, 34209000, 45000000 },
1186 .hactive = { 800, 800, 800 },
1187 .hfront_porch = { 20, 40, 200 },
1188 .hback_porch = { 87, 40, 1 },
1189 .hsync_len = { 1, 48, 87 },
1190 .vactive = { 480, 480, 480 },
1191 .vfront_porch = { 5, 13, 200 },
1192 .vback_porch = { 31, 31, 29 },
1193 .vsync_len = { 1, 1, 3 },
1194};
1195
1196static const struct panel_desc auo_g070vvn01 = {
1197 .timings = &auo_g070vvn01_timings,
1198 .num_timings = 1,
1199 .bpc = 8,
1200 .size = {
1201 .width = 152,
1202 .height = 91,
1203 },
1204 .delay = {
1205 .prepare = 200,
1206 .enable = 50,
1207 .disable = 50,
1208 .unprepare = 1000,
1209 },
1210};
1211
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001212static const struct drm_display_mode auo_g101evn010_mode = {
1213 .clock = 68930,
1214 .hdisplay = 1280,
1215 .hsync_start = 1280 + 82,
1216 .hsync_end = 1280 + 82 + 2,
1217 .htotal = 1280 + 82 + 2 + 84,
1218 .vdisplay = 800,
1219 .vsync_start = 800 + 8,
1220 .vsync_end = 800 + 8 + 2,
1221 .vtotal = 800 + 8 + 2 + 6,
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001222};
1223
1224static const struct panel_desc auo_g101evn010 = {
1225 .modes = &auo_g101evn010_mode,
1226 .num_modes = 1,
1227 .bpc = 6,
1228 .size = {
1229 .width = 216,
1230 .height = 135,
1231 },
Tomi Valkeinen27a46fb2020-04-17 14:40:43 +03001232 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1233 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001234};
1235
Christoph Fritz4451c282017-12-16 14:13:36 +01001236static const struct drm_display_mode auo_g104sn02_mode = {
1237 .clock = 40000,
1238 .hdisplay = 800,
1239 .hsync_start = 800 + 40,
1240 .hsync_end = 800 + 40 + 216,
1241 .htotal = 800 + 40 + 216 + 128,
1242 .vdisplay = 600,
1243 .vsync_start = 600 + 10,
1244 .vsync_end = 600 + 10 + 35,
1245 .vtotal = 600 + 10 + 35 + 2,
Christoph Fritz4451c282017-12-16 14:13:36 +01001246};
1247
1248static const struct panel_desc auo_g104sn02 = {
1249 .modes = &auo_g104sn02_mode,
1250 .num_modes = 1,
1251 .bpc = 8,
1252 .size = {
1253 .width = 211,
1254 .height = 158,
1255 },
Stefan Riedmuellera3050f22021-06-21 17:09:28 +02001256 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1257 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Christoph Fritz4451c282017-12-16 14:13:36 +01001258};
1259
Sebastian Reichel03e909a2020-04-15 19:27:25 +02001260static const struct drm_display_mode auo_g121ean01_mode = {
1261 .clock = 66700,
1262 .hdisplay = 1280,
1263 .hsync_start = 1280 + 58,
1264 .hsync_end = 1280 + 58 + 8,
1265 .htotal = 1280 + 58 + 8 + 70,
1266 .vdisplay = 800,
1267 .vsync_start = 800 + 6,
1268 .vsync_end = 800 + 6 + 4,
1269 .vtotal = 800 + 6 + 4 + 10,
Sebastian Reichel03e909a2020-04-15 19:27:25 +02001270};
1271
1272static const struct panel_desc auo_g121ean01 = {
1273 .modes = &auo_g121ean01_mode,
1274 .num_modes = 1,
1275 .bpc = 8,
1276 .size = {
1277 .width = 261,
1278 .height = 163,
1279 },
1280 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1281 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1282};
1283
Lucas Stach697035c2016-11-30 14:09:55 +01001284static const struct display_timing auo_g133han01_timings = {
1285 .pixelclock = { 134000000, 141200000, 149000000 },
1286 .hactive = { 1920, 1920, 1920 },
1287 .hfront_porch = { 39, 58, 77 },
1288 .hback_porch = { 59, 88, 117 },
1289 .hsync_len = { 28, 42, 56 },
1290 .vactive = { 1080, 1080, 1080 },
1291 .vfront_porch = { 3, 8, 11 },
1292 .vback_porch = { 5, 14, 19 },
1293 .vsync_len = { 4, 14, 19 },
1294};
1295
1296static const struct panel_desc auo_g133han01 = {
1297 .timings = &auo_g133han01_timings,
1298 .num_timings = 1,
1299 .bpc = 8,
1300 .size = {
1301 .width = 293,
1302 .height = 165,
1303 },
1304 .delay = {
1305 .prepare = 200,
1306 .enable = 50,
1307 .disable = 50,
1308 .unprepare = 1000,
1309 },
1310 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001311 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach697035c2016-11-30 14:09:55 +01001312};
1313
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02001314static const struct drm_display_mode auo_g156xtn01_mode = {
1315 .clock = 76000,
1316 .hdisplay = 1366,
1317 .hsync_start = 1366 + 33,
1318 .hsync_end = 1366 + 33 + 67,
1319 .htotal = 1560,
1320 .vdisplay = 768,
1321 .vsync_start = 768 + 4,
1322 .vsync_end = 768 + 4 + 4,
1323 .vtotal = 806,
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02001324};
1325
1326static const struct panel_desc auo_g156xtn01 = {
1327 .modes = &auo_g156xtn01_mode,
1328 .num_modes = 1,
1329 .bpc = 8,
1330 .size = {
1331 .width = 344,
1332 .height = 194,
1333 },
1334 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1335 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1336};
1337
Lucas Stach8c31f602016-11-30 14:09:56 +01001338static const struct display_timing auo_g185han01_timings = {
1339 .pixelclock = { 120000000, 144000000, 175000000 },
1340 .hactive = { 1920, 1920, 1920 },
Lucas Stachf8c6bfc2019-07-10 15:07:40 +02001341 .hfront_porch = { 36, 120, 148 },
1342 .hback_porch = { 24, 88, 108 },
1343 .hsync_len = { 20, 48, 64 },
Lucas Stach8c31f602016-11-30 14:09:56 +01001344 .vactive = { 1080, 1080, 1080 },
1345 .vfront_porch = { 6, 10, 40 },
1346 .vback_porch = { 2, 5, 20 },
1347 .vsync_len = { 2, 5, 20 },
1348};
1349
1350static const struct panel_desc auo_g185han01 = {
1351 .timings = &auo_g185han01_timings,
1352 .num_timings = 1,
1353 .bpc = 8,
1354 .size = {
1355 .width = 409,
1356 .height = 230,
1357 },
1358 .delay = {
1359 .prepare = 50,
1360 .enable = 200,
1361 .disable = 110,
1362 .unprepare = 1000,
1363 },
1364 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001365 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8c31f602016-11-30 14:09:56 +01001366};
1367
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02001368static const struct display_timing auo_g190ean01_timings = {
1369 .pixelclock = { 90000000, 108000000, 135000000 },
1370 .hactive = { 1280, 1280, 1280 },
1371 .hfront_porch = { 126, 184, 1266 },
1372 .hback_porch = { 84, 122, 844 },
1373 .hsync_len = { 70, 102, 704 },
1374 .vactive = { 1024, 1024, 1024 },
1375 .vfront_porch = { 4, 26, 76 },
1376 .vback_porch = { 2, 8, 25 },
1377 .vsync_len = { 2, 8, 25 },
1378};
1379
1380static const struct panel_desc auo_g190ean01 = {
1381 .timings = &auo_g190ean01_timings,
1382 .num_timings = 1,
1383 .bpc = 8,
1384 .size = {
1385 .width = 376,
1386 .height = 301,
1387 },
1388 .delay = {
1389 .prepare = 50,
1390 .enable = 200,
1391 .disable = 110,
1392 .unprepare = 1000,
1393 },
1394 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1395 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1396};
1397
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001398static const struct display_timing auo_p320hvn03_timings = {
1399 .pixelclock = { 106000000, 148500000, 164000000 },
1400 .hactive = { 1920, 1920, 1920 },
1401 .hfront_porch = { 25, 50, 130 },
1402 .hback_porch = { 25, 50, 130 },
1403 .hsync_len = { 20, 40, 105 },
1404 .vactive = { 1080, 1080, 1080 },
1405 .vfront_porch = { 8, 17, 150 },
1406 .vback_porch = { 8, 17, 150 },
1407 .vsync_len = { 4, 11, 100 },
1408};
1409
1410static const struct panel_desc auo_p320hvn03 = {
1411 .timings = &auo_p320hvn03_timings,
1412 .num_timings = 1,
1413 .bpc = 8,
1414 .size = {
1415 .width = 698,
1416 .height = 393,
1417 },
1418 .delay = {
1419 .prepare = 1,
1420 .enable = 450,
1421 .unprepare = 500,
1422 },
Lucas Stach2554f152018-04-11 17:27:41 +02001423 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001424 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001425};
1426
Haixia Shi7ee933a2016-10-11 14:59:16 -07001427static const struct drm_display_mode auo_t215hvn01_mode = {
1428 .clock = 148800,
1429 .hdisplay = 1920,
1430 .hsync_start = 1920 + 88,
1431 .hsync_end = 1920 + 88 + 44,
1432 .htotal = 1920 + 88 + 44 + 148,
1433 .vdisplay = 1080,
1434 .vsync_start = 1080 + 4,
1435 .vsync_end = 1080 + 4 + 5,
1436 .vtotal = 1080 + 4 + 5 + 36,
Haixia Shi7ee933a2016-10-11 14:59:16 -07001437};
1438
1439static const struct panel_desc auo_t215hvn01 = {
1440 .modes = &auo_t215hvn01_mode,
1441 .num_modes = 1,
1442 .bpc = 8,
1443 .size = {
1444 .width = 430,
1445 .height = 270,
1446 },
1447 .delay = {
1448 .disable = 5,
1449 .unprepare = 1000,
1450 }
1451};
1452
Philipp Zabeld47df632014-12-18 16:43:43 +01001453static const struct drm_display_mode avic_tm070ddh03_mode = {
1454 .clock = 51200,
1455 .hdisplay = 1024,
1456 .hsync_start = 1024 + 160,
1457 .hsync_end = 1024 + 160 + 4,
1458 .htotal = 1024 + 160 + 4 + 156,
1459 .vdisplay = 600,
1460 .vsync_start = 600 + 17,
1461 .vsync_end = 600 + 17 + 1,
1462 .vtotal = 600 + 17 + 1 + 17,
Philipp Zabeld47df632014-12-18 16:43:43 +01001463};
1464
1465static const struct panel_desc avic_tm070ddh03 = {
1466 .modes = &avic_tm070ddh03_mode,
1467 .num_modes = 1,
1468 .bpc = 8,
1469 .size = {
1470 .width = 154,
1471 .height = 90,
1472 },
1473 .delay = {
1474 .prepare = 20,
1475 .enable = 200,
1476 .disable = 200,
1477 },
1478};
1479
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08001480static const struct drm_display_mode bananapi_s070wv20_ct16_mode = {
1481 .clock = 30000,
1482 .hdisplay = 800,
1483 .hsync_start = 800 + 40,
1484 .hsync_end = 800 + 40 + 48,
1485 .htotal = 800 + 40 + 48 + 40,
1486 .vdisplay = 480,
1487 .vsync_start = 480 + 13,
1488 .vsync_end = 480 + 13 + 3,
1489 .vtotal = 480 + 13 + 3 + 29,
1490};
1491
1492static const struct panel_desc bananapi_s070wv20_ct16 = {
1493 .modes = &bananapi_s070wv20_ct16_mode,
1494 .num_modes = 1,
1495 .bpc = 6,
1496 .size = {
1497 .width = 154,
1498 .height = 86,
1499 },
1500};
1501
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001502static const struct drm_display_mode boe_hv070wsa_mode = {
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001503 .clock = 42105,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001504 .hdisplay = 1024,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001505 .hsync_start = 1024 + 30,
1506 .hsync_end = 1024 + 30 + 30,
1507 .htotal = 1024 + 30 + 30 + 30,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001508 .vdisplay = 600,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001509 .vsync_start = 600 + 10,
1510 .vsync_end = 600 + 10 + 10,
1511 .vtotal = 600 + 10 + 10 + 10,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001512};
1513
1514static const struct panel_desc boe_hv070wsa = {
1515 .modes = &boe_hv070wsa_mode,
1516 .num_modes = 1,
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001517 .bpc = 8,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001518 .size = {
1519 .width = 154,
1520 .height = 90,
1521 },
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001522 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1523 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1524 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001525};
1526
Caesar Wangcac1a412016-12-14 11:19:56 +08001527static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
1528 {
1529 .clock = 71900,
1530 .hdisplay = 1280,
1531 .hsync_start = 1280 + 48,
1532 .hsync_end = 1280 + 48 + 32,
1533 .htotal = 1280 + 48 + 32 + 80,
1534 .vdisplay = 800,
1535 .vsync_start = 800 + 3,
1536 .vsync_end = 800 + 3 + 5,
1537 .vtotal = 800 + 3 + 5 + 24,
Caesar Wangcac1a412016-12-14 11:19:56 +08001538 },
1539 {
1540 .clock = 57500,
1541 .hdisplay = 1280,
1542 .hsync_start = 1280 + 48,
1543 .hsync_end = 1280 + 48 + 32,
1544 .htotal = 1280 + 48 + 32 + 80,
1545 .vdisplay = 800,
1546 .vsync_start = 800 + 3,
1547 .vsync_end = 800 + 3 + 5,
1548 .vtotal = 800 + 3 + 5 + 24,
Caesar Wangcac1a412016-12-14 11:19:56 +08001549 },
1550};
1551
1552static const struct panel_desc boe_nv101wxmn51 = {
1553 .modes = boe_nv101wxmn51_modes,
1554 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
1555 .bpc = 8,
1556 .size = {
1557 .width = 217,
1558 .height = 136,
1559 },
1560 .delay = {
1561 .prepare = 210,
1562 .enable = 50,
1563 .unprepare = 160,
1564 },
1565};
1566
Douglas Andersona96ee0f2020-11-09 17:00:58 -08001567static const struct drm_display_mode boe_nv110wtm_n61_modes[] = {
1568 {
1569 .clock = 207800,
1570 .hdisplay = 2160,
1571 .hsync_start = 2160 + 48,
1572 .hsync_end = 2160 + 48 + 32,
1573 .htotal = 2160 + 48 + 32 + 100,
1574 .vdisplay = 1440,
1575 .vsync_start = 1440 + 3,
1576 .vsync_end = 1440 + 3 + 6,
1577 .vtotal = 1440 + 3 + 6 + 31,
Douglas Anderson9dbf1a42020-12-01 12:56:11 -08001578 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
Douglas Andersona96ee0f2020-11-09 17:00:58 -08001579 },
1580 {
1581 .clock = 138500,
1582 .hdisplay = 2160,
1583 .hsync_start = 2160 + 48,
1584 .hsync_end = 2160 + 48 + 32,
1585 .htotal = 2160 + 48 + 32 + 100,
1586 .vdisplay = 1440,
1587 .vsync_start = 1440 + 3,
1588 .vsync_end = 1440 + 3 + 6,
1589 .vtotal = 1440 + 3 + 6 + 31,
Douglas Anderson9dbf1a42020-12-01 12:56:11 -08001590 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
Douglas Andersona96ee0f2020-11-09 17:00:58 -08001591 },
1592};
1593
1594static const struct panel_desc boe_nv110wtm_n61 = {
1595 .modes = boe_nv110wtm_n61_modes,
1596 .num_modes = ARRAY_SIZE(boe_nv110wtm_n61_modes),
1597 .bpc = 8,
1598 .size = {
1599 .width = 233,
1600 .height = 155,
1601 },
1602 .delay = {
1603 .hpd_absent_delay = 200,
1604 .prepare_to_enable = 80,
Douglas Anderson67cc24a2021-02-22 08:17:24 -08001605 .enable = 50,
Douglas Andersona96ee0f2020-11-09 17:00:58 -08001606 .unprepare = 500,
1607 },
1608 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1609 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1610 .connector_type = DRM_MODE_CONNECTOR_eDP,
1611};
1612
Douglas Andersoncfe40d02020-05-08 15:59:02 -07001613/* Also used for boe_nv133fhm_n62 */
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001614static const struct drm_display_mode boe_nv133fhm_n61_modes = {
1615 .clock = 147840,
1616 .hdisplay = 1920,
1617 .hsync_start = 1920 + 48,
1618 .hsync_end = 1920 + 48 + 32,
1619 .htotal = 1920 + 48 + 32 + 200,
1620 .vdisplay = 1080,
1621 .vsync_start = 1080 + 3,
1622 .vsync_end = 1080 + 3 + 6,
1623 .vtotal = 1080 + 3 + 6 + 31,
Stephen Boydab6fd5d2020-11-06 10:23:33 -08001624 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001625};
1626
Douglas Andersoncfe40d02020-05-08 15:59:02 -07001627/* Also used for boe_nv133fhm_n62 */
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001628static const struct panel_desc boe_nv133fhm_n61 = {
1629 .modes = &boe_nv133fhm_n61_modes,
1630 .num_modes = 1,
Douglas Anderson9694d9c2020-05-08 15:59:00 -07001631 .bpc = 6,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001632 .size = {
Douglas Anderson9694d9c2020-05-08 15:59:00 -07001633 .width = 294,
1634 .height = 165,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001635 },
1636 .delay = {
Douglas Anderson667d73d2020-07-16 13:21:22 -07001637 /*
1638 * When power is first given to the panel there's a short
1639 * spike on the HPD line. It was explained that this spike
1640 * was until the TCON data download was complete. On
1641 * one system this was measured at 8 ms. We'll put 15 ms
1642 * in the prepare delay just to be safe and take it away
1643 * from the hpd_absent_delay (which would otherwise be 200 ms)
1644 * to handle this. That means:
1645 * - If HPD isn't hooked up you still have 200 ms delay.
1646 * - If HPD is hooked up we won't try to look at it for the
1647 * first 15 ms.
1648 */
1649 .prepare = 15,
1650 .hpd_absent_delay = 185,
1651
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001652 .unprepare = 500,
1653 },
1654 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1655 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1656 .connector_type = DRM_MODE_CONNECTOR_eDP,
1657};
1658
Tobias Schramma5119812020-01-09 12:29:52 +01001659static const struct drm_display_mode boe_nv140fhmn49_modes[] = {
1660 {
1661 .clock = 148500,
1662 .hdisplay = 1920,
1663 .hsync_start = 1920 + 48,
1664 .hsync_end = 1920 + 48 + 32,
1665 .htotal = 2200,
1666 .vdisplay = 1080,
1667 .vsync_start = 1080 + 3,
1668 .vsync_end = 1080 + 3 + 5,
1669 .vtotal = 1125,
Tobias Schramma5119812020-01-09 12:29:52 +01001670 },
1671};
1672
1673static const struct panel_desc boe_nv140fhmn49 = {
1674 .modes = boe_nv140fhmn49_modes,
1675 .num_modes = ARRAY_SIZE(boe_nv140fhmn49_modes),
1676 .bpc = 6,
1677 .size = {
1678 .width = 309,
1679 .height = 174,
1680 },
1681 .delay = {
1682 .prepare = 210,
1683 .enable = 50,
1684 .unprepare = 160,
1685 },
1686 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1687 .connector_type = DRM_MODE_CONNECTOR_eDP,
1688};
1689
Giulio Benettie58edce2018-07-31 01:11:16 +02001690static const struct drm_display_mode cdtech_s043wq26h_ct7_mode = {
1691 .clock = 9000,
1692 .hdisplay = 480,
1693 .hsync_start = 480 + 5,
1694 .hsync_end = 480 + 5 + 5,
1695 .htotal = 480 + 5 + 5 + 40,
1696 .vdisplay = 272,
1697 .vsync_start = 272 + 8,
1698 .vsync_end = 272 + 8 + 8,
1699 .vtotal = 272 + 8 + 8 + 8,
Giulio Benettie58edce2018-07-31 01:11:16 +02001700 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1701};
1702
1703static const struct panel_desc cdtech_s043wq26h_ct7 = {
1704 .modes = &cdtech_s043wq26h_ct7_mode,
1705 .num_modes = 1,
1706 .bpc = 8,
1707 .size = {
1708 .width = 95,
1709 .height = 54,
1710 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001711 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Giulio Benettie58edce2018-07-31 01:11:16 +02001712};
1713
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001714/* S070PWS19HP-FC21 2017/04/22 */
1715static const struct drm_display_mode cdtech_s070pws19hp_fc21_mode = {
1716 .clock = 51200,
1717 .hdisplay = 1024,
1718 .hsync_start = 1024 + 160,
1719 .hsync_end = 1024 + 160 + 20,
1720 .htotal = 1024 + 160 + 20 + 140,
1721 .vdisplay = 600,
1722 .vsync_start = 600 + 12,
1723 .vsync_end = 600 + 12 + 3,
1724 .vtotal = 600 + 12 + 3 + 20,
1725 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1726};
1727
1728static const struct panel_desc cdtech_s070pws19hp_fc21 = {
1729 .modes = &cdtech_s070pws19hp_fc21_mode,
1730 .num_modes = 1,
1731 .bpc = 6,
1732 .size = {
1733 .width = 154,
1734 .height = 86,
1735 },
1736 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001737 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001738 .connector_type = DRM_MODE_CONNECTOR_DPI,
1739};
1740
1741/* S070SWV29HG-DC44 2017/09/21 */
1742static const struct drm_display_mode cdtech_s070swv29hg_dc44_mode = {
1743 .clock = 33300,
1744 .hdisplay = 800,
1745 .hsync_start = 800 + 210,
1746 .hsync_end = 800 + 210 + 2,
1747 .htotal = 800 + 210 + 2 + 44,
1748 .vdisplay = 480,
1749 .vsync_start = 480 + 22,
1750 .vsync_end = 480 + 22 + 2,
1751 .vtotal = 480 + 22 + 2 + 21,
1752 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1753};
1754
1755static const struct panel_desc cdtech_s070swv29hg_dc44 = {
1756 .modes = &cdtech_s070swv29hg_dc44_mode,
1757 .num_modes = 1,
1758 .bpc = 6,
1759 .size = {
1760 .width = 154,
1761 .height = 86,
1762 },
1763 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001764 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001765 .connector_type = DRM_MODE_CONNECTOR_DPI,
1766};
1767
Giulio Benetti982f9442018-07-31 01:11:14 +02001768static const struct drm_display_mode cdtech_s070wv95_ct16_mode = {
1769 .clock = 35000,
1770 .hdisplay = 800,
1771 .hsync_start = 800 + 40,
1772 .hsync_end = 800 + 40 + 40,
1773 .htotal = 800 + 40 + 40 + 48,
1774 .vdisplay = 480,
1775 .vsync_start = 480 + 29,
1776 .vsync_end = 480 + 29 + 13,
1777 .vtotal = 480 + 29 + 13 + 3,
Giulio Benetti982f9442018-07-31 01:11:14 +02001778 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1779};
1780
1781static const struct panel_desc cdtech_s070wv95_ct16 = {
1782 .modes = &cdtech_s070wv95_ct16_mode,
1783 .num_modes = 1,
1784 .bpc = 8,
1785 .size = {
1786 .width = 154,
1787 .height = 85,
1788 },
1789};
1790
Marek Vasut07c913c2020-07-28 22:12:42 +02001791static const struct display_timing chefree_ch101olhlwh_002_timing = {
1792 .pixelclock = { 68900000, 71100000, 73400000 },
1793 .hactive = { 1280, 1280, 1280 },
1794 .hfront_porch = { 65, 80, 95 },
1795 .hback_porch = { 64, 79, 94 },
1796 .hsync_len = { 1, 1, 1 },
1797 .vactive = { 800, 800, 800 },
1798 .vfront_porch = { 7, 11, 14 },
1799 .vback_porch = { 7, 11, 14 },
1800 .vsync_len = { 1, 1, 1 },
1801 .flags = DISPLAY_FLAGS_DE_HIGH,
1802};
1803
1804static const struct panel_desc chefree_ch101olhlwh_002 = {
1805 .timings = &chefree_ch101olhlwh_002_timing,
1806 .num_timings = 1,
1807 .bpc = 8,
1808 .size = {
1809 .width = 217,
1810 .height = 135,
1811 },
1812 .delay = {
1813 .enable = 200,
1814 .disable = 200,
1815 },
1816 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1817 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1818 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1819};
1820
Randy Li2cb35c82016-09-20 03:02:51 +08001821static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
1822 .clock = 66770,
1823 .hdisplay = 800,
1824 .hsync_start = 800 + 49,
1825 .hsync_end = 800 + 49 + 33,
1826 .htotal = 800 + 49 + 33 + 17,
1827 .vdisplay = 1280,
1828 .vsync_start = 1280 + 1,
1829 .vsync_end = 1280 + 1 + 7,
1830 .vtotal = 1280 + 1 + 7 + 15,
Randy Li2cb35c82016-09-20 03:02:51 +08001831 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1832};
1833
1834static const struct panel_desc chunghwa_claa070wp03xg = {
1835 .modes = &chunghwa_claa070wp03xg_mode,
1836 .num_modes = 1,
1837 .bpc = 6,
1838 .size = {
1839 .width = 94,
1840 .height = 150,
1841 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001842 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001843 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001844 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Randy Li2cb35c82016-09-20 03:02:51 +08001845};
1846
Stephen Warren4c930752014-01-07 16:46:26 -07001847static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
1848 .clock = 72070,
1849 .hdisplay = 1366,
1850 .hsync_start = 1366 + 58,
1851 .hsync_end = 1366 + 58 + 58,
1852 .htotal = 1366 + 58 + 58 + 58,
1853 .vdisplay = 768,
1854 .vsync_start = 768 + 4,
1855 .vsync_end = 768 + 4 + 4,
1856 .vtotal = 768 + 4 + 4 + 4,
Stephen Warren4c930752014-01-07 16:46:26 -07001857};
1858
1859static const struct panel_desc chunghwa_claa101wa01a = {
1860 .modes = &chunghwa_claa101wa01a_mode,
1861 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001862 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -07001863 .size = {
1864 .width = 220,
1865 .height = 120,
1866 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001867 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001868 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001869 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Stephen Warren4c930752014-01-07 16:46:26 -07001870};
1871
Thierry Reding280921d2013-08-30 15:10:14 +02001872static const struct drm_display_mode chunghwa_claa101wb01_mode = {
1873 .clock = 69300,
1874 .hdisplay = 1366,
1875 .hsync_start = 1366 + 48,
1876 .hsync_end = 1366 + 48 + 32,
1877 .htotal = 1366 + 48 + 32 + 20,
1878 .vdisplay = 768,
1879 .vsync_start = 768 + 16,
1880 .vsync_end = 768 + 16 + 8,
1881 .vtotal = 768 + 16 + 8 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02001882};
1883
1884static const struct panel_desc chunghwa_claa101wb01 = {
1885 .modes = &chunghwa_claa101wb01_mode,
1886 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001887 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +02001888 .size = {
1889 .width = 223,
1890 .height = 125,
1891 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001892 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001893 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001894 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +02001895};
1896
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001897static const struct drm_display_mode dataimage_scf0700c48ggu18_mode = {
1898 .clock = 33260,
1899 .hdisplay = 800,
1900 .hsync_start = 800 + 40,
1901 .hsync_end = 800 + 40 + 128,
1902 .htotal = 800 + 40 + 128 + 88,
1903 .vdisplay = 480,
1904 .vsync_start = 480 + 10,
1905 .vsync_end = 480 + 10 + 2,
1906 .vtotal = 480 + 10 + 2 + 33,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001907 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1908};
1909
1910static const struct panel_desc dataimage_scf0700c48ggu18 = {
1911 .modes = &dataimage_scf0700c48ggu18_mode,
1912 .num_modes = 1,
1913 .bpc = 8,
1914 .size = {
1915 .width = 152,
1916 .height = 91,
1917 },
1918 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001919 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001920};
1921
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001922static const struct display_timing dlc_dlc0700yzg_1_timing = {
1923 .pixelclock = { 45000000, 51200000, 57000000 },
1924 .hactive = { 1024, 1024, 1024 },
1925 .hfront_porch = { 100, 106, 113 },
1926 .hback_porch = { 100, 106, 113 },
1927 .hsync_len = { 100, 108, 114 },
1928 .vactive = { 600, 600, 600 },
1929 .vfront_porch = { 8, 11, 15 },
1930 .vback_porch = { 8, 11, 15 },
1931 .vsync_len = { 9, 13, 15 },
1932 .flags = DISPLAY_FLAGS_DE_HIGH,
1933};
1934
1935static const struct panel_desc dlc_dlc0700yzg_1 = {
1936 .timings = &dlc_dlc0700yzg_1_timing,
1937 .num_timings = 1,
1938 .bpc = 6,
1939 .size = {
1940 .width = 154,
1941 .height = 86,
1942 },
1943 .delay = {
1944 .prepare = 30,
1945 .enable = 200,
1946 .disable = 200,
1947 },
1948 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001949 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001950};
1951
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001952static const struct display_timing dlc_dlc1010gig_timing = {
1953 .pixelclock = { 68900000, 71100000, 73400000 },
1954 .hactive = { 1280, 1280, 1280 },
1955 .hfront_porch = { 43, 53, 63 },
1956 .hback_porch = { 43, 53, 63 },
1957 .hsync_len = { 44, 54, 64 },
1958 .vactive = { 800, 800, 800 },
1959 .vfront_porch = { 5, 8, 11 },
1960 .vback_porch = { 5, 8, 11 },
1961 .vsync_len = { 5, 7, 11 },
1962 .flags = DISPLAY_FLAGS_DE_HIGH,
1963};
1964
1965static const struct panel_desc dlc_dlc1010gig = {
1966 .timings = &dlc_dlc1010gig_timing,
1967 .num_timings = 1,
1968 .bpc = 8,
1969 .size = {
1970 .width = 216,
1971 .height = 135,
1972 },
1973 .delay = {
1974 .prepare = 60,
1975 .enable = 150,
1976 .disable = 100,
1977 .unprepare = 60,
1978 },
1979 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001980 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001981};
1982
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001983static const struct drm_display_mode edt_et035012dm6_mode = {
1984 .clock = 6500,
1985 .hdisplay = 320,
1986 .hsync_start = 320 + 20,
1987 .hsync_end = 320 + 20 + 30,
1988 .htotal = 320 + 20 + 68,
1989 .vdisplay = 240,
1990 .vsync_start = 240 + 4,
1991 .vsync_end = 240 + 4 + 4,
1992 .vtotal = 240 + 4 + 4 + 14,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001993 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1994};
1995
1996static const struct panel_desc edt_et035012dm6 = {
1997 .modes = &edt_et035012dm6_mode,
1998 .num_modes = 1,
1999 .bpc = 8,
2000 .size = {
2001 .width = 70,
2002 .height = 52,
2003 },
2004 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002005 .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02002006};
2007
Stefan Riedmuellerf08a2a12021-07-09 22:03:49 +02002008static const struct drm_display_mode edt_etm0350g0dh6_mode = {
2009 .clock = 6520,
2010 .hdisplay = 320,
2011 .hsync_start = 320 + 20,
2012 .hsync_end = 320 + 20 + 68,
2013 .htotal = 320 + 20 + 68,
2014 .vdisplay = 240,
2015 .vsync_start = 240 + 4,
2016 .vsync_end = 240 + 4 + 18,
2017 .vtotal = 240 + 4 + 18,
2018 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2019};
2020
2021static const struct panel_desc edt_etm0350g0dh6 = {
2022 .modes = &edt_etm0350g0dh6_mode,
2023 .num_modes = 1,
2024 .bpc = 6,
2025 .size = {
2026 .width = 70,
2027 .height = 53,
2028 },
2029 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2030 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
2031 .connector_type = DRM_MODE_CONNECTOR_DPI,
2032};
2033
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00002034static const struct drm_display_mode edt_etm043080dh6gp_mode = {
2035 .clock = 10870,
2036 .hdisplay = 480,
2037 .hsync_start = 480 + 8,
2038 .hsync_end = 480 + 8 + 4,
2039 .htotal = 480 + 8 + 4 + 41,
2040
2041 /*
2042 * IWG22M: Y resolution changed for "dc_linuxfb" module crashing while
2043 * fb_align
2044 */
2045
2046 .vdisplay = 288,
2047 .vsync_start = 288 + 2,
2048 .vsync_end = 288 + 2 + 4,
2049 .vtotal = 288 + 2 + 4 + 10,
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00002050};
2051
2052static const struct panel_desc edt_etm043080dh6gp = {
2053 .modes = &edt_etm043080dh6gp_mode,
2054 .num_modes = 1,
2055 .bpc = 8,
2056 .size = {
2057 .width = 100,
2058 .height = 65,
2059 },
2060 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2061 .connector_type = DRM_MODE_CONNECTOR_DPI,
2062};
2063
Marek Vasutfd819bf2019-02-19 15:04:38 +01002064static const struct drm_display_mode edt_etm0430g0dh6_mode = {
2065 .clock = 9000,
2066 .hdisplay = 480,
2067 .hsync_start = 480 + 2,
2068 .hsync_end = 480 + 2 + 41,
2069 .htotal = 480 + 2 + 41 + 2,
2070 .vdisplay = 272,
2071 .vsync_start = 272 + 2,
2072 .vsync_end = 272 + 2 + 10,
2073 .vtotal = 272 + 2 + 10 + 2,
Marek Vasutfd819bf2019-02-19 15:04:38 +01002074 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2075};
2076
2077static const struct panel_desc edt_etm0430g0dh6 = {
2078 .modes = &edt_etm0430g0dh6_mode,
2079 .num_modes = 1,
2080 .bpc = 6,
2081 .size = {
2082 .width = 95,
2083 .height = 54,
2084 },
Stefan Riedmueller4824a5f2021-06-21 17:09:30 +02002085 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2086 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Stefan Riedmuellerd112e102021-06-21 17:09:29 +02002087 .connector_type = DRM_MODE_CONNECTOR_DPI,
Marek Vasutfd819bf2019-02-19 15:04:38 +01002088};
2089
Stefan Agner26ab0062014-05-15 11:38:45 +02002090static const struct drm_display_mode edt_et057090dhu_mode = {
2091 .clock = 25175,
2092 .hdisplay = 640,
2093 .hsync_start = 640 + 16,
2094 .hsync_end = 640 + 16 + 30,
2095 .htotal = 640 + 16 + 30 + 114,
2096 .vdisplay = 480,
2097 .vsync_start = 480 + 10,
2098 .vsync_end = 480 + 10 + 3,
2099 .vtotal = 480 + 10 + 3 + 32,
Stefan Agner26ab0062014-05-15 11:38:45 +02002100 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2101};
2102
2103static const struct panel_desc edt_et057090dhu = {
2104 .modes = &edt_et057090dhu_mode,
2105 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002106 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +02002107 .size = {
2108 .width = 115,
2109 .height = 86,
2110 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08002111 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002112 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Dmitry Osipenko75e73222020-06-22 01:27:41 +03002113 .connector_type = DRM_MODE_CONNECTOR_DPI,
Stefan Agner26ab0062014-05-15 11:38:45 +02002114};
2115
Philipp Zabelfff5de42014-05-15 12:25:47 +02002116static const struct drm_display_mode edt_etm0700g0dh6_mode = {
2117 .clock = 33260,
2118 .hdisplay = 800,
2119 .hsync_start = 800 + 40,
2120 .hsync_end = 800 + 40 + 128,
2121 .htotal = 800 + 40 + 128 + 88,
2122 .vdisplay = 480,
2123 .vsync_start = 480 + 10,
2124 .vsync_end = 480 + 10 + 2,
2125 .vtotal = 480 + 10 + 2 + 33,
Philipp Zabelfff5de42014-05-15 12:25:47 +02002126 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2127};
2128
2129static const struct panel_desc edt_etm0700g0dh6 = {
2130 .modes = &edt_etm0700g0dh6_mode,
2131 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002132 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +02002133 .size = {
2134 .width = 152,
2135 .height = 91,
2136 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08002137 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002138 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Biju Das281edb92020-10-20 10:49:10 +01002139 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabelfff5de42014-05-15 12:25:47 +02002140};
2141
Jan Tuerkaa7e6452018-06-19 11:55:44 +02002142static const struct panel_desc edt_etm0700g0bdh6 = {
2143 .modes = &edt_etm0700g0dh6_mode,
2144 .num_modes = 1,
2145 .bpc = 6,
2146 .size = {
2147 .width = 152,
2148 .height = 91,
2149 },
2150 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002151 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Stefan Riedmuellerd112e102021-06-21 17:09:29 +02002152 .connector_type = DRM_MODE_CONNECTOR_DPI,
Jan Tuerkaa7e6452018-06-19 11:55:44 +02002153};
2154
Stefan Riedmuellere46f73f2021-07-09 22:03:48 +02002155static const struct drm_display_mode edt_etmv570g2dhu_mode = {
2156 .clock = 25175,
2157 .hdisplay = 640,
2158 .hsync_start = 640,
2159 .hsync_end = 640 + 16,
2160 .htotal = 640 + 16 + 30 + 114,
2161 .vdisplay = 480,
2162 .vsync_start = 480 + 10,
2163 .vsync_end = 480 + 10 + 3,
2164 .vtotal = 480 + 10 + 3 + 35,
2165 .flags = DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_PHSYNC,
2166};
2167
2168static const struct panel_desc edt_etmv570g2dhu = {
2169 .modes = &edt_etmv570g2dhu_mode,
2170 .num_modes = 1,
2171 .bpc = 6,
2172 .size = {
2173 .width = 115,
2174 .height = 86,
2175 },
2176 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2177 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
2178 .connector_type = DRM_MODE_CONNECTOR_DPI,
2179};
2180
Alistair Francis9746f5f2021-08-01 10:47:00 +10002181static const struct display_timing eink_vb3300_kca_timing = {
2182 .pixelclock = { 40000000, 40000000, 40000000 },
2183 .hactive = { 334, 334, 334 },
2184 .hfront_porch = { 1, 1, 1 },
2185 .hback_porch = { 1, 1, 1 },
2186 .hsync_len = { 1, 1, 1 },
2187 .vactive = { 1405, 1405, 1405 },
2188 .vfront_porch = { 1, 1, 1 },
2189 .vback_porch = { 1, 1, 1 },
2190 .vsync_len = { 1, 1, 1 },
2191 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2192 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
2193};
2194
2195static const struct panel_desc eink_vb3300_kca = {
2196 .timings = &eink_vb3300_kca_timing,
2197 .num_timings = 1,
2198 .bpc = 6,
2199 .size = {
2200 .width = 157,
2201 .height = 209,
2202 },
2203 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2204 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
2205 .connector_type = DRM_MODE_CONNECTOR_DPI,
2206};
2207
Marco Felsch9158e3c2019-04-16 12:06:45 +02002208static const struct display_timing evervision_vgg804821_timing = {
2209 .pixelclock = { 27600000, 33300000, 50000000 },
2210 .hactive = { 800, 800, 800 },
2211 .hfront_porch = { 40, 66, 70 },
2212 .hback_porch = { 40, 67, 70 },
2213 .hsync_len = { 40, 67, 70 },
2214 .vactive = { 480, 480, 480 },
2215 .vfront_porch = { 6, 10, 10 },
2216 .vback_porch = { 7, 11, 11 },
2217 .vsync_len = { 7, 11, 11 },
2218 .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH |
2219 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
2220 DISPLAY_FLAGS_SYNC_NEGEDGE,
2221};
2222
2223static const struct panel_desc evervision_vgg804821 = {
2224 .timings = &evervision_vgg804821_timing,
2225 .num_timings = 1,
2226 .bpc = 8,
2227 .size = {
2228 .width = 108,
2229 .height = 64,
2230 },
2231 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002232 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Marco Felsch9158e3c2019-04-16 12:06:45 +02002233};
2234
Boris BREZILLON102932b2014-06-05 15:53:32 +02002235static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
2236 .clock = 32260,
2237 .hdisplay = 800,
2238 .hsync_start = 800 + 168,
2239 .hsync_end = 800 + 168 + 64,
2240 .htotal = 800 + 168 + 64 + 88,
2241 .vdisplay = 480,
2242 .vsync_start = 480 + 37,
2243 .vsync_end = 480 + 37 + 2,
2244 .vtotal = 480 + 37 + 2 + 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02002245};
2246
2247static const struct panel_desc foxlink_fl500wvr00_a0t = {
2248 .modes = &foxlink_fl500wvr00_a0t_mode,
2249 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002250 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02002251 .size = {
2252 .width = 108,
2253 .height = 65,
2254 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +02002255 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +02002256};
2257
Paul Cercueil795db2a2020-07-16 14:56:47 +02002258static const struct drm_display_mode frida_frd350h54004_modes[] = {
2259 { /* 60 Hz */
2260 .clock = 6000,
2261 .hdisplay = 320,
2262 .hsync_start = 320 + 44,
2263 .hsync_end = 320 + 44 + 16,
2264 .htotal = 320 + 44 + 16 + 20,
2265 .vdisplay = 240,
2266 .vsync_start = 240 + 2,
2267 .vsync_end = 240 + 2 + 6,
2268 .vtotal = 240 + 2 + 6 + 2,
2269 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2270 },
2271 { /* 50 Hz */
2272 .clock = 5400,
2273 .hdisplay = 320,
2274 .hsync_start = 320 + 56,
2275 .hsync_end = 320 + 56 + 16,
2276 .htotal = 320 + 56 + 16 + 40,
2277 .vdisplay = 240,
2278 .vsync_start = 240 + 2,
2279 .vsync_end = 240 + 2 + 6,
2280 .vtotal = 240 + 2 + 6 + 2,
2281 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2282 },
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002283};
2284
2285static const struct panel_desc frida_frd350h54004 = {
Paul Cercueil795db2a2020-07-16 14:56:47 +02002286 .modes = frida_frd350h54004_modes,
2287 .num_modes = ARRAY_SIZE(frida_frd350h54004_modes),
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002288 .bpc = 8,
2289 .size = {
2290 .width = 77,
2291 .height = 64,
2292 },
2293 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002294 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002295 .connector_type = DRM_MODE_CONNECTOR_DPI,
2296};
2297
Jagan Teki3be20712019-05-07 18:37:07 +05302298static const struct drm_display_mode friendlyarm_hd702e_mode = {
2299 .clock = 67185,
2300 .hdisplay = 800,
2301 .hsync_start = 800 + 20,
2302 .hsync_end = 800 + 20 + 24,
2303 .htotal = 800 + 20 + 24 + 20,
2304 .vdisplay = 1280,
2305 .vsync_start = 1280 + 4,
2306 .vsync_end = 1280 + 4 + 8,
2307 .vtotal = 1280 + 4 + 8 + 4,
Jagan Teki3be20712019-05-07 18:37:07 +05302308 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2309};
2310
2311static const struct panel_desc friendlyarm_hd702e = {
2312 .modes = &friendlyarm_hd702e_mode,
2313 .num_modes = 1,
2314 .size = {
2315 .width = 94,
2316 .height = 151,
2317 },
2318};
2319
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002320static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
2321 .clock = 9000,
2322 .hdisplay = 480,
2323 .hsync_start = 480 + 5,
2324 .hsync_end = 480 + 5 + 1,
2325 .htotal = 480 + 5 + 1 + 40,
2326 .vdisplay = 272,
2327 .vsync_start = 272 + 8,
2328 .vsync_end = 272 + 8 + 1,
2329 .vtotal = 272 + 8 + 1 + 8,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002330};
2331
2332static const struct panel_desc giantplus_gpg482739qs5 = {
2333 .modes = &giantplus_gpg482739qs5_mode,
2334 .num_modes = 1,
2335 .bpc = 8,
2336 .size = {
2337 .width = 95,
2338 .height = 54,
2339 },
Philipp Zabel33536a02015-02-11 18:50:07 +01002340 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002341};
2342
Paul Cercueil2c6574a2019-06-06 00:22:47 +02002343static const struct display_timing giantplus_gpm940b0_timing = {
2344 .pixelclock = { 13500000, 27000000, 27500000 },
2345 .hactive = { 320, 320, 320 },
2346 .hfront_porch = { 14, 686, 718 },
2347 .hback_porch = { 50, 70, 255 },
2348 .hsync_len = { 1, 1, 1 },
2349 .vactive = { 240, 240, 240 },
2350 .vfront_porch = { 1, 1, 179 },
2351 .vback_porch = { 1, 21, 31 },
2352 .vsync_len = { 1, 1, 6 },
2353 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
2354};
2355
2356static const struct panel_desc giantplus_gpm940b0 = {
2357 .timings = &giantplus_gpm940b0_timing,
2358 .num_timings = 1,
2359 .bpc = 8,
2360 .size = {
2361 .width = 60,
2362 .height = 45,
2363 },
2364 .bus_format = MEDIA_BUS_FMT_RGB888_3X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002365 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Paul Cercueil2c6574a2019-06-06 00:22:47 +02002366};
2367
Philipp Zabelab077252014-12-11 18:32:46 +01002368static const struct display_timing hannstar_hsd070pww1_timing = {
2369 .pixelclock = { 64300000, 71100000, 82000000 },
2370 .hactive = { 1280, 1280, 1280 },
2371 .hfront_porch = { 1, 1, 10 },
2372 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +02002373 /*
2374 * According to the data sheet, the minimum horizontal blanking interval
2375 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
2376 * minimum working horizontal blanking interval to be 60 clocks.
2377 */
2378 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +01002379 .vactive = { 800, 800, 800 },
2380 .vfront_porch = { 1, 1, 10 },
2381 .vback_porch = { 1, 1, 10 },
2382 .vsync_len = { 1, 21, 203 },
2383 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +02002384};
2385
2386static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +01002387 .timings = &hannstar_hsd070pww1_timing,
2388 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +02002389 .bpc = 6,
2390 .size = {
2391 .width = 151,
2392 .height = 94,
2393 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +02002394 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002395 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabela8532052014-10-23 16:31:06 +02002396};
2397
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002398static const struct display_timing hannstar_hsd100pxn1_timing = {
2399 .pixelclock = { 55000000, 65000000, 75000000 },
2400 .hactive = { 1024, 1024, 1024 },
2401 .hfront_porch = { 40, 40, 40 },
2402 .hback_porch = { 220, 220, 220 },
2403 .hsync_len = { 20, 60, 100 },
2404 .vactive = { 768, 768, 768 },
2405 .vfront_porch = { 7, 7, 7 },
2406 .vback_porch = { 21, 21, 21 },
2407 .vsync_len = { 10, 10, 10 },
2408 .flags = DISPLAY_FLAGS_DE_HIGH,
2409};
2410
2411static const struct panel_desc hannstar_hsd100pxn1 = {
2412 .timings = &hannstar_hsd100pxn1_timing,
2413 .num_timings = 1,
2414 .bpc = 6,
2415 .size = {
2416 .width = 203,
2417 .height = 152,
2418 },
Philipp Zabel4946b042015-05-20 11:34:08 +02002419 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002420 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002421};
2422
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002423static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
2424 .clock = 33333,
2425 .hdisplay = 800,
2426 .hsync_start = 800 + 85,
2427 .hsync_end = 800 + 85 + 86,
2428 .htotal = 800 + 85 + 86 + 85,
2429 .vdisplay = 480,
2430 .vsync_start = 480 + 16,
2431 .vsync_end = 480 + 16 + 13,
2432 .vtotal = 480 + 16 + 13 + 16,
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002433};
2434
2435static const struct panel_desc hitachi_tx23d38vm0caa = {
2436 .modes = &hitachi_tx23d38vm0caa_mode,
2437 .num_modes = 1,
2438 .bpc = 6,
2439 .size = {
2440 .width = 195,
2441 .height = 117,
2442 },
Philipp Zabel6c684e32017-10-11 14:59:58 +02002443 .delay = {
2444 .enable = 160,
2445 .disable = 160,
2446 },
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002447};
2448
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002449static const struct drm_display_mode innolux_at043tn24_mode = {
2450 .clock = 9000,
2451 .hdisplay = 480,
2452 .hsync_start = 480 + 2,
2453 .hsync_end = 480 + 2 + 41,
2454 .htotal = 480 + 2 + 41 + 2,
2455 .vdisplay = 272,
2456 .vsync_start = 272 + 2,
Philipp Zabela4831592017-10-11 14:59:56 +02002457 .vsync_end = 272 + 2 + 10,
2458 .vtotal = 272 + 2 + 10 + 2,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002459 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2460};
2461
2462static const struct panel_desc innolux_at043tn24 = {
2463 .modes = &innolux_at043tn24_mode,
2464 .num_modes = 1,
2465 .bpc = 8,
2466 .size = {
2467 .width = 95,
2468 .height = 54,
2469 },
2470 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002471 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002472};
2473
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002474static const struct drm_display_mode innolux_at070tn92_mode = {
2475 .clock = 33333,
2476 .hdisplay = 800,
2477 .hsync_start = 800 + 210,
2478 .hsync_end = 800 + 210 + 20,
2479 .htotal = 800 + 210 + 20 + 46,
2480 .vdisplay = 480,
2481 .vsync_start = 480 + 22,
2482 .vsync_end = 480 + 22 + 10,
2483 .vtotal = 480 + 22 + 23 + 10,
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002484};
2485
2486static const struct panel_desc innolux_at070tn92 = {
2487 .modes = &innolux_at070tn92_mode,
2488 .num_modes = 1,
2489 .size = {
2490 .width = 154,
2491 .height = 86,
2492 },
2493 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2494};
2495
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002496static const struct display_timing innolux_g070y2_l01_timing = {
2497 .pixelclock = { 28000000, 29500000, 32000000 },
2498 .hactive = { 800, 800, 800 },
2499 .hfront_porch = { 61, 91, 141 },
2500 .hback_porch = { 60, 90, 140 },
2501 .hsync_len = { 12, 12, 12 },
2502 .vactive = { 480, 480, 480 },
2503 .vfront_porch = { 4, 9, 30 },
2504 .vback_porch = { 4, 8, 28 },
2505 .vsync_len = { 2, 2, 2 },
2506 .flags = DISPLAY_FLAGS_DE_HIGH,
2507};
2508
2509static const struct panel_desc innolux_g070y2_l01 = {
2510 .timings = &innolux_g070y2_l01_timing,
2511 .num_timings = 1,
2512 .bpc = 6,
2513 .size = {
2514 .width = 152,
2515 .height = 91,
2516 },
2517 .delay = {
2518 .prepare = 10,
2519 .enable = 100,
2520 .disable = 100,
2521 .unprepare = 800,
2522 },
2523 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002524 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002525};
2526
Michael Olbrich1e29b842016-08-15 14:32:02 +02002527static const struct display_timing innolux_g101ice_l01_timing = {
2528 .pixelclock = { 60400000, 71100000, 74700000 },
2529 .hactive = { 1280, 1280, 1280 },
2530 .hfront_porch = { 41, 80, 100 },
2531 .hback_porch = { 40, 79, 99 },
2532 .hsync_len = { 1, 1, 1 },
2533 .vactive = { 800, 800, 800 },
2534 .vfront_porch = { 5, 11, 14 },
2535 .vback_porch = { 4, 11, 14 },
2536 .vsync_len = { 1, 1, 1 },
2537 .flags = DISPLAY_FLAGS_DE_HIGH,
2538};
2539
2540static const struct panel_desc innolux_g101ice_l01 = {
2541 .timings = &innolux_g101ice_l01_timing,
2542 .num_timings = 1,
2543 .bpc = 8,
2544 .size = {
2545 .width = 217,
2546 .height = 135,
2547 },
2548 .delay = {
2549 .enable = 200,
2550 .disable = 200,
2551 },
2552 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002553 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Michael Olbrich1e29b842016-08-15 14:32:02 +02002554};
2555
Lucas Stach4ae13e42016-11-30 14:09:54 +01002556static const struct display_timing innolux_g121i1_l01_timing = {
2557 .pixelclock = { 67450000, 71000000, 74550000 },
2558 .hactive = { 1280, 1280, 1280 },
2559 .hfront_porch = { 40, 80, 160 },
2560 .hback_porch = { 39, 79, 159 },
2561 .hsync_len = { 1, 1, 1 },
2562 .vactive = { 800, 800, 800 },
2563 .vfront_porch = { 5, 11, 100 },
2564 .vback_porch = { 4, 11, 99 },
2565 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01002566};
2567
2568static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01002569 .timings = &innolux_g121i1_l01_timing,
2570 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01002571 .bpc = 6,
2572 .size = {
2573 .width = 261,
2574 .height = 163,
2575 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01002576 .delay = {
2577 .enable = 200,
2578 .disable = 20,
2579 },
2580 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002581 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stachd731f662014-11-06 17:44:33 +01002582};
2583
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002584static const struct drm_display_mode innolux_g121x1_l03_mode = {
2585 .clock = 65000,
2586 .hdisplay = 1024,
2587 .hsync_start = 1024 + 0,
2588 .hsync_end = 1024 + 1,
2589 .htotal = 1024 + 0 + 1 + 320,
2590 .vdisplay = 768,
2591 .vsync_start = 768 + 38,
2592 .vsync_end = 768 + 38 + 1,
2593 .vtotal = 768 + 38 + 1 + 0,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05002594 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002595};
2596
2597static const struct panel_desc innolux_g121x1_l03 = {
2598 .modes = &innolux_g121x1_l03_mode,
2599 .num_modes = 1,
2600 .bpc = 6,
2601 .size = {
2602 .width = 246,
2603 .height = 185,
2604 },
2605 .delay = {
2606 .enable = 200,
2607 .unprepare = 200,
2608 .disable = 400,
2609 },
2610};
2611
Douglas Anderson51d35632021-01-15 14:44:20 -08002612static const struct drm_display_mode innolux_n116bca_ea1_mode = {
2613 .clock = 76420,
2614 .hdisplay = 1366,
2615 .hsync_start = 1366 + 136,
2616 .hsync_end = 1366 + 136 + 30,
2617 .htotal = 1366 + 136 + 30 + 60,
2618 .vdisplay = 768,
2619 .vsync_start = 768 + 8,
2620 .vsync_end = 768 + 8 + 12,
2621 .vtotal = 768 + 8 + 12 + 12,
2622 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2623};
2624
2625static const struct panel_desc innolux_n116bca_ea1 = {
2626 .modes = &innolux_n116bca_ea1_mode,
2627 .num_modes = 1,
2628 .bpc = 6,
2629 .size = {
2630 .width = 256,
2631 .height = 144,
2632 },
2633 .delay = {
2634 .hpd_absent_delay = 200,
2635 .prepare_to_enable = 80,
2636 .unprepare = 500,
2637 },
2638 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2639 .connector_type = DRM_MODE_CONNECTOR_eDP,
2640};
2641
Douglas Andersond719cbe2019-07-11 13:34:54 -07002642/*
2643 * Datasheet specifies that at 60 Hz refresh rate:
2644 * - total horizontal time: { 1506, 1592, 1716 }
2645 * - total vertical time: { 788, 800, 868 }
2646 *
2647 * ...but doesn't go into exactly how that should be split into a front
2648 * porch, back porch, or sync length. For now we'll leave a single setting
2649 * here which allows a bit of tweaking of the pixel clock at the expense of
2650 * refresh rate.
2651 */
2652static const struct display_timing innolux_n116bge_timing = {
2653 .pixelclock = { 72600000, 76420000, 80240000 },
2654 .hactive = { 1366, 1366, 1366 },
2655 .hfront_porch = { 136, 136, 136 },
2656 .hback_porch = { 60, 60, 60 },
2657 .hsync_len = { 30, 30, 30 },
2658 .vactive = { 768, 768, 768 },
2659 .vfront_porch = { 8, 8, 8 },
2660 .vback_porch = { 12, 12, 12 },
2661 .vsync_len = { 12, 12, 12 },
2662 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002663};
2664
2665static const struct panel_desc innolux_n116bge = {
Douglas Andersond719cbe2019-07-11 13:34:54 -07002666 .timings = &innolux_n116bge_timing,
2667 .num_timings = 1,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002668 .bpc = 6,
2669 .size = {
2670 .width = 256,
2671 .height = 144,
2672 },
Heiko Stuebner87969bc2021-01-09 14:09:51 +01002673 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2674 .connector_type = DRM_MODE_CONNECTOR_eDP,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002675};
2676
Lukas F. Hartmanna14c6b02020-11-24 18:26:04 +01002677static const struct drm_display_mode innolux_n125hce_gn1_mode = {
2678 .clock = 162000,
2679 .hdisplay = 1920,
2680 .hsync_start = 1920 + 40,
2681 .hsync_end = 1920 + 40 + 40,
2682 .htotal = 1920 + 40 + 40 + 80,
2683 .vdisplay = 1080,
2684 .vsync_start = 1080 + 4,
2685 .vsync_end = 1080 + 4 + 4,
2686 .vtotal = 1080 + 4 + 4 + 24,
2687};
2688
2689static const struct panel_desc innolux_n125hce_gn1 = {
2690 .modes = &innolux_n125hce_gn1_mode,
2691 .num_modes = 1,
2692 .bpc = 8,
2693 .size = {
2694 .width = 276,
2695 .height = 155,
2696 },
2697 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2698 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
2699 .connector_type = DRM_MODE_CONNECTOR_eDP,
2700};
2701
Alban Bedelea447392014-07-22 08:38:55 +02002702static const struct drm_display_mode innolux_n156bge_l21_mode = {
2703 .clock = 69300,
2704 .hdisplay = 1366,
2705 .hsync_start = 1366 + 16,
2706 .hsync_end = 1366 + 16 + 34,
2707 .htotal = 1366 + 16 + 34 + 50,
2708 .vdisplay = 768,
2709 .vsync_start = 768 + 2,
2710 .vsync_end = 768 + 2 + 6,
2711 .vtotal = 768 + 2 + 6 + 12,
Alban Bedelea447392014-07-22 08:38:55 +02002712};
2713
2714static const struct panel_desc innolux_n156bge_l21 = {
2715 .modes = &innolux_n156bge_l21_mode,
2716 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002717 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02002718 .size = {
2719 .width = 344,
2720 .height = 193,
2721 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03002722 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002723 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03002724 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alban Bedelea447392014-07-22 08:38:55 +02002725};
2726
Douglas Anderson8f054b62018-10-25 15:21:34 -07002727static const struct drm_display_mode innolux_p120zdg_bf1_mode = {
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302728 .clock = 206016,
2729 .hdisplay = 2160,
2730 .hsync_start = 2160 + 48,
2731 .hsync_end = 2160 + 48 + 32,
2732 .htotal = 2160 + 48 + 32 + 80,
2733 .vdisplay = 1440,
2734 .vsync_start = 1440 + 3,
2735 .vsync_end = 1440 + 3 + 10,
2736 .vtotal = 1440 + 3 + 10 + 27,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302737 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2738};
2739
Douglas Anderson8f054b62018-10-25 15:21:34 -07002740static const struct panel_desc innolux_p120zdg_bf1 = {
2741 .modes = &innolux_p120zdg_bf1_mode,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302742 .num_modes = 1,
2743 .bpc = 8,
2744 .size = {
Douglas Anderson8f054b62018-10-25 15:21:34 -07002745 .width = 254,
2746 .height = 169,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302747 },
Sean Paul22fd99e2018-08-13 17:30:40 -04002748 .delay = {
Douglas Anderson625d3b52018-10-25 15:21:31 -07002749 .hpd_absent_delay = 200,
Sean Paul22fd99e2018-08-13 17:30:40 -04002750 .unprepare = 500,
2751 },
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302752};
2753
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002754static const struct drm_display_mode innolux_zj070na_01p_mode = {
2755 .clock = 51501,
2756 .hdisplay = 1024,
2757 .hsync_start = 1024 + 128,
2758 .hsync_end = 1024 + 128 + 64,
2759 .htotal = 1024 + 128 + 64 + 128,
2760 .vdisplay = 600,
2761 .vsync_start = 600 + 16,
2762 .vsync_end = 600 + 16 + 4,
2763 .vtotal = 600 + 16 + 4 + 16,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002764};
2765
2766static const struct panel_desc innolux_zj070na_01p = {
2767 .modes = &innolux_zj070na_01p_mode,
2768 .num_modes = 1,
2769 .bpc = 6,
2770 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02002771 .width = 154,
2772 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002773 },
2774};
2775
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07002776static const struct drm_display_mode ivo_m133nwf4_r0_mode = {
2777 .clock = 138778,
2778 .hdisplay = 1920,
2779 .hsync_start = 1920 + 24,
2780 .hsync_end = 1920 + 24 + 48,
2781 .htotal = 1920 + 24 + 48 + 88,
2782 .vdisplay = 1080,
2783 .vsync_start = 1080 + 3,
2784 .vsync_end = 1080 + 3 + 12,
2785 .vtotal = 1080 + 3 + 12 + 17,
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07002786 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2787};
2788
2789static const struct panel_desc ivo_m133nwf4_r0 = {
2790 .modes = &ivo_m133nwf4_r0_mode,
2791 .num_modes = 1,
2792 .bpc = 8,
2793 .size = {
2794 .width = 294,
2795 .height = 165,
2796 },
2797 .delay = {
2798 .hpd_absent_delay = 200,
2799 .unprepare = 500,
2800 },
2801 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2802 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
2803 .connector_type = DRM_MODE_CONNECTOR_eDP,
2804};
2805
Douglas Andersonfc26a372020-08-21 08:35:15 -07002806static const struct drm_display_mode kingdisplay_kd116n21_30nv_a010_mode = {
2807 .clock = 81000,
2808 .hdisplay = 1366,
2809 .hsync_start = 1366 + 40,
2810 .hsync_end = 1366 + 40 + 32,
2811 .htotal = 1366 + 40 + 32 + 62,
2812 .vdisplay = 768,
2813 .vsync_start = 768 + 5,
2814 .vsync_end = 768 + 5 + 5,
2815 .vtotal = 768 + 5 + 5 + 122,
2816 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2817};
2818
2819static const struct panel_desc kingdisplay_kd116n21_30nv_a010 = {
2820 .modes = &kingdisplay_kd116n21_30nv_a010_mode,
2821 .num_modes = 1,
2822 .bpc = 6,
2823 .size = {
2824 .width = 256,
2825 .height = 144,
2826 },
2827 .delay = {
2828 .hpd_absent_delay = 200,
2829 },
2830 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2831 .connector_type = DRM_MODE_CONNECTOR_eDP,
2832};
2833
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02002834static const struct display_timing koe_tx14d24vm1bpa_timing = {
2835 .pixelclock = { 5580000, 5850000, 6200000 },
2836 .hactive = { 320, 320, 320 },
2837 .hfront_porch = { 30, 30, 30 },
2838 .hback_porch = { 30, 30, 30 },
2839 .hsync_len = { 1, 5, 17 },
2840 .vactive = { 240, 240, 240 },
2841 .vfront_porch = { 6, 6, 6 },
2842 .vback_porch = { 5, 5, 5 },
2843 .vsync_len = { 1, 2, 11 },
2844 .flags = DISPLAY_FLAGS_DE_HIGH,
2845};
2846
2847static const struct panel_desc koe_tx14d24vm1bpa = {
2848 .timings = &koe_tx14d24vm1bpa_timing,
2849 .num_timings = 1,
2850 .bpc = 6,
2851 .size = {
2852 .width = 115,
2853 .height = 86,
2854 },
2855};
2856
Liu Ying8a070522020-06-01 14:11:20 +08002857static const struct display_timing koe_tx26d202vm0bwa_timing = {
2858 .pixelclock = { 151820000, 156720000, 159780000 },
2859 .hactive = { 1920, 1920, 1920 },
2860 .hfront_porch = { 105, 130, 142 },
2861 .hback_porch = { 45, 70, 82 },
2862 .hsync_len = { 30, 30, 30 },
2863 .vactive = { 1200, 1200, 1200},
2864 .vfront_porch = { 3, 5, 10 },
2865 .vback_porch = { 2, 5, 10 },
2866 .vsync_len = { 5, 5, 5 },
2867};
2868
2869static const struct panel_desc koe_tx26d202vm0bwa = {
2870 .timings = &koe_tx26d202vm0bwa_timing,
2871 .num_timings = 1,
2872 .bpc = 8,
2873 .size = {
2874 .width = 217,
2875 .height = 136,
2876 },
2877 .delay = {
2878 .prepare = 1000,
2879 .enable = 1000,
2880 .unprepare = 1000,
2881 .disable = 1000,
2882 },
2883 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002884 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Liu Ying8a070522020-06-01 14:11:20 +08002885 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2886};
2887
Jagan Teki8cfe8342018-02-04 23:19:28 +05302888static const struct display_timing koe_tx31d200vm0baa_timing = {
2889 .pixelclock = { 39600000, 43200000, 48000000 },
2890 .hactive = { 1280, 1280, 1280 },
2891 .hfront_porch = { 16, 36, 56 },
2892 .hback_porch = { 16, 36, 56 },
2893 .hsync_len = { 8, 8, 8 },
2894 .vactive = { 480, 480, 480 },
Stefan Agnerc9b6be72018-04-19 23:20:03 +02002895 .vfront_porch = { 6, 21, 33 },
2896 .vback_porch = { 6, 21, 33 },
Jagan Teki8cfe8342018-02-04 23:19:28 +05302897 .vsync_len = { 8, 8, 8 },
2898 .flags = DISPLAY_FLAGS_DE_HIGH,
2899};
2900
2901static const struct panel_desc koe_tx31d200vm0baa = {
2902 .timings = &koe_tx31d200vm0baa_timing,
2903 .num_timings = 1,
2904 .bpc = 6,
2905 .size = {
2906 .width = 292,
2907 .height = 109,
2908 },
2909 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002910 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Jagan Teki8cfe8342018-02-04 23:19:28 +05302911};
2912
Lucas Stach8def22e2015-12-02 19:41:11 +01002913static const struct display_timing kyo_tcg121xglp_timing = {
2914 .pixelclock = { 52000000, 65000000, 71000000 },
2915 .hactive = { 1024, 1024, 1024 },
2916 .hfront_porch = { 2, 2, 2 },
2917 .hback_porch = { 2, 2, 2 },
2918 .hsync_len = { 86, 124, 244 },
2919 .vactive = { 768, 768, 768 },
2920 .vfront_porch = { 2, 2, 2 },
2921 .vback_porch = { 2, 2, 2 },
2922 .vsync_len = { 6, 34, 73 },
2923 .flags = DISPLAY_FLAGS_DE_HIGH,
2924};
2925
2926static const struct panel_desc kyo_tcg121xglp = {
2927 .timings = &kyo_tcg121xglp_timing,
2928 .num_timings = 1,
2929 .bpc = 8,
2930 .size = {
2931 .width = 246,
2932 .height = 184,
2933 },
2934 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002935 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8def22e2015-12-02 19:41:11 +01002936};
2937
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002938static const struct drm_display_mode lemaker_bl035_rgb_002_mode = {
2939 .clock = 7000,
2940 .hdisplay = 320,
2941 .hsync_start = 320 + 20,
2942 .hsync_end = 320 + 20 + 30,
2943 .htotal = 320 + 20 + 30 + 38,
2944 .vdisplay = 240,
2945 .vsync_start = 240 + 4,
2946 .vsync_end = 240 + 4 + 3,
2947 .vtotal = 240 + 4 + 3 + 15,
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002948};
2949
2950static const struct panel_desc lemaker_bl035_rgb_002 = {
2951 .modes = &lemaker_bl035_rgb_002_mode,
2952 .num_modes = 1,
2953 .size = {
2954 .width = 70,
2955 .height = 52,
2956 },
2957 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2958 .bus_flags = DRM_BUS_FLAG_DE_LOW,
2959};
2960
Heiko Schocherdd015002015-05-22 10:25:57 +02002961static const struct drm_display_mode lg_lb070wv8_mode = {
2962 .clock = 33246,
2963 .hdisplay = 800,
2964 .hsync_start = 800 + 88,
2965 .hsync_end = 800 + 88 + 80,
2966 .htotal = 800 + 88 + 80 + 88,
2967 .vdisplay = 480,
2968 .vsync_start = 480 + 10,
2969 .vsync_end = 480 + 10 + 25,
2970 .vtotal = 480 + 10 + 25 + 10,
Heiko Schocherdd015002015-05-22 10:25:57 +02002971};
2972
2973static const struct panel_desc lg_lb070wv8 = {
2974 .modes = &lg_lb070wv8_mode,
2975 .num_modes = 1,
Laurent Pincharta6ae2fe2020-07-12 01:53:17 +03002976 .bpc = 8,
Heiko Schocherdd015002015-05-22 10:25:57 +02002977 .size = {
2978 .width = 151,
2979 .height = 91,
2980 },
2981 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002982 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Heiko Schocherdd015002015-05-22 10:25:57 +02002983};
2984
Yakir Yangc5ece402016-06-28 12:51:15 +08002985static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
2986 .clock = 200000,
2987 .hdisplay = 1536,
2988 .hsync_start = 1536 + 12,
2989 .hsync_end = 1536 + 12 + 16,
2990 .htotal = 1536 + 12 + 16 + 48,
2991 .vdisplay = 2048,
2992 .vsync_start = 2048 + 8,
2993 .vsync_end = 2048 + 8 + 4,
2994 .vtotal = 2048 + 8 + 4 + 8,
Yakir Yangc5ece402016-06-28 12:51:15 +08002995 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2996};
2997
2998static const struct panel_desc lg_lp079qx1_sp0v = {
2999 .modes = &lg_lp079qx1_sp0v_mode,
3000 .num_modes = 1,
3001 .size = {
3002 .width = 129,
3003 .height = 171,
3004 },
3005};
3006
Yakir Yang0355dde2016-06-12 10:56:02 +08003007static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
3008 .clock = 205210,
3009 .hdisplay = 2048,
3010 .hsync_start = 2048 + 150,
3011 .hsync_end = 2048 + 150 + 5,
3012 .htotal = 2048 + 150 + 5 + 5,
3013 .vdisplay = 1536,
3014 .vsync_start = 1536 + 3,
3015 .vsync_end = 1536 + 3 + 1,
3016 .vtotal = 1536 + 3 + 1 + 9,
Yakir Yang0355dde2016-06-12 10:56:02 +08003017};
3018
3019static const struct panel_desc lg_lp097qx1_spa1 = {
3020 .modes = &lg_lp097qx1_spa1_mode,
3021 .num_modes = 1,
3022 .size = {
3023 .width = 208,
3024 .height = 147,
3025 },
3026};
3027
Jitao Shi690d8fa2016-02-22 19:01:44 +08003028static const struct drm_display_mode lg_lp120up1_mode = {
3029 .clock = 162300,
3030 .hdisplay = 1920,
3031 .hsync_start = 1920 + 40,
3032 .hsync_end = 1920 + 40 + 40,
3033 .htotal = 1920 + 40 + 40+ 80,
3034 .vdisplay = 1280,
3035 .vsync_start = 1280 + 4,
3036 .vsync_end = 1280 + 4 + 4,
3037 .vtotal = 1280 + 4 + 4 + 12,
Jitao Shi690d8fa2016-02-22 19:01:44 +08003038};
3039
3040static const struct panel_desc lg_lp120up1 = {
3041 .modes = &lg_lp120up1_mode,
3042 .num_modes = 1,
3043 .bpc = 8,
3044 .size = {
3045 .width = 267,
3046 .height = 183,
3047 },
Enric Balletbo i Serrad53139b2020-04-16 18:44:03 +02003048 .connector_type = DRM_MODE_CONNECTOR_eDP,
Jitao Shi690d8fa2016-02-22 19:01:44 +08003049};
3050
Thierry Redingec7c5652013-11-15 15:59:32 +01003051static const struct drm_display_mode lg_lp129qe_mode = {
3052 .clock = 285250,
3053 .hdisplay = 2560,
3054 .hsync_start = 2560 + 48,
3055 .hsync_end = 2560 + 48 + 32,
3056 .htotal = 2560 + 48 + 32 + 80,
3057 .vdisplay = 1700,
3058 .vsync_start = 1700 + 3,
3059 .vsync_end = 1700 + 3 + 10,
3060 .vtotal = 1700 + 3 + 10 + 36,
Thierry Redingec7c5652013-11-15 15:59:32 +01003061};
3062
3063static const struct panel_desc lg_lp129qe = {
3064 .modes = &lg_lp129qe_mode,
3065 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07003066 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01003067 .size = {
3068 .width = 272,
3069 .height = 181,
3070 },
3071};
3072
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01003073static const struct display_timing logictechno_lt161010_2nh_timing = {
3074 .pixelclock = { 26400000, 33300000, 46800000 },
3075 .hactive = { 800, 800, 800 },
3076 .hfront_porch = { 16, 210, 354 },
3077 .hback_porch = { 46, 46, 46 },
3078 .hsync_len = { 1, 20, 40 },
3079 .vactive = { 480, 480, 480 },
3080 .vfront_porch = { 7, 22, 147 },
3081 .vback_porch = { 23, 23, 23 },
3082 .vsync_len = { 1, 10, 20 },
3083 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
3084 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
3085 DISPLAY_FLAGS_SYNC_POSEDGE,
3086};
3087
3088static const struct panel_desc logictechno_lt161010_2nh = {
3089 .timings = &logictechno_lt161010_2nh_timing,
3090 .num_timings = 1,
3091 .size = {
3092 .width = 154,
3093 .height = 86,
3094 },
3095 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3096 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
3097 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
3098 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
3099 .connector_type = DRM_MODE_CONNECTOR_DPI,
3100};
3101
3102static const struct display_timing logictechno_lt170410_2whc_timing = {
3103 .pixelclock = { 68900000, 71100000, 73400000 },
3104 .hactive = { 1280, 1280, 1280 },
3105 .hfront_porch = { 23, 60, 71 },
3106 .hback_porch = { 23, 60, 71 },
3107 .hsync_len = { 15, 40, 47 },
3108 .vactive = { 800, 800, 800 },
3109 .vfront_porch = { 5, 7, 10 },
3110 .vback_porch = { 5, 7, 10 },
3111 .vsync_len = { 6, 9, 12 },
3112 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
3113 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
3114 DISPLAY_FLAGS_SYNC_POSEDGE,
3115};
3116
3117static const struct panel_desc logictechno_lt170410_2whc = {
3118 .timings = &logictechno_lt170410_2whc_timing,
3119 .num_timings = 1,
3120 .size = {
3121 .width = 217,
3122 .height = 136,
3123 },
3124 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003125 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01003126 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3127};
3128
Lukasz Majewski65c766c2017-10-21 00:18:37 +02003129static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
3130 .clock = 30400,
3131 .hdisplay = 800,
3132 .hsync_start = 800 + 0,
3133 .hsync_end = 800 + 1,
3134 .htotal = 800 + 0 + 1 + 160,
3135 .vdisplay = 480,
3136 .vsync_start = 480 + 0,
3137 .vsync_end = 480 + 48 + 1,
3138 .vtotal = 480 + 48 + 1 + 0,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02003139 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
3140};
3141
Adam Ford0d354082019-10-16 08:51:45 -05003142static const struct drm_display_mode logicpd_type_28_mode = {
Ville Syrjäläf873c5d2020-03-02 22:34:40 +02003143 .clock = 9107,
Adam Ford0d354082019-10-16 08:51:45 -05003144 .hdisplay = 480,
3145 .hsync_start = 480 + 3,
3146 .hsync_end = 480 + 3 + 42,
3147 .htotal = 480 + 3 + 42 + 2,
3148
3149 .vdisplay = 272,
3150 .vsync_start = 272 + 2,
3151 .vsync_end = 272 + 2 + 11,
3152 .vtotal = 272 + 2 + 11 + 3,
Adam Ford0d354082019-10-16 08:51:45 -05003153 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3154};
3155
3156static const struct panel_desc logicpd_type_28 = {
3157 .modes = &logicpd_type_28_mode,
3158 .num_modes = 1,
3159 .bpc = 8,
3160 .size = {
3161 .width = 105,
3162 .height = 67,
3163 },
3164 .delay = {
3165 .prepare = 200,
3166 .enable = 200,
3167 .unprepare = 200,
3168 .disable = 200,
3169 },
3170 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3171 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3172 DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
Adam Fordefb94792020-06-15 08:19:34 -05003173 .connector_type = DRM_MODE_CONNECTOR_DPI,
Adam Ford0d354082019-10-16 08:51:45 -05003174};
3175
Lukasz Majewski65c766c2017-10-21 00:18:37 +02003176static const struct panel_desc mitsubishi_aa070mc01 = {
3177 .modes = &mitsubishi_aa070mc01_mode,
3178 .num_modes = 1,
3179 .bpc = 8,
3180 .size = {
3181 .width = 152,
3182 .height = 91,
3183 },
3184
3185 .delay = {
3186 .enable = 200,
3187 .unprepare = 200,
3188 .disable = 400,
3189 },
3190 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003191 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02003192 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
3193};
3194
Lucas Stach01bacc132017-06-08 20:07:55 +02003195static const struct display_timing nec_nl12880bc20_05_timing = {
3196 .pixelclock = { 67000000, 71000000, 75000000 },
3197 .hactive = { 1280, 1280, 1280 },
3198 .hfront_porch = { 2, 30, 30 },
3199 .hback_porch = { 6, 100, 100 },
3200 .hsync_len = { 2, 30, 30 },
3201 .vactive = { 800, 800, 800 },
3202 .vfront_porch = { 5, 5, 5 },
3203 .vback_porch = { 11, 11, 11 },
3204 .vsync_len = { 7, 7, 7 },
3205};
3206
3207static const struct panel_desc nec_nl12880bc20_05 = {
3208 .timings = &nec_nl12880bc20_05_timing,
3209 .num_timings = 1,
3210 .bpc = 8,
3211 .size = {
3212 .width = 261,
3213 .height = 163,
3214 },
3215 .delay = {
3216 .enable = 50,
3217 .disable = 50,
3218 },
3219 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003220 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach01bacc132017-06-08 20:07:55 +02003221};
3222
jianwei wangc6e87f92015-07-29 16:30:02 +08003223static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
3224 .clock = 10870,
3225 .hdisplay = 480,
3226 .hsync_start = 480 + 2,
3227 .hsync_end = 480 + 2 + 41,
3228 .htotal = 480 + 2 + 41 + 2,
3229 .vdisplay = 272,
3230 .vsync_start = 272 + 2,
3231 .vsync_end = 272 + 2 + 4,
3232 .vtotal = 272 + 2 + 4 + 2,
Stefan Agner4bc390c2015-11-17 19:10:29 -08003233 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08003234};
3235
3236static const struct panel_desc nec_nl4827hc19_05b = {
3237 .modes = &nec_nl4827hc19_05b_mode,
3238 .num_modes = 1,
3239 .bpc = 8,
3240 .size = {
3241 .width = 95,
3242 .height = 54,
3243 },
Stefan Agner2c806612016-02-08 12:50:13 -08003244 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003245 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08003246};
3247
Maxime Riparde6c2f062016-09-06 16:46:17 +02003248static const struct drm_display_mode netron_dy_e231732_mode = {
3249 .clock = 66000,
3250 .hdisplay = 1024,
3251 .hsync_start = 1024 + 160,
3252 .hsync_end = 1024 + 160 + 70,
3253 .htotal = 1024 + 160 + 70 + 90,
3254 .vdisplay = 600,
3255 .vsync_start = 600 + 127,
3256 .vsync_end = 600 + 127 + 20,
3257 .vtotal = 600 + 127 + 20 + 3,
Maxime Riparde6c2f062016-09-06 16:46:17 +02003258};
3259
3260static const struct panel_desc netron_dy_e231732 = {
3261 .modes = &netron_dy_e231732_mode,
3262 .num_modes = 1,
3263 .size = {
3264 .width = 154,
3265 .height = 87,
3266 },
3267 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3268};
3269
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08003270static const struct drm_display_mode neweast_wjfh116008a_modes[] = {
3271 {
3272 .clock = 138500,
3273 .hdisplay = 1920,
3274 .hsync_start = 1920 + 48,
3275 .hsync_end = 1920 + 48 + 32,
3276 .htotal = 1920 + 48 + 32 + 80,
3277 .vdisplay = 1080,
3278 .vsync_start = 1080 + 3,
3279 .vsync_end = 1080 + 3 + 5,
3280 .vtotal = 1080 + 3 + 5 + 23,
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08003281 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3282 }, {
3283 .clock = 110920,
3284 .hdisplay = 1920,
3285 .hsync_start = 1920 + 48,
3286 .hsync_end = 1920 + 48 + 32,
3287 .htotal = 1920 + 48 + 32 + 80,
3288 .vdisplay = 1080,
3289 .vsync_start = 1080 + 3,
3290 .vsync_end = 1080 + 3 + 5,
3291 .vtotal = 1080 + 3 + 5 + 23,
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08003292 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3293 }
3294};
3295
3296static const struct panel_desc neweast_wjfh116008a = {
3297 .modes = neweast_wjfh116008a_modes,
3298 .num_modes = 2,
3299 .bpc = 6,
3300 .size = {
3301 .width = 260,
3302 .height = 150,
3303 },
3304 .delay = {
3305 .prepare = 110,
3306 .enable = 20,
3307 .unprepare = 500,
3308 },
3309 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3310 .connector_type = DRM_MODE_CONNECTOR_eDP,
3311};
3312
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003313static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
3314 .clock = 9000,
3315 .hdisplay = 480,
3316 .hsync_start = 480 + 2,
3317 .hsync_end = 480 + 2 + 41,
3318 .htotal = 480 + 2 + 41 + 2,
3319 .vdisplay = 272,
3320 .vsync_start = 272 + 2,
3321 .vsync_end = 272 + 2 + 10,
3322 .vtotal = 272 + 2 + 10 + 2,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003323 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3324};
3325
3326static const struct panel_desc newhaven_nhd_43_480272ef_atxl = {
3327 .modes = &newhaven_nhd_43_480272ef_atxl_mode,
3328 .num_modes = 1,
3329 .bpc = 8,
3330 .size = {
3331 .width = 95,
3332 .height = 54,
3333 },
3334 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003335 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3336 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Tomi Valkeinen8a4f5e12020-06-09 13:28:09 +03003337 .connector_type = DRM_MODE_CONNECTOR_DPI,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003338};
3339
Lucas Stach4177fa62017-06-08 20:07:57 +02003340static const struct display_timing nlt_nl192108ac18_02d_timing = {
3341 .pixelclock = { 130000000, 148350000, 163000000 },
3342 .hactive = { 1920, 1920, 1920 },
3343 .hfront_porch = { 80, 100, 100 },
3344 .hback_porch = { 100, 120, 120 },
3345 .hsync_len = { 50, 60, 60 },
3346 .vactive = { 1080, 1080, 1080 },
3347 .vfront_porch = { 12, 30, 30 },
3348 .vback_porch = { 4, 10, 10 },
3349 .vsync_len = { 4, 5, 5 },
3350};
3351
3352static const struct panel_desc nlt_nl192108ac18_02d = {
3353 .timings = &nlt_nl192108ac18_02d_timing,
3354 .num_timings = 1,
3355 .bpc = 8,
3356 .size = {
3357 .width = 344,
3358 .height = 194,
3359 },
3360 .delay = {
3361 .unprepare = 500,
3362 },
3363 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003364 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach4177fa62017-06-08 20:07:57 +02003365};
3366
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02003367static const struct drm_display_mode nvd_9128_mode = {
3368 .clock = 29500,
3369 .hdisplay = 800,
3370 .hsync_start = 800 + 130,
3371 .hsync_end = 800 + 130 + 98,
3372 .htotal = 800 + 0 + 130 + 98,
3373 .vdisplay = 480,
3374 .vsync_start = 480 + 10,
3375 .vsync_end = 480 + 10 + 50,
3376 .vtotal = 480 + 0 + 10 + 50,
3377};
3378
3379static const struct panel_desc nvd_9128 = {
3380 .modes = &nvd_9128_mode,
3381 .num_modes = 1,
3382 .bpc = 8,
3383 .size = {
3384 .width = 156,
3385 .height = 88,
3386 },
3387 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003388 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02003389};
3390
Gary Bissona99fb622015-06-10 18:44:23 +02003391static const struct display_timing okaya_rs800480t_7x0gp_timing = {
3392 .pixelclock = { 30000000, 30000000, 40000000 },
3393 .hactive = { 800, 800, 800 },
3394 .hfront_porch = { 40, 40, 40 },
3395 .hback_porch = { 40, 40, 40 },
3396 .hsync_len = { 1, 48, 48 },
3397 .vactive = { 480, 480, 480 },
3398 .vfront_porch = { 13, 13, 13 },
3399 .vback_porch = { 29, 29, 29 },
3400 .vsync_len = { 3, 3, 3 },
3401 .flags = DISPLAY_FLAGS_DE_HIGH,
3402};
3403
3404static const struct panel_desc okaya_rs800480t_7x0gp = {
3405 .timings = &okaya_rs800480t_7x0gp_timing,
3406 .num_timings = 1,
3407 .bpc = 6,
3408 .size = {
3409 .width = 154,
3410 .height = 87,
3411 },
3412 .delay = {
3413 .prepare = 41,
3414 .enable = 50,
3415 .unprepare = 41,
3416 .disable = 50,
3417 },
3418 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3419};
3420
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003421static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
3422 .clock = 9000,
3423 .hdisplay = 480,
3424 .hsync_start = 480 + 5,
3425 .hsync_end = 480 + 5 + 30,
3426 .htotal = 480 + 5 + 30 + 10,
3427 .vdisplay = 272,
3428 .vsync_start = 272 + 8,
3429 .vsync_end = 272 + 8 + 5,
3430 .vtotal = 272 + 8 + 5 + 3,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003431};
3432
3433static const struct panel_desc olimex_lcd_olinuxino_43ts = {
3434 .modes = &olimex_lcd_olinuxino_43ts_mode,
3435 .num_modes = 1,
3436 .size = {
Jonathan Liu30c6d7ab92017-07-20 20:29:43 +10003437 .width = 95,
3438 .height = 54,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003439 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10003440 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003441};
3442
Eric Anholte8b6f562016-03-24 17:23:48 -07003443/*
3444 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
3445 * pixel clocks, but this is the timing that was being used in the Adafruit
3446 * installation instructions.
3447 */
3448static const struct drm_display_mode ontat_yx700wv03_mode = {
3449 .clock = 29500,
3450 .hdisplay = 800,
3451 .hsync_start = 824,
3452 .hsync_end = 896,
3453 .htotal = 992,
3454 .vdisplay = 480,
3455 .vsync_start = 483,
3456 .vsync_end = 493,
3457 .vtotal = 500,
Eric Anholte8b6f562016-03-24 17:23:48 -07003458 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3459};
3460
3461/*
3462 * Specification at:
3463 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
3464 */
3465static const struct panel_desc ontat_yx700wv03 = {
3466 .modes = &ontat_yx700wv03_mode,
3467 .num_modes = 1,
3468 .bpc = 8,
3469 .size = {
3470 .width = 154,
3471 .height = 83,
3472 },
Eric Anholt5651e5e2018-03-09 15:33:32 -08003473 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Eric Anholte8b6f562016-03-24 17:23:48 -07003474};
3475
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003476static const struct drm_display_mode ortustech_com37h3m_mode = {
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003477 .clock = 22230,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003478 .hdisplay = 480,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003479 .hsync_start = 480 + 40,
3480 .hsync_end = 480 + 40 + 10,
3481 .htotal = 480 + 40 + 10 + 40,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003482 .vdisplay = 640,
3483 .vsync_start = 640 + 4,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003484 .vsync_end = 640 + 4 + 2,
3485 .vtotal = 640 + 4 + 2 + 4,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003486 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3487};
3488
3489static const struct panel_desc ortustech_com37h3m = {
3490 .modes = &ortustech_com37h3m_mode,
3491 .num_modes = 1,
3492 .bpc = 8,
3493 .size = {
3494 .width = 56, /* 56.16mm */
3495 .height = 75, /* 74.88mm */
3496 },
3497 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003498 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003499 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
3500};
3501
Philipp Zabel725c9d42015-02-11 18:50:11 +01003502static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
3503 .clock = 25000,
3504 .hdisplay = 480,
3505 .hsync_start = 480 + 10,
3506 .hsync_end = 480 + 10 + 10,
3507 .htotal = 480 + 10 + 10 + 15,
3508 .vdisplay = 800,
3509 .vsync_start = 800 + 3,
3510 .vsync_end = 800 + 3 + 3,
3511 .vtotal = 800 + 3 + 3 + 3,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003512};
3513
3514static const struct panel_desc ortustech_com43h4m85ulc = {
3515 .modes = &ortustech_com43h4m85ulc_mode,
3516 .num_modes = 1,
Laurent Pinchart3b809512020-08-24 03:32:54 +03003517 .bpc = 6,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003518 .size = {
3519 .width = 56,
3520 .height = 93,
3521 },
Laurent Pinchartf098f162020-08-13 01:02:44 +03003522 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003523 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Laurent Pinchart2ccedf42020-03-09 20:42:10 +02003524 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003525};
3526
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003527static const struct drm_display_mode osddisplays_osd070t1718_19ts_mode = {
3528 .clock = 33000,
3529 .hdisplay = 800,
3530 .hsync_start = 800 + 210,
3531 .hsync_end = 800 + 210 + 30,
3532 .htotal = 800 + 210 + 30 + 16,
3533 .vdisplay = 480,
3534 .vsync_start = 480 + 22,
3535 .vsync_end = 480 + 22 + 13,
3536 .vtotal = 480 + 22 + 13 + 10,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003537 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3538};
3539
3540static const struct panel_desc osddisplays_osd070t1718_19ts = {
3541 .modes = &osddisplays_osd070t1718_19ts_mode,
3542 .num_modes = 1,
3543 .bpc = 8,
3544 .size = {
3545 .width = 152,
3546 .height = 91,
3547 },
3548 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Tomi Valkeinenfb0629e2019-11-14 11:39:50 +02003549 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3550 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Laurent Pincharta793f0e2019-09-04 16:37:23 +03003551 .connector_type = DRM_MODE_CONNECTOR_DPI,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003552};
3553
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003554static const struct drm_display_mode pda_91_00156_a0_mode = {
3555 .clock = 33300,
3556 .hdisplay = 800,
3557 .hsync_start = 800 + 1,
3558 .hsync_end = 800 + 1 + 64,
3559 .htotal = 800 + 1 + 64 + 64,
3560 .vdisplay = 480,
3561 .vsync_start = 480 + 1,
3562 .vsync_end = 480 + 1 + 23,
3563 .vtotal = 480 + 1 + 23 + 22,
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003564};
3565
3566static const struct panel_desc pda_91_00156_a0 = {
3567 .modes = &pda_91_00156_a0_mode,
3568 .num_modes = 1,
3569 .size = {
3570 .width = 152,
3571 .height = 91,
3572 },
3573 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3574};
3575
Marek Vasutd69de692020-07-28 14:12:46 +02003576static const struct drm_display_mode powertip_ph800480t013_idf02_mode = {
3577 .clock = 24750,
3578 .hdisplay = 800,
3579 .hsync_start = 800 + 54,
3580 .hsync_end = 800 + 54 + 2,
3581 .htotal = 800 + 54 + 2 + 44,
3582 .vdisplay = 480,
3583 .vsync_start = 480 + 49,
3584 .vsync_end = 480 + 49 + 2,
3585 .vtotal = 480 + 49 + 2 + 22,
3586};
3587
3588static const struct panel_desc powertip_ph800480t013_idf02 = {
3589 .modes = &powertip_ph800480t013_idf02_mode,
3590 .num_modes = 1,
3591 .size = {
3592 .width = 152,
3593 .height = 91,
3594 },
3595 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
3596 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
3597 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
3598 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3599 .connector_type = DRM_MODE_CONNECTOR_DPI,
3600};
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003601
Josh Wud2a6f0f2015-10-08 17:42:41 +02003602static const struct drm_display_mode qd43003c0_40_mode = {
3603 .clock = 9000,
3604 .hdisplay = 480,
3605 .hsync_start = 480 + 8,
3606 .hsync_end = 480 + 8 + 4,
3607 .htotal = 480 + 8 + 4 + 39,
3608 .vdisplay = 272,
3609 .vsync_start = 272 + 4,
3610 .vsync_end = 272 + 4 + 10,
3611 .vtotal = 272 + 4 + 10 + 2,
Josh Wud2a6f0f2015-10-08 17:42:41 +02003612};
3613
3614static const struct panel_desc qd43003c0_40 = {
3615 .modes = &qd43003c0_40_mode,
3616 .num_modes = 1,
3617 .bpc = 8,
3618 .size = {
3619 .width = 95,
3620 .height = 53,
3621 },
3622 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3623};
3624
Artjom Vejsel49179e62021-08-04 03:23:53 +03003625static const struct drm_display_mode qishenglong_gopher2b_lcd_modes[] = {
3626 { /* 60 Hz */
3627 .clock = 10800,
3628 .hdisplay = 480,
3629 .hsync_start = 480 + 77,
3630 .hsync_end = 480 + 77 + 41,
3631 .htotal = 480 + 77 + 41 + 2,
3632 .vdisplay = 272,
3633 .vsync_start = 272 + 16,
3634 .vsync_end = 272 + 16 + 10,
3635 .vtotal = 272 + 16 + 10 + 2,
3636 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3637 },
3638 { /* 50 Hz */
3639 .clock = 10800,
3640 .hdisplay = 480,
3641 .hsync_start = 480 + 17,
3642 .hsync_end = 480 + 17 + 41,
3643 .htotal = 480 + 17 + 41 + 2,
3644 .vdisplay = 272,
3645 .vsync_start = 272 + 116,
3646 .vsync_end = 272 + 116 + 10,
3647 .vtotal = 272 + 116 + 10 + 2,
3648 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3649 },
3650};
3651
3652static const struct panel_desc qishenglong_gopher2b_lcd = {
3653 .modes = qishenglong_gopher2b_lcd_modes,
3654 .num_modes = ARRAY_SIZE(qishenglong_gopher2b_lcd_modes),
3655 .bpc = 8,
3656 .size = {
3657 .width = 95,
3658 .height = 54,
3659 },
3660 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3661 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
3662 .connector_type = DRM_MODE_CONNECTOR_DPI,
3663};
3664
Jagan Teki23167fa2018-06-07 19:16:48 +05303665static const struct display_timing rocktech_rk070er9427_timing = {
3666 .pixelclock = { 26400000, 33300000, 46800000 },
3667 .hactive = { 800, 800, 800 },
3668 .hfront_porch = { 16, 210, 354 },
3669 .hback_porch = { 46, 46, 46 },
3670 .hsync_len = { 1, 1, 1 },
3671 .vactive = { 480, 480, 480 },
3672 .vfront_porch = { 7, 22, 147 },
3673 .vback_porch = { 23, 23, 23 },
3674 .vsync_len = { 1, 1, 1 },
3675 .flags = DISPLAY_FLAGS_DE_HIGH,
3676};
3677
3678static const struct panel_desc rocktech_rk070er9427 = {
3679 .timings = &rocktech_rk070er9427_timing,
3680 .num_timings = 1,
3681 .bpc = 6,
3682 .size = {
3683 .width = 154,
3684 .height = 86,
3685 },
3686 .delay = {
3687 .prepare = 41,
3688 .enable = 50,
3689 .unprepare = 41,
3690 .disable = 50,
3691 },
3692 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3693};
3694
Jyri Sarhaf3050472020-02-11 14:17:18 +02003695static const struct drm_display_mode rocktech_rk101ii01d_ct_mode = {
3696 .clock = 71100,
3697 .hdisplay = 1280,
3698 .hsync_start = 1280 + 48,
3699 .hsync_end = 1280 + 48 + 32,
3700 .htotal = 1280 + 48 + 32 + 80,
3701 .vdisplay = 800,
3702 .vsync_start = 800 + 2,
3703 .vsync_end = 800 + 2 + 5,
3704 .vtotal = 800 + 2 + 5 + 16,
Jyri Sarhaf3050472020-02-11 14:17:18 +02003705};
3706
3707static const struct panel_desc rocktech_rk101ii01d_ct = {
3708 .modes = &rocktech_rk101ii01d_ct_mode,
3709 .num_modes = 1,
3710 .size = {
3711 .width = 217,
3712 .height = 136,
3713 },
3714 .delay = {
3715 .prepare = 50,
3716 .disable = 50,
3717 },
3718 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
3719 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3720 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3721};
3722
Yakir Yang0330eaf2016-06-12 10:56:13 +08003723static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
3724 .clock = 271560,
3725 .hdisplay = 2560,
3726 .hsync_start = 2560 + 48,
3727 .hsync_end = 2560 + 48 + 32,
3728 .htotal = 2560 + 48 + 32 + 80,
3729 .vdisplay = 1600,
3730 .vsync_start = 1600 + 2,
3731 .vsync_end = 1600 + 2 + 5,
3732 .vtotal = 1600 + 2 + 5 + 57,
Yakir Yang0330eaf2016-06-12 10:56:13 +08003733};
3734
3735static const struct panel_desc samsung_lsn122dl01_c01 = {
3736 .modes = &samsung_lsn122dl01_c01_mode,
3737 .num_modes = 1,
3738 .size = {
3739 .width = 263,
3740 .height = 164,
3741 },
3742};
3743
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003744static const struct drm_display_mode samsung_ltn101nt05_mode = {
3745 .clock = 54030,
3746 .hdisplay = 1024,
3747 .hsync_start = 1024 + 24,
3748 .hsync_end = 1024 + 24 + 136,
3749 .htotal = 1024 + 24 + 136 + 160,
3750 .vdisplay = 600,
3751 .vsync_start = 600 + 3,
3752 .vsync_end = 600 + 3 + 6,
3753 .vtotal = 600 + 3 + 6 + 61,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003754};
3755
3756static const struct panel_desc samsung_ltn101nt05 = {
3757 .modes = &samsung_ltn101nt05_mode,
3758 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07003759 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003760 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02003761 .width = 223,
3762 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003763 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03003764 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003765 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03003766 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003767};
3768
Stéphane Marchesin0c934302015-03-18 10:52:18 +01003769static const struct drm_display_mode samsung_ltn140at29_301_mode = {
3770 .clock = 76300,
3771 .hdisplay = 1366,
3772 .hsync_start = 1366 + 64,
3773 .hsync_end = 1366 + 64 + 48,
3774 .htotal = 1366 + 64 + 48 + 128,
3775 .vdisplay = 768,
3776 .vsync_start = 768 + 2,
3777 .vsync_end = 768 + 2 + 5,
3778 .vtotal = 768 + 2 + 5 + 17,
Stéphane Marchesin0c934302015-03-18 10:52:18 +01003779};
3780
3781static const struct panel_desc samsung_ltn140at29_301 = {
3782 .modes = &samsung_ltn140at29_301_mode,
3783 .num_modes = 1,
3784 .bpc = 6,
3785 .size = {
3786 .width = 320,
3787 .height = 187,
3788 },
3789};
3790
Miquel Raynal44c58c52020-01-09 19:40:37 +01003791static const struct display_timing satoz_sat050at40h12r2_timing = {
3792 .pixelclock = {33300000, 33300000, 50000000},
3793 .hactive = {800, 800, 800},
3794 .hfront_porch = {16, 210, 354},
3795 .hback_porch = {46, 46, 46},
3796 .hsync_len = {1, 1, 40},
3797 .vactive = {480, 480, 480},
3798 .vfront_porch = {7, 22, 147},
3799 .vback_porch = {23, 23, 23},
3800 .vsync_len = {1, 1, 20},
3801};
3802
3803static const struct panel_desc satoz_sat050at40h12r2 = {
3804 .timings = &satoz_sat050at40h12r2_timing,
3805 .num_timings = 1,
3806 .bpc = 8,
3807 .size = {
3808 .width = 108,
3809 .height = 65,
3810 },
Laurent Pinchart34ca6b52020-06-30 02:33:18 +03003811 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Miquel Raynal44c58c52020-01-09 19:40:37 +01003812 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3813};
3814
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07003815static const struct drm_display_mode sharp_ld_d5116z01b_mode = {
3816 .clock = 168480,
3817 .hdisplay = 1920,
3818 .hsync_start = 1920 + 48,
3819 .hsync_end = 1920 + 48 + 32,
3820 .htotal = 1920 + 48 + 32 + 80,
3821 .vdisplay = 1280,
3822 .vsync_start = 1280 + 3,
3823 .vsync_end = 1280 + 3 + 10,
3824 .vtotal = 1280 + 3 + 10 + 57,
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07003825 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3826};
3827
3828static const struct panel_desc sharp_ld_d5116z01b = {
3829 .modes = &sharp_ld_d5116z01b_mode,
3830 .num_modes = 1,
3831 .bpc = 8,
3832 .size = {
3833 .width = 260,
3834 .height = 120,
3835 },
3836 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3837 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
3838};
3839
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003840static const struct drm_display_mode sharp_lq070y3dg3b_mode = {
3841 .clock = 33260,
3842 .hdisplay = 800,
3843 .hsync_start = 800 + 64,
3844 .hsync_end = 800 + 64 + 128,
3845 .htotal = 800 + 64 + 128 + 64,
3846 .vdisplay = 480,
3847 .vsync_start = 480 + 8,
3848 .vsync_end = 480 + 8 + 2,
3849 .vtotal = 480 + 8 + 2 + 35,
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003850 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3851};
3852
3853static const struct panel_desc sharp_lq070y3dg3b = {
3854 .modes = &sharp_lq070y3dg3b_mode,
3855 .num_modes = 1,
3856 .bpc = 8,
3857 .size = {
3858 .width = 152, /* 152.4mm */
3859 .height = 91, /* 91.4mm */
3860 },
3861 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003862 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003863 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
3864};
3865
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003866static const struct drm_display_mode sharp_lq035q7db03_mode = {
3867 .clock = 5500,
3868 .hdisplay = 240,
3869 .hsync_start = 240 + 16,
3870 .hsync_end = 240 + 16 + 7,
3871 .htotal = 240 + 16 + 7 + 5,
3872 .vdisplay = 320,
3873 .vsync_start = 320 + 9,
3874 .vsync_end = 320 + 9 + 1,
3875 .vtotal = 320 + 9 + 1 + 7,
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003876};
3877
3878static const struct panel_desc sharp_lq035q7db03 = {
3879 .modes = &sharp_lq035q7db03_mode,
3880 .num_modes = 1,
3881 .bpc = 6,
3882 .size = {
3883 .width = 54,
3884 .height = 72,
3885 },
3886 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3887};
3888
Joshua Clayton592aa022016-07-06 15:59:16 -07003889static const struct display_timing sharp_lq101k1ly04_timing = {
3890 .pixelclock = { 60000000, 65000000, 80000000 },
3891 .hactive = { 1280, 1280, 1280 },
3892 .hfront_porch = { 20, 20, 20 },
3893 .hback_porch = { 20, 20, 20 },
3894 .hsync_len = { 10, 10, 10 },
3895 .vactive = { 800, 800, 800 },
3896 .vfront_porch = { 4, 4, 4 },
3897 .vback_porch = { 4, 4, 4 },
3898 .vsync_len = { 4, 4, 4 },
3899 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3900};
3901
3902static const struct panel_desc sharp_lq101k1ly04 = {
3903 .timings = &sharp_lq101k1ly04_timing,
3904 .num_timings = 1,
3905 .bpc = 8,
3906 .size = {
3907 .width = 217,
3908 .height = 136,
3909 },
3910 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003911 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Joshua Clayton592aa022016-07-06 15:59:16 -07003912};
3913
Sean Paul9f7bae22018-02-08 12:48:52 -05003914static const struct display_timing sharp_lq123p1jx31_timing = {
3915 .pixelclock = { 252750000, 252750000, 266604720 },
3916 .hactive = { 2400, 2400, 2400 },
3917 .hfront_porch = { 48, 48, 48 },
3918 .hback_porch = { 80, 80, 84 },
3919 .hsync_len = { 32, 32, 32 },
3920 .vactive = { 1600, 1600, 1600 },
3921 .vfront_porch = { 3, 3, 3 },
3922 .vback_porch = { 33, 33, 120 },
3923 .vsync_len = { 10, 10, 10 },
3924 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Yakir Yang739c7de2016-06-12 10:56:35 +08003925};
3926
3927static const struct panel_desc sharp_lq123p1jx31 = {
Sean Paul9f7bae22018-02-08 12:48:52 -05003928 .timings = &sharp_lq123p1jx31_timing,
3929 .num_timings = 1,
zain wang5466a632016-11-19 10:27:16 +08003930 .bpc = 8,
Yakir Yang739c7de2016-06-12 10:56:35 +08003931 .size = {
3932 .width = 259,
3933 .height = 173,
3934 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08003935 .delay = {
3936 .prepare = 110,
3937 .enable = 50,
3938 .unprepare = 550,
3939 },
Yakir Yang739c7de2016-06-12 10:56:35 +08003940};
3941
Paul Cercueil656b7592020-08-11 02:22:38 +02003942static const struct drm_display_mode sharp_ls020b1dd01d_modes[] = {
Paul Cercueile6c21e62020-08-11 02:22:40 +02003943 { /* 50 Hz */
3944 .clock = 3000,
3945 .hdisplay = 240,
3946 .hsync_start = 240 + 58,
3947 .hsync_end = 240 + 58 + 1,
3948 .htotal = 240 + 58 + 1 + 1,
3949 .vdisplay = 160,
3950 .vsync_start = 160 + 24,
3951 .vsync_end = 160 + 24 + 10,
3952 .vtotal = 160 + 24 + 10 + 6,
3953 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
3954 },
Paul Cercueil656b7592020-08-11 02:22:38 +02003955 { /* 60 Hz */
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003956 .clock = 3000,
Paul Cercueil656b7592020-08-11 02:22:38 +02003957 .hdisplay = 240,
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003958 .hsync_start = 240 + 8,
3959 .hsync_end = 240 + 8 + 1,
3960 .htotal = 240 + 8 + 1 + 1,
Paul Cercueil656b7592020-08-11 02:22:38 +02003961 .vdisplay = 160,
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003962 .vsync_start = 160 + 24,
3963 .vsync_end = 160 + 24 + 10,
3964 .vtotal = 160 + 24 + 10 + 6,
Paul Cercueil656b7592020-08-11 02:22:38 +02003965 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
3966 },
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003967};
3968
3969static const struct panel_desc sharp_ls020b1dd01d = {
Paul Cercueil656b7592020-08-11 02:22:38 +02003970 .modes = sharp_ls020b1dd01d_modes,
3971 .num_modes = ARRAY_SIZE(sharp_ls020b1dd01d_modes),
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003972 .bpc = 6,
3973 .size = {
3974 .width = 42,
3975 .height = 28,
3976 },
3977 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
3978 .bus_flags = DRM_BUS_FLAG_DE_HIGH
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003979 | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003980 | DRM_BUS_FLAG_SHARP_SIGNALS,
3981};
3982
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003983static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
3984 .clock = 33300,
3985 .hdisplay = 800,
3986 .hsync_start = 800 + 1,
3987 .hsync_end = 800 + 1 + 64,
3988 .htotal = 800 + 1 + 64 + 64,
3989 .vdisplay = 480,
3990 .vsync_start = 480 + 1,
3991 .vsync_end = 480 + 1 + 23,
3992 .vtotal = 480 + 1 + 23 + 22,
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003993};
3994
3995static const struct panel_desc shelly_sca07010_bfn_lnn = {
3996 .modes = &shelly_sca07010_bfn_lnn_mode,
3997 .num_modes = 1,
3998 .size = {
3999 .width = 152,
4000 .height = 91,
4001 },
4002 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
4003};
4004
Pascal Roeleven105235e2020-03-20 12:21:33 +01004005static const struct drm_display_mode starry_kr070pe2t_mode = {
4006 .clock = 33000,
4007 .hdisplay = 800,
4008 .hsync_start = 800 + 209,
4009 .hsync_end = 800 + 209 + 1,
4010 .htotal = 800 + 209 + 1 + 45,
4011 .vdisplay = 480,
4012 .vsync_start = 480 + 22,
4013 .vsync_end = 480 + 22 + 1,
4014 .vtotal = 480 + 22 + 1 + 22,
Pascal Roeleven105235e2020-03-20 12:21:33 +01004015};
4016
4017static const struct panel_desc starry_kr070pe2t = {
4018 .modes = &starry_kr070pe2t_mode,
4019 .num_modes = 1,
4020 .bpc = 8,
4021 .size = {
4022 .width = 152,
4023 .height = 86,
4024 },
4025 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
4026 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Laurent Pinchart41fad302020-06-30 02:33:17 +03004027 .connector_type = DRM_MODE_CONNECTOR_DPI,
Pascal Roeleven105235e2020-03-20 12:21:33 +01004028};
4029
Douglas Anderson9bb34c42016-06-10 10:02:07 -07004030static const struct drm_display_mode starry_kr122ea0sra_mode = {
4031 .clock = 147000,
4032 .hdisplay = 1920,
4033 .hsync_start = 1920 + 16,
4034 .hsync_end = 1920 + 16 + 16,
4035 .htotal = 1920 + 16 + 16 + 32,
4036 .vdisplay = 1200,
4037 .vsync_start = 1200 + 15,
4038 .vsync_end = 1200 + 15 + 2,
4039 .vtotal = 1200 + 15 + 2 + 18,
Douglas Anderson9bb34c42016-06-10 10:02:07 -07004040 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4041};
4042
4043static const struct panel_desc starry_kr122ea0sra = {
4044 .modes = &starry_kr122ea0sra_mode,
4045 .num_modes = 1,
4046 .size = {
4047 .width = 263,
4048 .height = 164,
4049 },
Brian Norrisc46b9242016-08-26 14:32:14 -07004050 .delay = {
4051 .prepare = 10 + 200,
4052 .enable = 50,
4053 .unprepare = 10 + 500,
4054 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07004055};
4056
Jyri Sarha42161532019-03-22 10:33:36 +02004057static const struct drm_display_mode tfc_s9700rtwv43tr_01b_mode = {
4058 .clock = 30000,
4059 .hdisplay = 800,
4060 .hsync_start = 800 + 39,
4061 .hsync_end = 800 + 39 + 47,
4062 .htotal = 800 + 39 + 47 + 39,
4063 .vdisplay = 480,
4064 .vsync_start = 480 + 13,
4065 .vsync_end = 480 + 13 + 2,
4066 .vtotal = 480 + 13 + 2 + 29,
Jyri Sarha42161532019-03-22 10:33:36 +02004067};
4068
4069static const struct panel_desc tfc_s9700rtwv43tr_01b = {
4070 .modes = &tfc_s9700rtwv43tr_01b_mode,
4071 .num_modes = 1,
4072 .bpc = 8,
4073 .size = {
4074 .width = 155,
4075 .height = 90,
4076 },
4077 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02004078 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Jyri Sarha42161532019-03-22 10:33:36 +02004079};
4080
Gary Bissonadb973e2016-12-02 09:52:08 +01004081static const struct display_timing tianma_tm070jdhg30_timing = {
4082 .pixelclock = { 62600000, 68200000, 78100000 },
4083 .hactive = { 1280, 1280, 1280 },
4084 .hfront_porch = { 15, 64, 159 },
4085 .hback_porch = { 5, 5, 5 },
4086 .hsync_len = { 1, 1, 256 },
4087 .vactive = { 800, 800, 800 },
4088 .vfront_porch = { 3, 40, 99 },
4089 .vback_porch = { 2, 2, 2 },
4090 .vsync_len = { 1, 1, 128 },
4091 .flags = DISPLAY_FLAGS_DE_HIGH,
4092};
4093
4094static const struct panel_desc tianma_tm070jdhg30 = {
4095 .timings = &tianma_tm070jdhg30_timing,
4096 .num_timings = 1,
4097 .bpc = 8,
4098 .size = {
4099 .width = 151,
4100 .height = 95,
4101 },
4102 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03004103 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Gary Bissonadb973e2016-12-02 09:52:08 +01004104};
4105
Max Merchelb3bfcdf2020-06-12 09:22:19 +02004106static const struct panel_desc tianma_tm070jvhg33 = {
4107 .timings = &tianma_tm070jdhg30_timing,
4108 .num_timings = 1,
4109 .bpc = 8,
4110 .size = {
4111 .width = 150,
4112 .height = 94,
4113 },
4114 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
4115 .connector_type = DRM_MODE_CONNECTOR_LVDS,
4116};
4117
Lukasz Majewski870a0b12017-11-07 16:30:58 +01004118static const struct display_timing tianma_tm070rvhg71_timing = {
4119 .pixelclock = { 27700000, 29200000, 39600000 },
4120 .hactive = { 800, 800, 800 },
4121 .hfront_porch = { 12, 40, 212 },
4122 .hback_porch = { 88, 88, 88 },
4123 .hsync_len = { 1, 1, 40 },
4124 .vactive = { 480, 480, 480 },
4125 .vfront_porch = { 1, 13, 88 },
4126 .vback_porch = { 32, 32, 32 },
4127 .vsync_len = { 1, 1, 3 },
4128 .flags = DISPLAY_FLAGS_DE_HIGH,
4129};
4130
4131static const struct panel_desc tianma_tm070rvhg71 = {
4132 .timings = &tianma_tm070rvhg71_timing,
4133 .num_timings = 1,
4134 .bpc = 8,
4135 .size = {
4136 .width = 154,
4137 .height = 86,
4138 },
4139 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03004140 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski870a0b12017-11-07 16:30:58 +01004141};
4142
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004143static const struct drm_display_mode ti_nspire_cx_lcd_mode[] = {
4144 {
4145 .clock = 10000,
4146 .hdisplay = 320,
4147 .hsync_start = 320 + 50,
4148 .hsync_end = 320 + 50 + 6,
4149 .htotal = 320 + 50 + 6 + 38,
4150 .vdisplay = 240,
4151 .vsync_start = 240 + 3,
4152 .vsync_end = 240 + 3 + 1,
4153 .vtotal = 240 + 3 + 1 + 17,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004154 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4155 },
4156};
4157
4158static const struct panel_desc ti_nspire_cx_lcd_panel = {
4159 .modes = ti_nspire_cx_lcd_mode,
4160 .num_modes = 1,
4161 .bpc = 8,
4162 .size = {
4163 .width = 65,
4164 .height = 49,
4165 },
4166 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02004167 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004168};
4169
4170static const struct drm_display_mode ti_nspire_classic_lcd_mode[] = {
4171 {
4172 .clock = 10000,
4173 .hdisplay = 320,
4174 .hsync_start = 320 + 6,
4175 .hsync_end = 320 + 6 + 6,
4176 .htotal = 320 + 6 + 6 + 6,
4177 .vdisplay = 240,
4178 .vsync_start = 240 + 0,
4179 .vsync_end = 240 + 0 + 1,
4180 .vtotal = 240 + 0 + 1 + 0,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004181 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
4182 },
4183};
4184
4185static const struct panel_desc ti_nspire_classic_lcd_panel = {
4186 .modes = ti_nspire_classic_lcd_mode,
4187 .num_modes = 1,
4188 /* The grayscale panel has 8 bit for the color .. Y (black) */
4189 .bpc = 8,
4190 .size = {
4191 .width = 71,
4192 .height = 53,
4193 },
4194 /* This is the grayscale bus format */
4195 .bus_format = MEDIA_BUS_FMT_Y8_1X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02004196 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004197};
4198
Lucas Stach06e733e2017-10-18 19:22:40 +02004199static const struct drm_display_mode toshiba_lt089ac29000_mode = {
4200 .clock = 79500,
4201 .hdisplay = 1280,
4202 .hsync_start = 1280 + 192,
4203 .hsync_end = 1280 + 192 + 128,
4204 .htotal = 1280 + 192 + 128 + 64,
4205 .vdisplay = 768,
4206 .vsync_start = 768 + 20,
4207 .vsync_end = 768 + 20 + 7,
4208 .vtotal = 768 + 20 + 7 + 3,
Lucas Stach06e733e2017-10-18 19:22:40 +02004209};
4210
4211static const struct panel_desc toshiba_lt089ac29000 = {
4212 .modes = &toshiba_lt089ac29000_mode,
4213 .num_modes = 1,
4214 .size = {
4215 .width = 194,
4216 .height = 116,
4217 },
Boris Brezillon9781bd12020-01-28 14:55:13 +01004218 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchartc4715832020-06-30 02:33:19 +03004219 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03004220 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach06e733e2017-10-18 19:22:40 +02004221};
4222
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304223static const struct drm_display_mode tpk_f07a_0102_mode = {
4224 .clock = 33260,
4225 .hdisplay = 800,
4226 .hsync_start = 800 + 40,
4227 .hsync_end = 800 + 40 + 128,
4228 .htotal = 800 + 40 + 128 + 88,
4229 .vdisplay = 480,
4230 .vsync_start = 480 + 10,
4231 .vsync_end = 480 + 10 + 2,
4232 .vtotal = 480 + 10 + 2 + 33,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304233};
4234
4235static const struct panel_desc tpk_f07a_0102 = {
4236 .modes = &tpk_f07a_0102_mode,
4237 .num_modes = 1,
4238 .size = {
4239 .width = 152,
4240 .height = 91,
4241 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03004242 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304243};
4244
4245static const struct drm_display_mode tpk_f10a_0102_mode = {
4246 .clock = 45000,
4247 .hdisplay = 1024,
4248 .hsync_start = 1024 + 176,
4249 .hsync_end = 1024 + 176 + 5,
4250 .htotal = 1024 + 176 + 5 + 88,
4251 .vdisplay = 600,
4252 .vsync_start = 600 + 20,
4253 .vsync_end = 600 + 20 + 5,
4254 .vtotal = 600 + 20 + 5 + 25,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304255};
4256
4257static const struct panel_desc tpk_f10a_0102 = {
4258 .modes = &tpk_f10a_0102_mode,
4259 .num_modes = 1,
4260 .size = {
4261 .width = 223,
4262 .height = 125,
4263 },
4264};
4265
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01004266static const struct display_timing urt_umsh_8596md_timing = {
4267 .pixelclock = { 33260000, 33260000, 33260000 },
4268 .hactive = { 800, 800, 800 },
4269 .hfront_porch = { 41, 41, 41 },
4270 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
4271 .hsync_len = { 71, 128, 128 },
4272 .vactive = { 480, 480, 480 },
4273 .vfront_porch = { 10, 10, 10 },
4274 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
4275 .vsync_len = { 2, 2, 2 },
4276 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
4277 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
4278};
4279
4280static const struct panel_desc urt_umsh_8596md_lvds = {
4281 .timings = &urt_umsh_8596md_timing,
4282 .num_timings = 1,
4283 .bpc = 6,
4284 .size = {
4285 .width = 152,
4286 .height = 91,
4287 },
4288 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03004289 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01004290};
4291
4292static const struct panel_desc urt_umsh_8596md_parallel = {
4293 .timings = &urt_umsh_8596md_timing,
4294 .num_timings = 1,
4295 .bpc = 6,
4296 .size = {
4297 .width = 152,
4298 .height = 91,
4299 },
4300 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
4301};
4302
Fabio Estevam04206182019-02-18 21:27:06 -03004303static const struct drm_display_mode vl050_8048nt_c01_mode = {
4304 .clock = 33333,
4305 .hdisplay = 800,
4306 .hsync_start = 800 + 210,
4307 .hsync_end = 800 + 210 + 20,
4308 .htotal = 800 + 210 + 20 + 46,
4309 .vdisplay = 480,
4310 .vsync_start = 480 + 22,
4311 .vsync_end = 480 + 22 + 10,
4312 .vtotal = 480 + 22 + 10 + 23,
Fabio Estevam04206182019-02-18 21:27:06 -03004313 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
4314};
4315
4316static const struct panel_desc vl050_8048nt_c01 = {
4317 .modes = &vl050_8048nt_c01_mode,
4318 .num_modes = 1,
4319 .bpc = 8,
4320 .size = {
4321 .width = 120,
4322 .height = 76,
4323 },
4324 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02004325 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Fabio Estevam04206182019-02-18 21:27:06 -03004326};
4327
Richard Genoude4bac402017-03-27 12:33:23 +02004328static const struct drm_display_mode winstar_wf35ltiacd_mode = {
4329 .clock = 6410,
4330 .hdisplay = 320,
4331 .hsync_start = 320 + 20,
4332 .hsync_end = 320 + 20 + 30,
4333 .htotal = 320 + 20 + 30 + 38,
4334 .vdisplay = 240,
4335 .vsync_start = 240 + 4,
4336 .vsync_end = 240 + 4 + 3,
4337 .vtotal = 240 + 4 + 3 + 15,
Richard Genoude4bac402017-03-27 12:33:23 +02004338 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4339};
4340
4341static const struct panel_desc winstar_wf35ltiacd = {
4342 .modes = &winstar_wf35ltiacd_mode,
4343 .num_modes = 1,
4344 .bpc = 8,
4345 .size = {
4346 .width = 70,
4347 .height = 53,
4348 },
4349 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
4350};
4351
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05304352static const struct drm_display_mode yes_optoelectronics_ytc700tlag_05_201c_mode = {
4353 .clock = 51200,
4354 .hdisplay = 1024,
4355 .hsync_start = 1024 + 100,
4356 .hsync_end = 1024 + 100 + 100,
4357 .htotal = 1024 + 100 + 100 + 120,
4358 .vdisplay = 600,
4359 .vsync_start = 600 + 10,
4360 .vsync_end = 600 + 10 + 10,
4361 .vtotal = 600 + 10 + 10 + 15,
4362 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
4363};
4364
4365static const struct panel_desc yes_optoelectronics_ytc700tlag_05_201c = {
4366 .modes = &yes_optoelectronics_ytc700tlag_05_201c_mode,
4367 .num_modes = 1,
4368 .bpc = 6,
4369 .size = {
4370 .width = 154,
4371 .height = 90,
4372 },
4373 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
4374 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
4375 .connector_type = DRM_MODE_CONNECTOR_LVDS,
4376};
4377
Linus Walleijfcec4162018-10-26 13:13:34 +02004378static const struct drm_display_mode arm_rtsm_mode[] = {
4379 {
4380 .clock = 65000,
4381 .hdisplay = 1024,
4382 .hsync_start = 1024 + 24,
4383 .hsync_end = 1024 + 24 + 136,
4384 .htotal = 1024 + 24 + 136 + 160,
4385 .vdisplay = 768,
4386 .vsync_start = 768 + 3,
4387 .vsync_end = 768 + 3 + 6,
4388 .vtotal = 768 + 3 + 6 + 29,
Linus Walleijfcec4162018-10-26 13:13:34 +02004389 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4390 },
4391};
4392
4393static const struct panel_desc arm_rtsm = {
4394 .modes = arm_rtsm_mode,
4395 .num_modes = 1,
4396 .bpc = 8,
4397 .size = {
4398 .width = 400,
4399 .height = 300,
4400 },
4401 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
4402};
4403
Thierry Reding280921d2013-08-30 15:10:14 +02004404static const struct of_device_id platform_of_match[] = {
4405 {
Jagan Tekibca684e2020-08-29 22:03:28 +05304406 .compatible = "ampire,am-1280800n3tzqw-t00h",
4407 .data = &ampire_am_1280800n3tzqw_t00h,
4408 }, {
Yannick Fertre966fea72017-03-28 11:44:49 +02004409 .compatible = "ampire,am-480272h3tmqw-t01h",
4410 .data = &ampire_am_480272h3tmqw_t01h,
4411 }, {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01004412 .compatible = "ampire,am800480r3tmqwa1h",
4413 .data = &ampire_am800480r3tmqwa1h,
4414 }, {
Linus Walleijfcec4162018-10-26 13:13:34 +02004415 .compatible = "arm,rtsm-display",
4416 .data = &arm_rtsm,
4417 }, {
Sébastien Szymanskic479450f2019-05-07 17:27:12 +02004418 .compatible = "armadeus,st0700-adapt",
4419 .data = &armadeus_st0700_adapt,
4420 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004421 .compatible = "auo,b101aw03",
4422 .data = &auo_b101aw03,
4423 }, {
Huang Lina531bc32015-02-28 10:18:58 +08004424 .compatible = "auo,b101ean01",
4425 .data = &auo_b101ean01,
4426 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04004427 .compatible = "auo,b101xtn01",
4428 .data = &auo_b101xtn01,
4429 }, {
Rob Clarkda4582862020-01-08 15:53:56 -08004430 .compatible = "auo,b116xa01",
4431 .data = &auo_b116xak01,
4432 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05304433 .compatible = "auo,b116xw03",
4434 .data = &auo_b116xw03,
4435 }, {
Bjorn Andersson93ea7aa2021-07-26 10:33:00 -07004436 .compatible = "auo,b133han05",
4437 .data = &auo_b133han05,
4438 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05304439 .compatible = "auo,b133htn01",
4440 .data = &auo_b133htn01,
4441 }, {
Bjorn Andersson93ea7aa2021-07-26 10:33:00 -07004442 .compatible = "auo,b140han06",
4443 .data = &auo_b140han06,
4444 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07004445 .compatible = "auo,b133xtn01",
4446 .data = &auo_b133xtn01,
4447 }, {
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02004448 .compatible = "auo,g070vvn01",
4449 .data = &auo_g070vvn01,
4450 }, {
Alex Gonzalez4fb86402018-10-25 17:09:30 +02004451 .compatible = "auo,g101evn010",
4452 .data = &auo_g101evn010,
4453 }, {
Christoph Fritz4451c282017-12-16 14:13:36 +01004454 .compatible = "auo,g104sn02",
4455 .data = &auo_g104sn02,
4456 }, {
Sebastian Reichel03e909a2020-04-15 19:27:25 +02004457 .compatible = "auo,g121ean01",
4458 .data = &auo_g121ean01,
4459 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01004460 .compatible = "auo,g133han01",
4461 .data = &auo_g133han01,
4462 }, {
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02004463 .compatible = "auo,g156xtn01",
4464 .data = &auo_g156xtn01,
4465 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01004466 .compatible = "auo,g185han01",
4467 .data = &auo_g185han01,
4468 }, {
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02004469 .compatible = "auo,g190ean01",
4470 .data = &auo_g190ean01,
4471 }, {
Lucas Stach70c0d5b2017-06-08 20:07:58 +02004472 .compatible = "auo,p320hvn03",
4473 .data = &auo_p320hvn03,
4474 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07004475 .compatible = "auo,t215hvn01",
4476 .data = &auo_t215hvn01,
4477 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01004478 .compatible = "avic,tm070ddh03",
4479 .data = &avic_tm070ddh03,
4480 }, {
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08004481 .compatible = "bananapi,s070wv20-ct16",
4482 .data = &bananapi_s070wv20_ct16,
4483 }, {
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02004484 .compatible = "boe,hv070wsa-100",
4485 .data = &boe_hv070wsa
4486 }, {
Caesar Wangcac1a412016-12-14 11:19:56 +08004487 .compatible = "boe,nv101wxmn51",
4488 .data = &boe_nv101wxmn51,
4489 }, {
Douglas Andersona96ee0f2020-11-09 17:00:58 -08004490 .compatible = "boe,nv110wtm-n61",
4491 .data = &boe_nv110wtm_n61,
4492 }, {
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07004493 .compatible = "boe,nv133fhm-n61",
4494 .data = &boe_nv133fhm_n61,
4495 }, {
Douglas Andersoncfe40d02020-05-08 15:59:02 -07004496 .compatible = "boe,nv133fhm-n62",
4497 .data = &boe_nv133fhm_n61,
4498 }, {
Tobias Schramma5119812020-01-09 12:29:52 +01004499 .compatible = "boe,nv140fhmn49",
4500 .data = &boe_nv140fhmn49,
4501 }, {
Giulio Benettie58edce2018-07-31 01:11:16 +02004502 .compatible = "cdtech,s043wq26h-ct7",
4503 .data = &cdtech_s043wq26h_ct7,
4504 }, {
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02004505 .compatible = "cdtech,s070pws19hp-fc21",
4506 .data = &cdtech_s070pws19hp_fc21,
4507 }, {
4508 .compatible = "cdtech,s070swv29hg-dc44",
4509 .data = &cdtech_s070swv29hg_dc44,
4510 }, {
Giulio Benetti982f9442018-07-31 01:11:14 +02004511 .compatible = "cdtech,s070wv95-ct16",
4512 .data = &cdtech_s070wv95_ct16,
4513 }, {
Marek Vasut07c913c2020-07-28 22:12:42 +02004514 .compatible = "chefree,ch101olhlwh-002",
4515 .data = &chefree_ch101olhlwh_002,
4516 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08004517 .compatible = "chunghwa,claa070wp03xg",
4518 .data = &chunghwa_claa070wp03xg,
4519 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07004520 .compatible = "chunghwa,claa101wa01a",
4521 .data = &chunghwa_claa101wa01a
4522 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004523 .compatible = "chunghwa,claa101wb01",
4524 .data = &chunghwa_claa101wb01
4525 }, {
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02004526 .compatible = "dataimage,scf0700c48ggu18",
4527 .data = &dataimage_scf0700c48ggu18,
4528 }, {
Philipp Zabel0ca0c822018-05-23 11:25:04 +02004529 .compatible = "dlc,dlc0700yzg-1",
4530 .data = &dlc_dlc0700yzg_1,
4531 }, {
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02004532 .compatible = "dlc,dlc1010gig",
4533 .data = &dlc_dlc1010gig,
4534 }, {
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02004535 .compatible = "edt,et035012dm6",
4536 .data = &edt_et035012dm6,
4537 }, {
Stefan Riedmuellerf08a2a12021-07-09 22:03:49 +02004538 .compatible = "edt,etm0350g0dh6",
4539 .data = &edt_etm0350g0dh6,
4540 }, {
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00004541 .compatible = "edt,etm043080dh6gp",
4542 .data = &edt_etm043080dh6gp,
4543 }, {
Marek Vasutfd819bf2019-02-19 15:04:38 +01004544 .compatible = "edt,etm0430g0dh6",
4545 .data = &edt_etm0430g0dh6,
4546 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02004547 .compatible = "edt,et057090dhu",
4548 .data = &edt_et057090dhu,
4549 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02004550 .compatible = "edt,et070080dh6",
4551 .data = &edt_etm0700g0dh6,
4552 }, {
4553 .compatible = "edt,etm0700g0dh6",
4554 .data = &edt_etm0700g0dh6,
4555 }, {
Jan Tuerkaa7e6452018-06-19 11:55:44 +02004556 .compatible = "edt,etm0700g0bdh6",
4557 .data = &edt_etm0700g0bdh6,
4558 }, {
Jan Tuerkaad34de2018-06-19 11:55:45 +02004559 .compatible = "edt,etm0700g0edh6",
4560 .data = &edt_etm0700g0bdh6,
4561 }, {
Stefan Riedmuellere46f73f2021-07-09 22:03:48 +02004562 .compatible = "edt,etmv570g2dhu",
4563 .data = &edt_etmv570g2dhu,
4564 }, {
Alistair Francis9746f5f2021-08-01 10:47:00 +10004565 .compatible = "eink,vb3300-kca",
4566 .data = &eink_vb3300_kca,
4567 }, {
Marco Felsch9158e3c2019-04-16 12:06:45 +02004568 .compatible = "evervision,vgg804821",
4569 .data = &evervision_vgg804821,
4570 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02004571 .compatible = "foxlink,fl500wvr00-a0t",
4572 .data = &foxlink_fl500wvr00_a0t,
4573 }, {
Paul Cercueil7b6bd842020-01-13 13:17:41 -03004574 .compatible = "frida,frd350h54004",
4575 .data = &frida_frd350h54004,
4576 }, {
Jagan Teki3be20712019-05-07 18:37:07 +05304577 .compatible = "friendlyarm,hd702e",
4578 .data = &friendlyarm_hd702e,
4579 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01004580 .compatible = "giantplus,gpg482739qs5",
4581 .data = &giantplus_gpg482739qs5
4582 }, {
Paul Cercueil2c6574a2019-06-06 00:22:47 +02004583 .compatible = "giantplus,gpm940b0",
4584 .data = &giantplus_gpm940b0,
4585 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02004586 .compatible = "hannstar,hsd070pww1",
4587 .data = &hannstar_hsd070pww1,
4588 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07004589 .compatible = "hannstar,hsd100pxn1",
4590 .data = &hannstar_hsd100pxn1,
4591 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01004592 .compatible = "hit,tx23d38vm0caa",
4593 .data = &hitachi_tx23d38vm0caa
4594 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01004595 .compatible = "innolux,at043tn24",
4596 .data = &innolux_at043tn24,
4597 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02004598 .compatible = "innolux,at070tn92",
4599 .data = &innolux_at070tn92,
4600 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02004601 .compatible = "innolux,g070y2-l01",
4602 .data = &innolux_g070y2_l01,
4603 }, {
4604 .compatible = "innolux,g101ice-l01",
Michael Olbrich1e29b842016-08-15 14:32:02 +02004605 .data = &innolux_g101ice_l01
4606 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02004607 .compatible = "innolux,g121i1-l01",
Lucas Stachd731f662014-11-06 17:44:33 +01004608 .data = &innolux_g121i1_l01
4609 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05004610 .compatible = "innolux,g121x1-l03",
4611 .data = &innolux_g121x1_l03,
4612 }, {
Douglas Anderson51d35632021-01-15 14:44:20 -08004613 .compatible = "innolux,n116bca-ea1",
4614 .data = &innolux_n116bca_ea1,
4615 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02004616 .compatible = "innolux,n116bge",
4617 .data = &innolux_n116bge,
4618 }, {
Lukas F. Hartmanna14c6b02020-11-24 18:26:04 +01004619 .compatible = "innolux,n125hce-gn1",
4620 .data = &innolux_n125hce_gn1,
4621 }, {
Alban Bedelea447392014-07-22 08:38:55 +02004622 .compatible = "innolux,n156bge-l21",
4623 .data = &innolux_n156bge_l21,
4624 }, {
Douglas Anderson8f054b62018-10-25 15:21:34 -07004625 .compatible = "innolux,p120zdg-bf1",
4626 .data = &innolux_p120zdg_bf1,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05304627 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01004628 .compatible = "innolux,zj070na-01p",
4629 .data = &innolux_zj070na_01p,
4630 }, {
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07004631 .compatible = "ivo,m133nwf4-r0",
4632 .data = &ivo_m133nwf4_r0,
4633 }, {
Douglas Andersonfc26a372020-08-21 08:35:15 -07004634 .compatible = "kingdisplay,kd116n21-30nv-a010",
4635 .data = &kingdisplay_kd116n21_30nv_a010,
4636 }, {
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02004637 .compatible = "koe,tx14d24vm1bpa",
4638 .data = &koe_tx14d24vm1bpa,
4639 }, {
Liu Ying8a070522020-06-01 14:11:20 +08004640 .compatible = "koe,tx26d202vm0bwa",
4641 .data = &koe_tx26d202vm0bwa,
4642 }, {
Jagan Teki8cfe8342018-02-04 23:19:28 +05304643 .compatible = "koe,tx31d200vm0baa",
4644 .data = &koe_tx31d200vm0baa,
4645 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01004646 .compatible = "kyo,tcg121xglp",
4647 .data = &kyo_tcg121xglp,
4648 }, {
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01004649 .compatible = "lemaker,bl035-rgb-002",
4650 .data = &lemaker_bl035_rgb_002,
4651 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02004652 .compatible = "lg,lb070wv8",
4653 .data = &lg_lb070wv8,
4654 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08004655 .compatible = "lg,lp079qx1-sp0v",
4656 .data = &lg_lp079qx1_sp0v,
4657 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08004658 .compatible = "lg,lp097qx1-spa1",
4659 .data = &lg_lp097qx1_spa1,
4660 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08004661 .compatible = "lg,lp120up1",
4662 .data = &lg_lp120up1,
4663 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01004664 .compatible = "lg,lp129qe",
4665 .data = &lg_lp129qe,
4666 }, {
Adam Ford0d354082019-10-16 08:51:45 -05004667 .compatible = "logicpd,type28",
4668 .data = &logicpd_type_28,
4669 }, {
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01004670 .compatible = "logictechno,lt161010-2nhc",
4671 .data = &logictechno_lt161010_2nh,
4672 }, {
4673 .compatible = "logictechno,lt161010-2nhr",
4674 .data = &logictechno_lt161010_2nh,
4675 }, {
4676 .compatible = "logictechno,lt170410-2whc",
4677 .data = &logictechno_lt170410_2whc,
4678 }, {
Lukasz Majewski65c766c2017-10-21 00:18:37 +02004679 .compatible = "mitsubishi,aa070mc01-ca1",
4680 .data = &mitsubishi_aa070mc01,
4681 }, {
Lucas Stach01bacc132017-06-08 20:07:55 +02004682 .compatible = "nec,nl12880bc20-05",
4683 .data = &nec_nl12880bc20_05,
4684 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08004685 .compatible = "nec,nl4827hc19-05b",
4686 .data = &nec_nl4827hc19_05b,
4687 }, {
Maxime Riparde6c2f062016-09-06 16:46:17 +02004688 .compatible = "netron-dy,e231732",
4689 .data = &netron_dy_e231732,
4690 }, {
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08004691 .compatible = "neweast,wjfh116008a",
4692 .data = &neweast_wjfh116008a,
4693 }, {
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03004694 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
4695 .data = &newhaven_nhd_43_480272ef_atxl,
4696 }, {
Lucas Stach4177fa62017-06-08 20:07:57 +02004697 .compatible = "nlt,nl192108ac18-02d",
4698 .data = &nlt_nl192108ac18_02d,
4699 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02004700 .compatible = "nvd,9128",
4701 .data = &nvd_9128,
4702 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02004703 .compatible = "okaya,rs800480t-7x0gp",
4704 .data = &okaya_rs800480t_7x0gp,
4705 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01004706 .compatible = "olimex,lcd-olinuxino-43-ts",
4707 .data = &olimex_lcd_olinuxino_43ts,
4708 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07004709 .compatible = "ontat,yx700wv03",
4710 .data = &ontat_yx700wv03,
4711 }, {
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02004712 .compatible = "ortustech,com37h3m05dtc",
4713 .data = &ortustech_com37h3m,
4714 }, {
4715 .compatible = "ortustech,com37h3m99dtc",
4716 .data = &ortustech_com37h3m,
4717 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01004718 .compatible = "ortustech,com43h4m85ulc",
4719 .data = &ortustech_com43h4m85ulc,
4720 }, {
Laurent Pinchart163f7a32018-12-07 22:13:44 +02004721 .compatible = "osddisplays,osd070t1718-19ts",
4722 .data = &osddisplays_osd070t1718_19ts,
4723 }, {
Eugen Hristev4ba3e562019-01-14 09:43:31 +00004724 .compatible = "pda,91-00156-a0",
4725 .data = &pda_91_00156_a0,
4726 }, {
Marek Vasutd69de692020-07-28 14:12:46 +02004727 .compatible = "powertip,ph800480t013-idf02",
4728 .data = &powertip_ph800480t013_idf02,
4729 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02004730 .compatible = "qiaodian,qd43003c0-40",
4731 .data = &qd43003c0_40,
4732 }, {
Artjom Vejsel49179e62021-08-04 03:23:53 +03004733 .compatible = "qishenglong,gopher2b-lcd",
4734 .data = &qishenglong_gopher2b_lcd,
4735 }, {
Jagan Teki23167fa2018-06-07 19:16:48 +05304736 .compatible = "rocktech,rk070er9427",
4737 .data = &rocktech_rk070er9427,
4738 }, {
Jyri Sarhaf3050472020-02-11 14:17:18 +02004739 .compatible = "rocktech,rk101ii01d-ct",
4740 .data = &rocktech_rk101ii01d_ct,
4741 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08004742 .compatible = "samsung,lsn122dl01-c01",
4743 .data = &samsung_lsn122dl01_c01,
4744 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01004745 .compatible = "samsung,ltn101nt05",
4746 .data = &samsung_ltn101nt05,
4747 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01004748 .compatible = "samsung,ltn140at29-301",
4749 .data = &samsung_ltn140at29_301,
4750 }, {
Miquel Raynal44c58c52020-01-09 19:40:37 +01004751 .compatible = "satoz,sat050at40h12r2",
4752 .data = &satoz_sat050at40h12r2,
4753 }, {
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07004754 .compatible = "sharp,ld-d5116z01b",
4755 .data = &sharp_ld_d5116z01b,
4756 }, {
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03004757 .compatible = "sharp,lq035q7db03",
4758 .data = &sharp_lq035q7db03,
4759 }, {
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02004760 .compatible = "sharp,lq070y3dg3b",
4761 .data = &sharp_lq070y3dg3b,
4762 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07004763 .compatible = "sharp,lq101k1ly04",
4764 .data = &sharp_lq101k1ly04,
4765 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08004766 .compatible = "sharp,lq123p1jx31",
4767 .data = &sharp_lq123p1jx31,
4768 }, {
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02004769 .compatible = "sharp,ls020b1dd01d",
4770 .data = &sharp_ls020b1dd01d,
4771 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01004772 .compatible = "shelly,sca07010-bfn-lnn",
4773 .data = &shelly_sca07010_bfn_lnn,
4774 }, {
Pascal Roeleven105235e2020-03-20 12:21:33 +01004775 .compatible = "starry,kr070pe2t",
4776 .data = &starry_kr070pe2t,
4777 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07004778 .compatible = "starry,kr122ea0sra",
4779 .data = &starry_kr122ea0sra,
4780 }, {
Jyri Sarha42161532019-03-22 10:33:36 +02004781 .compatible = "tfc,s9700rtwv43tr-01b",
4782 .data = &tfc_s9700rtwv43tr_01b,
4783 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01004784 .compatible = "tianma,tm070jdhg30",
4785 .data = &tianma_tm070jdhg30,
4786 }, {
Max Merchelb3bfcdf2020-06-12 09:22:19 +02004787 .compatible = "tianma,tm070jvhg33",
4788 .data = &tianma_tm070jvhg33,
4789 }, {
Lukasz Majewski870a0b12017-11-07 16:30:58 +01004790 .compatible = "tianma,tm070rvhg71",
4791 .data = &tianma_tm070rvhg71,
4792 }, {
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004793 .compatible = "ti,nspire-cx-lcd-panel",
4794 .data = &ti_nspire_cx_lcd_panel,
4795 }, {
4796 .compatible = "ti,nspire-classic-lcd-panel",
4797 .data = &ti_nspire_classic_lcd_panel,
4798 }, {
Lucas Stach06e733e2017-10-18 19:22:40 +02004799 .compatible = "toshiba,lt089ac29000",
4800 .data = &toshiba_lt089ac29000,
4801 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304802 .compatible = "tpk,f07a-0102",
4803 .data = &tpk_f07a_0102,
4804 }, {
4805 .compatible = "tpk,f10a-0102",
4806 .data = &tpk_f10a_0102,
4807 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01004808 .compatible = "urt,umsh-8596md-t",
4809 .data = &urt_umsh_8596md_parallel,
4810 }, {
4811 .compatible = "urt,umsh-8596md-1t",
4812 .data = &urt_umsh_8596md_parallel,
4813 }, {
4814 .compatible = "urt,umsh-8596md-7t",
4815 .data = &urt_umsh_8596md_parallel,
4816 }, {
4817 .compatible = "urt,umsh-8596md-11t",
4818 .data = &urt_umsh_8596md_lvds,
4819 }, {
4820 .compatible = "urt,umsh-8596md-19t",
4821 .data = &urt_umsh_8596md_lvds,
4822 }, {
4823 .compatible = "urt,umsh-8596md-20t",
4824 .data = &urt_umsh_8596md_parallel,
4825 }, {
Fabio Estevam04206182019-02-18 21:27:06 -03004826 .compatible = "vxt,vl050-8048nt-c01",
4827 .data = &vl050_8048nt_c01,
4828 }, {
Richard Genoude4bac402017-03-27 12:33:23 +02004829 .compatible = "winstar,wf35ltiacd",
4830 .data = &winstar_wf35ltiacd,
4831 }, {
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05304832 .compatible = "yes-optoelectronics,ytc700tlag-05-201c",
4833 .data = &yes_optoelectronics_ytc700tlag_05_201c,
4834 }, {
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +01004835 /* Must be the last entry */
4836 .compatible = "panel-dpi",
4837 .data = &panel_dpi,
4838 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004839 /* sentinel */
4840 }
4841};
4842MODULE_DEVICE_TABLE(of, platform_of_match);
4843
4844static int panel_simple_platform_probe(struct platform_device *pdev)
4845{
4846 const struct of_device_id *id;
4847
4848 id = of_match_node(platform_of_match, pdev->dev.of_node);
4849 if (!id)
4850 return -ENODEV;
4851
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -07004852 return panel_simple_probe(&pdev->dev, id->data, NULL);
Thierry Reding280921d2013-08-30 15:10:14 +02004853}
4854
4855static int panel_simple_platform_remove(struct platform_device *pdev)
4856{
4857 return panel_simple_remove(&pdev->dev);
4858}
4859
Thierry Redingd02fd932014-04-29 17:21:21 +02004860static void panel_simple_platform_shutdown(struct platform_device *pdev)
4861{
4862 panel_simple_shutdown(&pdev->dev);
4863}
4864
Douglas Anderson3235b0f2021-04-16 15:39:30 -07004865static const struct dev_pm_ops panel_simple_pm_ops = {
4866 SET_RUNTIME_PM_OPS(panel_simple_suspend, panel_simple_resume, NULL)
4867 SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
4868 pm_runtime_force_resume)
4869};
4870
Thierry Reding280921d2013-08-30 15:10:14 +02004871static struct platform_driver panel_simple_platform_driver = {
4872 .driver = {
4873 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02004874 .of_match_table = platform_of_match,
Douglas Anderson3235b0f2021-04-16 15:39:30 -07004875 .pm = &panel_simple_pm_ops,
Thierry Reding280921d2013-08-30 15:10:14 +02004876 },
4877 .probe = panel_simple_platform_probe,
4878 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004879 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004880};
4881
Thierry Reding210fcd92013-11-22 19:27:11 +01004882struct panel_desc_dsi {
4883 struct panel_desc desc;
4884
Thierry Reding462658b2014-03-14 11:24:57 +01004885 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004886 enum mipi_dsi_pixel_format format;
4887 unsigned int lanes;
4888};
4889
Thierry Redingd718d792015-04-08 16:52:33 +02004890static const struct drm_display_mode auo_b080uan01_mode = {
4891 .clock = 154500,
4892 .hdisplay = 1200,
4893 .hsync_start = 1200 + 62,
4894 .hsync_end = 1200 + 62 + 4,
4895 .htotal = 1200 + 62 + 4 + 62,
4896 .vdisplay = 1920,
4897 .vsync_start = 1920 + 9,
4898 .vsync_end = 1920 + 9 + 2,
4899 .vtotal = 1920 + 9 + 2 + 8,
Thierry Redingd718d792015-04-08 16:52:33 +02004900};
4901
4902static const struct panel_desc_dsi auo_b080uan01 = {
4903 .desc = {
4904 .modes = &auo_b080uan01_mode,
4905 .num_modes = 1,
4906 .bpc = 8,
4907 .size = {
4908 .width = 108,
4909 .height = 272,
4910 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004911 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Redingd718d792015-04-08 16:52:33 +02004912 },
4913 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
4914 .format = MIPI_DSI_FMT_RGB888,
4915 .lanes = 4,
4916};
4917
Chris Zhongc8521962015-11-20 16:15:37 +08004918static const struct drm_display_mode boe_tv080wum_nl0_mode = {
4919 .clock = 160000,
4920 .hdisplay = 1200,
4921 .hsync_start = 1200 + 120,
4922 .hsync_end = 1200 + 120 + 20,
4923 .htotal = 1200 + 120 + 20 + 21,
4924 .vdisplay = 1920,
4925 .vsync_start = 1920 + 21,
4926 .vsync_end = 1920 + 21 + 3,
4927 .vtotal = 1920 + 21 + 3 + 18,
Chris Zhongc8521962015-11-20 16:15:37 +08004928 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4929};
4930
4931static const struct panel_desc_dsi boe_tv080wum_nl0 = {
4932 .desc = {
4933 .modes = &boe_tv080wum_nl0_mode,
4934 .num_modes = 1,
4935 .size = {
4936 .width = 107,
4937 .height = 172,
4938 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004939 .connector_type = DRM_MODE_CONNECTOR_DSI,
Chris Zhongc8521962015-11-20 16:15:37 +08004940 },
4941 .flags = MIPI_DSI_MODE_VIDEO |
4942 MIPI_DSI_MODE_VIDEO_BURST |
4943 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
4944 .format = MIPI_DSI_FMT_RGB888,
4945 .lanes = 4,
4946};
4947
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004948static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
4949 .clock = 71000,
4950 .hdisplay = 800,
4951 .hsync_start = 800 + 32,
4952 .hsync_end = 800 + 32 + 1,
4953 .htotal = 800 + 32 + 1 + 57,
4954 .vdisplay = 1280,
4955 .vsync_start = 1280 + 28,
4956 .vsync_end = 1280 + 28 + 1,
4957 .vtotal = 1280 + 28 + 1 + 14,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004958};
4959
4960static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
4961 .desc = {
4962 .modes = &lg_ld070wx3_sl01_mode,
4963 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004964 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004965 .size = {
4966 .width = 94,
4967 .height = 151,
4968 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004969 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004970 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004971 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004972 .format = MIPI_DSI_FMT_RGB888,
4973 .lanes = 4,
4974};
4975
Alexandre Courbot499ce852014-01-21 18:57:09 +09004976static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
4977 .clock = 67000,
4978 .hdisplay = 720,
4979 .hsync_start = 720 + 12,
4980 .hsync_end = 720 + 12 + 4,
4981 .htotal = 720 + 12 + 4 + 112,
4982 .vdisplay = 1280,
4983 .vsync_start = 1280 + 8,
4984 .vsync_end = 1280 + 8 + 4,
4985 .vtotal = 1280 + 8 + 4 + 12,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004986};
4987
4988static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
4989 .desc = {
4990 .modes = &lg_lh500wx1_sd03_mode,
4991 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004992 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004993 .size = {
4994 .width = 62,
4995 .height = 110,
4996 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004997 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004998 },
4999 .flags = MIPI_DSI_MODE_VIDEO,
5000 .format = MIPI_DSI_FMT_RGB888,
5001 .lanes = 4,
5002};
5003
Thierry Reding280921d2013-08-30 15:10:14 +02005004static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
5005 .clock = 157200,
5006 .hdisplay = 1920,
5007 .hsync_start = 1920 + 154,
5008 .hsync_end = 1920 + 154 + 16,
5009 .htotal = 1920 + 154 + 16 + 32,
5010 .vdisplay = 1200,
5011 .vsync_start = 1200 + 17,
5012 .vsync_end = 1200 + 17 + 2,
5013 .vtotal = 1200 + 17 + 2 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02005014};
5015
Thierry Reding210fcd92013-11-22 19:27:11 +01005016static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
5017 .desc = {
5018 .modes = &panasonic_vvx10f004b00_mode,
5019 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01005020 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01005021 .size = {
5022 .width = 217,
5023 .height = 136,
5024 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03005025 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Reding280921d2013-08-30 15:10:14 +02005026 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09005027 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
5028 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01005029 .format = MIPI_DSI_FMT_RGB888,
5030 .lanes = 4,
5031};
5032
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05005033static const struct drm_display_mode lg_acx467akm_7_mode = {
5034 .clock = 150000,
5035 .hdisplay = 1080,
5036 .hsync_start = 1080 + 2,
5037 .hsync_end = 1080 + 2 + 2,
5038 .htotal = 1080 + 2 + 2 + 2,
5039 .vdisplay = 1920,
5040 .vsync_start = 1920 + 2,
5041 .vsync_end = 1920 + 2 + 2,
5042 .vtotal = 1920 + 2 + 2 + 2,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05005043};
5044
5045static const struct panel_desc_dsi lg_acx467akm_7 = {
5046 .desc = {
5047 .modes = &lg_acx467akm_7_mode,
5048 .num_modes = 1,
5049 .bpc = 8,
5050 .size = {
5051 .width = 62,
5052 .height = 110,
5053 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03005054 .connector_type = DRM_MODE_CONNECTOR_DSI,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05005055 },
5056 .flags = 0,
5057 .format = MIPI_DSI_FMT_RGB888,
5058 .lanes = 4,
5059};
5060
Peter Ujfalusi62967232019-02-26 09:55:21 +02005061static const struct drm_display_mode osd101t2045_53ts_mode = {
5062 .clock = 154500,
5063 .hdisplay = 1920,
5064 .hsync_start = 1920 + 112,
5065 .hsync_end = 1920 + 112 + 16,
5066 .htotal = 1920 + 112 + 16 + 32,
5067 .vdisplay = 1200,
5068 .vsync_start = 1200 + 16,
5069 .vsync_end = 1200 + 16 + 2,
5070 .vtotal = 1200 + 16 + 2 + 16,
Peter Ujfalusi62967232019-02-26 09:55:21 +02005071 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
5072};
5073
5074static const struct panel_desc_dsi osd101t2045_53ts = {
5075 .desc = {
5076 .modes = &osd101t2045_53ts_mode,
5077 .num_modes = 1,
5078 .bpc = 8,
5079 .size = {
5080 .width = 217,
5081 .height = 136,
5082 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03005083 .connector_type = DRM_MODE_CONNECTOR_DSI,
Peter Ujfalusi62967232019-02-26 09:55:21 +02005084 },
5085 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
5086 MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
Nicolas Boichat0f3b68b62021-07-27 09:45:21 +08005087 MIPI_DSI_MODE_NO_EOT_PACKET,
Peter Ujfalusi62967232019-02-26 09:55:21 +02005088 .format = MIPI_DSI_FMT_RGB888,
5089 .lanes = 4,
5090};
5091
Thierry Reding210fcd92013-11-22 19:27:11 +01005092static const struct of_device_id dsi_of_match[] = {
5093 {
Thierry Redingd718d792015-04-08 16:52:33 +02005094 .compatible = "auo,b080uan01",
5095 .data = &auo_b080uan01
5096 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08005097 .compatible = "boe,tv080wum-nl0",
5098 .data = &boe_tv080wum_nl0
5099 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09005100 .compatible = "lg,ld070wx3-sl01",
5101 .data = &lg_ld070wx3_sl01
5102 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09005103 .compatible = "lg,lh500wx1-sd03",
5104 .data = &lg_lh500wx1_sd03
5105 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01005106 .compatible = "panasonic,vvx10f004b00",
5107 .data = &panasonic_vvx10f004b00
5108 }, {
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05005109 .compatible = "lg,acx467akm-7",
5110 .data = &lg_acx467akm_7
5111 }, {
Peter Ujfalusi62967232019-02-26 09:55:21 +02005112 .compatible = "osddisplays,osd101t2045-53ts",
5113 .data = &osd101t2045_53ts
5114 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01005115 /* sentinel */
5116 }
5117};
5118MODULE_DEVICE_TABLE(of, dsi_of_match);
5119
5120static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
5121{
5122 const struct panel_desc_dsi *desc;
5123 const struct of_device_id *id;
5124 int err;
5125
5126 id = of_match_node(dsi_of_match, dsi->dev.of_node);
5127 if (!id)
5128 return -ENODEV;
5129
5130 desc = id->data;
5131
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -07005132 err = panel_simple_probe(&dsi->dev, &desc->desc, NULL);
Thierry Reding210fcd92013-11-22 19:27:11 +01005133 if (err < 0)
5134 return err;
5135
Thierry Reding462658b2014-03-14 11:24:57 +01005136 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01005137 dsi->format = desc->format;
5138 dsi->lanes = desc->lanes;
5139
Peter Ujfalusi7ad9db62019-02-26 10:11:53 +02005140 err = mipi_dsi_attach(dsi);
5141 if (err) {
Julia Lawall5dd331d2021-02-09 22:13:04 +01005142 struct panel_simple *panel = mipi_dsi_get_drvdata(dsi);
Peter Ujfalusi7ad9db62019-02-26 10:11:53 +02005143
5144 drm_panel_remove(&panel->base);
5145 }
5146
5147 return err;
Thierry Reding210fcd92013-11-22 19:27:11 +01005148}
5149
5150static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
5151{
5152 int err;
5153
5154 err = mipi_dsi_detach(dsi);
5155 if (err < 0)
5156 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
5157
5158 return panel_simple_remove(&dsi->dev);
5159}
5160
Thierry Redingd02fd932014-04-29 17:21:21 +02005161static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
5162{
5163 panel_simple_shutdown(&dsi->dev);
5164}
5165
Thierry Reding210fcd92013-11-22 19:27:11 +01005166static struct mipi_dsi_driver panel_simple_dsi_driver = {
5167 .driver = {
5168 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01005169 .of_match_table = dsi_of_match,
Douglas Anderson3235b0f2021-04-16 15:39:30 -07005170 .pm = &panel_simple_pm_ops,
Thierry Reding210fcd92013-11-22 19:27:11 +01005171 },
5172 .probe = panel_simple_dsi_probe,
5173 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02005174 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02005175};
5176
Douglas Anderson74c06c22021-06-11 10:17:41 -07005177static int panel_simple_dp_aux_ep_probe(struct dp_aux_ep_device *aux_ep)
5178{
5179 const struct of_device_id *id;
5180
5181 id = of_match_node(platform_of_match, aux_ep->dev.of_node);
5182 if (!id)
5183 return -ENODEV;
5184
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -07005185 return panel_simple_probe(&aux_ep->dev, id->data, aux_ep->aux);
Douglas Anderson74c06c22021-06-11 10:17:41 -07005186}
5187
5188static void panel_simple_dp_aux_ep_remove(struct dp_aux_ep_device *aux_ep)
5189{
5190 panel_simple_remove(&aux_ep->dev);
5191}
5192
5193static void panel_simple_dp_aux_ep_shutdown(struct dp_aux_ep_device *aux_ep)
5194{
5195 panel_simple_shutdown(&aux_ep->dev);
5196}
5197
5198static struct dp_aux_ep_driver panel_simple_dp_aux_ep_driver = {
5199 .driver = {
5200 .name = "panel-simple-dp-aux",
5201 .of_match_table = platform_of_match, /* Same as platform one! */
5202 .pm = &panel_simple_pm_ops,
5203 },
5204 .probe = panel_simple_dp_aux_ep_probe,
5205 .remove = panel_simple_dp_aux_ep_remove,
5206 .shutdown = panel_simple_dp_aux_ep_shutdown,
5207};
5208
Thierry Reding280921d2013-08-30 15:10:14 +02005209static int __init panel_simple_init(void)
5210{
Thierry Reding210fcd92013-11-22 19:27:11 +01005211 int err;
5212
5213 err = platform_driver_register(&panel_simple_platform_driver);
5214 if (err < 0)
5215 return err;
5216
Douglas Anderson74c06c22021-06-11 10:17:41 -07005217 err = dp_aux_dp_driver_register(&panel_simple_dp_aux_ep_driver);
5218 if (err < 0)
5219 goto err_did_platform_register;
5220
Thierry Reding210fcd92013-11-22 19:27:11 +01005221 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
5222 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
Douglas Anderson74c06c22021-06-11 10:17:41 -07005223 if (err < 0)
5224 goto err_did_aux_ep_register;
Thierry Reding210fcd92013-11-22 19:27:11 +01005225 }
5226
5227 return 0;
Douglas Anderson74c06c22021-06-11 10:17:41 -07005228
5229err_did_aux_ep_register:
5230 dp_aux_dp_driver_unregister(&panel_simple_dp_aux_ep_driver);
5231
5232err_did_platform_register:
5233 platform_driver_unregister(&panel_simple_platform_driver);
5234
5235 return err;
Thierry Reding280921d2013-08-30 15:10:14 +02005236}
5237module_init(panel_simple_init);
5238
5239static void __exit panel_simple_exit(void)
5240{
Thierry Reding210fcd92013-11-22 19:27:11 +01005241 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
5242 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
5243
Douglas Anderson74c06c22021-06-11 10:17:41 -07005244 dp_aux_dp_driver_unregister(&panel_simple_dp_aux_ep_driver);
Thierry Reding280921d2013-08-30 15:10:14 +02005245 platform_driver_unregister(&panel_simple_platform_driver);
5246}
5247module_exit(panel_simple_exit);
5248
5249MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
5250MODULE_DESCRIPTION("DRM Driver for Simple Panels");
5251MODULE_LICENSE("GPL and additional rights");