blob: 78f0394e3b2486ce8f3ff8f2004247916a390e80 [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:
752 if (desc->bus_format == 0)
753 dev_warn(dev, "Specify missing bus_format\n");
754 if (desc->bpc != 6 && desc->bpc != 8)
755 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
756 break;
757 case DRM_MODE_CONNECTOR_DSI:
758 if (desc->bpc != 6 && desc->bpc != 8)
759 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
760 break;
761 case DRM_MODE_CONNECTOR_DPI:
762 bus_flags = DRM_BUS_FLAG_DE_LOW |
763 DRM_BUS_FLAG_DE_HIGH |
764 DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE |
765 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
766 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
767 DRM_BUS_FLAG_DATA_LSB_TO_MSB |
768 DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE |
769 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE;
770 if (desc->bus_flags & ~bus_flags)
771 dev_warn(dev, "Unexpected bus_flags(%d)\n", desc->bus_flags & ~bus_flags);
772 if (!(desc->bus_flags & bus_flags))
773 dev_warn(dev, "Specify missing bus_flags\n");
774 if (desc->bus_format == 0)
775 dev_warn(dev, "Specify missing bus_format\n");
776 if (desc->bpc != 6 && desc->bpc != 8)
777 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
778 break;
779 default:
780 dev_warn(dev, "Specify a valid connector_type: %d\n", desc->connector_type);
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200781 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200782 break;
Laurent Pinchart1185c402020-06-30 02:33:20 +0300783 }
Laurent Pinchartc4715832020-06-30 02:33:19 +0300784
Douglas Anderson3235b0f2021-04-16 15:39:30 -0700785 dev_set_drvdata(dev, panel);
786
787 /*
788 * We use runtime PM for prepare / unprepare since those power the panel
789 * on and off and those can be very slow operations. This is important
790 * to optimize powering the panel on briefly to read the EDID before
791 * fully enabling the panel.
792 */
793 pm_runtime_enable(dev);
794 pm_runtime_set_autosuspend_delay(dev, 1000);
795 pm_runtime_use_autosuspend(dev);
796
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200797 drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type);
Thierry Reding280921d2013-08-30 15:10:14 +0200798
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100799 err = drm_panel_of_backlight(&panel->base);
800 if (err)
Douglas Anderson70e12562021-04-23 09:58:47 -0700801 goto disable_pm_runtime;
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100802
Bernard Zhaoc3ee8c62020-08-01 20:02:13 +0800803 drm_panel_add(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200804
Thierry Reding280921d2013-08-30 15:10:14 +0200805 return 0;
806
Douglas Anderson70e12562021-04-23 09:58:47 -0700807disable_pm_runtime:
Douglas Andersona596fcd2021-05-17 13:08:58 -0700808 pm_runtime_dont_use_autosuspend(dev);
Douglas Anderson70e12562021-04-23 09:58:47 -0700809 pm_runtime_disable(dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200810free_ddc:
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -0700811 if (panel->ddc && (!panel->aux || panel->ddc != &panel->aux->ddc))
Thierry Reding280921d2013-08-30 15:10:14 +0200812 put_device(&panel->ddc->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200813
814 return err;
815}
816
817static int panel_simple_remove(struct device *dev)
818{
819 struct panel_simple *panel = dev_get_drvdata(dev);
820
Thierry Reding280921d2013-08-30 15:10:14 +0200821 drm_panel_remove(&panel->base);
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100822 drm_panel_disable(&panel->base);
823 drm_panel_unprepare(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200824
Douglas Andersona596fcd2021-05-17 13:08:58 -0700825 pm_runtime_dont_use_autosuspend(dev);
Douglas Anderson70e12562021-04-23 09:58:47 -0700826 pm_runtime_disable(dev);
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -0700827 if (panel->ddc && (!panel->aux || panel->ddc != &panel->aux->ddc))
Thierry Reding280921d2013-08-30 15:10:14 +0200828 put_device(&panel->ddc->dev);
829
Thierry Reding280921d2013-08-30 15:10:14 +0200830 return 0;
831}
832
Thierry Redingd02fd932014-04-29 17:21:21 +0200833static void panel_simple_shutdown(struct device *dev)
834{
835 struct panel_simple *panel = dev_get_drvdata(dev);
836
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100837 drm_panel_disable(&panel->base);
838 drm_panel_unprepare(&panel->base);
Thierry Redingd02fd932014-04-29 17:21:21 +0200839}
840
Jagan Tekibca684e2020-08-29 22:03:28 +0530841static const struct drm_display_mode ampire_am_1280800n3tzqw_t00h_mode = {
842 .clock = 71100,
843 .hdisplay = 1280,
844 .hsync_start = 1280 + 40,
845 .hsync_end = 1280 + 40 + 80,
846 .htotal = 1280 + 40 + 80 + 40,
847 .vdisplay = 800,
848 .vsync_start = 800 + 3,
849 .vsync_end = 800 + 3 + 10,
850 .vtotal = 800 + 3 + 10 + 10,
851 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
852};
853
854static const struct panel_desc ampire_am_1280800n3tzqw_t00h = {
855 .modes = &ampire_am_1280800n3tzqw_t00h_mode,
856 .num_modes = 1,
857 .bpc = 6,
858 .size = {
859 .width = 217,
860 .height = 136,
861 },
862 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
863 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
864 .connector_type = DRM_MODE_CONNECTOR_LVDS,
865};
866
Yannick Fertre966fea72017-03-28 11:44:49 +0200867static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
868 .clock = 9000,
869 .hdisplay = 480,
870 .hsync_start = 480 + 2,
871 .hsync_end = 480 + 2 + 41,
872 .htotal = 480 + 2 + 41 + 2,
873 .vdisplay = 272,
874 .vsync_start = 272 + 2,
875 .vsync_end = 272 + 2 + 10,
876 .vtotal = 272 + 2 + 10 + 2,
Yannick Fertre966fea72017-03-28 11:44:49 +0200877 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
878};
879
880static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
881 .modes = &ampire_am_480272h3tmqw_t01h_mode,
882 .num_modes = 1,
883 .bpc = 8,
884 .size = {
885 .width = 105,
886 .height = 67,
887 },
888 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
889};
890
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100891static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
892 .clock = 33333,
893 .hdisplay = 800,
894 .hsync_start = 800 + 0,
895 .hsync_end = 800 + 0 + 255,
896 .htotal = 800 + 0 + 255 + 0,
897 .vdisplay = 480,
898 .vsync_start = 480 + 2,
899 .vsync_end = 480 + 2 + 45,
900 .vtotal = 480 + 2 + 45 + 0,
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100901 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
902};
903
904static const struct panel_desc ampire_am800480r3tmqwa1h = {
905 .modes = &ampire_am800480r3tmqwa1h_mode,
906 .num_modes = 1,
907 .bpc = 6,
908 .size = {
909 .width = 152,
910 .height = 91,
911 },
912 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
913};
914
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200915static const struct display_timing santek_st0700i5y_rbslw_f_timing = {
916 .pixelclock = { 26400000, 33300000, 46800000 },
917 .hactive = { 800, 800, 800 },
918 .hfront_porch = { 16, 210, 354 },
919 .hback_porch = { 45, 36, 6 },
920 .hsync_len = { 1, 10, 40 },
921 .vactive = { 480, 480, 480 },
922 .vfront_porch = { 7, 22, 147 },
923 .vback_porch = { 22, 13, 3 },
924 .vsync_len = { 1, 10, 20 },
925 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
926 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE
927};
928
929static const struct panel_desc armadeus_st0700_adapt = {
930 .timings = &santek_st0700i5y_rbslw_f_timing,
931 .num_timings = 1,
932 .bpc = 6,
933 .size = {
934 .width = 154,
935 .height = 86,
936 },
937 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +0200938 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200939};
940
Thierry Reding280921d2013-08-30 15:10:14 +0200941static const struct drm_display_mode auo_b101aw03_mode = {
942 .clock = 51450,
943 .hdisplay = 1024,
944 .hsync_start = 1024 + 156,
945 .hsync_end = 1024 + 156 + 8,
946 .htotal = 1024 + 156 + 8 + 156,
947 .vdisplay = 600,
948 .vsync_start = 600 + 16,
949 .vsync_end = 600 + 16 + 6,
950 .vtotal = 600 + 16 + 6 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +0200951};
952
953static const struct panel_desc auo_b101aw03 = {
954 .modes = &auo_b101aw03_mode,
955 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700956 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200957 .size = {
958 .width = 223,
959 .height = 125,
960 },
Dmitry Osipenko85560822020-06-22 01:27:42 +0300961 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +0300962 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +0300963 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +0200964};
965
Douglas Anderson374bf822019-07-11 13:34:55 -0700966static const struct display_timing auo_b101ean01_timing = {
967 .pixelclock = { 65300000, 72500000, 75000000 },
968 .hactive = { 1280, 1280, 1280 },
969 .hfront_porch = { 18, 119, 119 },
970 .hback_porch = { 21, 21, 21 },
971 .hsync_len = { 32, 32, 32 },
972 .vactive = { 800, 800, 800 },
973 .vfront_porch = { 4, 4, 4 },
974 .vback_porch = { 8, 8, 8 },
975 .vsync_len = { 18, 20, 20 },
Huang Lina531bc32015-02-28 10:18:58 +0800976};
977
978static const struct panel_desc auo_b101ean01 = {
Douglas Anderson374bf822019-07-11 13:34:55 -0700979 .timings = &auo_b101ean01_timing,
980 .num_timings = 1,
Huang Lina531bc32015-02-28 10:18:58 +0800981 .bpc = 6,
982 .size = {
983 .width = 217,
984 .height = 136,
985 },
986};
987
Rob Clarkdac746e2014-08-01 17:01:06 -0400988static const struct drm_display_mode auo_b101xtn01_mode = {
989 .clock = 72000,
990 .hdisplay = 1366,
991 .hsync_start = 1366 + 20,
992 .hsync_end = 1366 + 20 + 70,
993 .htotal = 1366 + 20 + 70,
994 .vdisplay = 768,
995 .vsync_start = 768 + 14,
996 .vsync_end = 768 + 14 + 42,
997 .vtotal = 768 + 14 + 42,
Rob Clarkdac746e2014-08-01 17:01:06 -0400998 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
999};
1000
1001static const struct panel_desc auo_b101xtn01 = {
1002 .modes = &auo_b101xtn01_mode,
1003 .num_modes = 1,
1004 .bpc = 6,
1005 .size = {
1006 .width = 223,
1007 .height = 125,
1008 },
1009};
1010
Rob Clarkda4582862020-01-08 15:53:56 -08001011static const struct drm_display_mode auo_b116xak01_mode = {
1012 .clock = 69300,
1013 .hdisplay = 1366,
1014 .hsync_start = 1366 + 48,
1015 .hsync_end = 1366 + 48 + 32,
1016 .htotal = 1366 + 48 + 32 + 10,
1017 .vdisplay = 768,
1018 .vsync_start = 768 + 4,
1019 .vsync_end = 768 + 4 + 6,
1020 .vtotal = 768 + 4 + 6 + 15,
Rob Clarkda4582862020-01-08 15:53:56 -08001021 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1022};
1023
1024static const struct panel_desc auo_b116xak01 = {
1025 .modes = &auo_b116xak01_mode,
1026 .num_modes = 1,
1027 .bpc = 6,
1028 .size = {
1029 .width = 256,
1030 .height = 144,
1031 },
1032 .delay = {
1033 .hpd_absent_delay = 200,
1034 },
1035 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1036 .connector_type = DRM_MODE_CONNECTOR_eDP,
1037};
1038
Ajay Kumare35e3052014-09-01 15:40:02 +05301039static const struct drm_display_mode auo_b116xw03_mode = {
1040 .clock = 70589,
1041 .hdisplay = 1366,
1042 .hsync_start = 1366 + 40,
1043 .hsync_end = 1366 + 40 + 40,
1044 .htotal = 1366 + 40 + 40 + 32,
1045 .vdisplay = 768,
1046 .vsync_start = 768 + 10,
1047 .vsync_end = 768 + 10 + 12,
1048 .vtotal = 768 + 10 + 12 + 6,
Jitao Shi88d34572020-07-05 17:45:14 +08001049 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
Ajay Kumare35e3052014-09-01 15:40:02 +05301050};
1051
1052static const struct panel_desc auo_b116xw03 = {
1053 .modes = &auo_b116xw03_mode,
1054 .num_modes = 1,
1055 .bpc = 6,
1056 .size = {
1057 .width = 256,
1058 .height = 144,
1059 },
Jitao Shi88d34572020-07-05 17:45:14 +08001060 .delay = {
1061 .enable = 400,
1062 },
1063 .bus_flags = DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
1064 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1065 .connector_type = DRM_MODE_CONNECTOR_eDP,
Ajay Kumare35e3052014-09-01 15:40:02 +05301066};
1067
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07001068static const struct drm_display_mode auo_b133xtn01_mode = {
1069 .clock = 69500,
1070 .hdisplay = 1366,
1071 .hsync_start = 1366 + 48,
1072 .hsync_end = 1366 + 48 + 32,
1073 .htotal = 1366 + 48 + 32 + 20,
1074 .vdisplay = 768,
1075 .vsync_start = 768 + 3,
1076 .vsync_end = 768 + 3 + 6,
1077 .vtotal = 768 + 3 + 6 + 13,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07001078};
1079
1080static const struct panel_desc auo_b133xtn01 = {
1081 .modes = &auo_b133xtn01_mode,
1082 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001083 .bpc = 6,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07001084 .size = {
1085 .width = 293,
1086 .height = 165,
1087 },
1088};
1089
Ajay Kumar3e51d602014-07-31 23:12:12 +05301090static const struct drm_display_mode auo_b133htn01_mode = {
1091 .clock = 150660,
1092 .hdisplay = 1920,
1093 .hsync_start = 1920 + 172,
1094 .hsync_end = 1920 + 172 + 80,
1095 .htotal = 1920 + 172 + 80 + 60,
1096 .vdisplay = 1080,
1097 .vsync_start = 1080 + 25,
1098 .vsync_end = 1080 + 25 + 10,
1099 .vtotal = 1080 + 25 + 10 + 10,
Ajay Kumar3e51d602014-07-31 23:12:12 +05301100};
1101
1102static const struct panel_desc auo_b133htn01 = {
1103 .modes = &auo_b133htn01_mode,
1104 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001105 .bpc = 6,
Ajay Kumar3e51d602014-07-31 23:12:12 +05301106 .size = {
1107 .width = 293,
1108 .height = 165,
1109 },
1110 .delay = {
1111 .prepare = 105,
1112 .enable = 20,
1113 .unprepare = 50,
1114 },
1115};
1116
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02001117static const struct display_timing auo_g070vvn01_timings = {
1118 .pixelclock = { 33300000, 34209000, 45000000 },
1119 .hactive = { 800, 800, 800 },
1120 .hfront_porch = { 20, 40, 200 },
1121 .hback_porch = { 87, 40, 1 },
1122 .hsync_len = { 1, 48, 87 },
1123 .vactive = { 480, 480, 480 },
1124 .vfront_porch = { 5, 13, 200 },
1125 .vback_porch = { 31, 31, 29 },
1126 .vsync_len = { 1, 1, 3 },
1127};
1128
1129static const struct panel_desc auo_g070vvn01 = {
1130 .timings = &auo_g070vvn01_timings,
1131 .num_timings = 1,
1132 .bpc = 8,
1133 .size = {
1134 .width = 152,
1135 .height = 91,
1136 },
1137 .delay = {
1138 .prepare = 200,
1139 .enable = 50,
1140 .disable = 50,
1141 .unprepare = 1000,
1142 },
1143};
1144
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001145static const struct drm_display_mode auo_g101evn010_mode = {
1146 .clock = 68930,
1147 .hdisplay = 1280,
1148 .hsync_start = 1280 + 82,
1149 .hsync_end = 1280 + 82 + 2,
1150 .htotal = 1280 + 82 + 2 + 84,
1151 .vdisplay = 800,
1152 .vsync_start = 800 + 8,
1153 .vsync_end = 800 + 8 + 2,
1154 .vtotal = 800 + 8 + 2 + 6,
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001155};
1156
1157static const struct panel_desc auo_g101evn010 = {
1158 .modes = &auo_g101evn010_mode,
1159 .num_modes = 1,
1160 .bpc = 6,
1161 .size = {
1162 .width = 216,
1163 .height = 135,
1164 },
Tomi Valkeinen27a46fb2020-04-17 14:40:43 +03001165 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1166 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001167};
1168
Christoph Fritz4451c282017-12-16 14:13:36 +01001169static const struct drm_display_mode auo_g104sn02_mode = {
1170 .clock = 40000,
1171 .hdisplay = 800,
1172 .hsync_start = 800 + 40,
1173 .hsync_end = 800 + 40 + 216,
1174 .htotal = 800 + 40 + 216 + 128,
1175 .vdisplay = 600,
1176 .vsync_start = 600 + 10,
1177 .vsync_end = 600 + 10 + 35,
1178 .vtotal = 600 + 10 + 35 + 2,
Christoph Fritz4451c282017-12-16 14:13:36 +01001179};
1180
1181static const struct panel_desc auo_g104sn02 = {
1182 .modes = &auo_g104sn02_mode,
1183 .num_modes = 1,
1184 .bpc = 8,
1185 .size = {
1186 .width = 211,
1187 .height = 158,
1188 },
Stefan Riedmuellera3050f22021-06-21 17:09:28 +02001189 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1190 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Christoph Fritz4451c282017-12-16 14:13:36 +01001191};
1192
Sebastian Reichel03e909a2020-04-15 19:27:25 +02001193static const struct drm_display_mode auo_g121ean01_mode = {
1194 .clock = 66700,
1195 .hdisplay = 1280,
1196 .hsync_start = 1280 + 58,
1197 .hsync_end = 1280 + 58 + 8,
1198 .htotal = 1280 + 58 + 8 + 70,
1199 .vdisplay = 800,
1200 .vsync_start = 800 + 6,
1201 .vsync_end = 800 + 6 + 4,
1202 .vtotal = 800 + 6 + 4 + 10,
Sebastian Reichel03e909a2020-04-15 19:27:25 +02001203};
1204
1205static const struct panel_desc auo_g121ean01 = {
1206 .modes = &auo_g121ean01_mode,
1207 .num_modes = 1,
1208 .bpc = 8,
1209 .size = {
1210 .width = 261,
1211 .height = 163,
1212 },
1213 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1214 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1215};
1216
Lucas Stach697035c2016-11-30 14:09:55 +01001217static const struct display_timing auo_g133han01_timings = {
1218 .pixelclock = { 134000000, 141200000, 149000000 },
1219 .hactive = { 1920, 1920, 1920 },
1220 .hfront_porch = { 39, 58, 77 },
1221 .hback_porch = { 59, 88, 117 },
1222 .hsync_len = { 28, 42, 56 },
1223 .vactive = { 1080, 1080, 1080 },
1224 .vfront_porch = { 3, 8, 11 },
1225 .vback_porch = { 5, 14, 19 },
1226 .vsync_len = { 4, 14, 19 },
1227};
1228
1229static const struct panel_desc auo_g133han01 = {
1230 .timings = &auo_g133han01_timings,
1231 .num_timings = 1,
1232 .bpc = 8,
1233 .size = {
1234 .width = 293,
1235 .height = 165,
1236 },
1237 .delay = {
1238 .prepare = 200,
1239 .enable = 50,
1240 .disable = 50,
1241 .unprepare = 1000,
1242 },
1243 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001244 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach697035c2016-11-30 14:09:55 +01001245};
1246
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02001247static const struct drm_display_mode auo_g156xtn01_mode = {
1248 .clock = 76000,
1249 .hdisplay = 1366,
1250 .hsync_start = 1366 + 33,
1251 .hsync_end = 1366 + 33 + 67,
1252 .htotal = 1560,
1253 .vdisplay = 768,
1254 .vsync_start = 768 + 4,
1255 .vsync_end = 768 + 4 + 4,
1256 .vtotal = 806,
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02001257};
1258
1259static const struct panel_desc auo_g156xtn01 = {
1260 .modes = &auo_g156xtn01_mode,
1261 .num_modes = 1,
1262 .bpc = 8,
1263 .size = {
1264 .width = 344,
1265 .height = 194,
1266 },
1267 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1268 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1269};
1270
Lucas Stach8c31f602016-11-30 14:09:56 +01001271static const struct display_timing auo_g185han01_timings = {
1272 .pixelclock = { 120000000, 144000000, 175000000 },
1273 .hactive = { 1920, 1920, 1920 },
Lucas Stachf8c6bfc2019-07-10 15:07:40 +02001274 .hfront_porch = { 36, 120, 148 },
1275 .hback_porch = { 24, 88, 108 },
1276 .hsync_len = { 20, 48, 64 },
Lucas Stach8c31f602016-11-30 14:09:56 +01001277 .vactive = { 1080, 1080, 1080 },
1278 .vfront_porch = { 6, 10, 40 },
1279 .vback_porch = { 2, 5, 20 },
1280 .vsync_len = { 2, 5, 20 },
1281};
1282
1283static const struct panel_desc auo_g185han01 = {
1284 .timings = &auo_g185han01_timings,
1285 .num_timings = 1,
1286 .bpc = 8,
1287 .size = {
1288 .width = 409,
1289 .height = 230,
1290 },
1291 .delay = {
1292 .prepare = 50,
1293 .enable = 200,
1294 .disable = 110,
1295 .unprepare = 1000,
1296 },
1297 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001298 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8c31f602016-11-30 14:09:56 +01001299};
1300
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02001301static const struct display_timing auo_g190ean01_timings = {
1302 .pixelclock = { 90000000, 108000000, 135000000 },
1303 .hactive = { 1280, 1280, 1280 },
1304 .hfront_porch = { 126, 184, 1266 },
1305 .hback_porch = { 84, 122, 844 },
1306 .hsync_len = { 70, 102, 704 },
1307 .vactive = { 1024, 1024, 1024 },
1308 .vfront_porch = { 4, 26, 76 },
1309 .vback_porch = { 2, 8, 25 },
1310 .vsync_len = { 2, 8, 25 },
1311};
1312
1313static const struct panel_desc auo_g190ean01 = {
1314 .timings = &auo_g190ean01_timings,
1315 .num_timings = 1,
1316 .bpc = 8,
1317 .size = {
1318 .width = 376,
1319 .height = 301,
1320 },
1321 .delay = {
1322 .prepare = 50,
1323 .enable = 200,
1324 .disable = 110,
1325 .unprepare = 1000,
1326 },
1327 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1328 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1329};
1330
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001331static const struct display_timing auo_p320hvn03_timings = {
1332 .pixelclock = { 106000000, 148500000, 164000000 },
1333 .hactive = { 1920, 1920, 1920 },
1334 .hfront_porch = { 25, 50, 130 },
1335 .hback_porch = { 25, 50, 130 },
1336 .hsync_len = { 20, 40, 105 },
1337 .vactive = { 1080, 1080, 1080 },
1338 .vfront_porch = { 8, 17, 150 },
1339 .vback_porch = { 8, 17, 150 },
1340 .vsync_len = { 4, 11, 100 },
1341};
1342
1343static const struct panel_desc auo_p320hvn03 = {
1344 .timings = &auo_p320hvn03_timings,
1345 .num_timings = 1,
1346 .bpc = 8,
1347 .size = {
1348 .width = 698,
1349 .height = 393,
1350 },
1351 .delay = {
1352 .prepare = 1,
1353 .enable = 450,
1354 .unprepare = 500,
1355 },
Lucas Stach2554f152018-04-11 17:27:41 +02001356 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001357 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001358};
1359
Haixia Shi7ee933a2016-10-11 14:59:16 -07001360static const struct drm_display_mode auo_t215hvn01_mode = {
1361 .clock = 148800,
1362 .hdisplay = 1920,
1363 .hsync_start = 1920 + 88,
1364 .hsync_end = 1920 + 88 + 44,
1365 .htotal = 1920 + 88 + 44 + 148,
1366 .vdisplay = 1080,
1367 .vsync_start = 1080 + 4,
1368 .vsync_end = 1080 + 4 + 5,
1369 .vtotal = 1080 + 4 + 5 + 36,
Haixia Shi7ee933a2016-10-11 14:59:16 -07001370};
1371
1372static const struct panel_desc auo_t215hvn01 = {
1373 .modes = &auo_t215hvn01_mode,
1374 .num_modes = 1,
1375 .bpc = 8,
1376 .size = {
1377 .width = 430,
1378 .height = 270,
1379 },
1380 .delay = {
1381 .disable = 5,
1382 .unprepare = 1000,
1383 }
1384};
1385
Philipp Zabeld47df632014-12-18 16:43:43 +01001386static const struct drm_display_mode avic_tm070ddh03_mode = {
1387 .clock = 51200,
1388 .hdisplay = 1024,
1389 .hsync_start = 1024 + 160,
1390 .hsync_end = 1024 + 160 + 4,
1391 .htotal = 1024 + 160 + 4 + 156,
1392 .vdisplay = 600,
1393 .vsync_start = 600 + 17,
1394 .vsync_end = 600 + 17 + 1,
1395 .vtotal = 600 + 17 + 1 + 17,
Philipp Zabeld47df632014-12-18 16:43:43 +01001396};
1397
1398static const struct panel_desc avic_tm070ddh03 = {
1399 .modes = &avic_tm070ddh03_mode,
1400 .num_modes = 1,
1401 .bpc = 8,
1402 .size = {
1403 .width = 154,
1404 .height = 90,
1405 },
1406 .delay = {
1407 .prepare = 20,
1408 .enable = 200,
1409 .disable = 200,
1410 },
1411};
1412
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08001413static const struct drm_display_mode bananapi_s070wv20_ct16_mode = {
1414 .clock = 30000,
1415 .hdisplay = 800,
1416 .hsync_start = 800 + 40,
1417 .hsync_end = 800 + 40 + 48,
1418 .htotal = 800 + 40 + 48 + 40,
1419 .vdisplay = 480,
1420 .vsync_start = 480 + 13,
1421 .vsync_end = 480 + 13 + 3,
1422 .vtotal = 480 + 13 + 3 + 29,
1423};
1424
1425static const struct panel_desc bananapi_s070wv20_ct16 = {
1426 .modes = &bananapi_s070wv20_ct16_mode,
1427 .num_modes = 1,
1428 .bpc = 6,
1429 .size = {
1430 .width = 154,
1431 .height = 86,
1432 },
1433};
1434
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001435static const struct drm_display_mode boe_hv070wsa_mode = {
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001436 .clock = 42105,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001437 .hdisplay = 1024,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001438 .hsync_start = 1024 + 30,
1439 .hsync_end = 1024 + 30 + 30,
1440 .htotal = 1024 + 30 + 30 + 30,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001441 .vdisplay = 600,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001442 .vsync_start = 600 + 10,
1443 .vsync_end = 600 + 10 + 10,
1444 .vtotal = 600 + 10 + 10 + 10,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001445};
1446
1447static const struct panel_desc boe_hv070wsa = {
1448 .modes = &boe_hv070wsa_mode,
1449 .num_modes = 1,
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001450 .bpc = 8,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001451 .size = {
1452 .width = 154,
1453 .height = 90,
1454 },
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001455 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1456 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1457 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001458};
1459
Caesar Wangcac1a412016-12-14 11:19:56 +08001460static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
1461 {
1462 .clock = 71900,
1463 .hdisplay = 1280,
1464 .hsync_start = 1280 + 48,
1465 .hsync_end = 1280 + 48 + 32,
1466 .htotal = 1280 + 48 + 32 + 80,
1467 .vdisplay = 800,
1468 .vsync_start = 800 + 3,
1469 .vsync_end = 800 + 3 + 5,
1470 .vtotal = 800 + 3 + 5 + 24,
Caesar Wangcac1a412016-12-14 11:19:56 +08001471 },
1472 {
1473 .clock = 57500,
1474 .hdisplay = 1280,
1475 .hsync_start = 1280 + 48,
1476 .hsync_end = 1280 + 48 + 32,
1477 .htotal = 1280 + 48 + 32 + 80,
1478 .vdisplay = 800,
1479 .vsync_start = 800 + 3,
1480 .vsync_end = 800 + 3 + 5,
1481 .vtotal = 800 + 3 + 5 + 24,
Caesar Wangcac1a412016-12-14 11:19:56 +08001482 },
1483};
1484
1485static const struct panel_desc boe_nv101wxmn51 = {
1486 .modes = boe_nv101wxmn51_modes,
1487 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
1488 .bpc = 8,
1489 .size = {
1490 .width = 217,
1491 .height = 136,
1492 },
1493 .delay = {
1494 .prepare = 210,
1495 .enable = 50,
1496 .unprepare = 160,
1497 },
1498};
1499
Douglas Andersona96ee0f2020-11-09 17:00:58 -08001500static const struct drm_display_mode boe_nv110wtm_n61_modes[] = {
1501 {
1502 .clock = 207800,
1503 .hdisplay = 2160,
1504 .hsync_start = 2160 + 48,
1505 .hsync_end = 2160 + 48 + 32,
1506 .htotal = 2160 + 48 + 32 + 100,
1507 .vdisplay = 1440,
1508 .vsync_start = 1440 + 3,
1509 .vsync_end = 1440 + 3 + 6,
1510 .vtotal = 1440 + 3 + 6 + 31,
Douglas Anderson9dbf1a42020-12-01 12:56:11 -08001511 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
Douglas Andersona96ee0f2020-11-09 17:00:58 -08001512 },
1513 {
1514 .clock = 138500,
1515 .hdisplay = 2160,
1516 .hsync_start = 2160 + 48,
1517 .hsync_end = 2160 + 48 + 32,
1518 .htotal = 2160 + 48 + 32 + 100,
1519 .vdisplay = 1440,
1520 .vsync_start = 1440 + 3,
1521 .vsync_end = 1440 + 3 + 6,
1522 .vtotal = 1440 + 3 + 6 + 31,
Douglas Anderson9dbf1a42020-12-01 12:56:11 -08001523 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
Douglas Andersona96ee0f2020-11-09 17:00:58 -08001524 },
1525};
1526
1527static const struct panel_desc boe_nv110wtm_n61 = {
1528 .modes = boe_nv110wtm_n61_modes,
1529 .num_modes = ARRAY_SIZE(boe_nv110wtm_n61_modes),
1530 .bpc = 8,
1531 .size = {
1532 .width = 233,
1533 .height = 155,
1534 },
1535 .delay = {
1536 .hpd_absent_delay = 200,
1537 .prepare_to_enable = 80,
Douglas Anderson67cc24a2021-02-22 08:17:24 -08001538 .enable = 50,
Douglas Andersona96ee0f2020-11-09 17:00:58 -08001539 .unprepare = 500,
1540 },
1541 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1542 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1543 .connector_type = DRM_MODE_CONNECTOR_eDP,
1544};
1545
Douglas Andersoncfe40d02020-05-08 15:59:02 -07001546/* Also used for boe_nv133fhm_n62 */
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001547static const struct drm_display_mode boe_nv133fhm_n61_modes = {
1548 .clock = 147840,
1549 .hdisplay = 1920,
1550 .hsync_start = 1920 + 48,
1551 .hsync_end = 1920 + 48 + 32,
1552 .htotal = 1920 + 48 + 32 + 200,
1553 .vdisplay = 1080,
1554 .vsync_start = 1080 + 3,
1555 .vsync_end = 1080 + 3 + 6,
1556 .vtotal = 1080 + 3 + 6 + 31,
Stephen Boydab6fd5d2020-11-06 10:23:33 -08001557 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001558};
1559
Douglas Andersoncfe40d02020-05-08 15:59:02 -07001560/* Also used for boe_nv133fhm_n62 */
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001561static const struct panel_desc boe_nv133fhm_n61 = {
1562 .modes = &boe_nv133fhm_n61_modes,
1563 .num_modes = 1,
Douglas Anderson9694d9c2020-05-08 15:59:00 -07001564 .bpc = 6,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001565 .size = {
Douglas Anderson9694d9c2020-05-08 15:59:00 -07001566 .width = 294,
1567 .height = 165,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001568 },
1569 .delay = {
Douglas Anderson667d73d2020-07-16 13:21:22 -07001570 /*
1571 * When power is first given to the panel there's a short
1572 * spike on the HPD line. It was explained that this spike
1573 * was until the TCON data download was complete. On
1574 * one system this was measured at 8 ms. We'll put 15 ms
1575 * in the prepare delay just to be safe and take it away
1576 * from the hpd_absent_delay (which would otherwise be 200 ms)
1577 * to handle this. That means:
1578 * - If HPD isn't hooked up you still have 200 ms delay.
1579 * - If HPD is hooked up we won't try to look at it for the
1580 * first 15 ms.
1581 */
1582 .prepare = 15,
1583 .hpd_absent_delay = 185,
1584
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001585 .unprepare = 500,
1586 },
1587 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1588 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1589 .connector_type = DRM_MODE_CONNECTOR_eDP,
1590};
1591
Tobias Schramma5119812020-01-09 12:29:52 +01001592static const struct drm_display_mode boe_nv140fhmn49_modes[] = {
1593 {
1594 .clock = 148500,
1595 .hdisplay = 1920,
1596 .hsync_start = 1920 + 48,
1597 .hsync_end = 1920 + 48 + 32,
1598 .htotal = 2200,
1599 .vdisplay = 1080,
1600 .vsync_start = 1080 + 3,
1601 .vsync_end = 1080 + 3 + 5,
1602 .vtotal = 1125,
Tobias Schramma5119812020-01-09 12:29:52 +01001603 },
1604};
1605
1606static const struct panel_desc boe_nv140fhmn49 = {
1607 .modes = boe_nv140fhmn49_modes,
1608 .num_modes = ARRAY_SIZE(boe_nv140fhmn49_modes),
1609 .bpc = 6,
1610 .size = {
1611 .width = 309,
1612 .height = 174,
1613 },
1614 .delay = {
1615 .prepare = 210,
1616 .enable = 50,
1617 .unprepare = 160,
1618 },
1619 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1620 .connector_type = DRM_MODE_CONNECTOR_eDP,
1621};
1622
Giulio Benettie58edce2018-07-31 01:11:16 +02001623static const struct drm_display_mode cdtech_s043wq26h_ct7_mode = {
1624 .clock = 9000,
1625 .hdisplay = 480,
1626 .hsync_start = 480 + 5,
1627 .hsync_end = 480 + 5 + 5,
1628 .htotal = 480 + 5 + 5 + 40,
1629 .vdisplay = 272,
1630 .vsync_start = 272 + 8,
1631 .vsync_end = 272 + 8 + 8,
1632 .vtotal = 272 + 8 + 8 + 8,
Giulio Benettie58edce2018-07-31 01:11:16 +02001633 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1634};
1635
1636static const struct panel_desc cdtech_s043wq26h_ct7 = {
1637 .modes = &cdtech_s043wq26h_ct7_mode,
1638 .num_modes = 1,
1639 .bpc = 8,
1640 .size = {
1641 .width = 95,
1642 .height = 54,
1643 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001644 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Giulio Benettie58edce2018-07-31 01:11:16 +02001645};
1646
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001647/* S070PWS19HP-FC21 2017/04/22 */
1648static const struct drm_display_mode cdtech_s070pws19hp_fc21_mode = {
1649 .clock = 51200,
1650 .hdisplay = 1024,
1651 .hsync_start = 1024 + 160,
1652 .hsync_end = 1024 + 160 + 20,
1653 .htotal = 1024 + 160 + 20 + 140,
1654 .vdisplay = 600,
1655 .vsync_start = 600 + 12,
1656 .vsync_end = 600 + 12 + 3,
1657 .vtotal = 600 + 12 + 3 + 20,
1658 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1659};
1660
1661static const struct panel_desc cdtech_s070pws19hp_fc21 = {
1662 .modes = &cdtech_s070pws19hp_fc21_mode,
1663 .num_modes = 1,
1664 .bpc = 6,
1665 .size = {
1666 .width = 154,
1667 .height = 86,
1668 },
1669 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001670 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001671 .connector_type = DRM_MODE_CONNECTOR_DPI,
1672};
1673
1674/* S070SWV29HG-DC44 2017/09/21 */
1675static const struct drm_display_mode cdtech_s070swv29hg_dc44_mode = {
1676 .clock = 33300,
1677 .hdisplay = 800,
1678 .hsync_start = 800 + 210,
1679 .hsync_end = 800 + 210 + 2,
1680 .htotal = 800 + 210 + 2 + 44,
1681 .vdisplay = 480,
1682 .vsync_start = 480 + 22,
1683 .vsync_end = 480 + 22 + 2,
1684 .vtotal = 480 + 22 + 2 + 21,
1685 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1686};
1687
1688static const struct panel_desc cdtech_s070swv29hg_dc44 = {
1689 .modes = &cdtech_s070swv29hg_dc44_mode,
1690 .num_modes = 1,
1691 .bpc = 6,
1692 .size = {
1693 .width = 154,
1694 .height = 86,
1695 },
1696 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001697 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001698 .connector_type = DRM_MODE_CONNECTOR_DPI,
1699};
1700
Giulio Benetti982f9442018-07-31 01:11:14 +02001701static const struct drm_display_mode cdtech_s070wv95_ct16_mode = {
1702 .clock = 35000,
1703 .hdisplay = 800,
1704 .hsync_start = 800 + 40,
1705 .hsync_end = 800 + 40 + 40,
1706 .htotal = 800 + 40 + 40 + 48,
1707 .vdisplay = 480,
1708 .vsync_start = 480 + 29,
1709 .vsync_end = 480 + 29 + 13,
1710 .vtotal = 480 + 29 + 13 + 3,
Giulio Benetti982f9442018-07-31 01:11:14 +02001711 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1712};
1713
1714static const struct panel_desc cdtech_s070wv95_ct16 = {
1715 .modes = &cdtech_s070wv95_ct16_mode,
1716 .num_modes = 1,
1717 .bpc = 8,
1718 .size = {
1719 .width = 154,
1720 .height = 85,
1721 },
1722};
1723
Marek Vasut07c913c2020-07-28 22:12:42 +02001724static const struct display_timing chefree_ch101olhlwh_002_timing = {
1725 .pixelclock = { 68900000, 71100000, 73400000 },
1726 .hactive = { 1280, 1280, 1280 },
1727 .hfront_porch = { 65, 80, 95 },
1728 .hback_porch = { 64, 79, 94 },
1729 .hsync_len = { 1, 1, 1 },
1730 .vactive = { 800, 800, 800 },
1731 .vfront_porch = { 7, 11, 14 },
1732 .vback_porch = { 7, 11, 14 },
1733 .vsync_len = { 1, 1, 1 },
1734 .flags = DISPLAY_FLAGS_DE_HIGH,
1735};
1736
1737static const struct panel_desc chefree_ch101olhlwh_002 = {
1738 .timings = &chefree_ch101olhlwh_002_timing,
1739 .num_timings = 1,
1740 .bpc = 8,
1741 .size = {
1742 .width = 217,
1743 .height = 135,
1744 },
1745 .delay = {
1746 .enable = 200,
1747 .disable = 200,
1748 },
1749 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1750 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1751 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1752};
1753
Randy Li2cb35c82016-09-20 03:02:51 +08001754static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
1755 .clock = 66770,
1756 .hdisplay = 800,
1757 .hsync_start = 800 + 49,
1758 .hsync_end = 800 + 49 + 33,
1759 .htotal = 800 + 49 + 33 + 17,
1760 .vdisplay = 1280,
1761 .vsync_start = 1280 + 1,
1762 .vsync_end = 1280 + 1 + 7,
1763 .vtotal = 1280 + 1 + 7 + 15,
Randy Li2cb35c82016-09-20 03:02:51 +08001764 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1765};
1766
1767static const struct panel_desc chunghwa_claa070wp03xg = {
1768 .modes = &chunghwa_claa070wp03xg_mode,
1769 .num_modes = 1,
1770 .bpc = 6,
1771 .size = {
1772 .width = 94,
1773 .height = 150,
1774 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001775 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001776 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001777 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Randy Li2cb35c82016-09-20 03:02:51 +08001778};
1779
Stephen Warren4c930752014-01-07 16:46:26 -07001780static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
1781 .clock = 72070,
1782 .hdisplay = 1366,
1783 .hsync_start = 1366 + 58,
1784 .hsync_end = 1366 + 58 + 58,
1785 .htotal = 1366 + 58 + 58 + 58,
1786 .vdisplay = 768,
1787 .vsync_start = 768 + 4,
1788 .vsync_end = 768 + 4 + 4,
1789 .vtotal = 768 + 4 + 4 + 4,
Stephen Warren4c930752014-01-07 16:46:26 -07001790};
1791
1792static const struct panel_desc chunghwa_claa101wa01a = {
1793 .modes = &chunghwa_claa101wa01a_mode,
1794 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001795 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -07001796 .size = {
1797 .width = 220,
1798 .height = 120,
1799 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001800 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001801 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001802 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Stephen Warren4c930752014-01-07 16:46:26 -07001803};
1804
Thierry Reding280921d2013-08-30 15:10:14 +02001805static const struct drm_display_mode chunghwa_claa101wb01_mode = {
1806 .clock = 69300,
1807 .hdisplay = 1366,
1808 .hsync_start = 1366 + 48,
1809 .hsync_end = 1366 + 48 + 32,
1810 .htotal = 1366 + 48 + 32 + 20,
1811 .vdisplay = 768,
1812 .vsync_start = 768 + 16,
1813 .vsync_end = 768 + 16 + 8,
1814 .vtotal = 768 + 16 + 8 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02001815};
1816
1817static const struct panel_desc chunghwa_claa101wb01 = {
1818 .modes = &chunghwa_claa101wb01_mode,
1819 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001820 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +02001821 .size = {
1822 .width = 223,
1823 .height = 125,
1824 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001825 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001826 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001827 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +02001828};
1829
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001830static const struct drm_display_mode dataimage_scf0700c48ggu18_mode = {
1831 .clock = 33260,
1832 .hdisplay = 800,
1833 .hsync_start = 800 + 40,
1834 .hsync_end = 800 + 40 + 128,
1835 .htotal = 800 + 40 + 128 + 88,
1836 .vdisplay = 480,
1837 .vsync_start = 480 + 10,
1838 .vsync_end = 480 + 10 + 2,
1839 .vtotal = 480 + 10 + 2 + 33,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001840 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1841};
1842
1843static const struct panel_desc dataimage_scf0700c48ggu18 = {
1844 .modes = &dataimage_scf0700c48ggu18_mode,
1845 .num_modes = 1,
1846 .bpc = 8,
1847 .size = {
1848 .width = 152,
1849 .height = 91,
1850 },
1851 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001852 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001853};
1854
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001855static const struct display_timing dlc_dlc0700yzg_1_timing = {
1856 .pixelclock = { 45000000, 51200000, 57000000 },
1857 .hactive = { 1024, 1024, 1024 },
1858 .hfront_porch = { 100, 106, 113 },
1859 .hback_porch = { 100, 106, 113 },
1860 .hsync_len = { 100, 108, 114 },
1861 .vactive = { 600, 600, 600 },
1862 .vfront_porch = { 8, 11, 15 },
1863 .vback_porch = { 8, 11, 15 },
1864 .vsync_len = { 9, 13, 15 },
1865 .flags = DISPLAY_FLAGS_DE_HIGH,
1866};
1867
1868static const struct panel_desc dlc_dlc0700yzg_1 = {
1869 .timings = &dlc_dlc0700yzg_1_timing,
1870 .num_timings = 1,
1871 .bpc = 6,
1872 .size = {
1873 .width = 154,
1874 .height = 86,
1875 },
1876 .delay = {
1877 .prepare = 30,
1878 .enable = 200,
1879 .disable = 200,
1880 },
1881 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001882 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001883};
1884
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001885static const struct display_timing dlc_dlc1010gig_timing = {
1886 .pixelclock = { 68900000, 71100000, 73400000 },
1887 .hactive = { 1280, 1280, 1280 },
1888 .hfront_porch = { 43, 53, 63 },
1889 .hback_porch = { 43, 53, 63 },
1890 .hsync_len = { 44, 54, 64 },
1891 .vactive = { 800, 800, 800 },
1892 .vfront_porch = { 5, 8, 11 },
1893 .vback_porch = { 5, 8, 11 },
1894 .vsync_len = { 5, 7, 11 },
1895 .flags = DISPLAY_FLAGS_DE_HIGH,
1896};
1897
1898static const struct panel_desc dlc_dlc1010gig = {
1899 .timings = &dlc_dlc1010gig_timing,
1900 .num_timings = 1,
1901 .bpc = 8,
1902 .size = {
1903 .width = 216,
1904 .height = 135,
1905 },
1906 .delay = {
1907 .prepare = 60,
1908 .enable = 150,
1909 .disable = 100,
1910 .unprepare = 60,
1911 },
1912 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001913 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001914};
1915
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001916static const struct drm_display_mode edt_et035012dm6_mode = {
1917 .clock = 6500,
1918 .hdisplay = 320,
1919 .hsync_start = 320 + 20,
1920 .hsync_end = 320 + 20 + 30,
1921 .htotal = 320 + 20 + 68,
1922 .vdisplay = 240,
1923 .vsync_start = 240 + 4,
1924 .vsync_end = 240 + 4 + 4,
1925 .vtotal = 240 + 4 + 4 + 14,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001926 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1927};
1928
1929static const struct panel_desc edt_et035012dm6 = {
1930 .modes = &edt_et035012dm6_mode,
1931 .num_modes = 1,
1932 .bpc = 8,
1933 .size = {
1934 .width = 70,
1935 .height = 52,
1936 },
1937 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001938 .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001939};
1940
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00001941static const struct drm_display_mode edt_etm043080dh6gp_mode = {
1942 .clock = 10870,
1943 .hdisplay = 480,
1944 .hsync_start = 480 + 8,
1945 .hsync_end = 480 + 8 + 4,
1946 .htotal = 480 + 8 + 4 + 41,
1947
1948 /*
1949 * IWG22M: Y resolution changed for "dc_linuxfb" module crashing while
1950 * fb_align
1951 */
1952
1953 .vdisplay = 288,
1954 .vsync_start = 288 + 2,
1955 .vsync_end = 288 + 2 + 4,
1956 .vtotal = 288 + 2 + 4 + 10,
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00001957};
1958
1959static const struct panel_desc edt_etm043080dh6gp = {
1960 .modes = &edt_etm043080dh6gp_mode,
1961 .num_modes = 1,
1962 .bpc = 8,
1963 .size = {
1964 .width = 100,
1965 .height = 65,
1966 },
1967 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1968 .connector_type = DRM_MODE_CONNECTOR_DPI,
1969};
1970
Marek Vasutfd819bf2019-02-19 15:04:38 +01001971static const struct drm_display_mode edt_etm0430g0dh6_mode = {
1972 .clock = 9000,
1973 .hdisplay = 480,
1974 .hsync_start = 480 + 2,
1975 .hsync_end = 480 + 2 + 41,
1976 .htotal = 480 + 2 + 41 + 2,
1977 .vdisplay = 272,
1978 .vsync_start = 272 + 2,
1979 .vsync_end = 272 + 2 + 10,
1980 .vtotal = 272 + 2 + 10 + 2,
Marek Vasutfd819bf2019-02-19 15:04:38 +01001981 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1982};
1983
1984static const struct panel_desc edt_etm0430g0dh6 = {
1985 .modes = &edt_etm0430g0dh6_mode,
1986 .num_modes = 1,
1987 .bpc = 6,
1988 .size = {
1989 .width = 95,
1990 .height = 54,
1991 },
Stefan Riedmueller4824a5f2021-06-21 17:09:30 +02001992 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1993 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Stefan Riedmuellerd112e102021-06-21 17:09:29 +02001994 .connector_type = DRM_MODE_CONNECTOR_DPI,
Marek Vasutfd819bf2019-02-19 15:04:38 +01001995};
1996
Stefan Agner26ab0062014-05-15 11:38:45 +02001997static const struct drm_display_mode edt_et057090dhu_mode = {
1998 .clock = 25175,
1999 .hdisplay = 640,
2000 .hsync_start = 640 + 16,
2001 .hsync_end = 640 + 16 + 30,
2002 .htotal = 640 + 16 + 30 + 114,
2003 .vdisplay = 480,
2004 .vsync_start = 480 + 10,
2005 .vsync_end = 480 + 10 + 3,
2006 .vtotal = 480 + 10 + 3 + 32,
Stefan Agner26ab0062014-05-15 11:38:45 +02002007 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2008};
2009
2010static const struct panel_desc edt_et057090dhu = {
2011 .modes = &edt_et057090dhu_mode,
2012 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002013 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +02002014 .size = {
2015 .width = 115,
2016 .height = 86,
2017 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08002018 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002019 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Dmitry Osipenko75e73222020-06-22 01:27:41 +03002020 .connector_type = DRM_MODE_CONNECTOR_DPI,
Stefan Agner26ab0062014-05-15 11:38:45 +02002021};
2022
Philipp Zabelfff5de42014-05-15 12:25:47 +02002023static const struct drm_display_mode edt_etm0700g0dh6_mode = {
2024 .clock = 33260,
2025 .hdisplay = 800,
2026 .hsync_start = 800 + 40,
2027 .hsync_end = 800 + 40 + 128,
2028 .htotal = 800 + 40 + 128 + 88,
2029 .vdisplay = 480,
2030 .vsync_start = 480 + 10,
2031 .vsync_end = 480 + 10 + 2,
2032 .vtotal = 480 + 10 + 2 + 33,
Philipp Zabelfff5de42014-05-15 12:25:47 +02002033 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2034};
2035
2036static const struct panel_desc edt_etm0700g0dh6 = {
2037 .modes = &edt_etm0700g0dh6_mode,
2038 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002039 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +02002040 .size = {
2041 .width = 152,
2042 .height = 91,
2043 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08002044 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002045 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Biju Das281edb92020-10-20 10:49:10 +01002046 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabelfff5de42014-05-15 12:25:47 +02002047};
2048
Jan Tuerkaa7e6452018-06-19 11:55:44 +02002049static const struct panel_desc edt_etm0700g0bdh6 = {
2050 .modes = &edt_etm0700g0dh6_mode,
2051 .num_modes = 1,
2052 .bpc = 6,
2053 .size = {
2054 .width = 152,
2055 .height = 91,
2056 },
2057 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002058 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Stefan Riedmuellerd112e102021-06-21 17:09:29 +02002059 .connector_type = DRM_MODE_CONNECTOR_DPI,
Jan Tuerkaa7e6452018-06-19 11:55:44 +02002060};
2061
Marco Felsch9158e3c2019-04-16 12:06:45 +02002062static const struct display_timing evervision_vgg804821_timing = {
2063 .pixelclock = { 27600000, 33300000, 50000000 },
2064 .hactive = { 800, 800, 800 },
2065 .hfront_porch = { 40, 66, 70 },
2066 .hback_porch = { 40, 67, 70 },
2067 .hsync_len = { 40, 67, 70 },
2068 .vactive = { 480, 480, 480 },
2069 .vfront_porch = { 6, 10, 10 },
2070 .vback_porch = { 7, 11, 11 },
2071 .vsync_len = { 7, 11, 11 },
2072 .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH |
2073 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
2074 DISPLAY_FLAGS_SYNC_NEGEDGE,
2075};
2076
2077static const struct panel_desc evervision_vgg804821 = {
2078 .timings = &evervision_vgg804821_timing,
2079 .num_timings = 1,
2080 .bpc = 8,
2081 .size = {
2082 .width = 108,
2083 .height = 64,
2084 },
2085 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002086 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Marco Felsch9158e3c2019-04-16 12:06:45 +02002087};
2088
Boris BREZILLON102932b2014-06-05 15:53:32 +02002089static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
2090 .clock = 32260,
2091 .hdisplay = 800,
2092 .hsync_start = 800 + 168,
2093 .hsync_end = 800 + 168 + 64,
2094 .htotal = 800 + 168 + 64 + 88,
2095 .vdisplay = 480,
2096 .vsync_start = 480 + 37,
2097 .vsync_end = 480 + 37 + 2,
2098 .vtotal = 480 + 37 + 2 + 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02002099};
2100
2101static const struct panel_desc foxlink_fl500wvr00_a0t = {
2102 .modes = &foxlink_fl500wvr00_a0t_mode,
2103 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01002104 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02002105 .size = {
2106 .width = 108,
2107 .height = 65,
2108 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +02002109 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +02002110};
2111
Paul Cercueil795db2a2020-07-16 14:56:47 +02002112static const struct drm_display_mode frida_frd350h54004_modes[] = {
2113 { /* 60 Hz */
2114 .clock = 6000,
2115 .hdisplay = 320,
2116 .hsync_start = 320 + 44,
2117 .hsync_end = 320 + 44 + 16,
2118 .htotal = 320 + 44 + 16 + 20,
2119 .vdisplay = 240,
2120 .vsync_start = 240 + 2,
2121 .vsync_end = 240 + 2 + 6,
2122 .vtotal = 240 + 2 + 6 + 2,
2123 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2124 },
2125 { /* 50 Hz */
2126 .clock = 5400,
2127 .hdisplay = 320,
2128 .hsync_start = 320 + 56,
2129 .hsync_end = 320 + 56 + 16,
2130 .htotal = 320 + 56 + 16 + 40,
2131 .vdisplay = 240,
2132 .vsync_start = 240 + 2,
2133 .vsync_end = 240 + 2 + 6,
2134 .vtotal = 240 + 2 + 6 + 2,
2135 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2136 },
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002137};
2138
2139static const struct panel_desc frida_frd350h54004 = {
Paul Cercueil795db2a2020-07-16 14:56:47 +02002140 .modes = frida_frd350h54004_modes,
2141 .num_modes = ARRAY_SIZE(frida_frd350h54004_modes),
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002142 .bpc = 8,
2143 .size = {
2144 .width = 77,
2145 .height = 64,
2146 },
2147 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002148 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002149 .connector_type = DRM_MODE_CONNECTOR_DPI,
2150};
2151
Jagan Teki3be20712019-05-07 18:37:07 +05302152static const struct drm_display_mode friendlyarm_hd702e_mode = {
2153 .clock = 67185,
2154 .hdisplay = 800,
2155 .hsync_start = 800 + 20,
2156 .hsync_end = 800 + 20 + 24,
2157 .htotal = 800 + 20 + 24 + 20,
2158 .vdisplay = 1280,
2159 .vsync_start = 1280 + 4,
2160 .vsync_end = 1280 + 4 + 8,
2161 .vtotal = 1280 + 4 + 8 + 4,
Jagan Teki3be20712019-05-07 18:37:07 +05302162 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2163};
2164
2165static const struct panel_desc friendlyarm_hd702e = {
2166 .modes = &friendlyarm_hd702e_mode,
2167 .num_modes = 1,
2168 .size = {
2169 .width = 94,
2170 .height = 151,
2171 },
2172};
2173
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002174static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
2175 .clock = 9000,
2176 .hdisplay = 480,
2177 .hsync_start = 480 + 5,
2178 .hsync_end = 480 + 5 + 1,
2179 .htotal = 480 + 5 + 1 + 40,
2180 .vdisplay = 272,
2181 .vsync_start = 272 + 8,
2182 .vsync_end = 272 + 8 + 1,
2183 .vtotal = 272 + 8 + 1 + 8,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002184};
2185
2186static const struct panel_desc giantplus_gpg482739qs5 = {
2187 .modes = &giantplus_gpg482739qs5_mode,
2188 .num_modes = 1,
2189 .bpc = 8,
2190 .size = {
2191 .width = 95,
2192 .height = 54,
2193 },
Philipp Zabel33536a02015-02-11 18:50:07 +01002194 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002195};
2196
Paul Cercueil2c6574a2019-06-06 00:22:47 +02002197static const struct display_timing giantplus_gpm940b0_timing = {
2198 .pixelclock = { 13500000, 27000000, 27500000 },
2199 .hactive = { 320, 320, 320 },
2200 .hfront_porch = { 14, 686, 718 },
2201 .hback_porch = { 50, 70, 255 },
2202 .hsync_len = { 1, 1, 1 },
2203 .vactive = { 240, 240, 240 },
2204 .vfront_porch = { 1, 1, 179 },
2205 .vback_porch = { 1, 21, 31 },
2206 .vsync_len = { 1, 1, 6 },
2207 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
2208};
2209
2210static const struct panel_desc giantplus_gpm940b0 = {
2211 .timings = &giantplus_gpm940b0_timing,
2212 .num_timings = 1,
2213 .bpc = 8,
2214 .size = {
2215 .width = 60,
2216 .height = 45,
2217 },
2218 .bus_format = MEDIA_BUS_FMT_RGB888_3X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002219 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Paul Cercueil2c6574a2019-06-06 00:22:47 +02002220};
2221
Philipp Zabelab077252014-12-11 18:32:46 +01002222static const struct display_timing hannstar_hsd070pww1_timing = {
2223 .pixelclock = { 64300000, 71100000, 82000000 },
2224 .hactive = { 1280, 1280, 1280 },
2225 .hfront_porch = { 1, 1, 10 },
2226 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +02002227 /*
2228 * According to the data sheet, the minimum horizontal blanking interval
2229 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
2230 * minimum working horizontal blanking interval to be 60 clocks.
2231 */
2232 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +01002233 .vactive = { 800, 800, 800 },
2234 .vfront_porch = { 1, 1, 10 },
2235 .vback_porch = { 1, 1, 10 },
2236 .vsync_len = { 1, 21, 203 },
2237 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +02002238};
2239
2240static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +01002241 .timings = &hannstar_hsd070pww1_timing,
2242 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +02002243 .bpc = 6,
2244 .size = {
2245 .width = 151,
2246 .height = 94,
2247 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +02002248 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002249 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabela8532052014-10-23 16:31:06 +02002250};
2251
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002252static const struct display_timing hannstar_hsd100pxn1_timing = {
2253 .pixelclock = { 55000000, 65000000, 75000000 },
2254 .hactive = { 1024, 1024, 1024 },
2255 .hfront_porch = { 40, 40, 40 },
2256 .hback_porch = { 220, 220, 220 },
2257 .hsync_len = { 20, 60, 100 },
2258 .vactive = { 768, 768, 768 },
2259 .vfront_porch = { 7, 7, 7 },
2260 .vback_porch = { 21, 21, 21 },
2261 .vsync_len = { 10, 10, 10 },
2262 .flags = DISPLAY_FLAGS_DE_HIGH,
2263};
2264
2265static const struct panel_desc hannstar_hsd100pxn1 = {
2266 .timings = &hannstar_hsd100pxn1_timing,
2267 .num_timings = 1,
2268 .bpc = 6,
2269 .size = {
2270 .width = 203,
2271 .height = 152,
2272 },
Philipp Zabel4946b042015-05-20 11:34:08 +02002273 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002274 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002275};
2276
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002277static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
2278 .clock = 33333,
2279 .hdisplay = 800,
2280 .hsync_start = 800 + 85,
2281 .hsync_end = 800 + 85 + 86,
2282 .htotal = 800 + 85 + 86 + 85,
2283 .vdisplay = 480,
2284 .vsync_start = 480 + 16,
2285 .vsync_end = 480 + 16 + 13,
2286 .vtotal = 480 + 16 + 13 + 16,
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002287};
2288
2289static const struct panel_desc hitachi_tx23d38vm0caa = {
2290 .modes = &hitachi_tx23d38vm0caa_mode,
2291 .num_modes = 1,
2292 .bpc = 6,
2293 .size = {
2294 .width = 195,
2295 .height = 117,
2296 },
Philipp Zabel6c684e32017-10-11 14:59:58 +02002297 .delay = {
2298 .enable = 160,
2299 .disable = 160,
2300 },
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002301};
2302
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002303static const struct drm_display_mode innolux_at043tn24_mode = {
2304 .clock = 9000,
2305 .hdisplay = 480,
2306 .hsync_start = 480 + 2,
2307 .hsync_end = 480 + 2 + 41,
2308 .htotal = 480 + 2 + 41 + 2,
2309 .vdisplay = 272,
2310 .vsync_start = 272 + 2,
Philipp Zabela4831592017-10-11 14:59:56 +02002311 .vsync_end = 272 + 2 + 10,
2312 .vtotal = 272 + 2 + 10 + 2,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002313 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2314};
2315
2316static const struct panel_desc innolux_at043tn24 = {
2317 .modes = &innolux_at043tn24_mode,
2318 .num_modes = 1,
2319 .bpc = 8,
2320 .size = {
2321 .width = 95,
2322 .height = 54,
2323 },
2324 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002325 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002326};
2327
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002328static const struct drm_display_mode innolux_at070tn92_mode = {
2329 .clock = 33333,
2330 .hdisplay = 800,
2331 .hsync_start = 800 + 210,
2332 .hsync_end = 800 + 210 + 20,
2333 .htotal = 800 + 210 + 20 + 46,
2334 .vdisplay = 480,
2335 .vsync_start = 480 + 22,
2336 .vsync_end = 480 + 22 + 10,
2337 .vtotal = 480 + 22 + 23 + 10,
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002338};
2339
2340static const struct panel_desc innolux_at070tn92 = {
2341 .modes = &innolux_at070tn92_mode,
2342 .num_modes = 1,
2343 .size = {
2344 .width = 154,
2345 .height = 86,
2346 },
2347 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2348};
2349
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002350static const struct display_timing innolux_g070y2_l01_timing = {
2351 .pixelclock = { 28000000, 29500000, 32000000 },
2352 .hactive = { 800, 800, 800 },
2353 .hfront_porch = { 61, 91, 141 },
2354 .hback_porch = { 60, 90, 140 },
2355 .hsync_len = { 12, 12, 12 },
2356 .vactive = { 480, 480, 480 },
2357 .vfront_porch = { 4, 9, 30 },
2358 .vback_porch = { 4, 8, 28 },
2359 .vsync_len = { 2, 2, 2 },
2360 .flags = DISPLAY_FLAGS_DE_HIGH,
2361};
2362
2363static const struct panel_desc innolux_g070y2_l01 = {
2364 .timings = &innolux_g070y2_l01_timing,
2365 .num_timings = 1,
2366 .bpc = 6,
2367 .size = {
2368 .width = 152,
2369 .height = 91,
2370 },
2371 .delay = {
2372 .prepare = 10,
2373 .enable = 100,
2374 .disable = 100,
2375 .unprepare = 800,
2376 },
2377 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002378 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002379};
2380
Michael Olbrich1e29b842016-08-15 14:32:02 +02002381static const struct display_timing innolux_g101ice_l01_timing = {
2382 .pixelclock = { 60400000, 71100000, 74700000 },
2383 .hactive = { 1280, 1280, 1280 },
2384 .hfront_porch = { 41, 80, 100 },
2385 .hback_porch = { 40, 79, 99 },
2386 .hsync_len = { 1, 1, 1 },
2387 .vactive = { 800, 800, 800 },
2388 .vfront_porch = { 5, 11, 14 },
2389 .vback_porch = { 4, 11, 14 },
2390 .vsync_len = { 1, 1, 1 },
2391 .flags = DISPLAY_FLAGS_DE_HIGH,
2392};
2393
2394static const struct panel_desc innolux_g101ice_l01 = {
2395 .timings = &innolux_g101ice_l01_timing,
2396 .num_timings = 1,
2397 .bpc = 8,
2398 .size = {
2399 .width = 217,
2400 .height = 135,
2401 },
2402 .delay = {
2403 .enable = 200,
2404 .disable = 200,
2405 },
2406 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002407 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Michael Olbrich1e29b842016-08-15 14:32:02 +02002408};
2409
Lucas Stach4ae13e42016-11-30 14:09:54 +01002410static const struct display_timing innolux_g121i1_l01_timing = {
2411 .pixelclock = { 67450000, 71000000, 74550000 },
2412 .hactive = { 1280, 1280, 1280 },
2413 .hfront_porch = { 40, 80, 160 },
2414 .hback_porch = { 39, 79, 159 },
2415 .hsync_len = { 1, 1, 1 },
2416 .vactive = { 800, 800, 800 },
2417 .vfront_porch = { 5, 11, 100 },
2418 .vback_porch = { 4, 11, 99 },
2419 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01002420};
2421
2422static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01002423 .timings = &innolux_g121i1_l01_timing,
2424 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01002425 .bpc = 6,
2426 .size = {
2427 .width = 261,
2428 .height = 163,
2429 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01002430 .delay = {
2431 .enable = 200,
2432 .disable = 20,
2433 },
2434 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002435 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stachd731f662014-11-06 17:44:33 +01002436};
2437
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002438static const struct drm_display_mode innolux_g121x1_l03_mode = {
2439 .clock = 65000,
2440 .hdisplay = 1024,
2441 .hsync_start = 1024 + 0,
2442 .hsync_end = 1024 + 1,
2443 .htotal = 1024 + 0 + 1 + 320,
2444 .vdisplay = 768,
2445 .vsync_start = 768 + 38,
2446 .vsync_end = 768 + 38 + 1,
2447 .vtotal = 768 + 38 + 1 + 0,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05002448 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002449};
2450
2451static const struct panel_desc innolux_g121x1_l03 = {
2452 .modes = &innolux_g121x1_l03_mode,
2453 .num_modes = 1,
2454 .bpc = 6,
2455 .size = {
2456 .width = 246,
2457 .height = 185,
2458 },
2459 .delay = {
2460 .enable = 200,
2461 .unprepare = 200,
2462 .disable = 400,
2463 },
2464};
2465
Douglas Anderson51d35632021-01-15 14:44:20 -08002466static const struct drm_display_mode innolux_n116bca_ea1_mode = {
2467 .clock = 76420,
2468 .hdisplay = 1366,
2469 .hsync_start = 1366 + 136,
2470 .hsync_end = 1366 + 136 + 30,
2471 .htotal = 1366 + 136 + 30 + 60,
2472 .vdisplay = 768,
2473 .vsync_start = 768 + 8,
2474 .vsync_end = 768 + 8 + 12,
2475 .vtotal = 768 + 8 + 12 + 12,
2476 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2477};
2478
2479static const struct panel_desc innolux_n116bca_ea1 = {
2480 .modes = &innolux_n116bca_ea1_mode,
2481 .num_modes = 1,
2482 .bpc = 6,
2483 .size = {
2484 .width = 256,
2485 .height = 144,
2486 },
2487 .delay = {
2488 .hpd_absent_delay = 200,
2489 .prepare_to_enable = 80,
2490 .unprepare = 500,
2491 },
2492 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2493 .connector_type = DRM_MODE_CONNECTOR_eDP,
2494};
2495
Douglas Andersond719cbe2019-07-11 13:34:54 -07002496/*
2497 * Datasheet specifies that at 60 Hz refresh rate:
2498 * - total horizontal time: { 1506, 1592, 1716 }
2499 * - total vertical time: { 788, 800, 868 }
2500 *
2501 * ...but doesn't go into exactly how that should be split into a front
2502 * porch, back porch, or sync length. For now we'll leave a single setting
2503 * here which allows a bit of tweaking of the pixel clock at the expense of
2504 * refresh rate.
2505 */
2506static const struct display_timing innolux_n116bge_timing = {
2507 .pixelclock = { 72600000, 76420000, 80240000 },
2508 .hactive = { 1366, 1366, 1366 },
2509 .hfront_porch = { 136, 136, 136 },
2510 .hback_porch = { 60, 60, 60 },
2511 .hsync_len = { 30, 30, 30 },
2512 .vactive = { 768, 768, 768 },
2513 .vfront_porch = { 8, 8, 8 },
2514 .vback_porch = { 12, 12, 12 },
2515 .vsync_len = { 12, 12, 12 },
2516 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002517};
2518
2519static const struct panel_desc innolux_n116bge = {
Douglas Andersond719cbe2019-07-11 13:34:54 -07002520 .timings = &innolux_n116bge_timing,
2521 .num_timings = 1,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002522 .bpc = 6,
2523 .size = {
2524 .width = 256,
2525 .height = 144,
2526 },
Heiko Stuebner87969bc2021-01-09 14:09:51 +01002527 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2528 .connector_type = DRM_MODE_CONNECTOR_eDP,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002529};
2530
Lukas F. Hartmanna14c6b02020-11-24 18:26:04 +01002531static const struct drm_display_mode innolux_n125hce_gn1_mode = {
2532 .clock = 162000,
2533 .hdisplay = 1920,
2534 .hsync_start = 1920 + 40,
2535 .hsync_end = 1920 + 40 + 40,
2536 .htotal = 1920 + 40 + 40 + 80,
2537 .vdisplay = 1080,
2538 .vsync_start = 1080 + 4,
2539 .vsync_end = 1080 + 4 + 4,
2540 .vtotal = 1080 + 4 + 4 + 24,
2541};
2542
2543static const struct panel_desc innolux_n125hce_gn1 = {
2544 .modes = &innolux_n125hce_gn1_mode,
2545 .num_modes = 1,
2546 .bpc = 8,
2547 .size = {
2548 .width = 276,
2549 .height = 155,
2550 },
2551 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2552 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
2553 .connector_type = DRM_MODE_CONNECTOR_eDP,
2554};
2555
Alban Bedelea447392014-07-22 08:38:55 +02002556static const struct drm_display_mode innolux_n156bge_l21_mode = {
2557 .clock = 69300,
2558 .hdisplay = 1366,
2559 .hsync_start = 1366 + 16,
2560 .hsync_end = 1366 + 16 + 34,
2561 .htotal = 1366 + 16 + 34 + 50,
2562 .vdisplay = 768,
2563 .vsync_start = 768 + 2,
2564 .vsync_end = 768 + 2 + 6,
2565 .vtotal = 768 + 2 + 6 + 12,
Alban Bedelea447392014-07-22 08:38:55 +02002566};
2567
2568static const struct panel_desc innolux_n156bge_l21 = {
2569 .modes = &innolux_n156bge_l21_mode,
2570 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002571 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02002572 .size = {
2573 .width = 344,
2574 .height = 193,
2575 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03002576 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002577 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03002578 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alban Bedelea447392014-07-22 08:38:55 +02002579};
2580
Douglas Anderson8f054b62018-10-25 15:21:34 -07002581static const struct drm_display_mode innolux_p120zdg_bf1_mode = {
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302582 .clock = 206016,
2583 .hdisplay = 2160,
2584 .hsync_start = 2160 + 48,
2585 .hsync_end = 2160 + 48 + 32,
2586 .htotal = 2160 + 48 + 32 + 80,
2587 .vdisplay = 1440,
2588 .vsync_start = 1440 + 3,
2589 .vsync_end = 1440 + 3 + 10,
2590 .vtotal = 1440 + 3 + 10 + 27,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302591 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2592};
2593
Douglas Anderson8f054b62018-10-25 15:21:34 -07002594static const struct panel_desc innolux_p120zdg_bf1 = {
2595 .modes = &innolux_p120zdg_bf1_mode,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302596 .num_modes = 1,
2597 .bpc = 8,
2598 .size = {
Douglas Anderson8f054b62018-10-25 15:21:34 -07002599 .width = 254,
2600 .height = 169,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302601 },
Sean Paul22fd99e2018-08-13 17:30:40 -04002602 .delay = {
Douglas Anderson625d3b52018-10-25 15:21:31 -07002603 .hpd_absent_delay = 200,
Sean Paul22fd99e2018-08-13 17:30:40 -04002604 .unprepare = 500,
2605 },
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302606};
2607
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002608static const struct drm_display_mode innolux_zj070na_01p_mode = {
2609 .clock = 51501,
2610 .hdisplay = 1024,
2611 .hsync_start = 1024 + 128,
2612 .hsync_end = 1024 + 128 + 64,
2613 .htotal = 1024 + 128 + 64 + 128,
2614 .vdisplay = 600,
2615 .vsync_start = 600 + 16,
2616 .vsync_end = 600 + 16 + 4,
2617 .vtotal = 600 + 16 + 4 + 16,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002618};
2619
2620static const struct panel_desc innolux_zj070na_01p = {
2621 .modes = &innolux_zj070na_01p_mode,
2622 .num_modes = 1,
2623 .bpc = 6,
2624 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02002625 .width = 154,
2626 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002627 },
2628};
2629
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07002630static const struct drm_display_mode ivo_m133nwf4_r0_mode = {
2631 .clock = 138778,
2632 .hdisplay = 1920,
2633 .hsync_start = 1920 + 24,
2634 .hsync_end = 1920 + 24 + 48,
2635 .htotal = 1920 + 24 + 48 + 88,
2636 .vdisplay = 1080,
2637 .vsync_start = 1080 + 3,
2638 .vsync_end = 1080 + 3 + 12,
2639 .vtotal = 1080 + 3 + 12 + 17,
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07002640 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2641};
2642
2643static const struct panel_desc ivo_m133nwf4_r0 = {
2644 .modes = &ivo_m133nwf4_r0_mode,
2645 .num_modes = 1,
2646 .bpc = 8,
2647 .size = {
2648 .width = 294,
2649 .height = 165,
2650 },
2651 .delay = {
2652 .hpd_absent_delay = 200,
2653 .unprepare = 500,
2654 },
2655 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2656 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
2657 .connector_type = DRM_MODE_CONNECTOR_eDP,
2658};
2659
Douglas Andersonfc26a372020-08-21 08:35:15 -07002660static const struct drm_display_mode kingdisplay_kd116n21_30nv_a010_mode = {
2661 .clock = 81000,
2662 .hdisplay = 1366,
2663 .hsync_start = 1366 + 40,
2664 .hsync_end = 1366 + 40 + 32,
2665 .htotal = 1366 + 40 + 32 + 62,
2666 .vdisplay = 768,
2667 .vsync_start = 768 + 5,
2668 .vsync_end = 768 + 5 + 5,
2669 .vtotal = 768 + 5 + 5 + 122,
2670 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2671};
2672
2673static const struct panel_desc kingdisplay_kd116n21_30nv_a010 = {
2674 .modes = &kingdisplay_kd116n21_30nv_a010_mode,
2675 .num_modes = 1,
2676 .bpc = 6,
2677 .size = {
2678 .width = 256,
2679 .height = 144,
2680 },
2681 .delay = {
2682 .hpd_absent_delay = 200,
2683 },
2684 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2685 .connector_type = DRM_MODE_CONNECTOR_eDP,
2686};
2687
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02002688static const struct display_timing koe_tx14d24vm1bpa_timing = {
2689 .pixelclock = { 5580000, 5850000, 6200000 },
2690 .hactive = { 320, 320, 320 },
2691 .hfront_porch = { 30, 30, 30 },
2692 .hback_porch = { 30, 30, 30 },
2693 .hsync_len = { 1, 5, 17 },
2694 .vactive = { 240, 240, 240 },
2695 .vfront_porch = { 6, 6, 6 },
2696 .vback_porch = { 5, 5, 5 },
2697 .vsync_len = { 1, 2, 11 },
2698 .flags = DISPLAY_FLAGS_DE_HIGH,
2699};
2700
2701static const struct panel_desc koe_tx14d24vm1bpa = {
2702 .timings = &koe_tx14d24vm1bpa_timing,
2703 .num_timings = 1,
2704 .bpc = 6,
2705 .size = {
2706 .width = 115,
2707 .height = 86,
2708 },
2709};
2710
Liu Ying8a070522020-06-01 14:11:20 +08002711static const struct display_timing koe_tx26d202vm0bwa_timing = {
2712 .pixelclock = { 151820000, 156720000, 159780000 },
2713 .hactive = { 1920, 1920, 1920 },
2714 .hfront_porch = { 105, 130, 142 },
2715 .hback_porch = { 45, 70, 82 },
2716 .hsync_len = { 30, 30, 30 },
2717 .vactive = { 1200, 1200, 1200},
2718 .vfront_porch = { 3, 5, 10 },
2719 .vback_porch = { 2, 5, 10 },
2720 .vsync_len = { 5, 5, 5 },
2721};
2722
2723static const struct panel_desc koe_tx26d202vm0bwa = {
2724 .timings = &koe_tx26d202vm0bwa_timing,
2725 .num_timings = 1,
2726 .bpc = 8,
2727 .size = {
2728 .width = 217,
2729 .height = 136,
2730 },
2731 .delay = {
2732 .prepare = 1000,
2733 .enable = 1000,
2734 .unprepare = 1000,
2735 .disable = 1000,
2736 },
2737 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002738 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Liu Ying8a070522020-06-01 14:11:20 +08002739 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2740};
2741
Jagan Teki8cfe8342018-02-04 23:19:28 +05302742static const struct display_timing koe_tx31d200vm0baa_timing = {
2743 .pixelclock = { 39600000, 43200000, 48000000 },
2744 .hactive = { 1280, 1280, 1280 },
2745 .hfront_porch = { 16, 36, 56 },
2746 .hback_porch = { 16, 36, 56 },
2747 .hsync_len = { 8, 8, 8 },
2748 .vactive = { 480, 480, 480 },
Stefan Agnerc9b6be72018-04-19 23:20:03 +02002749 .vfront_porch = { 6, 21, 33 },
2750 .vback_porch = { 6, 21, 33 },
Jagan Teki8cfe8342018-02-04 23:19:28 +05302751 .vsync_len = { 8, 8, 8 },
2752 .flags = DISPLAY_FLAGS_DE_HIGH,
2753};
2754
2755static const struct panel_desc koe_tx31d200vm0baa = {
2756 .timings = &koe_tx31d200vm0baa_timing,
2757 .num_timings = 1,
2758 .bpc = 6,
2759 .size = {
2760 .width = 292,
2761 .height = 109,
2762 },
2763 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002764 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Jagan Teki8cfe8342018-02-04 23:19:28 +05302765};
2766
Lucas Stach8def22e2015-12-02 19:41:11 +01002767static const struct display_timing kyo_tcg121xglp_timing = {
2768 .pixelclock = { 52000000, 65000000, 71000000 },
2769 .hactive = { 1024, 1024, 1024 },
2770 .hfront_porch = { 2, 2, 2 },
2771 .hback_porch = { 2, 2, 2 },
2772 .hsync_len = { 86, 124, 244 },
2773 .vactive = { 768, 768, 768 },
2774 .vfront_porch = { 2, 2, 2 },
2775 .vback_porch = { 2, 2, 2 },
2776 .vsync_len = { 6, 34, 73 },
2777 .flags = DISPLAY_FLAGS_DE_HIGH,
2778};
2779
2780static const struct panel_desc kyo_tcg121xglp = {
2781 .timings = &kyo_tcg121xglp_timing,
2782 .num_timings = 1,
2783 .bpc = 8,
2784 .size = {
2785 .width = 246,
2786 .height = 184,
2787 },
2788 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002789 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8def22e2015-12-02 19:41:11 +01002790};
2791
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002792static const struct drm_display_mode lemaker_bl035_rgb_002_mode = {
2793 .clock = 7000,
2794 .hdisplay = 320,
2795 .hsync_start = 320 + 20,
2796 .hsync_end = 320 + 20 + 30,
2797 .htotal = 320 + 20 + 30 + 38,
2798 .vdisplay = 240,
2799 .vsync_start = 240 + 4,
2800 .vsync_end = 240 + 4 + 3,
2801 .vtotal = 240 + 4 + 3 + 15,
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002802};
2803
2804static const struct panel_desc lemaker_bl035_rgb_002 = {
2805 .modes = &lemaker_bl035_rgb_002_mode,
2806 .num_modes = 1,
2807 .size = {
2808 .width = 70,
2809 .height = 52,
2810 },
2811 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2812 .bus_flags = DRM_BUS_FLAG_DE_LOW,
2813};
2814
Heiko Schocherdd015002015-05-22 10:25:57 +02002815static const struct drm_display_mode lg_lb070wv8_mode = {
2816 .clock = 33246,
2817 .hdisplay = 800,
2818 .hsync_start = 800 + 88,
2819 .hsync_end = 800 + 88 + 80,
2820 .htotal = 800 + 88 + 80 + 88,
2821 .vdisplay = 480,
2822 .vsync_start = 480 + 10,
2823 .vsync_end = 480 + 10 + 25,
2824 .vtotal = 480 + 10 + 25 + 10,
Heiko Schocherdd015002015-05-22 10:25:57 +02002825};
2826
2827static const struct panel_desc lg_lb070wv8 = {
2828 .modes = &lg_lb070wv8_mode,
2829 .num_modes = 1,
Laurent Pincharta6ae2fe2020-07-12 01:53:17 +03002830 .bpc = 8,
Heiko Schocherdd015002015-05-22 10:25:57 +02002831 .size = {
2832 .width = 151,
2833 .height = 91,
2834 },
2835 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002836 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Heiko Schocherdd015002015-05-22 10:25:57 +02002837};
2838
Yakir Yangc5ece402016-06-28 12:51:15 +08002839static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
2840 .clock = 200000,
2841 .hdisplay = 1536,
2842 .hsync_start = 1536 + 12,
2843 .hsync_end = 1536 + 12 + 16,
2844 .htotal = 1536 + 12 + 16 + 48,
2845 .vdisplay = 2048,
2846 .vsync_start = 2048 + 8,
2847 .vsync_end = 2048 + 8 + 4,
2848 .vtotal = 2048 + 8 + 4 + 8,
Yakir Yangc5ece402016-06-28 12:51:15 +08002849 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2850};
2851
2852static const struct panel_desc lg_lp079qx1_sp0v = {
2853 .modes = &lg_lp079qx1_sp0v_mode,
2854 .num_modes = 1,
2855 .size = {
2856 .width = 129,
2857 .height = 171,
2858 },
2859};
2860
Yakir Yang0355dde2016-06-12 10:56:02 +08002861static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
2862 .clock = 205210,
2863 .hdisplay = 2048,
2864 .hsync_start = 2048 + 150,
2865 .hsync_end = 2048 + 150 + 5,
2866 .htotal = 2048 + 150 + 5 + 5,
2867 .vdisplay = 1536,
2868 .vsync_start = 1536 + 3,
2869 .vsync_end = 1536 + 3 + 1,
2870 .vtotal = 1536 + 3 + 1 + 9,
Yakir Yang0355dde2016-06-12 10:56:02 +08002871};
2872
2873static const struct panel_desc lg_lp097qx1_spa1 = {
2874 .modes = &lg_lp097qx1_spa1_mode,
2875 .num_modes = 1,
2876 .size = {
2877 .width = 208,
2878 .height = 147,
2879 },
2880};
2881
Jitao Shi690d8fa2016-02-22 19:01:44 +08002882static const struct drm_display_mode lg_lp120up1_mode = {
2883 .clock = 162300,
2884 .hdisplay = 1920,
2885 .hsync_start = 1920 + 40,
2886 .hsync_end = 1920 + 40 + 40,
2887 .htotal = 1920 + 40 + 40+ 80,
2888 .vdisplay = 1280,
2889 .vsync_start = 1280 + 4,
2890 .vsync_end = 1280 + 4 + 4,
2891 .vtotal = 1280 + 4 + 4 + 12,
Jitao Shi690d8fa2016-02-22 19:01:44 +08002892};
2893
2894static const struct panel_desc lg_lp120up1 = {
2895 .modes = &lg_lp120up1_mode,
2896 .num_modes = 1,
2897 .bpc = 8,
2898 .size = {
2899 .width = 267,
2900 .height = 183,
2901 },
Enric Balletbo i Serrad53139b2020-04-16 18:44:03 +02002902 .connector_type = DRM_MODE_CONNECTOR_eDP,
Jitao Shi690d8fa2016-02-22 19:01:44 +08002903};
2904
Thierry Redingec7c5652013-11-15 15:59:32 +01002905static const struct drm_display_mode lg_lp129qe_mode = {
2906 .clock = 285250,
2907 .hdisplay = 2560,
2908 .hsync_start = 2560 + 48,
2909 .hsync_end = 2560 + 48 + 32,
2910 .htotal = 2560 + 48 + 32 + 80,
2911 .vdisplay = 1700,
2912 .vsync_start = 1700 + 3,
2913 .vsync_end = 1700 + 3 + 10,
2914 .vtotal = 1700 + 3 + 10 + 36,
Thierry Redingec7c5652013-11-15 15:59:32 +01002915};
2916
2917static const struct panel_desc lg_lp129qe = {
2918 .modes = &lg_lp129qe_mode,
2919 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002920 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01002921 .size = {
2922 .width = 272,
2923 .height = 181,
2924 },
2925};
2926
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01002927static const struct display_timing logictechno_lt161010_2nh_timing = {
2928 .pixelclock = { 26400000, 33300000, 46800000 },
2929 .hactive = { 800, 800, 800 },
2930 .hfront_porch = { 16, 210, 354 },
2931 .hback_porch = { 46, 46, 46 },
2932 .hsync_len = { 1, 20, 40 },
2933 .vactive = { 480, 480, 480 },
2934 .vfront_porch = { 7, 22, 147 },
2935 .vback_porch = { 23, 23, 23 },
2936 .vsync_len = { 1, 10, 20 },
2937 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2938 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
2939 DISPLAY_FLAGS_SYNC_POSEDGE,
2940};
2941
2942static const struct panel_desc logictechno_lt161010_2nh = {
2943 .timings = &logictechno_lt161010_2nh_timing,
2944 .num_timings = 1,
2945 .size = {
2946 .width = 154,
2947 .height = 86,
2948 },
2949 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2950 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
2951 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
2952 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
2953 .connector_type = DRM_MODE_CONNECTOR_DPI,
2954};
2955
2956static const struct display_timing logictechno_lt170410_2whc_timing = {
2957 .pixelclock = { 68900000, 71100000, 73400000 },
2958 .hactive = { 1280, 1280, 1280 },
2959 .hfront_porch = { 23, 60, 71 },
2960 .hback_porch = { 23, 60, 71 },
2961 .hsync_len = { 15, 40, 47 },
2962 .vactive = { 800, 800, 800 },
2963 .vfront_porch = { 5, 7, 10 },
2964 .vback_porch = { 5, 7, 10 },
2965 .vsync_len = { 6, 9, 12 },
2966 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2967 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
2968 DISPLAY_FLAGS_SYNC_POSEDGE,
2969};
2970
2971static const struct panel_desc logictechno_lt170410_2whc = {
2972 .timings = &logictechno_lt170410_2whc_timing,
2973 .num_timings = 1,
2974 .size = {
2975 .width = 217,
2976 .height = 136,
2977 },
2978 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002979 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01002980 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2981};
2982
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002983static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
2984 .clock = 30400,
2985 .hdisplay = 800,
2986 .hsync_start = 800 + 0,
2987 .hsync_end = 800 + 1,
2988 .htotal = 800 + 0 + 1 + 160,
2989 .vdisplay = 480,
2990 .vsync_start = 480 + 0,
2991 .vsync_end = 480 + 48 + 1,
2992 .vtotal = 480 + 48 + 1 + 0,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002993 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2994};
2995
Adam Ford0d354082019-10-16 08:51:45 -05002996static const struct drm_display_mode logicpd_type_28_mode = {
Ville Syrjäläf873c5d2020-03-02 22:34:40 +02002997 .clock = 9107,
Adam Ford0d354082019-10-16 08:51:45 -05002998 .hdisplay = 480,
2999 .hsync_start = 480 + 3,
3000 .hsync_end = 480 + 3 + 42,
3001 .htotal = 480 + 3 + 42 + 2,
3002
3003 .vdisplay = 272,
3004 .vsync_start = 272 + 2,
3005 .vsync_end = 272 + 2 + 11,
3006 .vtotal = 272 + 2 + 11 + 3,
Adam Ford0d354082019-10-16 08:51:45 -05003007 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3008};
3009
3010static const struct panel_desc logicpd_type_28 = {
3011 .modes = &logicpd_type_28_mode,
3012 .num_modes = 1,
3013 .bpc = 8,
3014 .size = {
3015 .width = 105,
3016 .height = 67,
3017 },
3018 .delay = {
3019 .prepare = 200,
3020 .enable = 200,
3021 .unprepare = 200,
3022 .disable = 200,
3023 },
3024 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3025 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3026 DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
Adam Fordefb94792020-06-15 08:19:34 -05003027 .connector_type = DRM_MODE_CONNECTOR_DPI,
Adam Ford0d354082019-10-16 08:51:45 -05003028};
3029
Lukasz Majewski65c766c2017-10-21 00:18:37 +02003030static const struct panel_desc mitsubishi_aa070mc01 = {
3031 .modes = &mitsubishi_aa070mc01_mode,
3032 .num_modes = 1,
3033 .bpc = 8,
3034 .size = {
3035 .width = 152,
3036 .height = 91,
3037 },
3038
3039 .delay = {
3040 .enable = 200,
3041 .unprepare = 200,
3042 .disable = 400,
3043 },
3044 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003045 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02003046 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
3047};
3048
Lucas Stach01bacc132017-06-08 20:07:55 +02003049static const struct display_timing nec_nl12880bc20_05_timing = {
3050 .pixelclock = { 67000000, 71000000, 75000000 },
3051 .hactive = { 1280, 1280, 1280 },
3052 .hfront_porch = { 2, 30, 30 },
3053 .hback_porch = { 6, 100, 100 },
3054 .hsync_len = { 2, 30, 30 },
3055 .vactive = { 800, 800, 800 },
3056 .vfront_porch = { 5, 5, 5 },
3057 .vback_porch = { 11, 11, 11 },
3058 .vsync_len = { 7, 7, 7 },
3059};
3060
3061static const struct panel_desc nec_nl12880bc20_05 = {
3062 .timings = &nec_nl12880bc20_05_timing,
3063 .num_timings = 1,
3064 .bpc = 8,
3065 .size = {
3066 .width = 261,
3067 .height = 163,
3068 },
3069 .delay = {
3070 .enable = 50,
3071 .disable = 50,
3072 },
3073 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003074 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach01bacc132017-06-08 20:07:55 +02003075};
3076
jianwei wangc6e87f92015-07-29 16:30:02 +08003077static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
3078 .clock = 10870,
3079 .hdisplay = 480,
3080 .hsync_start = 480 + 2,
3081 .hsync_end = 480 + 2 + 41,
3082 .htotal = 480 + 2 + 41 + 2,
3083 .vdisplay = 272,
3084 .vsync_start = 272 + 2,
3085 .vsync_end = 272 + 2 + 4,
3086 .vtotal = 272 + 2 + 4 + 2,
Stefan Agner4bc390c2015-11-17 19:10:29 -08003087 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08003088};
3089
3090static const struct panel_desc nec_nl4827hc19_05b = {
3091 .modes = &nec_nl4827hc19_05b_mode,
3092 .num_modes = 1,
3093 .bpc = 8,
3094 .size = {
3095 .width = 95,
3096 .height = 54,
3097 },
Stefan Agner2c806612016-02-08 12:50:13 -08003098 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003099 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08003100};
3101
Maxime Riparde6c2f062016-09-06 16:46:17 +02003102static const struct drm_display_mode netron_dy_e231732_mode = {
3103 .clock = 66000,
3104 .hdisplay = 1024,
3105 .hsync_start = 1024 + 160,
3106 .hsync_end = 1024 + 160 + 70,
3107 .htotal = 1024 + 160 + 70 + 90,
3108 .vdisplay = 600,
3109 .vsync_start = 600 + 127,
3110 .vsync_end = 600 + 127 + 20,
3111 .vtotal = 600 + 127 + 20 + 3,
Maxime Riparde6c2f062016-09-06 16:46:17 +02003112};
3113
3114static const struct panel_desc netron_dy_e231732 = {
3115 .modes = &netron_dy_e231732_mode,
3116 .num_modes = 1,
3117 .size = {
3118 .width = 154,
3119 .height = 87,
3120 },
3121 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3122};
3123
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08003124static const struct drm_display_mode neweast_wjfh116008a_modes[] = {
3125 {
3126 .clock = 138500,
3127 .hdisplay = 1920,
3128 .hsync_start = 1920 + 48,
3129 .hsync_end = 1920 + 48 + 32,
3130 .htotal = 1920 + 48 + 32 + 80,
3131 .vdisplay = 1080,
3132 .vsync_start = 1080 + 3,
3133 .vsync_end = 1080 + 3 + 5,
3134 .vtotal = 1080 + 3 + 5 + 23,
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08003135 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3136 }, {
3137 .clock = 110920,
3138 .hdisplay = 1920,
3139 .hsync_start = 1920 + 48,
3140 .hsync_end = 1920 + 48 + 32,
3141 .htotal = 1920 + 48 + 32 + 80,
3142 .vdisplay = 1080,
3143 .vsync_start = 1080 + 3,
3144 .vsync_end = 1080 + 3 + 5,
3145 .vtotal = 1080 + 3 + 5 + 23,
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08003146 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3147 }
3148};
3149
3150static const struct panel_desc neweast_wjfh116008a = {
3151 .modes = neweast_wjfh116008a_modes,
3152 .num_modes = 2,
3153 .bpc = 6,
3154 .size = {
3155 .width = 260,
3156 .height = 150,
3157 },
3158 .delay = {
3159 .prepare = 110,
3160 .enable = 20,
3161 .unprepare = 500,
3162 },
3163 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3164 .connector_type = DRM_MODE_CONNECTOR_eDP,
3165};
3166
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003167static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
3168 .clock = 9000,
3169 .hdisplay = 480,
3170 .hsync_start = 480 + 2,
3171 .hsync_end = 480 + 2 + 41,
3172 .htotal = 480 + 2 + 41 + 2,
3173 .vdisplay = 272,
3174 .vsync_start = 272 + 2,
3175 .vsync_end = 272 + 2 + 10,
3176 .vtotal = 272 + 2 + 10 + 2,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003177 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3178};
3179
3180static const struct panel_desc newhaven_nhd_43_480272ef_atxl = {
3181 .modes = &newhaven_nhd_43_480272ef_atxl_mode,
3182 .num_modes = 1,
3183 .bpc = 8,
3184 .size = {
3185 .width = 95,
3186 .height = 54,
3187 },
3188 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003189 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3190 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Tomi Valkeinen8a4f5e12020-06-09 13:28:09 +03003191 .connector_type = DRM_MODE_CONNECTOR_DPI,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003192};
3193
Lucas Stach4177fa62017-06-08 20:07:57 +02003194static const struct display_timing nlt_nl192108ac18_02d_timing = {
3195 .pixelclock = { 130000000, 148350000, 163000000 },
3196 .hactive = { 1920, 1920, 1920 },
3197 .hfront_porch = { 80, 100, 100 },
3198 .hback_porch = { 100, 120, 120 },
3199 .hsync_len = { 50, 60, 60 },
3200 .vactive = { 1080, 1080, 1080 },
3201 .vfront_porch = { 12, 30, 30 },
3202 .vback_porch = { 4, 10, 10 },
3203 .vsync_len = { 4, 5, 5 },
3204};
3205
3206static const struct panel_desc nlt_nl192108ac18_02d = {
3207 .timings = &nlt_nl192108ac18_02d_timing,
3208 .num_timings = 1,
3209 .bpc = 8,
3210 .size = {
3211 .width = 344,
3212 .height = 194,
3213 },
3214 .delay = {
3215 .unprepare = 500,
3216 },
3217 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003218 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach4177fa62017-06-08 20:07:57 +02003219};
3220
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02003221static const struct drm_display_mode nvd_9128_mode = {
3222 .clock = 29500,
3223 .hdisplay = 800,
3224 .hsync_start = 800 + 130,
3225 .hsync_end = 800 + 130 + 98,
3226 .htotal = 800 + 0 + 130 + 98,
3227 .vdisplay = 480,
3228 .vsync_start = 480 + 10,
3229 .vsync_end = 480 + 10 + 50,
3230 .vtotal = 480 + 0 + 10 + 50,
3231};
3232
3233static const struct panel_desc nvd_9128 = {
3234 .modes = &nvd_9128_mode,
3235 .num_modes = 1,
3236 .bpc = 8,
3237 .size = {
3238 .width = 156,
3239 .height = 88,
3240 },
3241 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003242 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02003243};
3244
Gary Bissona99fb622015-06-10 18:44:23 +02003245static const struct display_timing okaya_rs800480t_7x0gp_timing = {
3246 .pixelclock = { 30000000, 30000000, 40000000 },
3247 .hactive = { 800, 800, 800 },
3248 .hfront_porch = { 40, 40, 40 },
3249 .hback_porch = { 40, 40, 40 },
3250 .hsync_len = { 1, 48, 48 },
3251 .vactive = { 480, 480, 480 },
3252 .vfront_porch = { 13, 13, 13 },
3253 .vback_porch = { 29, 29, 29 },
3254 .vsync_len = { 3, 3, 3 },
3255 .flags = DISPLAY_FLAGS_DE_HIGH,
3256};
3257
3258static const struct panel_desc okaya_rs800480t_7x0gp = {
3259 .timings = &okaya_rs800480t_7x0gp_timing,
3260 .num_timings = 1,
3261 .bpc = 6,
3262 .size = {
3263 .width = 154,
3264 .height = 87,
3265 },
3266 .delay = {
3267 .prepare = 41,
3268 .enable = 50,
3269 .unprepare = 41,
3270 .disable = 50,
3271 },
3272 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3273};
3274
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003275static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
3276 .clock = 9000,
3277 .hdisplay = 480,
3278 .hsync_start = 480 + 5,
3279 .hsync_end = 480 + 5 + 30,
3280 .htotal = 480 + 5 + 30 + 10,
3281 .vdisplay = 272,
3282 .vsync_start = 272 + 8,
3283 .vsync_end = 272 + 8 + 5,
3284 .vtotal = 272 + 8 + 5 + 3,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003285};
3286
3287static const struct panel_desc olimex_lcd_olinuxino_43ts = {
3288 .modes = &olimex_lcd_olinuxino_43ts_mode,
3289 .num_modes = 1,
3290 .size = {
Jonathan Liu30c6d7ab92017-07-20 20:29:43 +10003291 .width = 95,
3292 .height = 54,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003293 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10003294 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003295};
3296
Eric Anholte8b6f562016-03-24 17:23:48 -07003297/*
3298 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
3299 * pixel clocks, but this is the timing that was being used in the Adafruit
3300 * installation instructions.
3301 */
3302static const struct drm_display_mode ontat_yx700wv03_mode = {
3303 .clock = 29500,
3304 .hdisplay = 800,
3305 .hsync_start = 824,
3306 .hsync_end = 896,
3307 .htotal = 992,
3308 .vdisplay = 480,
3309 .vsync_start = 483,
3310 .vsync_end = 493,
3311 .vtotal = 500,
Eric Anholte8b6f562016-03-24 17:23:48 -07003312 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3313};
3314
3315/*
3316 * Specification at:
3317 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
3318 */
3319static const struct panel_desc ontat_yx700wv03 = {
3320 .modes = &ontat_yx700wv03_mode,
3321 .num_modes = 1,
3322 .bpc = 8,
3323 .size = {
3324 .width = 154,
3325 .height = 83,
3326 },
Eric Anholt5651e5e2018-03-09 15:33:32 -08003327 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Eric Anholte8b6f562016-03-24 17:23:48 -07003328};
3329
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003330static const struct drm_display_mode ortustech_com37h3m_mode = {
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003331 .clock = 22230,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003332 .hdisplay = 480,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003333 .hsync_start = 480 + 40,
3334 .hsync_end = 480 + 40 + 10,
3335 .htotal = 480 + 40 + 10 + 40,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003336 .vdisplay = 640,
3337 .vsync_start = 640 + 4,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003338 .vsync_end = 640 + 4 + 2,
3339 .vtotal = 640 + 4 + 2 + 4,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003340 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3341};
3342
3343static const struct panel_desc ortustech_com37h3m = {
3344 .modes = &ortustech_com37h3m_mode,
3345 .num_modes = 1,
3346 .bpc = 8,
3347 .size = {
3348 .width = 56, /* 56.16mm */
3349 .height = 75, /* 74.88mm */
3350 },
3351 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003352 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003353 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
3354};
3355
Philipp Zabel725c9d42015-02-11 18:50:11 +01003356static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
3357 .clock = 25000,
3358 .hdisplay = 480,
3359 .hsync_start = 480 + 10,
3360 .hsync_end = 480 + 10 + 10,
3361 .htotal = 480 + 10 + 10 + 15,
3362 .vdisplay = 800,
3363 .vsync_start = 800 + 3,
3364 .vsync_end = 800 + 3 + 3,
3365 .vtotal = 800 + 3 + 3 + 3,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003366};
3367
3368static const struct panel_desc ortustech_com43h4m85ulc = {
3369 .modes = &ortustech_com43h4m85ulc_mode,
3370 .num_modes = 1,
Laurent Pinchart3b809512020-08-24 03:32:54 +03003371 .bpc = 6,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003372 .size = {
3373 .width = 56,
3374 .height = 93,
3375 },
Laurent Pinchartf098f162020-08-13 01:02:44 +03003376 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003377 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Laurent Pinchart2ccedf42020-03-09 20:42:10 +02003378 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003379};
3380
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003381static const struct drm_display_mode osddisplays_osd070t1718_19ts_mode = {
3382 .clock = 33000,
3383 .hdisplay = 800,
3384 .hsync_start = 800 + 210,
3385 .hsync_end = 800 + 210 + 30,
3386 .htotal = 800 + 210 + 30 + 16,
3387 .vdisplay = 480,
3388 .vsync_start = 480 + 22,
3389 .vsync_end = 480 + 22 + 13,
3390 .vtotal = 480 + 22 + 13 + 10,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003391 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3392};
3393
3394static const struct panel_desc osddisplays_osd070t1718_19ts = {
3395 .modes = &osddisplays_osd070t1718_19ts_mode,
3396 .num_modes = 1,
3397 .bpc = 8,
3398 .size = {
3399 .width = 152,
3400 .height = 91,
3401 },
3402 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Tomi Valkeinenfb0629e2019-11-14 11:39:50 +02003403 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3404 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Laurent Pincharta793f0e2019-09-04 16:37:23 +03003405 .connector_type = DRM_MODE_CONNECTOR_DPI,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003406};
3407
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003408static const struct drm_display_mode pda_91_00156_a0_mode = {
3409 .clock = 33300,
3410 .hdisplay = 800,
3411 .hsync_start = 800 + 1,
3412 .hsync_end = 800 + 1 + 64,
3413 .htotal = 800 + 1 + 64 + 64,
3414 .vdisplay = 480,
3415 .vsync_start = 480 + 1,
3416 .vsync_end = 480 + 1 + 23,
3417 .vtotal = 480 + 1 + 23 + 22,
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003418};
3419
3420static const struct panel_desc pda_91_00156_a0 = {
3421 .modes = &pda_91_00156_a0_mode,
3422 .num_modes = 1,
3423 .size = {
3424 .width = 152,
3425 .height = 91,
3426 },
3427 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3428};
3429
Marek Vasutd69de692020-07-28 14:12:46 +02003430static const struct drm_display_mode powertip_ph800480t013_idf02_mode = {
3431 .clock = 24750,
3432 .hdisplay = 800,
3433 .hsync_start = 800 + 54,
3434 .hsync_end = 800 + 54 + 2,
3435 .htotal = 800 + 54 + 2 + 44,
3436 .vdisplay = 480,
3437 .vsync_start = 480 + 49,
3438 .vsync_end = 480 + 49 + 2,
3439 .vtotal = 480 + 49 + 2 + 22,
3440};
3441
3442static const struct panel_desc powertip_ph800480t013_idf02 = {
3443 .modes = &powertip_ph800480t013_idf02_mode,
3444 .num_modes = 1,
3445 .size = {
3446 .width = 152,
3447 .height = 91,
3448 },
3449 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
3450 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
3451 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
3452 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3453 .connector_type = DRM_MODE_CONNECTOR_DPI,
3454};
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003455
Josh Wud2a6f0f2015-10-08 17:42:41 +02003456static const struct drm_display_mode qd43003c0_40_mode = {
3457 .clock = 9000,
3458 .hdisplay = 480,
3459 .hsync_start = 480 + 8,
3460 .hsync_end = 480 + 8 + 4,
3461 .htotal = 480 + 8 + 4 + 39,
3462 .vdisplay = 272,
3463 .vsync_start = 272 + 4,
3464 .vsync_end = 272 + 4 + 10,
3465 .vtotal = 272 + 4 + 10 + 2,
Josh Wud2a6f0f2015-10-08 17:42:41 +02003466};
3467
3468static const struct panel_desc qd43003c0_40 = {
3469 .modes = &qd43003c0_40_mode,
3470 .num_modes = 1,
3471 .bpc = 8,
3472 .size = {
3473 .width = 95,
3474 .height = 53,
3475 },
3476 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3477};
3478
Jagan Teki23167fa2018-06-07 19:16:48 +05303479static const struct display_timing rocktech_rk070er9427_timing = {
3480 .pixelclock = { 26400000, 33300000, 46800000 },
3481 .hactive = { 800, 800, 800 },
3482 .hfront_porch = { 16, 210, 354 },
3483 .hback_porch = { 46, 46, 46 },
3484 .hsync_len = { 1, 1, 1 },
3485 .vactive = { 480, 480, 480 },
3486 .vfront_porch = { 7, 22, 147 },
3487 .vback_porch = { 23, 23, 23 },
3488 .vsync_len = { 1, 1, 1 },
3489 .flags = DISPLAY_FLAGS_DE_HIGH,
3490};
3491
3492static const struct panel_desc rocktech_rk070er9427 = {
3493 .timings = &rocktech_rk070er9427_timing,
3494 .num_timings = 1,
3495 .bpc = 6,
3496 .size = {
3497 .width = 154,
3498 .height = 86,
3499 },
3500 .delay = {
3501 .prepare = 41,
3502 .enable = 50,
3503 .unprepare = 41,
3504 .disable = 50,
3505 },
3506 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3507};
3508
Jyri Sarhaf3050472020-02-11 14:17:18 +02003509static const struct drm_display_mode rocktech_rk101ii01d_ct_mode = {
3510 .clock = 71100,
3511 .hdisplay = 1280,
3512 .hsync_start = 1280 + 48,
3513 .hsync_end = 1280 + 48 + 32,
3514 .htotal = 1280 + 48 + 32 + 80,
3515 .vdisplay = 800,
3516 .vsync_start = 800 + 2,
3517 .vsync_end = 800 + 2 + 5,
3518 .vtotal = 800 + 2 + 5 + 16,
Jyri Sarhaf3050472020-02-11 14:17:18 +02003519};
3520
3521static const struct panel_desc rocktech_rk101ii01d_ct = {
3522 .modes = &rocktech_rk101ii01d_ct_mode,
3523 .num_modes = 1,
3524 .size = {
3525 .width = 217,
3526 .height = 136,
3527 },
3528 .delay = {
3529 .prepare = 50,
3530 .disable = 50,
3531 },
3532 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
3533 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3534 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3535};
3536
Yakir Yang0330eaf2016-06-12 10:56:13 +08003537static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
3538 .clock = 271560,
3539 .hdisplay = 2560,
3540 .hsync_start = 2560 + 48,
3541 .hsync_end = 2560 + 48 + 32,
3542 .htotal = 2560 + 48 + 32 + 80,
3543 .vdisplay = 1600,
3544 .vsync_start = 1600 + 2,
3545 .vsync_end = 1600 + 2 + 5,
3546 .vtotal = 1600 + 2 + 5 + 57,
Yakir Yang0330eaf2016-06-12 10:56:13 +08003547};
3548
3549static const struct panel_desc samsung_lsn122dl01_c01 = {
3550 .modes = &samsung_lsn122dl01_c01_mode,
3551 .num_modes = 1,
3552 .size = {
3553 .width = 263,
3554 .height = 164,
3555 },
3556};
3557
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003558static const struct drm_display_mode samsung_ltn101nt05_mode = {
3559 .clock = 54030,
3560 .hdisplay = 1024,
3561 .hsync_start = 1024 + 24,
3562 .hsync_end = 1024 + 24 + 136,
3563 .htotal = 1024 + 24 + 136 + 160,
3564 .vdisplay = 600,
3565 .vsync_start = 600 + 3,
3566 .vsync_end = 600 + 3 + 6,
3567 .vtotal = 600 + 3 + 6 + 61,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003568};
3569
3570static const struct panel_desc samsung_ltn101nt05 = {
3571 .modes = &samsung_ltn101nt05_mode,
3572 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07003573 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003574 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02003575 .width = 223,
3576 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003577 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03003578 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003579 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03003580 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003581};
3582
Stéphane Marchesin0c934302015-03-18 10:52:18 +01003583static const struct drm_display_mode samsung_ltn140at29_301_mode = {
3584 .clock = 76300,
3585 .hdisplay = 1366,
3586 .hsync_start = 1366 + 64,
3587 .hsync_end = 1366 + 64 + 48,
3588 .htotal = 1366 + 64 + 48 + 128,
3589 .vdisplay = 768,
3590 .vsync_start = 768 + 2,
3591 .vsync_end = 768 + 2 + 5,
3592 .vtotal = 768 + 2 + 5 + 17,
Stéphane Marchesin0c934302015-03-18 10:52:18 +01003593};
3594
3595static const struct panel_desc samsung_ltn140at29_301 = {
3596 .modes = &samsung_ltn140at29_301_mode,
3597 .num_modes = 1,
3598 .bpc = 6,
3599 .size = {
3600 .width = 320,
3601 .height = 187,
3602 },
3603};
3604
Miquel Raynal44c58c52020-01-09 19:40:37 +01003605static const struct display_timing satoz_sat050at40h12r2_timing = {
3606 .pixelclock = {33300000, 33300000, 50000000},
3607 .hactive = {800, 800, 800},
3608 .hfront_porch = {16, 210, 354},
3609 .hback_porch = {46, 46, 46},
3610 .hsync_len = {1, 1, 40},
3611 .vactive = {480, 480, 480},
3612 .vfront_porch = {7, 22, 147},
3613 .vback_porch = {23, 23, 23},
3614 .vsync_len = {1, 1, 20},
3615};
3616
3617static const struct panel_desc satoz_sat050at40h12r2 = {
3618 .timings = &satoz_sat050at40h12r2_timing,
3619 .num_timings = 1,
3620 .bpc = 8,
3621 .size = {
3622 .width = 108,
3623 .height = 65,
3624 },
Laurent Pinchart34ca6b52020-06-30 02:33:18 +03003625 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Miquel Raynal44c58c52020-01-09 19:40:37 +01003626 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3627};
3628
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07003629static const struct drm_display_mode sharp_ld_d5116z01b_mode = {
3630 .clock = 168480,
3631 .hdisplay = 1920,
3632 .hsync_start = 1920 + 48,
3633 .hsync_end = 1920 + 48 + 32,
3634 .htotal = 1920 + 48 + 32 + 80,
3635 .vdisplay = 1280,
3636 .vsync_start = 1280 + 3,
3637 .vsync_end = 1280 + 3 + 10,
3638 .vtotal = 1280 + 3 + 10 + 57,
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07003639 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3640};
3641
3642static const struct panel_desc sharp_ld_d5116z01b = {
3643 .modes = &sharp_ld_d5116z01b_mode,
3644 .num_modes = 1,
3645 .bpc = 8,
3646 .size = {
3647 .width = 260,
3648 .height = 120,
3649 },
3650 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3651 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
3652};
3653
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003654static const struct drm_display_mode sharp_lq070y3dg3b_mode = {
3655 .clock = 33260,
3656 .hdisplay = 800,
3657 .hsync_start = 800 + 64,
3658 .hsync_end = 800 + 64 + 128,
3659 .htotal = 800 + 64 + 128 + 64,
3660 .vdisplay = 480,
3661 .vsync_start = 480 + 8,
3662 .vsync_end = 480 + 8 + 2,
3663 .vtotal = 480 + 8 + 2 + 35,
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003664 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3665};
3666
3667static const struct panel_desc sharp_lq070y3dg3b = {
3668 .modes = &sharp_lq070y3dg3b_mode,
3669 .num_modes = 1,
3670 .bpc = 8,
3671 .size = {
3672 .width = 152, /* 152.4mm */
3673 .height = 91, /* 91.4mm */
3674 },
3675 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003676 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003677 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
3678};
3679
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003680static const struct drm_display_mode sharp_lq035q7db03_mode = {
3681 .clock = 5500,
3682 .hdisplay = 240,
3683 .hsync_start = 240 + 16,
3684 .hsync_end = 240 + 16 + 7,
3685 .htotal = 240 + 16 + 7 + 5,
3686 .vdisplay = 320,
3687 .vsync_start = 320 + 9,
3688 .vsync_end = 320 + 9 + 1,
3689 .vtotal = 320 + 9 + 1 + 7,
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003690};
3691
3692static const struct panel_desc sharp_lq035q7db03 = {
3693 .modes = &sharp_lq035q7db03_mode,
3694 .num_modes = 1,
3695 .bpc = 6,
3696 .size = {
3697 .width = 54,
3698 .height = 72,
3699 },
3700 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3701};
3702
Joshua Clayton592aa022016-07-06 15:59:16 -07003703static const struct display_timing sharp_lq101k1ly04_timing = {
3704 .pixelclock = { 60000000, 65000000, 80000000 },
3705 .hactive = { 1280, 1280, 1280 },
3706 .hfront_porch = { 20, 20, 20 },
3707 .hback_porch = { 20, 20, 20 },
3708 .hsync_len = { 10, 10, 10 },
3709 .vactive = { 800, 800, 800 },
3710 .vfront_porch = { 4, 4, 4 },
3711 .vback_porch = { 4, 4, 4 },
3712 .vsync_len = { 4, 4, 4 },
3713 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3714};
3715
3716static const struct panel_desc sharp_lq101k1ly04 = {
3717 .timings = &sharp_lq101k1ly04_timing,
3718 .num_timings = 1,
3719 .bpc = 8,
3720 .size = {
3721 .width = 217,
3722 .height = 136,
3723 },
3724 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003725 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Joshua Clayton592aa022016-07-06 15:59:16 -07003726};
3727
Sean Paul9f7bae22018-02-08 12:48:52 -05003728static const struct display_timing sharp_lq123p1jx31_timing = {
3729 .pixelclock = { 252750000, 252750000, 266604720 },
3730 .hactive = { 2400, 2400, 2400 },
3731 .hfront_porch = { 48, 48, 48 },
3732 .hback_porch = { 80, 80, 84 },
3733 .hsync_len = { 32, 32, 32 },
3734 .vactive = { 1600, 1600, 1600 },
3735 .vfront_porch = { 3, 3, 3 },
3736 .vback_porch = { 33, 33, 120 },
3737 .vsync_len = { 10, 10, 10 },
3738 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Yakir Yang739c7de2016-06-12 10:56:35 +08003739};
3740
3741static const struct panel_desc sharp_lq123p1jx31 = {
Sean Paul9f7bae22018-02-08 12:48:52 -05003742 .timings = &sharp_lq123p1jx31_timing,
3743 .num_timings = 1,
zain wang5466a632016-11-19 10:27:16 +08003744 .bpc = 8,
Yakir Yang739c7de2016-06-12 10:56:35 +08003745 .size = {
3746 .width = 259,
3747 .height = 173,
3748 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08003749 .delay = {
3750 .prepare = 110,
3751 .enable = 50,
3752 .unprepare = 550,
3753 },
Yakir Yang739c7de2016-06-12 10:56:35 +08003754};
3755
Paul Cercueil656b7592020-08-11 02:22:38 +02003756static const struct drm_display_mode sharp_ls020b1dd01d_modes[] = {
Paul Cercueile6c21e62020-08-11 02:22:40 +02003757 { /* 50 Hz */
3758 .clock = 3000,
3759 .hdisplay = 240,
3760 .hsync_start = 240 + 58,
3761 .hsync_end = 240 + 58 + 1,
3762 .htotal = 240 + 58 + 1 + 1,
3763 .vdisplay = 160,
3764 .vsync_start = 160 + 24,
3765 .vsync_end = 160 + 24 + 10,
3766 .vtotal = 160 + 24 + 10 + 6,
3767 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
3768 },
Paul Cercueil656b7592020-08-11 02:22:38 +02003769 { /* 60 Hz */
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003770 .clock = 3000,
Paul Cercueil656b7592020-08-11 02:22:38 +02003771 .hdisplay = 240,
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003772 .hsync_start = 240 + 8,
3773 .hsync_end = 240 + 8 + 1,
3774 .htotal = 240 + 8 + 1 + 1,
Paul Cercueil656b7592020-08-11 02:22:38 +02003775 .vdisplay = 160,
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003776 .vsync_start = 160 + 24,
3777 .vsync_end = 160 + 24 + 10,
3778 .vtotal = 160 + 24 + 10 + 6,
Paul Cercueil656b7592020-08-11 02:22:38 +02003779 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
3780 },
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003781};
3782
3783static const struct panel_desc sharp_ls020b1dd01d = {
Paul Cercueil656b7592020-08-11 02:22:38 +02003784 .modes = sharp_ls020b1dd01d_modes,
3785 .num_modes = ARRAY_SIZE(sharp_ls020b1dd01d_modes),
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003786 .bpc = 6,
3787 .size = {
3788 .width = 42,
3789 .height = 28,
3790 },
3791 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
3792 .bus_flags = DRM_BUS_FLAG_DE_HIGH
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003793 | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003794 | DRM_BUS_FLAG_SHARP_SIGNALS,
3795};
3796
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003797static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
3798 .clock = 33300,
3799 .hdisplay = 800,
3800 .hsync_start = 800 + 1,
3801 .hsync_end = 800 + 1 + 64,
3802 .htotal = 800 + 1 + 64 + 64,
3803 .vdisplay = 480,
3804 .vsync_start = 480 + 1,
3805 .vsync_end = 480 + 1 + 23,
3806 .vtotal = 480 + 1 + 23 + 22,
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003807};
3808
3809static const struct panel_desc shelly_sca07010_bfn_lnn = {
3810 .modes = &shelly_sca07010_bfn_lnn_mode,
3811 .num_modes = 1,
3812 .size = {
3813 .width = 152,
3814 .height = 91,
3815 },
3816 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3817};
3818
Pascal Roeleven105235e2020-03-20 12:21:33 +01003819static const struct drm_display_mode starry_kr070pe2t_mode = {
3820 .clock = 33000,
3821 .hdisplay = 800,
3822 .hsync_start = 800 + 209,
3823 .hsync_end = 800 + 209 + 1,
3824 .htotal = 800 + 209 + 1 + 45,
3825 .vdisplay = 480,
3826 .vsync_start = 480 + 22,
3827 .vsync_end = 480 + 22 + 1,
3828 .vtotal = 480 + 22 + 1 + 22,
Pascal Roeleven105235e2020-03-20 12:21:33 +01003829};
3830
3831static const struct panel_desc starry_kr070pe2t = {
3832 .modes = &starry_kr070pe2t_mode,
3833 .num_modes = 1,
3834 .bpc = 8,
3835 .size = {
3836 .width = 152,
3837 .height = 86,
3838 },
3839 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3840 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Laurent Pinchart41fad302020-06-30 02:33:17 +03003841 .connector_type = DRM_MODE_CONNECTOR_DPI,
Pascal Roeleven105235e2020-03-20 12:21:33 +01003842};
3843
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003844static const struct drm_display_mode starry_kr122ea0sra_mode = {
3845 .clock = 147000,
3846 .hdisplay = 1920,
3847 .hsync_start = 1920 + 16,
3848 .hsync_end = 1920 + 16 + 16,
3849 .htotal = 1920 + 16 + 16 + 32,
3850 .vdisplay = 1200,
3851 .vsync_start = 1200 + 15,
3852 .vsync_end = 1200 + 15 + 2,
3853 .vtotal = 1200 + 15 + 2 + 18,
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003854 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3855};
3856
3857static const struct panel_desc starry_kr122ea0sra = {
3858 .modes = &starry_kr122ea0sra_mode,
3859 .num_modes = 1,
3860 .size = {
3861 .width = 263,
3862 .height = 164,
3863 },
Brian Norrisc46b9242016-08-26 14:32:14 -07003864 .delay = {
3865 .prepare = 10 + 200,
3866 .enable = 50,
3867 .unprepare = 10 + 500,
3868 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003869};
3870
Jyri Sarha42161532019-03-22 10:33:36 +02003871static const struct drm_display_mode tfc_s9700rtwv43tr_01b_mode = {
3872 .clock = 30000,
3873 .hdisplay = 800,
3874 .hsync_start = 800 + 39,
3875 .hsync_end = 800 + 39 + 47,
3876 .htotal = 800 + 39 + 47 + 39,
3877 .vdisplay = 480,
3878 .vsync_start = 480 + 13,
3879 .vsync_end = 480 + 13 + 2,
3880 .vtotal = 480 + 13 + 2 + 29,
Jyri Sarha42161532019-03-22 10:33:36 +02003881};
3882
3883static const struct panel_desc tfc_s9700rtwv43tr_01b = {
3884 .modes = &tfc_s9700rtwv43tr_01b_mode,
3885 .num_modes = 1,
3886 .bpc = 8,
3887 .size = {
3888 .width = 155,
3889 .height = 90,
3890 },
3891 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003892 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Jyri Sarha42161532019-03-22 10:33:36 +02003893};
3894
Gary Bissonadb973e2016-12-02 09:52:08 +01003895static const struct display_timing tianma_tm070jdhg30_timing = {
3896 .pixelclock = { 62600000, 68200000, 78100000 },
3897 .hactive = { 1280, 1280, 1280 },
3898 .hfront_porch = { 15, 64, 159 },
3899 .hback_porch = { 5, 5, 5 },
3900 .hsync_len = { 1, 1, 256 },
3901 .vactive = { 800, 800, 800 },
3902 .vfront_porch = { 3, 40, 99 },
3903 .vback_porch = { 2, 2, 2 },
3904 .vsync_len = { 1, 1, 128 },
3905 .flags = DISPLAY_FLAGS_DE_HIGH,
3906};
3907
3908static const struct panel_desc tianma_tm070jdhg30 = {
3909 .timings = &tianma_tm070jdhg30_timing,
3910 .num_timings = 1,
3911 .bpc = 8,
3912 .size = {
3913 .width = 151,
3914 .height = 95,
3915 },
3916 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003917 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Gary Bissonadb973e2016-12-02 09:52:08 +01003918};
3919
Max Merchelb3bfcdf2020-06-12 09:22:19 +02003920static const struct panel_desc tianma_tm070jvhg33 = {
3921 .timings = &tianma_tm070jdhg30_timing,
3922 .num_timings = 1,
3923 .bpc = 8,
3924 .size = {
3925 .width = 150,
3926 .height = 94,
3927 },
3928 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3929 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3930};
3931
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003932static const struct display_timing tianma_tm070rvhg71_timing = {
3933 .pixelclock = { 27700000, 29200000, 39600000 },
3934 .hactive = { 800, 800, 800 },
3935 .hfront_porch = { 12, 40, 212 },
3936 .hback_porch = { 88, 88, 88 },
3937 .hsync_len = { 1, 1, 40 },
3938 .vactive = { 480, 480, 480 },
3939 .vfront_porch = { 1, 13, 88 },
3940 .vback_porch = { 32, 32, 32 },
3941 .vsync_len = { 1, 1, 3 },
3942 .flags = DISPLAY_FLAGS_DE_HIGH,
3943};
3944
3945static const struct panel_desc tianma_tm070rvhg71 = {
3946 .timings = &tianma_tm070rvhg71_timing,
3947 .num_timings = 1,
3948 .bpc = 8,
3949 .size = {
3950 .width = 154,
3951 .height = 86,
3952 },
3953 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003954 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003955};
3956
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003957static const struct drm_display_mode ti_nspire_cx_lcd_mode[] = {
3958 {
3959 .clock = 10000,
3960 .hdisplay = 320,
3961 .hsync_start = 320 + 50,
3962 .hsync_end = 320 + 50 + 6,
3963 .htotal = 320 + 50 + 6 + 38,
3964 .vdisplay = 240,
3965 .vsync_start = 240 + 3,
3966 .vsync_end = 240 + 3 + 1,
3967 .vtotal = 240 + 3 + 1 + 17,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003968 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3969 },
3970};
3971
3972static const struct panel_desc ti_nspire_cx_lcd_panel = {
3973 .modes = ti_nspire_cx_lcd_mode,
3974 .num_modes = 1,
3975 .bpc = 8,
3976 .size = {
3977 .width = 65,
3978 .height = 49,
3979 },
3980 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003981 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003982};
3983
3984static const struct drm_display_mode ti_nspire_classic_lcd_mode[] = {
3985 {
3986 .clock = 10000,
3987 .hdisplay = 320,
3988 .hsync_start = 320 + 6,
3989 .hsync_end = 320 + 6 + 6,
3990 .htotal = 320 + 6 + 6 + 6,
3991 .vdisplay = 240,
3992 .vsync_start = 240 + 0,
3993 .vsync_end = 240 + 0 + 1,
3994 .vtotal = 240 + 0 + 1 + 0,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003995 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3996 },
3997};
3998
3999static const struct panel_desc ti_nspire_classic_lcd_panel = {
4000 .modes = ti_nspire_classic_lcd_mode,
4001 .num_modes = 1,
4002 /* The grayscale panel has 8 bit for the color .. Y (black) */
4003 .bpc = 8,
4004 .size = {
4005 .width = 71,
4006 .height = 53,
4007 },
4008 /* This is the grayscale bus format */
4009 .bus_format = MEDIA_BUS_FMT_Y8_1X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02004010 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004011};
4012
Lucas Stach06e733e2017-10-18 19:22:40 +02004013static const struct drm_display_mode toshiba_lt089ac29000_mode = {
4014 .clock = 79500,
4015 .hdisplay = 1280,
4016 .hsync_start = 1280 + 192,
4017 .hsync_end = 1280 + 192 + 128,
4018 .htotal = 1280 + 192 + 128 + 64,
4019 .vdisplay = 768,
4020 .vsync_start = 768 + 20,
4021 .vsync_end = 768 + 20 + 7,
4022 .vtotal = 768 + 20 + 7 + 3,
Lucas Stach06e733e2017-10-18 19:22:40 +02004023};
4024
4025static const struct panel_desc toshiba_lt089ac29000 = {
4026 .modes = &toshiba_lt089ac29000_mode,
4027 .num_modes = 1,
4028 .size = {
4029 .width = 194,
4030 .height = 116,
4031 },
Boris Brezillon9781bd12020-01-28 14:55:13 +01004032 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchartc4715832020-06-30 02:33:19 +03004033 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03004034 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach06e733e2017-10-18 19:22:40 +02004035};
4036
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304037static const struct drm_display_mode tpk_f07a_0102_mode = {
4038 .clock = 33260,
4039 .hdisplay = 800,
4040 .hsync_start = 800 + 40,
4041 .hsync_end = 800 + 40 + 128,
4042 .htotal = 800 + 40 + 128 + 88,
4043 .vdisplay = 480,
4044 .vsync_start = 480 + 10,
4045 .vsync_end = 480 + 10 + 2,
4046 .vtotal = 480 + 10 + 2 + 33,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304047};
4048
4049static const struct panel_desc tpk_f07a_0102 = {
4050 .modes = &tpk_f07a_0102_mode,
4051 .num_modes = 1,
4052 .size = {
4053 .width = 152,
4054 .height = 91,
4055 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03004056 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304057};
4058
4059static const struct drm_display_mode tpk_f10a_0102_mode = {
4060 .clock = 45000,
4061 .hdisplay = 1024,
4062 .hsync_start = 1024 + 176,
4063 .hsync_end = 1024 + 176 + 5,
4064 .htotal = 1024 + 176 + 5 + 88,
4065 .vdisplay = 600,
4066 .vsync_start = 600 + 20,
4067 .vsync_end = 600 + 20 + 5,
4068 .vtotal = 600 + 20 + 5 + 25,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304069};
4070
4071static const struct panel_desc tpk_f10a_0102 = {
4072 .modes = &tpk_f10a_0102_mode,
4073 .num_modes = 1,
4074 .size = {
4075 .width = 223,
4076 .height = 125,
4077 },
4078};
4079
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01004080static const struct display_timing urt_umsh_8596md_timing = {
4081 .pixelclock = { 33260000, 33260000, 33260000 },
4082 .hactive = { 800, 800, 800 },
4083 .hfront_porch = { 41, 41, 41 },
4084 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
4085 .hsync_len = { 71, 128, 128 },
4086 .vactive = { 480, 480, 480 },
4087 .vfront_porch = { 10, 10, 10 },
4088 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
4089 .vsync_len = { 2, 2, 2 },
4090 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
4091 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
4092};
4093
4094static const struct panel_desc urt_umsh_8596md_lvds = {
4095 .timings = &urt_umsh_8596md_timing,
4096 .num_timings = 1,
4097 .bpc = 6,
4098 .size = {
4099 .width = 152,
4100 .height = 91,
4101 },
4102 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03004103 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01004104};
4105
4106static const struct panel_desc urt_umsh_8596md_parallel = {
4107 .timings = &urt_umsh_8596md_timing,
4108 .num_timings = 1,
4109 .bpc = 6,
4110 .size = {
4111 .width = 152,
4112 .height = 91,
4113 },
4114 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
4115};
4116
Fabio Estevam04206182019-02-18 21:27:06 -03004117static const struct drm_display_mode vl050_8048nt_c01_mode = {
4118 .clock = 33333,
4119 .hdisplay = 800,
4120 .hsync_start = 800 + 210,
4121 .hsync_end = 800 + 210 + 20,
4122 .htotal = 800 + 210 + 20 + 46,
4123 .vdisplay = 480,
4124 .vsync_start = 480 + 22,
4125 .vsync_end = 480 + 22 + 10,
4126 .vtotal = 480 + 22 + 10 + 23,
Fabio Estevam04206182019-02-18 21:27:06 -03004127 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
4128};
4129
4130static const struct panel_desc vl050_8048nt_c01 = {
4131 .modes = &vl050_8048nt_c01_mode,
4132 .num_modes = 1,
4133 .bpc = 8,
4134 .size = {
4135 .width = 120,
4136 .height = 76,
4137 },
4138 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02004139 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Fabio Estevam04206182019-02-18 21:27:06 -03004140};
4141
Richard Genoude4bac402017-03-27 12:33:23 +02004142static const struct drm_display_mode winstar_wf35ltiacd_mode = {
4143 .clock = 6410,
4144 .hdisplay = 320,
4145 .hsync_start = 320 + 20,
4146 .hsync_end = 320 + 20 + 30,
4147 .htotal = 320 + 20 + 30 + 38,
4148 .vdisplay = 240,
4149 .vsync_start = 240 + 4,
4150 .vsync_end = 240 + 4 + 3,
4151 .vtotal = 240 + 4 + 3 + 15,
Richard Genoude4bac402017-03-27 12:33:23 +02004152 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4153};
4154
4155static const struct panel_desc winstar_wf35ltiacd = {
4156 .modes = &winstar_wf35ltiacd_mode,
4157 .num_modes = 1,
4158 .bpc = 8,
4159 .size = {
4160 .width = 70,
4161 .height = 53,
4162 },
4163 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
4164};
4165
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05304166static const struct drm_display_mode yes_optoelectronics_ytc700tlag_05_201c_mode = {
4167 .clock = 51200,
4168 .hdisplay = 1024,
4169 .hsync_start = 1024 + 100,
4170 .hsync_end = 1024 + 100 + 100,
4171 .htotal = 1024 + 100 + 100 + 120,
4172 .vdisplay = 600,
4173 .vsync_start = 600 + 10,
4174 .vsync_end = 600 + 10 + 10,
4175 .vtotal = 600 + 10 + 10 + 15,
4176 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
4177};
4178
4179static const struct panel_desc yes_optoelectronics_ytc700tlag_05_201c = {
4180 .modes = &yes_optoelectronics_ytc700tlag_05_201c_mode,
4181 .num_modes = 1,
4182 .bpc = 6,
4183 .size = {
4184 .width = 154,
4185 .height = 90,
4186 },
4187 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
4188 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
4189 .connector_type = DRM_MODE_CONNECTOR_LVDS,
4190};
4191
Linus Walleijfcec4162018-10-26 13:13:34 +02004192static const struct drm_display_mode arm_rtsm_mode[] = {
4193 {
4194 .clock = 65000,
4195 .hdisplay = 1024,
4196 .hsync_start = 1024 + 24,
4197 .hsync_end = 1024 + 24 + 136,
4198 .htotal = 1024 + 24 + 136 + 160,
4199 .vdisplay = 768,
4200 .vsync_start = 768 + 3,
4201 .vsync_end = 768 + 3 + 6,
4202 .vtotal = 768 + 3 + 6 + 29,
Linus Walleijfcec4162018-10-26 13:13:34 +02004203 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4204 },
4205};
4206
4207static const struct panel_desc arm_rtsm = {
4208 .modes = arm_rtsm_mode,
4209 .num_modes = 1,
4210 .bpc = 8,
4211 .size = {
4212 .width = 400,
4213 .height = 300,
4214 },
4215 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
4216};
4217
Thierry Reding280921d2013-08-30 15:10:14 +02004218static const struct of_device_id platform_of_match[] = {
4219 {
Jagan Tekibca684e2020-08-29 22:03:28 +05304220 .compatible = "ampire,am-1280800n3tzqw-t00h",
4221 .data = &ampire_am_1280800n3tzqw_t00h,
4222 }, {
Yannick Fertre966fea72017-03-28 11:44:49 +02004223 .compatible = "ampire,am-480272h3tmqw-t01h",
4224 .data = &ampire_am_480272h3tmqw_t01h,
4225 }, {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01004226 .compatible = "ampire,am800480r3tmqwa1h",
4227 .data = &ampire_am800480r3tmqwa1h,
4228 }, {
Linus Walleijfcec4162018-10-26 13:13:34 +02004229 .compatible = "arm,rtsm-display",
4230 .data = &arm_rtsm,
4231 }, {
Sébastien Szymanskic479450f2019-05-07 17:27:12 +02004232 .compatible = "armadeus,st0700-adapt",
4233 .data = &armadeus_st0700_adapt,
4234 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004235 .compatible = "auo,b101aw03",
4236 .data = &auo_b101aw03,
4237 }, {
Huang Lina531bc32015-02-28 10:18:58 +08004238 .compatible = "auo,b101ean01",
4239 .data = &auo_b101ean01,
4240 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04004241 .compatible = "auo,b101xtn01",
4242 .data = &auo_b101xtn01,
4243 }, {
Rob Clarkda4582862020-01-08 15:53:56 -08004244 .compatible = "auo,b116xa01",
4245 .data = &auo_b116xak01,
4246 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05304247 .compatible = "auo,b116xw03",
4248 .data = &auo_b116xw03,
4249 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05304250 .compatible = "auo,b133htn01",
4251 .data = &auo_b133htn01,
4252 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07004253 .compatible = "auo,b133xtn01",
4254 .data = &auo_b133xtn01,
4255 }, {
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02004256 .compatible = "auo,g070vvn01",
4257 .data = &auo_g070vvn01,
4258 }, {
Alex Gonzalez4fb86402018-10-25 17:09:30 +02004259 .compatible = "auo,g101evn010",
4260 .data = &auo_g101evn010,
4261 }, {
Christoph Fritz4451c282017-12-16 14:13:36 +01004262 .compatible = "auo,g104sn02",
4263 .data = &auo_g104sn02,
4264 }, {
Sebastian Reichel03e909a2020-04-15 19:27:25 +02004265 .compatible = "auo,g121ean01",
4266 .data = &auo_g121ean01,
4267 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01004268 .compatible = "auo,g133han01",
4269 .data = &auo_g133han01,
4270 }, {
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02004271 .compatible = "auo,g156xtn01",
4272 .data = &auo_g156xtn01,
4273 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01004274 .compatible = "auo,g185han01",
4275 .data = &auo_g185han01,
4276 }, {
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02004277 .compatible = "auo,g190ean01",
4278 .data = &auo_g190ean01,
4279 }, {
Lucas Stach70c0d5b2017-06-08 20:07:58 +02004280 .compatible = "auo,p320hvn03",
4281 .data = &auo_p320hvn03,
4282 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07004283 .compatible = "auo,t215hvn01",
4284 .data = &auo_t215hvn01,
4285 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01004286 .compatible = "avic,tm070ddh03",
4287 .data = &avic_tm070ddh03,
4288 }, {
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08004289 .compatible = "bananapi,s070wv20-ct16",
4290 .data = &bananapi_s070wv20_ct16,
4291 }, {
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02004292 .compatible = "boe,hv070wsa-100",
4293 .data = &boe_hv070wsa
4294 }, {
Caesar Wangcac1a412016-12-14 11:19:56 +08004295 .compatible = "boe,nv101wxmn51",
4296 .data = &boe_nv101wxmn51,
4297 }, {
Douglas Andersona96ee0f2020-11-09 17:00:58 -08004298 .compatible = "boe,nv110wtm-n61",
4299 .data = &boe_nv110wtm_n61,
4300 }, {
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07004301 .compatible = "boe,nv133fhm-n61",
4302 .data = &boe_nv133fhm_n61,
4303 }, {
Douglas Andersoncfe40d02020-05-08 15:59:02 -07004304 .compatible = "boe,nv133fhm-n62",
4305 .data = &boe_nv133fhm_n61,
4306 }, {
Tobias Schramma5119812020-01-09 12:29:52 +01004307 .compatible = "boe,nv140fhmn49",
4308 .data = &boe_nv140fhmn49,
4309 }, {
Giulio Benettie58edce2018-07-31 01:11:16 +02004310 .compatible = "cdtech,s043wq26h-ct7",
4311 .data = &cdtech_s043wq26h_ct7,
4312 }, {
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02004313 .compatible = "cdtech,s070pws19hp-fc21",
4314 .data = &cdtech_s070pws19hp_fc21,
4315 }, {
4316 .compatible = "cdtech,s070swv29hg-dc44",
4317 .data = &cdtech_s070swv29hg_dc44,
4318 }, {
Giulio Benetti982f9442018-07-31 01:11:14 +02004319 .compatible = "cdtech,s070wv95-ct16",
4320 .data = &cdtech_s070wv95_ct16,
4321 }, {
Marek Vasut07c913c2020-07-28 22:12:42 +02004322 .compatible = "chefree,ch101olhlwh-002",
4323 .data = &chefree_ch101olhlwh_002,
4324 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08004325 .compatible = "chunghwa,claa070wp03xg",
4326 .data = &chunghwa_claa070wp03xg,
4327 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07004328 .compatible = "chunghwa,claa101wa01a",
4329 .data = &chunghwa_claa101wa01a
4330 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004331 .compatible = "chunghwa,claa101wb01",
4332 .data = &chunghwa_claa101wb01
4333 }, {
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02004334 .compatible = "dataimage,scf0700c48ggu18",
4335 .data = &dataimage_scf0700c48ggu18,
4336 }, {
Philipp Zabel0ca0c822018-05-23 11:25:04 +02004337 .compatible = "dlc,dlc0700yzg-1",
4338 .data = &dlc_dlc0700yzg_1,
4339 }, {
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02004340 .compatible = "dlc,dlc1010gig",
4341 .data = &dlc_dlc1010gig,
4342 }, {
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02004343 .compatible = "edt,et035012dm6",
4344 .data = &edt_et035012dm6,
4345 }, {
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00004346 .compatible = "edt,etm043080dh6gp",
4347 .data = &edt_etm043080dh6gp,
4348 }, {
Marek Vasutfd819bf2019-02-19 15:04:38 +01004349 .compatible = "edt,etm0430g0dh6",
4350 .data = &edt_etm0430g0dh6,
4351 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02004352 .compatible = "edt,et057090dhu",
4353 .data = &edt_et057090dhu,
4354 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02004355 .compatible = "edt,et070080dh6",
4356 .data = &edt_etm0700g0dh6,
4357 }, {
4358 .compatible = "edt,etm0700g0dh6",
4359 .data = &edt_etm0700g0dh6,
4360 }, {
Jan Tuerkaa7e6452018-06-19 11:55:44 +02004361 .compatible = "edt,etm0700g0bdh6",
4362 .data = &edt_etm0700g0bdh6,
4363 }, {
Jan Tuerkaad34de2018-06-19 11:55:45 +02004364 .compatible = "edt,etm0700g0edh6",
4365 .data = &edt_etm0700g0bdh6,
4366 }, {
Marco Felsch9158e3c2019-04-16 12:06:45 +02004367 .compatible = "evervision,vgg804821",
4368 .data = &evervision_vgg804821,
4369 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02004370 .compatible = "foxlink,fl500wvr00-a0t",
4371 .data = &foxlink_fl500wvr00_a0t,
4372 }, {
Paul Cercueil7b6bd842020-01-13 13:17:41 -03004373 .compatible = "frida,frd350h54004",
4374 .data = &frida_frd350h54004,
4375 }, {
Jagan Teki3be20712019-05-07 18:37:07 +05304376 .compatible = "friendlyarm,hd702e",
4377 .data = &friendlyarm_hd702e,
4378 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01004379 .compatible = "giantplus,gpg482739qs5",
4380 .data = &giantplus_gpg482739qs5
4381 }, {
Paul Cercueil2c6574a2019-06-06 00:22:47 +02004382 .compatible = "giantplus,gpm940b0",
4383 .data = &giantplus_gpm940b0,
4384 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02004385 .compatible = "hannstar,hsd070pww1",
4386 .data = &hannstar_hsd070pww1,
4387 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07004388 .compatible = "hannstar,hsd100pxn1",
4389 .data = &hannstar_hsd100pxn1,
4390 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01004391 .compatible = "hit,tx23d38vm0caa",
4392 .data = &hitachi_tx23d38vm0caa
4393 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01004394 .compatible = "innolux,at043tn24",
4395 .data = &innolux_at043tn24,
4396 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02004397 .compatible = "innolux,at070tn92",
4398 .data = &innolux_at070tn92,
4399 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02004400 .compatible = "innolux,g070y2-l01",
4401 .data = &innolux_g070y2_l01,
4402 }, {
4403 .compatible = "innolux,g101ice-l01",
Michael Olbrich1e29b842016-08-15 14:32:02 +02004404 .data = &innolux_g101ice_l01
4405 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02004406 .compatible = "innolux,g121i1-l01",
Lucas Stachd731f662014-11-06 17:44:33 +01004407 .data = &innolux_g121i1_l01
4408 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05004409 .compatible = "innolux,g121x1-l03",
4410 .data = &innolux_g121x1_l03,
4411 }, {
Douglas Anderson51d35632021-01-15 14:44:20 -08004412 .compatible = "innolux,n116bca-ea1",
4413 .data = &innolux_n116bca_ea1,
4414 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02004415 .compatible = "innolux,n116bge",
4416 .data = &innolux_n116bge,
4417 }, {
Lukas F. Hartmanna14c6b02020-11-24 18:26:04 +01004418 .compatible = "innolux,n125hce-gn1",
4419 .data = &innolux_n125hce_gn1,
4420 }, {
Alban Bedelea447392014-07-22 08:38:55 +02004421 .compatible = "innolux,n156bge-l21",
4422 .data = &innolux_n156bge_l21,
4423 }, {
Douglas Anderson8f054b62018-10-25 15:21:34 -07004424 .compatible = "innolux,p120zdg-bf1",
4425 .data = &innolux_p120zdg_bf1,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05304426 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01004427 .compatible = "innolux,zj070na-01p",
4428 .data = &innolux_zj070na_01p,
4429 }, {
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07004430 .compatible = "ivo,m133nwf4-r0",
4431 .data = &ivo_m133nwf4_r0,
4432 }, {
Douglas Andersonfc26a372020-08-21 08:35:15 -07004433 .compatible = "kingdisplay,kd116n21-30nv-a010",
4434 .data = &kingdisplay_kd116n21_30nv_a010,
4435 }, {
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02004436 .compatible = "koe,tx14d24vm1bpa",
4437 .data = &koe_tx14d24vm1bpa,
4438 }, {
Liu Ying8a070522020-06-01 14:11:20 +08004439 .compatible = "koe,tx26d202vm0bwa",
4440 .data = &koe_tx26d202vm0bwa,
4441 }, {
Jagan Teki8cfe8342018-02-04 23:19:28 +05304442 .compatible = "koe,tx31d200vm0baa",
4443 .data = &koe_tx31d200vm0baa,
4444 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01004445 .compatible = "kyo,tcg121xglp",
4446 .data = &kyo_tcg121xglp,
4447 }, {
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01004448 .compatible = "lemaker,bl035-rgb-002",
4449 .data = &lemaker_bl035_rgb_002,
4450 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02004451 .compatible = "lg,lb070wv8",
4452 .data = &lg_lb070wv8,
4453 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08004454 .compatible = "lg,lp079qx1-sp0v",
4455 .data = &lg_lp079qx1_sp0v,
4456 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08004457 .compatible = "lg,lp097qx1-spa1",
4458 .data = &lg_lp097qx1_spa1,
4459 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08004460 .compatible = "lg,lp120up1",
4461 .data = &lg_lp120up1,
4462 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01004463 .compatible = "lg,lp129qe",
4464 .data = &lg_lp129qe,
4465 }, {
Adam Ford0d354082019-10-16 08:51:45 -05004466 .compatible = "logicpd,type28",
4467 .data = &logicpd_type_28,
4468 }, {
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01004469 .compatible = "logictechno,lt161010-2nhc",
4470 .data = &logictechno_lt161010_2nh,
4471 }, {
4472 .compatible = "logictechno,lt161010-2nhr",
4473 .data = &logictechno_lt161010_2nh,
4474 }, {
4475 .compatible = "logictechno,lt170410-2whc",
4476 .data = &logictechno_lt170410_2whc,
4477 }, {
Lukasz Majewski65c766c2017-10-21 00:18:37 +02004478 .compatible = "mitsubishi,aa070mc01-ca1",
4479 .data = &mitsubishi_aa070mc01,
4480 }, {
Lucas Stach01bacc132017-06-08 20:07:55 +02004481 .compatible = "nec,nl12880bc20-05",
4482 .data = &nec_nl12880bc20_05,
4483 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08004484 .compatible = "nec,nl4827hc19-05b",
4485 .data = &nec_nl4827hc19_05b,
4486 }, {
Maxime Riparde6c2f062016-09-06 16:46:17 +02004487 .compatible = "netron-dy,e231732",
4488 .data = &netron_dy_e231732,
4489 }, {
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08004490 .compatible = "neweast,wjfh116008a",
4491 .data = &neweast_wjfh116008a,
4492 }, {
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03004493 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
4494 .data = &newhaven_nhd_43_480272ef_atxl,
4495 }, {
Lucas Stach4177fa62017-06-08 20:07:57 +02004496 .compatible = "nlt,nl192108ac18-02d",
4497 .data = &nlt_nl192108ac18_02d,
4498 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02004499 .compatible = "nvd,9128",
4500 .data = &nvd_9128,
4501 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02004502 .compatible = "okaya,rs800480t-7x0gp",
4503 .data = &okaya_rs800480t_7x0gp,
4504 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01004505 .compatible = "olimex,lcd-olinuxino-43-ts",
4506 .data = &olimex_lcd_olinuxino_43ts,
4507 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07004508 .compatible = "ontat,yx700wv03",
4509 .data = &ontat_yx700wv03,
4510 }, {
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02004511 .compatible = "ortustech,com37h3m05dtc",
4512 .data = &ortustech_com37h3m,
4513 }, {
4514 .compatible = "ortustech,com37h3m99dtc",
4515 .data = &ortustech_com37h3m,
4516 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01004517 .compatible = "ortustech,com43h4m85ulc",
4518 .data = &ortustech_com43h4m85ulc,
4519 }, {
Laurent Pinchart163f7a32018-12-07 22:13:44 +02004520 .compatible = "osddisplays,osd070t1718-19ts",
4521 .data = &osddisplays_osd070t1718_19ts,
4522 }, {
Eugen Hristev4ba3e562019-01-14 09:43:31 +00004523 .compatible = "pda,91-00156-a0",
4524 .data = &pda_91_00156_a0,
4525 }, {
Marek Vasutd69de692020-07-28 14:12:46 +02004526 .compatible = "powertip,ph800480t013-idf02",
4527 .data = &powertip_ph800480t013_idf02,
4528 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02004529 .compatible = "qiaodian,qd43003c0-40",
4530 .data = &qd43003c0_40,
4531 }, {
Jagan Teki23167fa2018-06-07 19:16:48 +05304532 .compatible = "rocktech,rk070er9427",
4533 .data = &rocktech_rk070er9427,
4534 }, {
Jyri Sarhaf3050472020-02-11 14:17:18 +02004535 .compatible = "rocktech,rk101ii01d-ct",
4536 .data = &rocktech_rk101ii01d_ct,
4537 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08004538 .compatible = "samsung,lsn122dl01-c01",
4539 .data = &samsung_lsn122dl01_c01,
4540 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01004541 .compatible = "samsung,ltn101nt05",
4542 .data = &samsung_ltn101nt05,
4543 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01004544 .compatible = "samsung,ltn140at29-301",
4545 .data = &samsung_ltn140at29_301,
4546 }, {
Miquel Raynal44c58c52020-01-09 19:40:37 +01004547 .compatible = "satoz,sat050at40h12r2",
4548 .data = &satoz_sat050at40h12r2,
4549 }, {
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07004550 .compatible = "sharp,ld-d5116z01b",
4551 .data = &sharp_ld_d5116z01b,
4552 }, {
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03004553 .compatible = "sharp,lq035q7db03",
4554 .data = &sharp_lq035q7db03,
4555 }, {
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02004556 .compatible = "sharp,lq070y3dg3b",
4557 .data = &sharp_lq070y3dg3b,
4558 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07004559 .compatible = "sharp,lq101k1ly04",
4560 .data = &sharp_lq101k1ly04,
4561 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08004562 .compatible = "sharp,lq123p1jx31",
4563 .data = &sharp_lq123p1jx31,
4564 }, {
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02004565 .compatible = "sharp,ls020b1dd01d",
4566 .data = &sharp_ls020b1dd01d,
4567 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01004568 .compatible = "shelly,sca07010-bfn-lnn",
4569 .data = &shelly_sca07010_bfn_lnn,
4570 }, {
Pascal Roeleven105235e2020-03-20 12:21:33 +01004571 .compatible = "starry,kr070pe2t",
4572 .data = &starry_kr070pe2t,
4573 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07004574 .compatible = "starry,kr122ea0sra",
4575 .data = &starry_kr122ea0sra,
4576 }, {
Jyri Sarha42161532019-03-22 10:33:36 +02004577 .compatible = "tfc,s9700rtwv43tr-01b",
4578 .data = &tfc_s9700rtwv43tr_01b,
4579 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01004580 .compatible = "tianma,tm070jdhg30",
4581 .data = &tianma_tm070jdhg30,
4582 }, {
Max Merchelb3bfcdf2020-06-12 09:22:19 +02004583 .compatible = "tianma,tm070jvhg33",
4584 .data = &tianma_tm070jvhg33,
4585 }, {
Lukasz Majewski870a0b12017-11-07 16:30:58 +01004586 .compatible = "tianma,tm070rvhg71",
4587 .data = &tianma_tm070rvhg71,
4588 }, {
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004589 .compatible = "ti,nspire-cx-lcd-panel",
4590 .data = &ti_nspire_cx_lcd_panel,
4591 }, {
4592 .compatible = "ti,nspire-classic-lcd-panel",
4593 .data = &ti_nspire_classic_lcd_panel,
4594 }, {
Lucas Stach06e733e2017-10-18 19:22:40 +02004595 .compatible = "toshiba,lt089ac29000",
4596 .data = &toshiba_lt089ac29000,
4597 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304598 .compatible = "tpk,f07a-0102",
4599 .data = &tpk_f07a_0102,
4600 }, {
4601 .compatible = "tpk,f10a-0102",
4602 .data = &tpk_f10a_0102,
4603 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01004604 .compatible = "urt,umsh-8596md-t",
4605 .data = &urt_umsh_8596md_parallel,
4606 }, {
4607 .compatible = "urt,umsh-8596md-1t",
4608 .data = &urt_umsh_8596md_parallel,
4609 }, {
4610 .compatible = "urt,umsh-8596md-7t",
4611 .data = &urt_umsh_8596md_parallel,
4612 }, {
4613 .compatible = "urt,umsh-8596md-11t",
4614 .data = &urt_umsh_8596md_lvds,
4615 }, {
4616 .compatible = "urt,umsh-8596md-19t",
4617 .data = &urt_umsh_8596md_lvds,
4618 }, {
4619 .compatible = "urt,umsh-8596md-20t",
4620 .data = &urt_umsh_8596md_parallel,
4621 }, {
Fabio Estevam04206182019-02-18 21:27:06 -03004622 .compatible = "vxt,vl050-8048nt-c01",
4623 .data = &vl050_8048nt_c01,
4624 }, {
Richard Genoude4bac402017-03-27 12:33:23 +02004625 .compatible = "winstar,wf35ltiacd",
4626 .data = &winstar_wf35ltiacd,
4627 }, {
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05304628 .compatible = "yes-optoelectronics,ytc700tlag-05-201c",
4629 .data = &yes_optoelectronics_ytc700tlag_05_201c,
4630 }, {
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +01004631 /* Must be the last entry */
4632 .compatible = "panel-dpi",
4633 .data = &panel_dpi,
4634 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004635 /* sentinel */
4636 }
4637};
4638MODULE_DEVICE_TABLE(of, platform_of_match);
4639
4640static int panel_simple_platform_probe(struct platform_device *pdev)
4641{
4642 const struct of_device_id *id;
4643
4644 id = of_match_node(platform_of_match, pdev->dev.of_node);
4645 if (!id)
4646 return -ENODEV;
4647
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -07004648 return panel_simple_probe(&pdev->dev, id->data, NULL);
Thierry Reding280921d2013-08-30 15:10:14 +02004649}
4650
4651static int panel_simple_platform_remove(struct platform_device *pdev)
4652{
4653 return panel_simple_remove(&pdev->dev);
4654}
4655
Thierry Redingd02fd932014-04-29 17:21:21 +02004656static void panel_simple_platform_shutdown(struct platform_device *pdev)
4657{
4658 panel_simple_shutdown(&pdev->dev);
4659}
4660
Douglas Anderson3235b0f2021-04-16 15:39:30 -07004661static const struct dev_pm_ops panel_simple_pm_ops = {
4662 SET_RUNTIME_PM_OPS(panel_simple_suspend, panel_simple_resume, NULL)
4663 SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
4664 pm_runtime_force_resume)
4665};
4666
Thierry Reding280921d2013-08-30 15:10:14 +02004667static struct platform_driver panel_simple_platform_driver = {
4668 .driver = {
4669 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02004670 .of_match_table = platform_of_match,
Douglas Anderson3235b0f2021-04-16 15:39:30 -07004671 .pm = &panel_simple_pm_ops,
Thierry Reding280921d2013-08-30 15:10:14 +02004672 },
4673 .probe = panel_simple_platform_probe,
4674 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004675 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004676};
4677
Thierry Reding210fcd92013-11-22 19:27:11 +01004678struct panel_desc_dsi {
4679 struct panel_desc desc;
4680
Thierry Reding462658b2014-03-14 11:24:57 +01004681 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004682 enum mipi_dsi_pixel_format format;
4683 unsigned int lanes;
4684};
4685
Thierry Redingd718d792015-04-08 16:52:33 +02004686static const struct drm_display_mode auo_b080uan01_mode = {
4687 .clock = 154500,
4688 .hdisplay = 1200,
4689 .hsync_start = 1200 + 62,
4690 .hsync_end = 1200 + 62 + 4,
4691 .htotal = 1200 + 62 + 4 + 62,
4692 .vdisplay = 1920,
4693 .vsync_start = 1920 + 9,
4694 .vsync_end = 1920 + 9 + 2,
4695 .vtotal = 1920 + 9 + 2 + 8,
Thierry Redingd718d792015-04-08 16:52:33 +02004696};
4697
4698static const struct panel_desc_dsi auo_b080uan01 = {
4699 .desc = {
4700 .modes = &auo_b080uan01_mode,
4701 .num_modes = 1,
4702 .bpc = 8,
4703 .size = {
4704 .width = 108,
4705 .height = 272,
4706 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004707 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Redingd718d792015-04-08 16:52:33 +02004708 },
4709 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
4710 .format = MIPI_DSI_FMT_RGB888,
4711 .lanes = 4,
4712};
4713
Chris Zhongc8521962015-11-20 16:15:37 +08004714static const struct drm_display_mode boe_tv080wum_nl0_mode = {
4715 .clock = 160000,
4716 .hdisplay = 1200,
4717 .hsync_start = 1200 + 120,
4718 .hsync_end = 1200 + 120 + 20,
4719 .htotal = 1200 + 120 + 20 + 21,
4720 .vdisplay = 1920,
4721 .vsync_start = 1920 + 21,
4722 .vsync_end = 1920 + 21 + 3,
4723 .vtotal = 1920 + 21 + 3 + 18,
Chris Zhongc8521962015-11-20 16:15:37 +08004724 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4725};
4726
4727static const struct panel_desc_dsi boe_tv080wum_nl0 = {
4728 .desc = {
4729 .modes = &boe_tv080wum_nl0_mode,
4730 .num_modes = 1,
4731 .size = {
4732 .width = 107,
4733 .height = 172,
4734 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004735 .connector_type = DRM_MODE_CONNECTOR_DSI,
Chris Zhongc8521962015-11-20 16:15:37 +08004736 },
4737 .flags = MIPI_DSI_MODE_VIDEO |
4738 MIPI_DSI_MODE_VIDEO_BURST |
4739 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
4740 .format = MIPI_DSI_FMT_RGB888,
4741 .lanes = 4,
4742};
4743
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004744static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
4745 .clock = 71000,
4746 .hdisplay = 800,
4747 .hsync_start = 800 + 32,
4748 .hsync_end = 800 + 32 + 1,
4749 .htotal = 800 + 32 + 1 + 57,
4750 .vdisplay = 1280,
4751 .vsync_start = 1280 + 28,
4752 .vsync_end = 1280 + 28 + 1,
4753 .vtotal = 1280 + 28 + 1 + 14,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004754};
4755
4756static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
4757 .desc = {
4758 .modes = &lg_ld070wx3_sl01_mode,
4759 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004760 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004761 .size = {
4762 .width = 94,
4763 .height = 151,
4764 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004765 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004766 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004767 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004768 .format = MIPI_DSI_FMT_RGB888,
4769 .lanes = 4,
4770};
4771
Alexandre Courbot499ce852014-01-21 18:57:09 +09004772static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
4773 .clock = 67000,
4774 .hdisplay = 720,
4775 .hsync_start = 720 + 12,
4776 .hsync_end = 720 + 12 + 4,
4777 .htotal = 720 + 12 + 4 + 112,
4778 .vdisplay = 1280,
4779 .vsync_start = 1280 + 8,
4780 .vsync_end = 1280 + 8 + 4,
4781 .vtotal = 1280 + 8 + 4 + 12,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004782};
4783
4784static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
4785 .desc = {
4786 .modes = &lg_lh500wx1_sd03_mode,
4787 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004788 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004789 .size = {
4790 .width = 62,
4791 .height = 110,
4792 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004793 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004794 },
4795 .flags = MIPI_DSI_MODE_VIDEO,
4796 .format = MIPI_DSI_FMT_RGB888,
4797 .lanes = 4,
4798};
4799
Thierry Reding280921d2013-08-30 15:10:14 +02004800static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
4801 .clock = 157200,
4802 .hdisplay = 1920,
4803 .hsync_start = 1920 + 154,
4804 .hsync_end = 1920 + 154 + 16,
4805 .htotal = 1920 + 154 + 16 + 32,
4806 .vdisplay = 1200,
4807 .vsync_start = 1200 + 17,
4808 .vsync_end = 1200 + 17 + 2,
4809 .vtotal = 1200 + 17 + 2 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02004810};
4811
Thierry Reding210fcd92013-11-22 19:27:11 +01004812static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
4813 .desc = {
4814 .modes = &panasonic_vvx10f004b00_mode,
4815 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004816 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01004817 .size = {
4818 .width = 217,
4819 .height = 136,
4820 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004821 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Reding280921d2013-08-30 15:10:14 +02004822 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004823 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
4824 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01004825 .format = MIPI_DSI_FMT_RGB888,
4826 .lanes = 4,
4827};
4828
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004829static const struct drm_display_mode lg_acx467akm_7_mode = {
4830 .clock = 150000,
4831 .hdisplay = 1080,
4832 .hsync_start = 1080 + 2,
4833 .hsync_end = 1080 + 2 + 2,
4834 .htotal = 1080 + 2 + 2 + 2,
4835 .vdisplay = 1920,
4836 .vsync_start = 1920 + 2,
4837 .vsync_end = 1920 + 2 + 2,
4838 .vtotal = 1920 + 2 + 2 + 2,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004839};
4840
4841static const struct panel_desc_dsi lg_acx467akm_7 = {
4842 .desc = {
4843 .modes = &lg_acx467akm_7_mode,
4844 .num_modes = 1,
4845 .bpc = 8,
4846 .size = {
4847 .width = 62,
4848 .height = 110,
4849 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004850 .connector_type = DRM_MODE_CONNECTOR_DSI,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004851 },
4852 .flags = 0,
4853 .format = MIPI_DSI_FMT_RGB888,
4854 .lanes = 4,
4855};
4856
Peter Ujfalusi62967232019-02-26 09:55:21 +02004857static const struct drm_display_mode osd101t2045_53ts_mode = {
4858 .clock = 154500,
4859 .hdisplay = 1920,
4860 .hsync_start = 1920 + 112,
4861 .hsync_end = 1920 + 112 + 16,
4862 .htotal = 1920 + 112 + 16 + 32,
4863 .vdisplay = 1200,
4864 .vsync_start = 1200 + 16,
4865 .vsync_end = 1200 + 16 + 2,
4866 .vtotal = 1200 + 16 + 2 + 16,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004867 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
4868};
4869
4870static const struct panel_desc_dsi osd101t2045_53ts = {
4871 .desc = {
4872 .modes = &osd101t2045_53ts_mode,
4873 .num_modes = 1,
4874 .bpc = 8,
4875 .size = {
4876 .width = 217,
4877 .height = 136,
4878 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004879 .connector_type = DRM_MODE_CONNECTOR_DSI,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004880 },
4881 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
4882 MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
4883 MIPI_DSI_MODE_EOT_PACKET,
4884 .format = MIPI_DSI_FMT_RGB888,
4885 .lanes = 4,
4886};
4887
Thierry Reding210fcd92013-11-22 19:27:11 +01004888static const struct of_device_id dsi_of_match[] = {
4889 {
Thierry Redingd718d792015-04-08 16:52:33 +02004890 .compatible = "auo,b080uan01",
4891 .data = &auo_b080uan01
4892 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08004893 .compatible = "boe,tv080wum-nl0",
4894 .data = &boe_tv080wum_nl0
4895 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004896 .compatible = "lg,ld070wx3-sl01",
4897 .data = &lg_ld070wx3_sl01
4898 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09004899 .compatible = "lg,lh500wx1-sd03",
4900 .data = &lg_lh500wx1_sd03
4901 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01004902 .compatible = "panasonic,vvx10f004b00",
4903 .data = &panasonic_vvx10f004b00
4904 }, {
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004905 .compatible = "lg,acx467akm-7",
4906 .data = &lg_acx467akm_7
4907 }, {
Peter Ujfalusi62967232019-02-26 09:55:21 +02004908 .compatible = "osddisplays,osd101t2045-53ts",
4909 .data = &osd101t2045_53ts
4910 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01004911 /* sentinel */
4912 }
4913};
4914MODULE_DEVICE_TABLE(of, dsi_of_match);
4915
4916static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
4917{
4918 const struct panel_desc_dsi *desc;
4919 const struct of_device_id *id;
4920 int err;
4921
4922 id = of_match_node(dsi_of_match, dsi->dev.of_node);
4923 if (!id)
4924 return -ENODEV;
4925
4926 desc = id->data;
4927
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -07004928 err = panel_simple_probe(&dsi->dev, &desc->desc, NULL);
Thierry Reding210fcd92013-11-22 19:27:11 +01004929 if (err < 0)
4930 return err;
4931
Thierry Reding462658b2014-03-14 11:24:57 +01004932 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004933 dsi->format = desc->format;
4934 dsi->lanes = desc->lanes;
4935
Peter Ujfalusi7ad9db62019-02-26 10:11:53 +02004936 err = mipi_dsi_attach(dsi);
4937 if (err) {
Julia Lawall5dd331d2021-02-09 22:13:04 +01004938 struct panel_simple *panel = mipi_dsi_get_drvdata(dsi);
Peter Ujfalusi7ad9db62019-02-26 10:11:53 +02004939
4940 drm_panel_remove(&panel->base);
4941 }
4942
4943 return err;
Thierry Reding210fcd92013-11-22 19:27:11 +01004944}
4945
4946static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
4947{
4948 int err;
4949
4950 err = mipi_dsi_detach(dsi);
4951 if (err < 0)
4952 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
4953
4954 return panel_simple_remove(&dsi->dev);
4955}
4956
Thierry Redingd02fd932014-04-29 17:21:21 +02004957static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
4958{
4959 panel_simple_shutdown(&dsi->dev);
4960}
4961
Thierry Reding210fcd92013-11-22 19:27:11 +01004962static struct mipi_dsi_driver panel_simple_dsi_driver = {
4963 .driver = {
4964 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01004965 .of_match_table = dsi_of_match,
Douglas Anderson3235b0f2021-04-16 15:39:30 -07004966 .pm = &panel_simple_pm_ops,
Thierry Reding210fcd92013-11-22 19:27:11 +01004967 },
4968 .probe = panel_simple_dsi_probe,
4969 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004970 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004971};
4972
Douglas Anderson74c06c22021-06-11 10:17:41 -07004973static int panel_simple_dp_aux_ep_probe(struct dp_aux_ep_device *aux_ep)
4974{
4975 const struct of_device_id *id;
4976
4977 id = of_match_node(platform_of_match, aux_ep->dev.of_node);
4978 if (!id)
4979 return -ENODEV;
4980
Douglas Andersoncc5a3fc2021-06-11 10:17:42 -07004981 return panel_simple_probe(&aux_ep->dev, id->data, aux_ep->aux);
Douglas Anderson74c06c22021-06-11 10:17:41 -07004982}
4983
4984static void panel_simple_dp_aux_ep_remove(struct dp_aux_ep_device *aux_ep)
4985{
4986 panel_simple_remove(&aux_ep->dev);
4987}
4988
4989static void panel_simple_dp_aux_ep_shutdown(struct dp_aux_ep_device *aux_ep)
4990{
4991 panel_simple_shutdown(&aux_ep->dev);
4992}
4993
4994static struct dp_aux_ep_driver panel_simple_dp_aux_ep_driver = {
4995 .driver = {
4996 .name = "panel-simple-dp-aux",
4997 .of_match_table = platform_of_match, /* Same as platform one! */
4998 .pm = &panel_simple_pm_ops,
4999 },
5000 .probe = panel_simple_dp_aux_ep_probe,
5001 .remove = panel_simple_dp_aux_ep_remove,
5002 .shutdown = panel_simple_dp_aux_ep_shutdown,
5003};
5004
Thierry Reding280921d2013-08-30 15:10:14 +02005005static int __init panel_simple_init(void)
5006{
Thierry Reding210fcd92013-11-22 19:27:11 +01005007 int err;
5008
5009 err = platform_driver_register(&panel_simple_platform_driver);
5010 if (err < 0)
5011 return err;
5012
Douglas Anderson74c06c22021-06-11 10:17:41 -07005013 err = dp_aux_dp_driver_register(&panel_simple_dp_aux_ep_driver);
5014 if (err < 0)
5015 goto err_did_platform_register;
5016
Thierry Reding210fcd92013-11-22 19:27:11 +01005017 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
5018 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
Douglas Anderson74c06c22021-06-11 10:17:41 -07005019 if (err < 0)
5020 goto err_did_aux_ep_register;
Thierry Reding210fcd92013-11-22 19:27:11 +01005021 }
5022
5023 return 0;
Douglas Anderson74c06c22021-06-11 10:17:41 -07005024
5025err_did_aux_ep_register:
5026 dp_aux_dp_driver_unregister(&panel_simple_dp_aux_ep_driver);
5027
5028err_did_platform_register:
5029 platform_driver_unregister(&panel_simple_platform_driver);
5030
5031 return err;
Thierry Reding280921d2013-08-30 15:10:14 +02005032}
5033module_init(panel_simple_init);
5034
5035static void __exit panel_simple_exit(void)
5036{
Thierry Reding210fcd92013-11-22 19:27:11 +01005037 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
5038 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
5039
Douglas Anderson74c06c22021-06-11 10:17:41 -07005040 dp_aux_dp_driver_unregister(&panel_simple_dp_aux_ep_driver);
Thierry Reding280921d2013-08-30 15:10:14 +02005041 platform_driver_unregister(&panel_simple_platform_driver);
5042}
5043module_exit(panel_simple_exit);
5044
5045MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
5046MODULE_DESCRIPTION("DRM Driver for Simple Panels");
5047MODULE_LICENSE("GPL and additional rights");