blob: 216cde33b5c4c5be0551a11ae65e3a1b5fe168af [file] [log] [blame]
Thierry Reding280921d2013-08-30 15:10:14 +02001/*
2 * Copyright (C) 2013, NVIDIA Corporation. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sub license,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the
12 * next paragraph) shall be included in all copies or substantial portions
13 * of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
Sam Ravnborgcb23eae2019-05-26 20:05:32 +020024#include <linux/delay.h>
Alexandre Courbotcfdf0542014-03-01 14:00:58 +090025#include <linux/gpio/consumer.h>
Douglas Anderson48834e62020-05-07 14:34:57 -070026#include <linux/iopoll.h>
Thierry Reding280921d2013-08-30 15:10:14 +020027#include <linux/module.h>
Thierry Reding280921d2013-08-30 15:10:14 +020028#include <linux/of_platform.h>
29#include <linux/platform_device.h>
30#include <linux/regulator/consumer.h>
31
Philipp Zabela5d3e622014-12-11 18:32:45 +010032#include <video/display_timing.h>
Sean Paulb8a29482019-07-11 13:34:53 -070033#include <video/of_display_timing.h>
Philipp Zabela5d3e622014-12-11 18:32:45 +010034#include <video/videomode.h>
35
Sam Ravnborgcb23eae2019-05-26 20:05:32 +020036#include <drm/drm_crtc.h>
37#include <drm/drm_device.h>
38#include <drm/drm_mipi_dsi.h>
39#include <drm/drm_panel.h>
40
Douglas Andersone362cc62019-07-12 09:33:33 -070041/**
Lee Jones084ee212020-11-05 14:45:09 +000042 * struct panel_desc
Douglas Andersone362cc62019-07-12 09:33:33 -070043 * @modes: Pointer to array of fixed modes appropriate for this panel. If
44 * only one mode then this can just be the address of this the mode.
45 * NOTE: cannot be used with "timings" and also if this is specified
46 * then you cannot override the mode in the device tree.
47 * @num_modes: Number of elements in modes array.
48 * @timings: Pointer to array of display timings. NOTE: cannot be used with
49 * "modes" and also these will be used to validate a device tree
50 * override if one is present.
51 * @num_timings: Number of elements in timings array.
52 * @bpc: Bits per color.
53 * @size: Structure containing the physical size of this panel.
54 * @delay: Structure containing various delay values for this panel.
55 * @bus_format: See MEDIA_BUS_FMT_... defines.
56 * @bus_flags: See DRM_BUS_FLAG_... defines.
Lee Jones084ee212020-11-05 14:45:09 +000057 * @connector_type: LVDS, eDP, DSI, DPI, etc.
Douglas Andersone362cc62019-07-12 09:33:33 -070058 */
Thierry Reding280921d2013-08-30 15:10:14 +020059struct panel_desc {
60 const struct drm_display_mode *modes;
61 unsigned int num_modes;
Philipp Zabela5d3e622014-12-11 18:32:45 +010062 const struct display_timing *timings;
63 unsigned int num_timings;
Thierry Reding280921d2013-08-30 15:10:14 +020064
Stéphane Marchesin0208d512014-06-19 18:18:28 -070065 unsigned int bpc;
66
Thierry Reding280921d2013-08-30 15:10:14 +020067 struct {
Douglas Anderson131f9092020-11-09 17:00:55 -080068 /**
69 * @size.width: Width (in mm) of the active display area.
70 */
Thierry Reding280921d2013-08-30 15:10:14 +020071 unsigned int width;
Douglas Anderson131f9092020-11-09 17:00:55 -080072
73 /**
74 * @size.height: Height (in mm) of the active display area.
75 */
Thierry Reding280921d2013-08-30 15:10:14 +020076 unsigned int height;
77 } size;
Ajay Kumarf673c372014-07-31 23:12:11 +053078
Ajay Kumarf673c372014-07-31 23:12:11 +053079 struct {
Douglas Anderson131f9092020-11-09 17:00:55 -080080 /**
81 * @delay.prepare: Time for the panel to become ready.
82 *
83 * The time (in milliseconds) that it takes for the panel to
84 * become ready and start receiving video data
85 */
Ajay Kumarf673c372014-07-31 23:12:11 +053086 unsigned int prepare;
Douglas Anderson131f9092020-11-09 17:00:55 -080087
88 /**
89 * @delay.hpd_absent_delay: Time to wait if HPD isn't hooked up.
90 *
91 * Add this to the prepare delay if we know Hot Plug Detect
92 * isn't used.
93 */
Douglas Anderson2ed3e952018-10-25 15:21:30 -070094 unsigned int hpd_absent_delay;
Douglas Anderson131f9092020-11-09 17:00:55 -080095
96 /**
Douglas Anderson4beb04b2020-11-09 17:00:57 -080097 * @delay.prepare_to_enable: Time between prepare and enable.
98 *
99 * The minimum time, in milliseconds, that needs to have passed
100 * between when prepare finished and enable may begin. If at
101 * enable time less time has passed since prepare finished,
102 * the driver waits for the remaining time.
103 *
104 * If a fixed enable delay is also specified, we'll start
105 * counting before delaying for the fixed delay.
106 *
107 * If a fixed prepare delay is also specified, we won't start
108 * counting until after the fixed delay. We can't overlap this
109 * fixed delay with the min time because the fixed delay
110 * doesn't happen at the end of the function if a HPD GPIO was
111 * specified.
112 *
113 * In other words:
114 * prepare()
115 * ...
116 * // do fixed prepare delay
117 * // wait for HPD GPIO if applicable
118 * // start counting for prepare_to_enable
119 *
120 * enable()
121 * // do fixed enable delay
122 * // enforce prepare_to_enable min time
123 */
124 unsigned int prepare_to_enable;
125
126 /**
Douglas Anderson131f9092020-11-09 17:00:55 -0800127 * @delay.enable: Time for the panel to display a valid frame.
128 *
129 * The time (in milliseconds) that it takes for the panel to
130 * display the first valid frame after starting to receive
131 * video data.
132 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530133 unsigned int enable;
Douglas Anderson131f9092020-11-09 17:00:55 -0800134
135 /**
136 * @delay.disable: Time for the panel to turn the display off.
137 *
138 * The time (in milliseconds) that it takes for the panel to
139 * turn the display off (no content is visible).
140 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530141 unsigned int disable;
Douglas Anderson131f9092020-11-09 17:00:55 -0800142
143 /**
144 * @delay.unprepare: Time to power down completely.
145 *
146 * The time (in milliseconds) that it takes for the panel
147 * to power itself down completely.
Douglas Andersone5e30df2020-11-09 17:00:56 -0800148 *
149 * This time is used to prevent a future "prepare" from
150 * starting until at least this many milliseconds has passed.
151 * If at prepare time less time has passed since unprepare
152 * finished, the driver waits for the remaining time.
Douglas Anderson131f9092020-11-09 17:00:55 -0800153 */
Ajay Kumarf673c372014-07-31 23:12:11 +0530154 unsigned int unprepare;
155 } delay;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200156
157 u32 bus_format;
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800158 u32 bus_flags;
Laurent Pinchart9a2654c2019-09-04 16:28:03 +0300159 int connector_type;
Thierry Reding280921d2013-08-30 15:10:14 +0200160};
161
Thierry Reding280921d2013-08-30 15:10:14 +0200162struct panel_simple {
163 struct drm_panel base;
164 bool enabled;
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700165 bool no_hpd;
Thierry Reding280921d2013-08-30 15:10:14 +0200166
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800167 ktime_t prepared_time;
Douglas Andersone5e30df2020-11-09 17:00:56 -0800168 ktime_t unprepared_time;
169
Thierry Reding280921d2013-08-30 15:10:14 +0200170 const struct panel_desc *desc;
171
Thierry Reding280921d2013-08-30 15:10:14 +0200172 struct regulator *supply;
173 struct i2c_adapter *ddc;
174
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900175 struct gpio_desc *enable_gpio;
Douglas Anderson48834e62020-05-07 14:34:57 -0700176 struct gpio_desc *hpd_gpio;
Sean Paulb8a29482019-07-11 13:34:53 -0700177
178 struct drm_display_mode override_mode;
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300179
180 enum drm_panel_orientation orientation;
Thierry Reding280921d2013-08-30 15:10:14 +0200181};
182
183static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
184{
185 return container_of(panel, struct panel_simple, base);
186}
187
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100188static unsigned int panel_simple_get_timings_modes(struct panel_simple *panel,
189 struct drm_connector *connector)
Thierry Reding280921d2013-08-30 15:10:14 +0200190{
Thierry Reding280921d2013-08-30 15:10:14 +0200191 struct drm_display_mode *mode;
192 unsigned int i, num = 0;
193
Philipp Zabela5d3e622014-12-11 18:32:45 +0100194 for (i = 0; i < panel->desc->num_timings; i++) {
195 const struct display_timing *dt = &panel->desc->timings[i];
196 struct videomode vm;
197
198 videomode_from_timing(dt, &vm);
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100199 mode = drm_mode_create(connector->dev);
Philipp Zabela5d3e622014-12-11 18:32:45 +0100200 if (!mode) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100201 dev_err(panel->base.dev, "failed to add mode %ux%u\n",
Philipp Zabela5d3e622014-12-11 18:32:45 +0100202 dt->hactive.typ, dt->vactive.typ);
203 continue;
204 }
205
206 drm_display_mode_from_videomode(&vm, mode);
Boris Brezilloncda55372016-04-15 18:23:33 +0200207
208 mode->type |= DRM_MODE_TYPE_DRIVER;
209
Chen-Yu Tsai230c5b42016-10-24 21:21:15 +0800210 if (panel->desc->num_timings == 1)
Boris Brezilloncda55372016-04-15 18:23:33 +0200211 mode->type |= DRM_MODE_TYPE_PREFERRED;
212
Philipp Zabela5d3e622014-12-11 18:32:45 +0100213 drm_mode_probed_add(connector, mode);
214 num++;
215 }
216
Sean Paulb8a29482019-07-11 13:34:53 -0700217 return num;
218}
219
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100220static unsigned int panel_simple_get_display_modes(struct panel_simple *panel,
221 struct drm_connector *connector)
Sean Paulb8a29482019-07-11 13:34:53 -0700222{
Sean Paulb8a29482019-07-11 13:34:53 -0700223 struct drm_display_mode *mode;
224 unsigned int i, num = 0;
225
Thierry Reding280921d2013-08-30 15:10:14 +0200226 for (i = 0; i < panel->desc->num_modes; i++) {
227 const struct drm_display_mode *m = &panel->desc->modes[i];
228
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100229 mode = drm_mode_duplicate(connector->dev, m);
Thierry Reding280921d2013-08-30 15:10:14 +0200230 if (!mode) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100231 dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
Ville Syrjälä04256622020-04-28 20:19:27 +0300232 m->hdisplay, m->vdisplay,
233 drm_mode_vrefresh(m));
Thierry Reding280921d2013-08-30 15:10:14 +0200234 continue;
235 }
236
Boris Brezilloncda55372016-04-15 18:23:33 +0200237 mode->type |= DRM_MODE_TYPE_DRIVER;
238
239 if (panel->desc->num_modes == 1)
240 mode->type |= DRM_MODE_TYPE_PREFERRED;
241
Thierry Reding280921d2013-08-30 15:10:14 +0200242 drm_mode_set_name(mode);
243
244 drm_mode_probed_add(connector, mode);
245 num++;
246 }
247
Sean Paulb8a29482019-07-11 13:34:53 -0700248 return num;
249}
250
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100251static int panel_simple_get_non_edid_modes(struct panel_simple *panel,
252 struct drm_connector *connector)
Sean Paulb8a29482019-07-11 13:34:53 -0700253{
Sean Paulb8a29482019-07-11 13:34:53 -0700254 struct drm_display_mode *mode;
255 bool has_override = panel->override_mode.type;
256 unsigned int num = 0;
257
258 if (!panel->desc)
259 return 0;
260
261 if (has_override) {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100262 mode = drm_mode_duplicate(connector->dev,
263 &panel->override_mode);
Sean Paulb8a29482019-07-11 13:34:53 -0700264 if (mode) {
265 drm_mode_probed_add(connector, mode);
266 num = 1;
267 } else {
Sam Ravnborgaa6c4362019-12-07 15:03:35 +0100268 dev_err(panel->base.dev, "failed to add override mode\n");
Sean Paulb8a29482019-07-11 13:34:53 -0700269 }
270 }
271
272 /* Only add timings if override was not there or failed to validate */
273 if (num == 0 && panel->desc->num_timings)
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100274 num = panel_simple_get_timings_modes(panel, connector);
Sean Paulb8a29482019-07-11 13:34:53 -0700275
276 /*
277 * Only add fixed modes if timings/override added no mode.
278 *
279 * We should only ever have either the display timings specified
280 * or a fixed mode. Anything else is rather bogus.
281 */
282 WARN_ON(panel->desc->num_timings && panel->desc->num_modes);
283 if (num == 0)
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100284 num = panel_simple_get_display_modes(panel, connector);
Sean Paulb8a29482019-07-11 13:34:53 -0700285
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700286 connector->display_info.bpc = panel->desc->bpc;
Thierry Reding280921d2013-08-30 15:10:14 +0200287 connector->display_info.width_mm = panel->desc->size.width;
288 connector->display_info.height_mm = panel->desc->size.height;
Boris Brezillon795f7ab2014-07-22 13:33:59 +0200289 if (panel->desc->bus_format)
290 drm_display_info_set_bus_formats(&connector->display_info,
291 &panel->desc->bus_format, 1);
Stefan Agnerf0aa0832016-02-08 11:38:14 -0800292 connector->display_info.bus_flags = panel->desc->bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200293
294 return num;
295}
296
Douglas Andersone5e30df2020-11-09 17:00:56 -0800297static void panel_simple_wait(ktime_t start_ktime, unsigned int min_ms)
298{
299 ktime_t now_ktime, min_ktime;
300
301 if (!min_ms)
302 return;
303
304 min_ktime = ktime_add(start_ktime, ms_to_ktime(min_ms));
305 now_ktime = ktime_get();
306
307 if (ktime_before(now_ktime, min_ktime))
308 msleep(ktime_to_ms(ktime_sub(min_ktime, now_ktime)) + 1);
309}
310
Thierry Reding280921d2013-08-30 15:10:14 +0200311static int panel_simple_disable(struct drm_panel *panel)
312{
313 struct panel_simple *p = to_panel_simple(panel);
314
315 if (!p->enabled)
316 return 0;
317
Ajay Kumarf673c372014-07-31 23:12:11 +0530318 if (p->desc->delay.disable)
319 msleep(p->desc->delay.disable);
320
Thierry Reding280921d2013-08-30 15:10:14 +0200321 p->enabled = false;
322
323 return 0;
324}
325
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530326static int panel_simple_unprepare(struct drm_panel *panel)
327{
Ajay Kumar613a6332014-07-31 23:12:10 +0530328 struct panel_simple *p = to_panel_simple(panel);
329
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800330 if (p->prepared_time == 0)
Ajay Kumar613a6332014-07-31 23:12:10 +0530331 return 0;
332
Fabio Estevam756b9182017-07-16 21:05:39 -0300333 gpiod_set_value_cansleep(p->enable_gpio, 0);
Ajay Kumar613a6332014-07-31 23:12:10 +0530334
335 regulator_disable(p->supply);
336
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800337 p->prepared_time = 0;
Douglas Andersone5e30df2020-11-09 17:00:56 -0800338 p->unprepared_time = ktime_get();
Ajay Kumar613a6332014-07-31 23:12:10 +0530339
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530340 return 0;
341}
342
Douglas Anderson48834e62020-05-07 14:34:57 -0700343static int panel_simple_get_hpd_gpio(struct device *dev,
344 struct panel_simple *p, bool from_probe)
345{
346 int err;
347
348 p->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN);
349 if (IS_ERR(p->hpd_gpio)) {
350 err = PTR_ERR(p->hpd_gpio);
351
352 /*
353 * If we're called from probe we won't consider '-EPROBE_DEFER'
354 * to be an error--we'll leave the error code in "hpd_gpio".
355 * When we try to use it we'll try again. This allows for
356 * circular dependencies where the component providing the
357 * hpd gpio needs the panel to init before probing.
358 */
359 if (err != -EPROBE_DEFER || !from_probe) {
360 dev_err(dev, "failed to get 'hpd' GPIO: %d\n", err);
361 return err;
362 }
363 }
364
365 return 0;
366}
367
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530368static int panel_simple_prepare(struct drm_panel *panel)
369{
Thierry Reding280921d2013-08-30 15:10:14 +0200370 struct panel_simple *p = to_panel_simple(panel);
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700371 unsigned int delay;
Thierry Reding280921d2013-08-30 15:10:14 +0200372 int err;
Douglas Anderson48834e62020-05-07 14:34:57 -0700373 int hpd_asserted;
Thierry Reding280921d2013-08-30 15:10:14 +0200374
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800375 if (p->prepared_time != 0)
Thierry Reding280921d2013-08-30 15:10:14 +0200376 return 0;
377
Douglas Andersone5e30df2020-11-09 17:00:56 -0800378 panel_simple_wait(p->unprepared_time, p->desc->delay.unprepare);
379
Thierry Reding280921d2013-08-30 15:10:14 +0200380 err = regulator_enable(p->supply);
381 if (err < 0) {
382 dev_err(panel->dev, "failed to enable supply: %d\n", err);
383 return err;
384 }
385
Fabio Estevam756b9182017-07-16 21:05:39 -0300386 gpiod_set_value_cansleep(p->enable_gpio, 1);
Thierry Reding280921d2013-08-30 15:10:14 +0200387
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700388 delay = p->desc->delay.prepare;
389 if (p->no_hpd)
390 delay += p->desc->delay.hpd_absent_delay;
391 if (delay)
392 msleep(delay);
Ajay Kumarf673c372014-07-31 23:12:11 +0530393
Douglas Anderson48834e62020-05-07 14:34:57 -0700394 if (p->hpd_gpio) {
395 if (IS_ERR(p->hpd_gpio)) {
396 err = panel_simple_get_hpd_gpio(panel->dev, p, false);
397 if (err)
398 return err;
399 }
400
401 err = readx_poll_timeout(gpiod_get_value_cansleep, p->hpd_gpio,
402 hpd_asserted, hpd_asserted,
403 1000, 2000000);
404 if (hpd_asserted < 0)
405 err = hpd_asserted;
406
407 if (err) {
408 dev_err(panel->dev,
409 "error waiting for hpd GPIO: %d\n", err);
410 return err;
411 }
412 }
413
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800414 p->prepared_time = ktime_get();
Ajay Kumar613a6332014-07-31 23:12:10 +0530415
416 return 0;
417}
418
419static int panel_simple_enable(struct drm_panel *panel)
420{
421 struct panel_simple *p = to_panel_simple(panel);
422
423 if (p->enabled)
424 return 0;
425
Ajay Kumarf673c372014-07-31 23:12:11 +0530426 if (p->desc->delay.enable)
427 msleep(p->desc->delay.enable);
428
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800429 panel_simple_wait(p->prepared_time, p->desc->delay.prepare_to_enable);
430
Thierry Reding280921d2013-08-30 15:10:14 +0200431 p->enabled = true;
432
433 return 0;
434}
435
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100436static int panel_simple_get_modes(struct drm_panel *panel,
437 struct drm_connector *connector)
Thierry Reding280921d2013-08-30 15:10:14 +0200438{
439 struct panel_simple *p = to_panel_simple(panel);
440 int num = 0;
441
442 /* probe EDID if a DDC bus is available */
443 if (p->ddc) {
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100444 struct edid *edid = drm_get_edid(connector, p->ddc);
445
446 drm_connector_update_edid_property(connector, edid);
Thierry Reding280921d2013-08-30 15:10:14 +0200447 if (edid) {
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100448 num += drm_add_edid_modes(connector, edid);
Thierry Reding280921d2013-08-30 15:10:14 +0200449 kfree(edid);
450 }
451 }
452
453 /* add hard-coded panel modes */
Sam Ravnborg0ce8ddd2019-12-07 15:03:33 +0100454 num += panel_simple_get_non_edid_modes(p, connector);
Thierry Reding280921d2013-08-30 15:10:14 +0200455
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300456 /* set up connector's "panel orientation" property */
457 drm_connector_set_panel_orientation(connector, p->orientation);
458
Thierry Reding280921d2013-08-30 15:10:14 +0200459 return num;
460}
461
Philipp Zabela5d3e622014-12-11 18:32:45 +0100462static int panel_simple_get_timings(struct drm_panel *panel,
463 unsigned int num_timings,
464 struct display_timing *timings)
465{
466 struct panel_simple *p = to_panel_simple(panel);
467 unsigned int i;
468
469 if (p->desc->num_timings < num_timings)
470 num_timings = p->desc->num_timings;
471
472 if (timings)
473 for (i = 0; i < num_timings; i++)
474 timings[i] = p->desc->timings[i];
475
476 return p->desc->num_timings;
477}
478
Thierry Reding280921d2013-08-30 15:10:14 +0200479static const struct drm_panel_funcs panel_simple_funcs = {
480 .disable = panel_simple_disable,
Ajay Kumarc0e1d172014-07-31 23:12:04 +0530481 .unprepare = panel_simple_unprepare,
482 .prepare = panel_simple_prepare,
Thierry Reding280921d2013-08-30 15:10:14 +0200483 .enable = panel_simple_enable,
484 .get_modes = panel_simple_get_modes,
Philipp Zabela5d3e622014-12-11 18:32:45 +0100485 .get_timings = panel_simple_get_timings,
Thierry Reding280921d2013-08-30 15:10:14 +0200486};
487
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100488static struct panel_desc panel_dpi;
489
490static int panel_dpi_probe(struct device *dev,
491 struct panel_simple *panel)
492{
493 struct display_timing *timing;
494 const struct device_node *np;
495 struct panel_desc *desc;
496 unsigned int bus_flags;
497 struct videomode vm;
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100498 int ret;
499
500 np = dev->of_node;
501 desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
502 if (!desc)
503 return -ENOMEM;
504
505 timing = devm_kzalloc(dev, sizeof(*timing), GFP_KERNEL);
506 if (!timing)
507 return -ENOMEM;
508
509 ret = of_get_display_timing(np, "panel-timing", timing);
510 if (ret < 0) {
511 dev_err(dev, "%pOF: no panel-timing node found for \"panel-dpi\" binding\n",
512 np);
513 return ret;
514 }
515
516 desc->timings = timing;
517 desc->num_timings = 1;
518
519 of_property_read_u32(np, "width-mm", &desc->size.width);
520 of_property_read_u32(np, "height-mm", &desc->size.height);
521
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100522 /* Extract bus_flags from display_timing */
523 bus_flags = 0;
524 vm.flags = timing->flags;
525 drm_bus_flags_from_videomode(&vm, &bus_flags);
526 desc->bus_flags = bus_flags;
527
528 /* We do not know the connector for the DT node, so guess it */
529 desc->connector_type = DRM_MODE_CONNECTOR_DPI;
530
531 panel->desc = desc;
532
533 return 0;
534}
535
Sean Paulb8a29482019-07-11 13:34:53 -0700536#define PANEL_SIMPLE_BOUNDS_CHECK(to_check, bounds, field) \
537 (to_check->field.typ >= bounds->field.min && \
538 to_check->field.typ <= bounds->field.max)
Douglas Andersone362cc62019-07-12 09:33:33 -0700539static void panel_simple_parse_panel_timing_node(struct device *dev,
540 struct panel_simple *panel,
541 const struct display_timing *ot)
Sean Paulb8a29482019-07-11 13:34:53 -0700542{
543 const struct panel_desc *desc = panel->desc;
544 struct videomode vm;
545 unsigned int i;
546
547 if (WARN_ON(desc->num_modes)) {
548 dev_err(dev, "Reject override mode: panel has a fixed mode\n");
549 return;
550 }
551 if (WARN_ON(!desc->num_timings)) {
552 dev_err(dev, "Reject override mode: no timings specified\n");
553 return;
554 }
555
556 for (i = 0; i < panel->desc->num_timings; i++) {
557 const struct display_timing *dt = &panel->desc->timings[i];
558
559 if (!PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hactive) ||
560 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hfront_porch) ||
561 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hback_porch) ||
562 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, hsync_len) ||
563 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vactive) ||
564 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vfront_porch) ||
565 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vback_porch) ||
566 !PANEL_SIMPLE_BOUNDS_CHECK(ot, dt, vsync_len))
567 continue;
568
569 if (ot->flags != dt->flags)
570 continue;
571
572 videomode_from_timing(ot, &vm);
573 drm_display_mode_from_videomode(&vm, &panel->override_mode);
574 panel->override_mode.type |= DRM_MODE_TYPE_DRIVER |
575 DRM_MODE_TYPE_PREFERRED;
576 break;
577 }
578
579 if (WARN_ON(!panel->override_mode.type))
580 dev_err(dev, "Reject override mode: No display_timing found\n");
581}
582
Thierry Reding280921d2013-08-30 15:10:14 +0200583static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
584{
Thierry Reding280921d2013-08-30 15:10:14 +0200585 struct panel_simple *panel;
Sean Paulb8a29482019-07-11 13:34:53 -0700586 struct display_timing dt;
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100587 struct device_node *ddc;
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200588 int connector_type;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200589 u32 bus_flags;
Thierry Reding280921d2013-08-30 15:10:14 +0200590 int err;
591
592 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
593 if (!panel)
594 return -ENOMEM;
595
596 panel->enabled = false;
Douglas Anderson4beb04b2020-11-09 17:00:57 -0800597 panel->prepared_time = 0;
Thierry Reding280921d2013-08-30 15:10:14 +0200598 panel->desc = desc;
599
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700600 panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd");
Douglas Anderson48834e62020-05-07 14:34:57 -0700601 if (!panel->no_hpd) {
602 err = panel_simple_get_hpd_gpio(dev, panel, true);
603 if (err)
604 return err;
605 }
Douglas Anderson2ed3e952018-10-25 15:21:30 -0700606
Thierry Reding280921d2013-08-30 15:10:14 +0200607 panel->supply = devm_regulator_get(dev, "power");
608 if (IS_ERR(panel->supply))
609 return PTR_ERR(panel->supply);
610
Alexandre Courbota61400d2014-10-23 17:16:58 +0900611 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
612 GPIOD_OUT_LOW);
Alexandre Courbotcfdf0542014-03-01 14:00:58 +0900613 if (IS_ERR(panel->enable_gpio)) {
614 err = PTR_ERR(panel->enable_gpio);
Fabio Estevamb8e93802017-06-30 18:14:46 -0300615 if (err != -EPROBE_DEFER)
616 dev_err(dev, "failed to request GPIO: %d\n", err);
Alexandre Courbot9746c612014-07-25 23:47:25 +0900617 return err;
618 }
Thierry Reding280921d2013-08-30 15:10:14 +0200619
Dmitry Osipenko5759c962020-08-14 00:56:09 +0300620 err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
621 if (err) {
622 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
623 return err;
624 }
625
Thierry Reding280921d2013-08-30 15:10:14 +0200626 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
627 if (ddc) {
628 panel->ddc = of_find_i2c_adapter_by_node(ddc);
629 of_node_put(ddc);
630
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100631 if (!panel->ddc)
632 return -EPROBE_DEFER;
Thierry Reding280921d2013-08-30 15:10:14 +0200633 }
634
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +0100635 if (desc == &panel_dpi) {
636 /* Handle the generic panel-dpi binding */
637 err = panel_dpi_probe(dev, panel);
638 if (err)
639 goto free_ddc;
640 } else {
641 if (!of_get_display_timing(dev->of_node, "panel-timing", &dt))
642 panel_simple_parse_panel_timing_node(dev, panel, &dt);
643 }
Sean Paulb8a29482019-07-11 13:34:53 -0700644
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200645 connector_type = desc->connector_type;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200646 /* Catch common mistakes for panels. */
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200647 switch (connector_type) {
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200648 case 0:
649 dev_warn(dev, "Specify missing connector_type\n");
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200650 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200651 break;
652 case DRM_MODE_CONNECTOR_LVDS:
Laurent Pinchartc4715832020-06-30 02:33:19 +0300653 WARN_ON(desc->bus_flags &
654 ~(DRM_BUS_FLAG_DE_LOW |
655 DRM_BUS_FLAG_DE_HIGH |
656 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
657 DRM_BUS_FLAG_DATA_LSB_TO_MSB));
Laurent Pinchart1185c402020-06-30 02:33:20 +0300658 WARN_ON(desc->bus_format != MEDIA_BUS_FMT_RGB666_1X7X3_SPWG &&
659 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_SPWG &&
660 desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA);
661 WARN_ON(desc->bus_format == MEDIA_BUS_FMT_RGB666_1X7X3_SPWG &&
662 desc->bpc != 6);
663 WARN_ON((desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_SPWG ||
664 desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA) &&
665 desc->bpc != 8);
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200666 break;
667 case DRM_MODE_CONNECTOR_eDP:
668 if (desc->bus_format == 0)
669 dev_warn(dev, "Specify missing bus_format\n");
670 if (desc->bpc != 6 && desc->bpc != 8)
671 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
672 break;
673 case DRM_MODE_CONNECTOR_DSI:
674 if (desc->bpc != 6 && desc->bpc != 8)
675 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
676 break;
677 case DRM_MODE_CONNECTOR_DPI:
678 bus_flags = DRM_BUS_FLAG_DE_LOW |
679 DRM_BUS_FLAG_DE_HIGH |
680 DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE |
681 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
682 DRM_BUS_FLAG_DATA_MSB_TO_LSB |
683 DRM_BUS_FLAG_DATA_LSB_TO_MSB |
684 DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE |
685 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE;
686 if (desc->bus_flags & ~bus_flags)
687 dev_warn(dev, "Unexpected bus_flags(%d)\n", desc->bus_flags & ~bus_flags);
688 if (!(desc->bus_flags & bus_flags))
689 dev_warn(dev, "Specify missing bus_flags\n");
690 if (desc->bus_format == 0)
691 dev_warn(dev, "Specify missing bus_format\n");
692 if (desc->bpc != 6 && desc->bpc != 8)
693 dev_warn(dev, "Expected bpc in {6,8} but got: %u\n", desc->bpc);
694 break;
695 default:
696 dev_warn(dev, "Specify a valid connector_type: %d\n", desc->connector_type);
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200697 connector_type = DRM_MODE_CONNECTOR_DPI;
Sam Ravnborgddb8e852020-07-26 22:33:10 +0200698 break;
Laurent Pinchart1185c402020-06-30 02:33:20 +0300699 }
Laurent Pinchartc4715832020-06-30 02:33:19 +0300700
Sam Ravnborg9f069c62020-07-26 22:33:11 +0200701 drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type);
Thierry Reding280921d2013-08-30 15:10:14 +0200702
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100703 err = drm_panel_of_backlight(&panel->base);
704 if (err)
705 goto free_ddc;
706
Bernard Zhaoc3ee8c62020-08-01 20:02:13 +0800707 drm_panel_add(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200708
709 dev_set_drvdata(dev, panel);
710
711 return 0;
712
713free_ddc:
714 if (panel->ddc)
715 put_device(&panel->ddc->dev);
Thierry Reding280921d2013-08-30 15:10:14 +0200716
717 return err;
718}
719
720static int panel_simple_remove(struct device *dev)
721{
722 struct panel_simple *panel = dev_get_drvdata(dev);
723
Thierry Reding280921d2013-08-30 15:10:14 +0200724 drm_panel_remove(&panel->base);
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100725 drm_panel_disable(&panel->base);
726 drm_panel_unprepare(&panel->base);
Thierry Reding280921d2013-08-30 15:10:14 +0200727
728 if (panel->ddc)
729 put_device(&panel->ddc->dev);
730
Thierry Reding280921d2013-08-30 15:10:14 +0200731 return 0;
732}
733
Thierry Redingd02fd932014-04-29 17:21:21 +0200734static void panel_simple_shutdown(struct device *dev)
735{
736 struct panel_simple *panel = dev_get_drvdata(dev);
737
Sam Ravnborg0fe15642019-12-07 15:03:31 +0100738 drm_panel_disable(&panel->base);
739 drm_panel_unprepare(&panel->base);
Thierry Redingd02fd932014-04-29 17:21:21 +0200740}
741
Jagan Tekibca684e2020-08-29 22:03:28 +0530742static const struct drm_display_mode ampire_am_1280800n3tzqw_t00h_mode = {
743 .clock = 71100,
744 .hdisplay = 1280,
745 .hsync_start = 1280 + 40,
746 .hsync_end = 1280 + 40 + 80,
747 .htotal = 1280 + 40 + 80 + 40,
748 .vdisplay = 800,
749 .vsync_start = 800 + 3,
750 .vsync_end = 800 + 3 + 10,
751 .vtotal = 800 + 3 + 10 + 10,
752 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
753};
754
755static const struct panel_desc ampire_am_1280800n3tzqw_t00h = {
756 .modes = &ampire_am_1280800n3tzqw_t00h_mode,
757 .num_modes = 1,
758 .bpc = 6,
759 .size = {
760 .width = 217,
761 .height = 136,
762 },
763 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
764 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
765 .connector_type = DRM_MODE_CONNECTOR_LVDS,
766};
767
Yannick Fertre966fea72017-03-28 11:44:49 +0200768static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
769 .clock = 9000,
770 .hdisplay = 480,
771 .hsync_start = 480 + 2,
772 .hsync_end = 480 + 2 + 41,
773 .htotal = 480 + 2 + 41 + 2,
774 .vdisplay = 272,
775 .vsync_start = 272 + 2,
776 .vsync_end = 272 + 2 + 10,
777 .vtotal = 272 + 2 + 10 + 2,
Yannick Fertre966fea72017-03-28 11:44:49 +0200778 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
779};
780
781static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
782 .modes = &ampire_am_480272h3tmqw_t01h_mode,
783 .num_modes = 1,
784 .bpc = 8,
785 .size = {
786 .width = 105,
787 .height = 67,
788 },
789 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
790};
791
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100792static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
793 .clock = 33333,
794 .hdisplay = 800,
795 .hsync_start = 800 + 0,
796 .hsync_end = 800 + 0 + 255,
797 .htotal = 800 + 0 + 255 + 0,
798 .vdisplay = 480,
799 .vsync_start = 480 + 2,
800 .vsync_end = 480 + 2 + 45,
801 .vtotal = 480 + 2 + 45 + 0,
Philipp Zabel1c550fa12015-02-11 18:50:09 +0100802 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
803};
804
805static const struct panel_desc ampire_am800480r3tmqwa1h = {
806 .modes = &ampire_am800480r3tmqwa1h_mode,
807 .num_modes = 1,
808 .bpc = 6,
809 .size = {
810 .width = 152,
811 .height = 91,
812 },
813 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
814};
815
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200816static const struct display_timing santek_st0700i5y_rbslw_f_timing = {
817 .pixelclock = { 26400000, 33300000, 46800000 },
818 .hactive = { 800, 800, 800 },
819 .hfront_porch = { 16, 210, 354 },
820 .hback_porch = { 45, 36, 6 },
821 .hsync_len = { 1, 10, 40 },
822 .vactive = { 480, 480, 480 },
823 .vfront_porch = { 7, 22, 147 },
824 .vback_porch = { 22, 13, 3 },
825 .vsync_len = { 1, 10, 20 },
826 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
827 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE
828};
829
830static const struct panel_desc armadeus_st0700_adapt = {
831 .timings = &santek_st0700i5y_rbslw_f_timing,
832 .num_timings = 1,
833 .bpc = 6,
834 .size = {
835 .width = 154,
836 .height = 86,
837 },
838 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +0200839 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Sébastien Szymanskic479450f2019-05-07 17:27:12 +0200840};
841
Thierry Reding280921d2013-08-30 15:10:14 +0200842static const struct drm_display_mode auo_b101aw03_mode = {
843 .clock = 51450,
844 .hdisplay = 1024,
845 .hsync_start = 1024 + 156,
846 .hsync_end = 1024 + 156 + 8,
847 .htotal = 1024 + 156 + 8 + 156,
848 .vdisplay = 600,
849 .vsync_start = 600 + 16,
850 .vsync_end = 600 + 16 + 6,
851 .vtotal = 600 + 16 + 6 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +0200852};
853
854static const struct panel_desc auo_b101aw03 = {
855 .modes = &auo_b101aw03_mode,
856 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700857 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +0200858 .size = {
859 .width = 223,
860 .height = 125,
861 },
Dmitry Osipenko85560822020-06-22 01:27:42 +0300862 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +0300863 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +0300864 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +0200865};
866
Douglas Anderson374bf822019-07-11 13:34:55 -0700867static const struct display_timing auo_b101ean01_timing = {
868 .pixelclock = { 65300000, 72500000, 75000000 },
869 .hactive = { 1280, 1280, 1280 },
870 .hfront_porch = { 18, 119, 119 },
871 .hback_porch = { 21, 21, 21 },
872 .hsync_len = { 32, 32, 32 },
873 .vactive = { 800, 800, 800 },
874 .vfront_porch = { 4, 4, 4 },
875 .vback_porch = { 8, 8, 8 },
876 .vsync_len = { 18, 20, 20 },
Huang Lina531bc32015-02-28 10:18:58 +0800877};
878
879static const struct panel_desc auo_b101ean01 = {
Douglas Anderson374bf822019-07-11 13:34:55 -0700880 .timings = &auo_b101ean01_timing,
881 .num_timings = 1,
Huang Lina531bc32015-02-28 10:18:58 +0800882 .bpc = 6,
883 .size = {
884 .width = 217,
885 .height = 136,
886 },
887};
888
Rob Clarkdac746e2014-08-01 17:01:06 -0400889static const struct drm_display_mode auo_b101xtn01_mode = {
890 .clock = 72000,
891 .hdisplay = 1366,
892 .hsync_start = 1366 + 20,
893 .hsync_end = 1366 + 20 + 70,
894 .htotal = 1366 + 20 + 70,
895 .vdisplay = 768,
896 .vsync_start = 768 + 14,
897 .vsync_end = 768 + 14 + 42,
898 .vtotal = 768 + 14 + 42,
Rob Clarkdac746e2014-08-01 17:01:06 -0400899 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
900};
901
902static const struct panel_desc auo_b101xtn01 = {
903 .modes = &auo_b101xtn01_mode,
904 .num_modes = 1,
905 .bpc = 6,
906 .size = {
907 .width = 223,
908 .height = 125,
909 },
910};
911
Rob Clarkda4582862020-01-08 15:53:56 -0800912static const struct drm_display_mode auo_b116xak01_mode = {
913 .clock = 69300,
914 .hdisplay = 1366,
915 .hsync_start = 1366 + 48,
916 .hsync_end = 1366 + 48 + 32,
917 .htotal = 1366 + 48 + 32 + 10,
918 .vdisplay = 768,
919 .vsync_start = 768 + 4,
920 .vsync_end = 768 + 4 + 6,
921 .vtotal = 768 + 4 + 6 + 15,
Rob Clarkda4582862020-01-08 15:53:56 -0800922 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
923};
924
925static const struct panel_desc auo_b116xak01 = {
926 .modes = &auo_b116xak01_mode,
927 .num_modes = 1,
928 .bpc = 6,
929 .size = {
930 .width = 256,
931 .height = 144,
932 },
933 .delay = {
934 .hpd_absent_delay = 200,
935 },
936 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
937 .connector_type = DRM_MODE_CONNECTOR_eDP,
938};
939
Ajay Kumare35e3052014-09-01 15:40:02 +0530940static const struct drm_display_mode auo_b116xw03_mode = {
941 .clock = 70589,
942 .hdisplay = 1366,
943 .hsync_start = 1366 + 40,
944 .hsync_end = 1366 + 40 + 40,
945 .htotal = 1366 + 40 + 40 + 32,
946 .vdisplay = 768,
947 .vsync_start = 768 + 10,
948 .vsync_end = 768 + 10 + 12,
949 .vtotal = 768 + 10 + 12 + 6,
Jitao Shi88d34572020-07-05 17:45:14 +0800950 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
Ajay Kumare35e3052014-09-01 15:40:02 +0530951};
952
953static const struct panel_desc auo_b116xw03 = {
954 .modes = &auo_b116xw03_mode,
955 .num_modes = 1,
956 .bpc = 6,
957 .size = {
958 .width = 256,
959 .height = 144,
960 },
Jitao Shi88d34572020-07-05 17:45:14 +0800961 .delay = {
962 .enable = 400,
963 },
964 .bus_flags = DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
965 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
966 .connector_type = DRM_MODE_CONNECTOR_eDP,
Ajay Kumare35e3052014-09-01 15:40:02 +0530967};
968
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700969static const struct drm_display_mode auo_b133xtn01_mode = {
970 .clock = 69500,
971 .hdisplay = 1366,
972 .hsync_start = 1366 + 48,
973 .hsync_end = 1366 + 48 + 32,
974 .htotal = 1366 + 48 + 32 + 20,
975 .vdisplay = 768,
976 .vsync_start = 768 + 3,
977 .vsync_end = 768 + 3 + 6,
978 .vtotal = 768 + 3 + 6 + 13,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700979};
980
981static const struct panel_desc auo_b133xtn01 = {
982 .modes = &auo_b133xtn01_mode,
983 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -0700984 .bpc = 6,
Stéphane Marchesina333f7a2014-05-23 19:27:59 -0700985 .size = {
986 .width = 293,
987 .height = 165,
988 },
989};
990
Ajay Kumar3e51d602014-07-31 23:12:12 +0530991static const struct drm_display_mode auo_b133htn01_mode = {
992 .clock = 150660,
993 .hdisplay = 1920,
994 .hsync_start = 1920 + 172,
995 .hsync_end = 1920 + 172 + 80,
996 .htotal = 1920 + 172 + 80 + 60,
997 .vdisplay = 1080,
998 .vsync_start = 1080 + 25,
999 .vsync_end = 1080 + 25 + 10,
1000 .vtotal = 1080 + 25 + 10 + 10,
Ajay Kumar3e51d602014-07-31 23:12:12 +05301001};
1002
1003static const struct panel_desc auo_b133htn01 = {
1004 .modes = &auo_b133htn01_mode,
1005 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001006 .bpc = 6,
Ajay Kumar3e51d602014-07-31 23:12:12 +05301007 .size = {
1008 .width = 293,
1009 .height = 165,
1010 },
1011 .delay = {
1012 .prepare = 105,
1013 .enable = 20,
1014 .unprepare = 50,
1015 },
1016};
1017
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02001018static const struct display_timing auo_g070vvn01_timings = {
1019 .pixelclock = { 33300000, 34209000, 45000000 },
1020 .hactive = { 800, 800, 800 },
1021 .hfront_porch = { 20, 40, 200 },
1022 .hback_porch = { 87, 40, 1 },
1023 .hsync_len = { 1, 48, 87 },
1024 .vactive = { 480, 480, 480 },
1025 .vfront_porch = { 5, 13, 200 },
1026 .vback_porch = { 31, 31, 29 },
1027 .vsync_len = { 1, 1, 3 },
1028};
1029
1030static const struct panel_desc auo_g070vvn01 = {
1031 .timings = &auo_g070vvn01_timings,
1032 .num_timings = 1,
1033 .bpc = 8,
1034 .size = {
1035 .width = 152,
1036 .height = 91,
1037 },
1038 .delay = {
1039 .prepare = 200,
1040 .enable = 50,
1041 .disable = 50,
1042 .unprepare = 1000,
1043 },
1044};
1045
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001046static const struct drm_display_mode auo_g101evn010_mode = {
1047 .clock = 68930,
1048 .hdisplay = 1280,
1049 .hsync_start = 1280 + 82,
1050 .hsync_end = 1280 + 82 + 2,
1051 .htotal = 1280 + 82 + 2 + 84,
1052 .vdisplay = 800,
1053 .vsync_start = 800 + 8,
1054 .vsync_end = 800 + 8 + 2,
1055 .vtotal = 800 + 8 + 2 + 6,
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001056};
1057
1058static const struct panel_desc auo_g101evn010 = {
1059 .modes = &auo_g101evn010_mode,
1060 .num_modes = 1,
1061 .bpc = 6,
1062 .size = {
1063 .width = 216,
1064 .height = 135,
1065 },
Tomi Valkeinen27a46fb2020-04-17 14:40:43 +03001066 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1067 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alex Gonzalez4fb86402018-10-25 17:09:30 +02001068};
1069
Christoph Fritz4451c282017-12-16 14:13:36 +01001070static const struct drm_display_mode auo_g104sn02_mode = {
1071 .clock = 40000,
1072 .hdisplay = 800,
1073 .hsync_start = 800 + 40,
1074 .hsync_end = 800 + 40 + 216,
1075 .htotal = 800 + 40 + 216 + 128,
1076 .vdisplay = 600,
1077 .vsync_start = 600 + 10,
1078 .vsync_end = 600 + 10 + 35,
1079 .vtotal = 600 + 10 + 35 + 2,
Christoph Fritz4451c282017-12-16 14:13:36 +01001080};
1081
1082static const struct panel_desc auo_g104sn02 = {
1083 .modes = &auo_g104sn02_mode,
1084 .num_modes = 1,
1085 .bpc = 8,
1086 .size = {
1087 .width = 211,
1088 .height = 158,
1089 },
1090};
1091
Sebastian Reichel03e909a2020-04-15 19:27:25 +02001092static const struct drm_display_mode auo_g121ean01_mode = {
1093 .clock = 66700,
1094 .hdisplay = 1280,
1095 .hsync_start = 1280 + 58,
1096 .hsync_end = 1280 + 58 + 8,
1097 .htotal = 1280 + 58 + 8 + 70,
1098 .vdisplay = 800,
1099 .vsync_start = 800 + 6,
1100 .vsync_end = 800 + 6 + 4,
1101 .vtotal = 800 + 6 + 4 + 10,
Sebastian Reichel03e909a2020-04-15 19:27:25 +02001102};
1103
1104static const struct panel_desc auo_g121ean01 = {
1105 .modes = &auo_g121ean01_mode,
1106 .num_modes = 1,
1107 .bpc = 8,
1108 .size = {
1109 .width = 261,
1110 .height = 163,
1111 },
1112 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1113 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1114};
1115
Lucas Stach697035c2016-11-30 14:09:55 +01001116static const struct display_timing auo_g133han01_timings = {
1117 .pixelclock = { 134000000, 141200000, 149000000 },
1118 .hactive = { 1920, 1920, 1920 },
1119 .hfront_porch = { 39, 58, 77 },
1120 .hback_porch = { 59, 88, 117 },
1121 .hsync_len = { 28, 42, 56 },
1122 .vactive = { 1080, 1080, 1080 },
1123 .vfront_porch = { 3, 8, 11 },
1124 .vback_porch = { 5, 14, 19 },
1125 .vsync_len = { 4, 14, 19 },
1126};
1127
1128static const struct panel_desc auo_g133han01 = {
1129 .timings = &auo_g133han01_timings,
1130 .num_timings = 1,
1131 .bpc = 8,
1132 .size = {
1133 .width = 293,
1134 .height = 165,
1135 },
1136 .delay = {
1137 .prepare = 200,
1138 .enable = 50,
1139 .disable = 50,
1140 .unprepare = 1000,
1141 },
1142 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001143 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach697035c2016-11-30 14:09:55 +01001144};
1145
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02001146static const struct drm_display_mode auo_g156xtn01_mode = {
1147 .clock = 76000,
1148 .hdisplay = 1366,
1149 .hsync_start = 1366 + 33,
1150 .hsync_end = 1366 + 33 + 67,
1151 .htotal = 1560,
1152 .vdisplay = 768,
1153 .vsync_start = 768 + 4,
1154 .vsync_end = 768 + 4 + 4,
1155 .vtotal = 806,
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02001156};
1157
1158static const struct panel_desc auo_g156xtn01 = {
1159 .modes = &auo_g156xtn01_mode,
1160 .num_modes = 1,
1161 .bpc = 8,
1162 .size = {
1163 .width = 344,
1164 .height = 194,
1165 },
1166 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1167 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1168};
1169
Lucas Stach8c31f602016-11-30 14:09:56 +01001170static const struct display_timing auo_g185han01_timings = {
1171 .pixelclock = { 120000000, 144000000, 175000000 },
1172 .hactive = { 1920, 1920, 1920 },
Lucas Stachf8c6bfc2019-07-10 15:07:40 +02001173 .hfront_porch = { 36, 120, 148 },
1174 .hback_porch = { 24, 88, 108 },
1175 .hsync_len = { 20, 48, 64 },
Lucas Stach8c31f602016-11-30 14:09:56 +01001176 .vactive = { 1080, 1080, 1080 },
1177 .vfront_porch = { 6, 10, 40 },
1178 .vback_porch = { 2, 5, 20 },
1179 .vsync_len = { 2, 5, 20 },
1180};
1181
1182static const struct panel_desc auo_g185han01 = {
1183 .timings = &auo_g185han01_timings,
1184 .num_timings = 1,
1185 .bpc = 8,
1186 .size = {
1187 .width = 409,
1188 .height = 230,
1189 },
1190 .delay = {
1191 .prepare = 50,
1192 .enable = 200,
1193 .disable = 110,
1194 .unprepare = 1000,
1195 },
1196 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001197 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8c31f602016-11-30 14:09:56 +01001198};
1199
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02001200static const struct display_timing auo_g190ean01_timings = {
1201 .pixelclock = { 90000000, 108000000, 135000000 },
1202 .hactive = { 1280, 1280, 1280 },
1203 .hfront_porch = { 126, 184, 1266 },
1204 .hback_porch = { 84, 122, 844 },
1205 .hsync_len = { 70, 102, 704 },
1206 .vactive = { 1024, 1024, 1024 },
1207 .vfront_porch = { 4, 26, 76 },
1208 .vback_porch = { 2, 8, 25 },
1209 .vsync_len = { 2, 8, 25 },
1210};
1211
1212static const struct panel_desc auo_g190ean01 = {
1213 .timings = &auo_g190ean01_timings,
1214 .num_timings = 1,
1215 .bpc = 8,
1216 .size = {
1217 .width = 376,
1218 .height = 301,
1219 },
1220 .delay = {
1221 .prepare = 50,
1222 .enable = 200,
1223 .disable = 110,
1224 .unprepare = 1000,
1225 },
1226 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1227 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1228};
1229
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001230static const struct display_timing auo_p320hvn03_timings = {
1231 .pixelclock = { 106000000, 148500000, 164000000 },
1232 .hactive = { 1920, 1920, 1920 },
1233 .hfront_porch = { 25, 50, 130 },
1234 .hback_porch = { 25, 50, 130 },
1235 .hsync_len = { 20, 40, 105 },
1236 .vactive = { 1080, 1080, 1080 },
1237 .vfront_porch = { 8, 17, 150 },
1238 .vback_porch = { 8, 17, 150 },
1239 .vsync_len = { 4, 11, 100 },
1240};
1241
1242static const struct panel_desc auo_p320hvn03 = {
1243 .timings = &auo_p320hvn03_timings,
1244 .num_timings = 1,
1245 .bpc = 8,
1246 .size = {
1247 .width = 698,
1248 .height = 393,
1249 },
1250 .delay = {
1251 .prepare = 1,
1252 .enable = 450,
1253 .unprepare = 500,
1254 },
Lucas Stach2554f152018-04-11 17:27:41 +02001255 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001256 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach70c0d5b2017-06-08 20:07:58 +02001257};
1258
Haixia Shi7ee933a2016-10-11 14:59:16 -07001259static const struct drm_display_mode auo_t215hvn01_mode = {
1260 .clock = 148800,
1261 .hdisplay = 1920,
1262 .hsync_start = 1920 + 88,
1263 .hsync_end = 1920 + 88 + 44,
1264 .htotal = 1920 + 88 + 44 + 148,
1265 .vdisplay = 1080,
1266 .vsync_start = 1080 + 4,
1267 .vsync_end = 1080 + 4 + 5,
1268 .vtotal = 1080 + 4 + 5 + 36,
Haixia Shi7ee933a2016-10-11 14:59:16 -07001269};
1270
1271static const struct panel_desc auo_t215hvn01 = {
1272 .modes = &auo_t215hvn01_mode,
1273 .num_modes = 1,
1274 .bpc = 8,
1275 .size = {
1276 .width = 430,
1277 .height = 270,
1278 },
1279 .delay = {
1280 .disable = 5,
1281 .unprepare = 1000,
1282 }
1283};
1284
Philipp Zabeld47df632014-12-18 16:43:43 +01001285static const struct drm_display_mode avic_tm070ddh03_mode = {
1286 .clock = 51200,
1287 .hdisplay = 1024,
1288 .hsync_start = 1024 + 160,
1289 .hsync_end = 1024 + 160 + 4,
1290 .htotal = 1024 + 160 + 4 + 156,
1291 .vdisplay = 600,
1292 .vsync_start = 600 + 17,
1293 .vsync_end = 600 + 17 + 1,
1294 .vtotal = 600 + 17 + 1 + 17,
Philipp Zabeld47df632014-12-18 16:43:43 +01001295};
1296
1297static const struct panel_desc avic_tm070ddh03 = {
1298 .modes = &avic_tm070ddh03_mode,
1299 .num_modes = 1,
1300 .bpc = 8,
1301 .size = {
1302 .width = 154,
1303 .height = 90,
1304 },
1305 .delay = {
1306 .prepare = 20,
1307 .enable = 200,
1308 .disable = 200,
1309 },
1310};
1311
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08001312static const struct drm_display_mode bananapi_s070wv20_ct16_mode = {
1313 .clock = 30000,
1314 .hdisplay = 800,
1315 .hsync_start = 800 + 40,
1316 .hsync_end = 800 + 40 + 48,
1317 .htotal = 800 + 40 + 48 + 40,
1318 .vdisplay = 480,
1319 .vsync_start = 480 + 13,
1320 .vsync_end = 480 + 13 + 3,
1321 .vtotal = 480 + 13 + 3 + 29,
1322};
1323
1324static const struct panel_desc bananapi_s070wv20_ct16 = {
1325 .modes = &bananapi_s070wv20_ct16_mode,
1326 .num_modes = 1,
1327 .bpc = 6,
1328 .size = {
1329 .width = 154,
1330 .height = 86,
1331 },
1332};
1333
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001334static const struct drm_display_mode boe_hv070wsa_mode = {
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001335 .clock = 42105,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001336 .hdisplay = 1024,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001337 .hsync_start = 1024 + 30,
1338 .hsync_end = 1024 + 30 + 30,
1339 .htotal = 1024 + 30 + 30 + 30,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001340 .vdisplay = 600,
Andrzej Hajdae077e2f2018-07-25 17:46:43 +02001341 .vsync_start = 600 + 10,
1342 .vsync_end = 600 + 10 + 10,
1343 .vtotal = 600 + 10 + 10 + 10,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001344};
1345
1346static const struct panel_desc boe_hv070wsa = {
1347 .modes = &boe_hv070wsa_mode,
1348 .num_modes = 1,
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001349 .bpc = 8,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001350 .size = {
1351 .width = 154,
1352 .height = 90,
1353 },
Sam Ravnborg2a5c2ff2020-04-13 20:30:05 +02001354 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1355 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1356 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02001357};
1358
Caesar Wangcac1a412016-12-14 11:19:56 +08001359static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
1360 {
1361 .clock = 71900,
1362 .hdisplay = 1280,
1363 .hsync_start = 1280 + 48,
1364 .hsync_end = 1280 + 48 + 32,
1365 .htotal = 1280 + 48 + 32 + 80,
1366 .vdisplay = 800,
1367 .vsync_start = 800 + 3,
1368 .vsync_end = 800 + 3 + 5,
1369 .vtotal = 800 + 3 + 5 + 24,
Caesar Wangcac1a412016-12-14 11:19:56 +08001370 },
1371 {
1372 .clock = 57500,
1373 .hdisplay = 1280,
1374 .hsync_start = 1280 + 48,
1375 .hsync_end = 1280 + 48 + 32,
1376 .htotal = 1280 + 48 + 32 + 80,
1377 .vdisplay = 800,
1378 .vsync_start = 800 + 3,
1379 .vsync_end = 800 + 3 + 5,
1380 .vtotal = 800 + 3 + 5 + 24,
Caesar Wangcac1a412016-12-14 11:19:56 +08001381 },
1382};
1383
1384static const struct panel_desc boe_nv101wxmn51 = {
1385 .modes = boe_nv101wxmn51_modes,
1386 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
1387 .bpc = 8,
1388 .size = {
1389 .width = 217,
1390 .height = 136,
1391 },
1392 .delay = {
1393 .prepare = 210,
1394 .enable = 50,
1395 .unprepare = 160,
1396 },
1397};
1398
Douglas Andersona96ee0f2020-11-09 17:00:58 -08001399static const struct drm_display_mode boe_nv110wtm_n61_modes[] = {
1400 {
1401 .clock = 207800,
1402 .hdisplay = 2160,
1403 .hsync_start = 2160 + 48,
1404 .hsync_end = 2160 + 48 + 32,
1405 .htotal = 2160 + 48 + 32 + 100,
1406 .vdisplay = 1440,
1407 .vsync_start = 1440 + 3,
1408 .vsync_end = 1440 + 3 + 6,
1409 .vtotal = 1440 + 3 + 6 + 31,
1410 },
1411 {
1412 .clock = 138500,
1413 .hdisplay = 2160,
1414 .hsync_start = 2160 + 48,
1415 .hsync_end = 2160 + 48 + 32,
1416 .htotal = 2160 + 48 + 32 + 100,
1417 .vdisplay = 1440,
1418 .vsync_start = 1440 + 3,
1419 .vsync_end = 1440 + 3 + 6,
1420 .vtotal = 1440 + 3 + 6 + 31,
1421 },
1422};
1423
1424static const struct panel_desc boe_nv110wtm_n61 = {
1425 .modes = boe_nv110wtm_n61_modes,
1426 .num_modes = ARRAY_SIZE(boe_nv110wtm_n61_modes),
1427 .bpc = 8,
1428 .size = {
1429 .width = 233,
1430 .height = 155,
1431 },
1432 .delay = {
1433 .hpd_absent_delay = 200,
1434 .prepare_to_enable = 80,
1435 .unprepare = 500,
1436 },
1437 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1438 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1439 .connector_type = DRM_MODE_CONNECTOR_eDP,
1440};
1441
Douglas Andersoncfe40d02020-05-08 15:59:02 -07001442/* Also used for boe_nv133fhm_n62 */
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001443static const struct drm_display_mode boe_nv133fhm_n61_modes = {
1444 .clock = 147840,
1445 .hdisplay = 1920,
1446 .hsync_start = 1920 + 48,
1447 .hsync_end = 1920 + 48 + 32,
1448 .htotal = 1920 + 48 + 32 + 200,
1449 .vdisplay = 1080,
1450 .vsync_start = 1080 + 3,
1451 .vsync_end = 1080 + 3 + 6,
1452 .vtotal = 1080 + 3 + 6 + 31,
Stephen Boydab6fd5d2020-11-06 10:23:33 -08001453 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001454};
1455
Douglas Andersoncfe40d02020-05-08 15:59:02 -07001456/* Also used for boe_nv133fhm_n62 */
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001457static const struct panel_desc boe_nv133fhm_n61 = {
1458 .modes = &boe_nv133fhm_n61_modes,
1459 .num_modes = 1,
Douglas Anderson9694d9c2020-05-08 15:59:00 -07001460 .bpc = 6,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001461 .size = {
Douglas Anderson9694d9c2020-05-08 15:59:00 -07001462 .width = 294,
1463 .height = 165,
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001464 },
1465 .delay = {
Douglas Anderson667d73d2020-07-16 13:21:22 -07001466 /*
1467 * When power is first given to the panel there's a short
1468 * spike on the HPD line. It was explained that this spike
1469 * was until the TCON data download was complete. On
1470 * one system this was measured at 8 ms. We'll put 15 ms
1471 * in the prepare delay just to be safe and take it away
1472 * from the hpd_absent_delay (which would otherwise be 200 ms)
1473 * to handle this. That means:
1474 * - If HPD isn't hooked up you still have 200 ms delay.
1475 * - If HPD is hooked up we won't try to look at it for the
1476 * first 15 ms.
1477 */
1478 .prepare = 15,
1479 .hpd_absent_delay = 185,
1480
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07001481 .unprepare = 500,
1482 },
1483 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1484 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
1485 .connector_type = DRM_MODE_CONNECTOR_eDP,
1486};
1487
Tobias Schramma5119812020-01-09 12:29:52 +01001488static const struct drm_display_mode boe_nv140fhmn49_modes[] = {
1489 {
1490 .clock = 148500,
1491 .hdisplay = 1920,
1492 .hsync_start = 1920 + 48,
1493 .hsync_end = 1920 + 48 + 32,
1494 .htotal = 2200,
1495 .vdisplay = 1080,
1496 .vsync_start = 1080 + 3,
1497 .vsync_end = 1080 + 3 + 5,
1498 .vtotal = 1125,
Tobias Schramma5119812020-01-09 12:29:52 +01001499 },
1500};
1501
1502static const struct panel_desc boe_nv140fhmn49 = {
1503 .modes = boe_nv140fhmn49_modes,
1504 .num_modes = ARRAY_SIZE(boe_nv140fhmn49_modes),
1505 .bpc = 6,
1506 .size = {
1507 .width = 309,
1508 .height = 174,
1509 },
1510 .delay = {
1511 .prepare = 210,
1512 .enable = 50,
1513 .unprepare = 160,
1514 },
1515 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1516 .connector_type = DRM_MODE_CONNECTOR_eDP,
1517};
1518
Giulio Benettie58edce2018-07-31 01:11:16 +02001519static const struct drm_display_mode cdtech_s043wq26h_ct7_mode = {
1520 .clock = 9000,
1521 .hdisplay = 480,
1522 .hsync_start = 480 + 5,
1523 .hsync_end = 480 + 5 + 5,
1524 .htotal = 480 + 5 + 5 + 40,
1525 .vdisplay = 272,
1526 .vsync_start = 272 + 8,
1527 .vsync_end = 272 + 8 + 8,
1528 .vtotal = 272 + 8 + 8 + 8,
Giulio Benettie58edce2018-07-31 01:11:16 +02001529 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1530};
1531
1532static const struct panel_desc cdtech_s043wq26h_ct7 = {
1533 .modes = &cdtech_s043wq26h_ct7_mode,
1534 .num_modes = 1,
1535 .bpc = 8,
1536 .size = {
1537 .width = 95,
1538 .height = 54,
1539 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001540 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Giulio Benettie58edce2018-07-31 01:11:16 +02001541};
1542
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001543/* S070PWS19HP-FC21 2017/04/22 */
1544static const struct drm_display_mode cdtech_s070pws19hp_fc21_mode = {
1545 .clock = 51200,
1546 .hdisplay = 1024,
1547 .hsync_start = 1024 + 160,
1548 .hsync_end = 1024 + 160 + 20,
1549 .htotal = 1024 + 160 + 20 + 140,
1550 .vdisplay = 600,
1551 .vsync_start = 600 + 12,
1552 .vsync_end = 600 + 12 + 3,
1553 .vtotal = 600 + 12 + 3 + 20,
1554 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1555};
1556
1557static const struct panel_desc cdtech_s070pws19hp_fc21 = {
1558 .modes = &cdtech_s070pws19hp_fc21_mode,
1559 .num_modes = 1,
1560 .bpc = 6,
1561 .size = {
1562 .width = 154,
1563 .height = 86,
1564 },
1565 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001566 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001567 .connector_type = DRM_MODE_CONNECTOR_DPI,
1568};
1569
1570/* S070SWV29HG-DC44 2017/09/21 */
1571static const struct drm_display_mode cdtech_s070swv29hg_dc44_mode = {
1572 .clock = 33300,
1573 .hdisplay = 800,
1574 .hsync_start = 800 + 210,
1575 .hsync_end = 800 + 210 + 2,
1576 .htotal = 800 + 210 + 2 + 44,
1577 .vdisplay = 480,
1578 .vsync_start = 480 + 22,
1579 .vsync_end = 480 + 22 + 2,
1580 .vtotal = 480 + 22 + 2 + 21,
1581 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1582};
1583
1584static const struct panel_desc cdtech_s070swv29hg_dc44 = {
1585 .modes = &cdtech_s070swv29hg_dc44_mode,
1586 .num_modes = 1,
1587 .bpc = 6,
1588 .size = {
1589 .width = 154,
1590 .height = 86,
1591 },
1592 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001593 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02001594 .connector_type = DRM_MODE_CONNECTOR_DPI,
1595};
1596
Giulio Benetti982f9442018-07-31 01:11:14 +02001597static const struct drm_display_mode cdtech_s070wv95_ct16_mode = {
1598 .clock = 35000,
1599 .hdisplay = 800,
1600 .hsync_start = 800 + 40,
1601 .hsync_end = 800 + 40 + 40,
1602 .htotal = 800 + 40 + 40 + 48,
1603 .vdisplay = 480,
1604 .vsync_start = 480 + 29,
1605 .vsync_end = 480 + 29 + 13,
1606 .vtotal = 480 + 29 + 13 + 3,
Giulio Benetti982f9442018-07-31 01:11:14 +02001607 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1608};
1609
1610static const struct panel_desc cdtech_s070wv95_ct16 = {
1611 .modes = &cdtech_s070wv95_ct16_mode,
1612 .num_modes = 1,
1613 .bpc = 8,
1614 .size = {
1615 .width = 154,
1616 .height = 85,
1617 },
1618};
1619
Marek Vasut07c913c2020-07-28 22:12:42 +02001620static const struct display_timing chefree_ch101olhlwh_002_timing = {
1621 .pixelclock = { 68900000, 71100000, 73400000 },
1622 .hactive = { 1280, 1280, 1280 },
1623 .hfront_porch = { 65, 80, 95 },
1624 .hback_porch = { 64, 79, 94 },
1625 .hsync_len = { 1, 1, 1 },
1626 .vactive = { 800, 800, 800 },
1627 .vfront_porch = { 7, 11, 14 },
1628 .vback_porch = { 7, 11, 14 },
1629 .vsync_len = { 1, 1, 1 },
1630 .flags = DISPLAY_FLAGS_DE_HIGH,
1631};
1632
1633static const struct panel_desc chefree_ch101olhlwh_002 = {
1634 .timings = &chefree_ch101olhlwh_002_timing,
1635 .num_timings = 1,
1636 .bpc = 8,
1637 .size = {
1638 .width = 217,
1639 .height = 135,
1640 },
1641 .delay = {
1642 .enable = 200,
1643 .disable = 200,
1644 },
1645 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1646 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1647 .connector_type = DRM_MODE_CONNECTOR_LVDS,
1648};
1649
Randy Li2cb35c82016-09-20 03:02:51 +08001650static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
1651 .clock = 66770,
1652 .hdisplay = 800,
1653 .hsync_start = 800 + 49,
1654 .hsync_end = 800 + 49 + 33,
1655 .htotal = 800 + 49 + 33 + 17,
1656 .vdisplay = 1280,
1657 .vsync_start = 1280 + 1,
1658 .vsync_end = 1280 + 1 + 7,
1659 .vtotal = 1280 + 1 + 7 + 15,
Randy Li2cb35c82016-09-20 03:02:51 +08001660 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1661};
1662
1663static const struct panel_desc chunghwa_claa070wp03xg = {
1664 .modes = &chunghwa_claa070wp03xg_mode,
1665 .num_modes = 1,
1666 .bpc = 6,
1667 .size = {
1668 .width = 94,
1669 .height = 150,
1670 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001671 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001672 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001673 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Randy Li2cb35c82016-09-20 03:02:51 +08001674};
1675
Stephen Warren4c930752014-01-07 16:46:26 -07001676static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
1677 .clock = 72070,
1678 .hdisplay = 1366,
1679 .hsync_start = 1366 + 58,
1680 .hsync_end = 1366 + 58 + 58,
1681 .htotal = 1366 + 58 + 58 + 58,
1682 .vdisplay = 768,
1683 .vsync_start = 768 + 4,
1684 .vsync_end = 768 + 4 + 4,
1685 .vtotal = 768 + 4 + 4 + 4,
Stephen Warren4c930752014-01-07 16:46:26 -07001686};
1687
1688static const struct panel_desc chunghwa_claa101wa01a = {
1689 .modes = &chunghwa_claa101wa01a_mode,
1690 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001691 .bpc = 6,
Stephen Warren4c930752014-01-07 16:46:26 -07001692 .size = {
1693 .width = 220,
1694 .height = 120,
1695 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001696 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001697 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001698 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Stephen Warren4c930752014-01-07 16:46:26 -07001699};
1700
Thierry Reding280921d2013-08-30 15:10:14 +02001701static const struct drm_display_mode chunghwa_claa101wb01_mode = {
1702 .clock = 69300,
1703 .hdisplay = 1366,
1704 .hsync_start = 1366 + 48,
1705 .hsync_end = 1366 + 48 + 32,
1706 .htotal = 1366 + 48 + 32 + 20,
1707 .vdisplay = 768,
1708 .vsync_start = 768 + 16,
1709 .vsync_end = 768 + 16 + 8,
1710 .vtotal = 768 + 16 + 8 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02001711};
1712
1713static const struct panel_desc chunghwa_claa101wb01 = {
1714 .modes = &chunghwa_claa101wb01_mode,
1715 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001716 .bpc = 6,
Thierry Reding280921d2013-08-30 15:10:14 +02001717 .size = {
1718 .width = 223,
1719 .height = 125,
1720 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03001721 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03001722 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03001723 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Thierry Reding280921d2013-08-30 15:10:14 +02001724};
1725
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001726static const struct drm_display_mode dataimage_scf0700c48ggu18_mode = {
1727 .clock = 33260,
1728 .hdisplay = 800,
1729 .hsync_start = 800 + 40,
1730 .hsync_end = 800 + 40 + 128,
1731 .htotal = 800 + 40 + 128 + 88,
1732 .vdisplay = 480,
1733 .vsync_start = 480 + 10,
1734 .vsync_end = 480 + 10 + 2,
1735 .vtotal = 480 + 10 + 2 + 33,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001736 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1737};
1738
1739static const struct panel_desc dataimage_scf0700c48ggu18 = {
1740 .modes = &dataimage_scf0700c48ggu18_mode,
1741 .num_modes = 1,
1742 .bpc = 8,
1743 .size = {
1744 .width = 152,
1745 .height = 91,
1746 },
1747 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001748 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02001749};
1750
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001751static const struct display_timing dlc_dlc0700yzg_1_timing = {
1752 .pixelclock = { 45000000, 51200000, 57000000 },
1753 .hactive = { 1024, 1024, 1024 },
1754 .hfront_porch = { 100, 106, 113 },
1755 .hback_porch = { 100, 106, 113 },
1756 .hsync_len = { 100, 108, 114 },
1757 .vactive = { 600, 600, 600 },
1758 .vfront_porch = { 8, 11, 15 },
1759 .vback_porch = { 8, 11, 15 },
1760 .vsync_len = { 9, 13, 15 },
1761 .flags = DISPLAY_FLAGS_DE_HIGH,
1762};
1763
1764static const struct panel_desc dlc_dlc0700yzg_1 = {
1765 .timings = &dlc_dlc0700yzg_1_timing,
1766 .num_timings = 1,
1767 .bpc = 6,
1768 .size = {
1769 .width = 154,
1770 .height = 86,
1771 },
1772 .delay = {
1773 .prepare = 30,
1774 .enable = 200,
1775 .disable = 200,
1776 },
1777 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001778 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabel0ca0c822018-05-23 11:25:04 +02001779};
1780
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001781static const struct display_timing dlc_dlc1010gig_timing = {
1782 .pixelclock = { 68900000, 71100000, 73400000 },
1783 .hactive = { 1280, 1280, 1280 },
1784 .hfront_porch = { 43, 53, 63 },
1785 .hback_porch = { 43, 53, 63 },
1786 .hsync_len = { 44, 54, 64 },
1787 .vactive = { 800, 800, 800 },
1788 .vfront_porch = { 5, 8, 11 },
1789 .vback_porch = { 5, 8, 11 },
1790 .vsync_len = { 5, 7, 11 },
1791 .flags = DISPLAY_FLAGS_DE_HIGH,
1792};
1793
1794static const struct panel_desc dlc_dlc1010gig = {
1795 .timings = &dlc_dlc1010gig_timing,
1796 .num_timings = 1,
1797 .bpc = 8,
1798 .size = {
1799 .width = 216,
1800 .height = 135,
1801 },
1802 .delay = {
1803 .prepare = 60,
1804 .enable = 150,
1805 .disable = 100,
1806 .unprepare = 60,
1807 },
1808 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03001809 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02001810};
1811
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001812static const struct drm_display_mode edt_et035012dm6_mode = {
1813 .clock = 6500,
1814 .hdisplay = 320,
1815 .hsync_start = 320 + 20,
1816 .hsync_end = 320 + 20 + 30,
1817 .htotal = 320 + 20 + 68,
1818 .vdisplay = 240,
1819 .vsync_start = 240 + 4,
1820 .vsync_end = 240 + 4 + 4,
1821 .vtotal = 240 + 4 + 4 + 14,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001822 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1823};
1824
1825static const struct panel_desc edt_et035012dm6 = {
1826 .modes = &edt_et035012dm6_mode,
1827 .num_modes = 1,
1828 .bpc = 8,
1829 .size = {
1830 .width = 70,
1831 .height = 52,
1832 },
1833 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001834 .bus_flags = DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02001835};
1836
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00001837static const struct drm_display_mode edt_etm043080dh6gp_mode = {
1838 .clock = 10870,
1839 .hdisplay = 480,
1840 .hsync_start = 480 + 8,
1841 .hsync_end = 480 + 8 + 4,
1842 .htotal = 480 + 8 + 4 + 41,
1843
1844 /*
1845 * IWG22M: Y resolution changed for "dc_linuxfb" module crashing while
1846 * fb_align
1847 */
1848
1849 .vdisplay = 288,
1850 .vsync_start = 288 + 2,
1851 .vsync_end = 288 + 2 + 4,
1852 .vtotal = 288 + 2 + 4 + 10,
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00001853};
1854
1855static const struct panel_desc edt_etm043080dh6gp = {
1856 .modes = &edt_etm043080dh6gp_mode,
1857 .num_modes = 1,
1858 .bpc = 8,
1859 .size = {
1860 .width = 100,
1861 .height = 65,
1862 },
1863 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1864 .connector_type = DRM_MODE_CONNECTOR_DPI,
1865};
1866
Marek Vasutfd819bf2019-02-19 15:04:38 +01001867static const struct drm_display_mode edt_etm0430g0dh6_mode = {
1868 .clock = 9000,
1869 .hdisplay = 480,
1870 .hsync_start = 480 + 2,
1871 .hsync_end = 480 + 2 + 41,
1872 .htotal = 480 + 2 + 41 + 2,
1873 .vdisplay = 272,
1874 .vsync_start = 272 + 2,
1875 .vsync_end = 272 + 2 + 10,
1876 .vtotal = 272 + 2 + 10 + 2,
Marek Vasutfd819bf2019-02-19 15:04:38 +01001877 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1878};
1879
1880static const struct panel_desc edt_etm0430g0dh6 = {
1881 .modes = &edt_etm0430g0dh6_mode,
1882 .num_modes = 1,
1883 .bpc = 6,
1884 .size = {
1885 .width = 95,
1886 .height = 54,
1887 },
1888};
1889
Stefan Agner26ab0062014-05-15 11:38:45 +02001890static const struct drm_display_mode edt_et057090dhu_mode = {
1891 .clock = 25175,
1892 .hdisplay = 640,
1893 .hsync_start = 640 + 16,
1894 .hsync_end = 640 + 16 + 30,
1895 .htotal = 640 + 16 + 30 + 114,
1896 .vdisplay = 480,
1897 .vsync_start = 480 + 10,
1898 .vsync_end = 480 + 10 + 3,
1899 .vtotal = 480 + 10 + 3 + 32,
Stefan Agner26ab0062014-05-15 11:38:45 +02001900 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1901};
1902
1903static const struct panel_desc edt_et057090dhu = {
1904 .modes = &edt_et057090dhu_mode,
1905 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001906 .bpc = 6,
Stefan Agner26ab0062014-05-15 11:38:45 +02001907 .size = {
1908 .width = 115,
1909 .height = 86,
1910 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08001911 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001912 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Dmitry Osipenko75e73222020-06-22 01:27:41 +03001913 .connector_type = DRM_MODE_CONNECTOR_DPI,
Stefan Agner26ab0062014-05-15 11:38:45 +02001914};
1915
Philipp Zabelfff5de42014-05-15 12:25:47 +02001916static const struct drm_display_mode edt_etm0700g0dh6_mode = {
1917 .clock = 33260,
1918 .hdisplay = 800,
1919 .hsync_start = 800 + 40,
1920 .hsync_end = 800 + 40 + 128,
1921 .htotal = 800 + 40 + 128 + 88,
1922 .vdisplay = 480,
1923 .vsync_start = 480 + 10,
1924 .vsync_end = 480 + 10 + 2,
1925 .vtotal = 480 + 10 + 2 + 33,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001926 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1927};
1928
1929static const struct panel_desc edt_etm0700g0dh6 = {
1930 .modes = &edt_etm0700g0dh6_mode,
1931 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07001932 .bpc = 6,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001933 .size = {
1934 .width = 152,
1935 .height = 91,
1936 },
Stefan Agnereaeebff2016-12-08 14:54:31 -08001937 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001938 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Biju Das281edb92020-10-20 10:49:10 +01001939 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabelfff5de42014-05-15 12:25:47 +02001940};
1941
Jan Tuerkaa7e6452018-06-19 11:55:44 +02001942static const struct panel_desc edt_etm0700g0bdh6 = {
1943 .modes = &edt_etm0700g0dh6_mode,
1944 .num_modes = 1,
1945 .bpc = 6,
1946 .size = {
1947 .width = 152,
1948 .height = 91,
1949 },
1950 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03001951 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Jan Tuerkaa7e6452018-06-19 11:55:44 +02001952};
1953
Marco Felsch9158e3c2019-04-16 12:06:45 +02001954static const struct display_timing evervision_vgg804821_timing = {
1955 .pixelclock = { 27600000, 33300000, 50000000 },
1956 .hactive = { 800, 800, 800 },
1957 .hfront_porch = { 40, 66, 70 },
1958 .hback_porch = { 40, 67, 70 },
1959 .hsync_len = { 40, 67, 70 },
1960 .vactive = { 480, 480, 480 },
1961 .vfront_porch = { 6, 10, 10 },
1962 .vback_porch = { 7, 11, 11 },
1963 .vsync_len = { 7, 11, 11 },
1964 .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH |
1965 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
1966 DISPLAY_FLAGS_SYNC_NEGEDGE,
1967};
1968
1969static const struct panel_desc evervision_vgg804821 = {
1970 .timings = &evervision_vgg804821_timing,
1971 .num_timings = 1,
1972 .bpc = 8,
1973 .size = {
1974 .width = 108,
1975 .height = 64,
1976 },
1977 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02001978 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Marco Felsch9158e3c2019-04-16 12:06:45 +02001979};
1980
Boris BREZILLON102932b2014-06-05 15:53:32 +02001981static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
1982 .clock = 32260,
1983 .hdisplay = 800,
1984 .hsync_start = 800 + 168,
1985 .hsync_end = 800 + 168 + 64,
1986 .htotal = 800 + 168 + 64 + 88,
1987 .vdisplay = 480,
1988 .vsync_start = 480 + 37,
1989 .vsync_end = 480 + 37 + 2,
1990 .vtotal = 480 + 37 + 2 + 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001991};
1992
1993static const struct panel_desc foxlink_fl500wvr00_a0t = {
1994 .modes = &foxlink_fl500wvr00_a0t_mode,
1995 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01001996 .bpc = 8,
Boris BREZILLON102932b2014-06-05 15:53:32 +02001997 .size = {
1998 .width = 108,
1999 .height = 65,
2000 },
Boris Brezillonbb276cb2014-07-22 13:35:47 +02002001 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Boris BREZILLON102932b2014-06-05 15:53:32 +02002002};
2003
Paul Cercueil795db2a2020-07-16 14:56:47 +02002004static const struct drm_display_mode frida_frd350h54004_modes[] = {
2005 { /* 60 Hz */
2006 .clock = 6000,
2007 .hdisplay = 320,
2008 .hsync_start = 320 + 44,
2009 .hsync_end = 320 + 44 + 16,
2010 .htotal = 320 + 44 + 16 + 20,
2011 .vdisplay = 240,
2012 .vsync_start = 240 + 2,
2013 .vsync_end = 240 + 2 + 6,
2014 .vtotal = 240 + 2 + 6 + 2,
2015 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2016 },
2017 { /* 50 Hz */
2018 .clock = 5400,
2019 .hdisplay = 320,
2020 .hsync_start = 320 + 56,
2021 .hsync_end = 320 + 56 + 16,
2022 .htotal = 320 + 56 + 16 + 40,
2023 .vdisplay = 240,
2024 .vsync_start = 240 + 2,
2025 .vsync_end = 240 + 2 + 6,
2026 .vtotal = 240 + 2 + 6 + 2,
2027 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2028 },
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002029};
2030
2031static const struct panel_desc frida_frd350h54004 = {
Paul Cercueil795db2a2020-07-16 14:56:47 +02002032 .modes = frida_frd350h54004_modes,
2033 .num_modes = ARRAY_SIZE(frida_frd350h54004_modes),
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002034 .bpc = 8,
2035 .size = {
2036 .width = 77,
2037 .height = 64,
2038 },
2039 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002040 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Paul Cercueil7b6bd842020-01-13 13:17:41 -03002041 .connector_type = DRM_MODE_CONNECTOR_DPI,
2042};
2043
Jagan Teki3be20712019-05-07 18:37:07 +05302044static const struct drm_display_mode friendlyarm_hd702e_mode = {
2045 .clock = 67185,
2046 .hdisplay = 800,
2047 .hsync_start = 800 + 20,
2048 .hsync_end = 800 + 20 + 24,
2049 .htotal = 800 + 20 + 24 + 20,
2050 .vdisplay = 1280,
2051 .vsync_start = 1280 + 4,
2052 .vsync_end = 1280 + 4 + 8,
2053 .vtotal = 1280 + 4 + 8 + 4,
Jagan Teki3be20712019-05-07 18:37:07 +05302054 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2055};
2056
2057static const struct panel_desc friendlyarm_hd702e = {
2058 .modes = &friendlyarm_hd702e_mode,
2059 .num_modes = 1,
2060 .size = {
2061 .width = 94,
2062 .height = 151,
2063 },
2064};
2065
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002066static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
2067 .clock = 9000,
2068 .hdisplay = 480,
2069 .hsync_start = 480 + 5,
2070 .hsync_end = 480 + 5 + 1,
2071 .htotal = 480 + 5 + 1 + 40,
2072 .vdisplay = 272,
2073 .vsync_start = 272 + 8,
2074 .vsync_end = 272 + 8 + 1,
2075 .vtotal = 272 + 8 + 1 + 8,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002076};
2077
2078static const struct panel_desc giantplus_gpg482739qs5 = {
2079 .modes = &giantplus_gpg482739qs5_mode,
2080 .num_modes = 1,
2081 .bpc = 8,
2082 .size = {
2083 .width = 95,
2084 .height = 54,
2085 },
Philipp Zabel33536a02015-02-11 18:50:07 +01002086 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Philipp Zabeld435a2a2014-11-19 10:29:55 +01002087};
2088
Paul Cercueil2c6574a2019-06-06 00:22:47 +02002089static const struct display_timing giantplus_gpm940b0_timing = {
2090 .pixelclock = { 13500000, 27000000, 27500000 },
2091 .hactive = { 320, 320, 320 },
2092 .hfront_porch = { 14, 686, 718 },
2093 .hback_porch = { 50, 70, 255 },
2094 .hsync_len = { 1, 1, 1 },
2095 .vactive = { 240, 240, 240 },
2096 .vfront_porch = { 1, 1, 179 },
2097 .vback_porch = { 1, 21, 31 },
2098 .vsync_len = { 1, 1, 6 },
2099 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
2100};
2101
2102static const struct panel_desc giantplus_gpm940b0 = {
2103 .timings = &giantplus_gpm940b0_timing,
2104 .num_timings = 1,
2105 .bpc = 8,
2106 .size = {
2107 .width = 60,
2108 .height = 45,
2109 },
2110 .bus_format = MEDIA_BUS_FMT_RGB888_3X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02002111 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Paul Cercueil2c6574a2019-06-06 00:22:47 +02002112};
2113
Philipp Zabelab077252014-12-11 18:32:46 +01002114static const struct display_timing hannstar_hsd070pww1_timing = {
2115 .pixelclock = { 64300000, 71100000, 82000000 },
2116 .hactive = { 1280, 1280, 1280 },
2117 .hfront_porch = { 1, 1, 10 },
2118 .hback_porch = { 1, 1, 10 },
Philipp Zabeld901d2b2015-08-12 12:32:13 +02002119 /*
2120 * According to the data sheet, the minimum horizontal blanking interval
2121 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
2122 * minimum working horizontal blanking interval to be 60 clocks.
2123 */
2124 .hsync_len = { 58, 158, 661 },
Philipp Zabelab077252014-12-11 18:32:46 +01002125 .vactive = { 800, 800, 800 },
2126 .vfront_porch = { 1, 1, 10 },
2127 .vback_porch = { 1, 1, 10 },
2128 .vsync_len = { 1, 21, 203 },
2129 .flags = DISPLAY_FLAGS_DE_HIGH,
Philipp Zabela8532052014-10-23 16:31:06 +02002130};
2131
2132static const struct panel_desc hannstar_hsd070pww1 = {
Philipp Zabelab077252014-12-11 18:32:46 +01002133 .timings = &hannstar_hsd070pww1_timing,
2134 .num_timings = 1,
Philipp Zabela8532052014-10-23 16:31:06 +02002135 .bpc = 6,
2136 .size = {
2137 .width = 151,
2138 .height = 94,
2139 },
Philipp Zabel58d6a7b2015-08-12 12:32:12 +02002140 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002141 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Philipp Zabela8532052014-10-23 16:31:06 +02002142};
2143
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002144static const struct display_timing hannstar_hsd100pxn1_timing = {
2145 .pixelclock = { 55000000, 65000000, 75000000 },
2146 .hactive = { 1024, 1024, 1024 },
2147 .hfront_porch = { 40, 40, 40 },
2148 .hback_porch = { 220, 220, 220 },
2149 .hsync_len = { 20, 60, 100 },
2150 .vactive = { 768, 768, 768 },
2151 .vfront_porch = { 7, 7, 7 },
2152 .vback_porch = { 21, 21, 21 },
2153 .vsync_len = { 10, 10, 10 },
2154 .flags = DISPLAY_FLAGS_DE_HIGH,
2155};
2156
2157static const struct panel_desc hannstar_hsd100pxn1 = {
2158 .timings = &hannstar_hsd100pxn1_timing,
2159 .num_timings = 1,
2160 .bpc = 6,
2161 .size = {
2162 .width = 203,
2163 .height = 152,
2164 },
Philipp Zabel4946b042015-05-20 11:34:08 +02002165 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002166 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Eric Nelsonc0d607e2015-04-13 15:09:26 -07002167};
2168
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002169static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
2170 .clock = 33333,
2171 .hdisplay = 800,
2172 .hsync_start = 800 + 85,
2173 .hsync_end = 800 + 85 + 86,
2174 .htotal = 800 + 85 + 86 + 85,
2175 .vdisplay = 480,
2176 .vsync_start = 480 + 16,
2177 .vsync_end = 480 + 16 + 13,
2178 .vtotal = 480 + 16 + 13 + 16,
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002179};
2180
2181static const struct panel_desc hitachi_tx23d38vm0caa = {
2182 .modes = &hitachi_tx23d38vm0caa_mode,
2183 .num_modes = 1,
2184 .bpc = 6,
2185 .size = {
2186 .width = 195,
2187 .height = 117,
2188 },
Philipp Zabel6c684e32017-10-11 14:59:58 +02002189 .delay = {
2190 .enable = 160,
2191 .disable = 160,
2192 },
Lucas Stach61ac0bf2014-11-06 17:44:35 +01002193};
2194
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002195static const struct drm_display_mode innolux_at043tn24_mode = {
2196 .clock = 9000,
2197 .hdisplay = 480,
2198 .hsync_start = 480 + 2,
2199 .hsync_end = 480 + 2 + 41,
2200 .htotal = 480 + 2 + 41 + 2,
2201 .vdisplay = 272,
2202 .vsync_start = 272 + 2,
Philipp Zabela4831592017-10-11 14:59:56 +02002203 .vsync_end = 272 + 2 + 10,
2204 .vtotal = 272 + 2 + 10 + 2,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002205 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2206};
2207
2208static const struct panel_desc innolux_at043tn24 = {
2209 .modes = &innolux_at043tn24_mode,
2210 .num_modes = 1,
2211 .bpc = 8,
2212 .size = {
2213 .width = 95,
2214 .height = 54,
2215 },
2216 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002217 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01002218};
2219
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002220static const struct drm_display_mode innolux_at070tn92_mode = {
2221 .clock = 33333,
2222 .hdisplay = 800,
2223 .hsync_start = 800 + 210,
2224 .hsync_end = 800 + 210 + 20,
2225 .htotal = 800 + 210 + 20 + 46,
2226 .vdisplay = 480,
2227 .vsync_start = 480 + 22,
2228 .vsync_end = 480 + 22 + 10,
2229 .vtotal = 480 + 22 + 23 + 10,
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02002230};
2231
2232static const struct panel_desc innolux_at070tn92 = {
2233 .modes = &innolux_at070tn92_mode,
2234 .num_modes = 1,
2235 .size = {
2236 .width = 154,
2237 .height = 86,
2238 },
2239 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2240};
2241
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002242static const struct display_timing innolux_g070y2_l01_timing = {
2243 .pixelclock = { 28000000, 29500000, 32000000 },
2244 .hactive = { 800, 800, 800 },
2245 .hfront_porch = { 61, 91, 141 },
2246 .hback_porch = { 60, 90, 140 },
2247 .hsync_len = { 12, 12, 12 },
2248 .vactive = { 480, 480, 480 },
2249 .vfront_porch = { 4, 9, 30 },
2250 .vback_porch = { 4, 8, 28 },
2251 .vsync_len = { 2, 2, 2 },
2252 .flags = DISPLAY_FLAGS_DE_HIGH,
2253};
2254
2255static const struct panel_desc innolux_g070y2_l01 = {
2256 .timings = &innolux_g070y2_l01_timing,
2257 .num_timings = 1,
2258 .bpc = 6,
2259 .size = {
2260 .width = 152,
2261 .height = 91,
2262 },
2263 .delay = {
2264 .prepare = 10,
2265 .enable = 100,
2266 .disable = 100,
2267 .unprepare = 800,
2268 },
2269 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002270 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Christoph Fritza5d2ade2018-06-04 13:16:48 +02002271};
2272
Michael Olbrich1e29b842016-08-15 14:32:02 +02002273static const struct display_timing innolux_g101ice_l01_timing = {
2274 .pixelclock = { 60400000, 71100000, 74700000 },
2275 .hactive = { 1280, 1280, 1280 },
2276 .hfront_porch = { 41, 80, 100 },
2277 .hback_porch = { 40, 79, 99 },
2278 .hsync_len = { 1, 1, 1 },
2279 .vactive = { 800, 800, 800 },
2280 .vfront_porch = { 5, 11, 14 },
2281 .vback_porch = { 4, 11, 14 },
2282 .vsync_len = { 1, 1, 1 },
2283 .flags = DISPLAY_FLAGS_DE_HIGH,
2284};
2285
2286static const struct panel_desc innolux_g101ice_l01 = {
2287 .timings = &innolux_g101ice_l01_timing,
2288 .num_timings = 1,
2289 .bpc = 8,
2290 .size = {
2291 .width = 217,
2292 .height = 135,
2293 },
2294 .delay = {
2295 .enable = 200,
2296 .disable = 200,
2297 },
2298 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002299 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Michael Olbrich1e29b842016-08-15 14:32:02 +02002300};
2301
Lucas Stach4ae13e42016-11-30 14:09:54 +01002302static const struct display_timing innolux_g121i1_l01_timing = {
2303 .pixelclock = { 67450000, 71000000, 74550000 },
2304 .hactive = { 1280, 1280, 1280 },
2305 .hfront_porch = { 40, 80, 160 },
2306 .hback_porch = { 39, 79, 159 },
2307 .hsync_len = { 1, 1, 1 },
2308 .vactive = { 800, 800, 800 },
2309 .vfront_porch = { 5, 11, 100 },
2310 .vback_porch = { 4, 11, 99 },
2311 .vsync_len = { 1, 1, 1 },
Lucas Stachd731f662014-11-06 17:44:33 +01002312};
2313
2314static const struct panel_desc innolux_g121i1_l01 = {
Lucas Stach4ae13e42016-11-30 14:09:54 +01002315 .timings = &innolux_g121i1_l01_timing,
2316 .num_timings = 1,
Lucas Stachd731f662014-11-06 17:44:33 +01002317 .bpc = 6,
2318 .size = {
2319 .width = 261,
2320 .height = 163,
2321 },
Lucas Stach4ae13e42016-11-30 14:09:54 +01002322 .delay = {
2323 .enable = 200,
2324 .disable = 20,
2325 },
2326 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002327 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stachd731f662014-11-06 17:44:33 +01002328};
2329
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002330static const struct drm_display_mode innolux_g121x1_l03_mode = {
2331 .clock = 65000,
2332 .hdisplay = 1024,
2333 .hsync_start = 1024 + 0,
2334 .hsync_end = 1024 + 1,
2335 .htotal = 1024 + 0 + 1 + 320,
2336 .vdisplay = 768,
2337 .vsync_start = 768 + 38,
2338 .vsync_end = 768 + 38 + 1,
2339 .vtotal = 768 + 38 + 1 + 0,
Akshay Bhat2e8c5eb2016-03-01 18:06:54 -05002340 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05002341};
2342
2343static const struct panel_desc innolux_g121x1_l03 = {
2344 .modes = &innolux_g121x1_l03_mode,
2345 .num_modes = 1,
2346 .bpc = 6,
2347 .size = {
2348 .width = 246,
2349 .height = 185,
2350 },
2351 .delay = {
2352 .enable = 200,
2353 .unprepare = 200,
2354 .disable = 400,
2355 },
2356};
2357
Douglas Andersond719cbe2019-07-11 13:34:54 -07002358/*
2359 * Datasheet specifies that at 60 Hz refresh rate:
2360 * - total horizontal time: { 1506, 1592, 1716 }
2361 * - total vertical time: { 788, 800, 868 }
2362 *
2363 * ...but doesn't go into exactly how that should be split into a front
2364 * porch, back porch, or sync length. For now we'll leave a single setting
2365 * here which allows a bit of tweaking of the pixel clock at the expense of
2366 * refresh rate.
2367 */
2368static const struct display_timing innolux_n116bge_timing = {
2369 .pixelclock = { 72600000, 76420000, 80240000 },
2370 .hactive = { 1366, 1366, 1366 },
2371 .hfront_porch = { 136, 136, 136 },
2372 .hback_porch = { 60, 60, 60 },
2373 .hsync_len = { 30, 30, 30 },
2374 .vactive = { 768, 768, 768 },
2375 .vfront_porch = { 8, 8, 8 },
2376 .vback_porch = { 12, 12, 12 },
2377 .vsync_len = { 12, 12, 12 },
2378 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002379};
2380
2381static const struct panel_desc innolux_n116bge = {
Douglas Andersond719cbe2019-07-11 13:34:54 -07002382 .timings = &innolux_n116bge_timing,
2383 .num_timings = 1,
Thierry Reding0a2288c2014-07-03 14:02:59 +02002384 .bpc = 6,
2385 .size = {
2386 .width = 256,
2387 .height = 144,
2388 },
2389};
2390
Lukas F. Hartmanna14c6b02020-11-24 18:26:04 +01002391static const struct drm_display_mode innolux_n125hce_gn1_mode = {
2392 .clock = 162000,
2393 .hdisplay = 1920,
2394 .hsync_start = 1920 + 40,
2395 .hsync_end = 1920 + 40 + 40,
2396 .htotal = 1920 + 40 + 40 + 80,
2397 .vdisplay = 1080,
2398 .vsync_start = 1080 + 4,
2399 .vsync_end = 1080 + 4 + 4,
2400 .vtotal = 1080 + 4 + 4 + 24,
2401};
2402
2403static const struct panel_desc innolux_n125hce_gn1 = {
2404 .modes = &innolux_n125hce_gn1_mode,
2405 .num_modes = 1,
2406 .bpc = 8,
2407 .size = {
2408 .width = 276,
2409 .height = 155,
2410 },
2411 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2412 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
2413 .connector_type = DRM_MODE_CONNECTOR_eDP,
2414};
2415
Alban Bedelea447392014-07-22 08:38:55 +02002416static const struct drm_display_mode innolux_n156bge_l21_mode = {
2417 .clock = 69300,
2418 .hdisplay = 1366,
2419 .hsync_start = 1366 + 16,
2420 .hsync_end = 1366 + 16 + 34,
2421 .htotal = 1366 + 16 + 34 + 50,
2422 .vdisplay = 768,
2423 .vsync_start = 768 + 2,
2424 .vsync_end = 768 + 2 + 6,
2425 .vtotal = 768 + 2 + 6 + 12,
Alban Bedelea447392014-07-22 08:38:55 +02002426};
2427
2428static const struct panel_desc innolux_n156bge_l21 = {
2429 .modes = &innolux_n156bge_l21_mode,
2430 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002431 .bpc = 6,
Alban Bedelea447392014-07-22 08:38:55 +02002432 .size = {
2433 .width = 344,
2434 .height = 193,
2435 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03002436 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002437 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03002438 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Alban Bedelea447392014-07-22 08:38:55 +02002439};
2440
Douglas Anderson8f054b62018-10-25 15:21:34 -07002441static const struct drm_display_mode innolux_p120zdg_bf1_mode = {
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302442 .clock = 206016,
2443 .hdisplay = 2160,
2444 .hsync_start = 2160 + 48,
2445 .hsync_end = 2160 + 48 + 32,
2446 .htotal = 2160 + 48 + 32 + 80,
2447 .vdisplay = 1440,
2448 .vsync_start = 1440 + 3,
2449 .vsync_end = 1440 + 3 + 10,
2450 .vtotal = 1440 + 3 + 10 + 27,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302451 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2452};
2453
Douglas Anderson8f054b62018-10-25 15:21:34 -07002454static const struct panel_desc innolux_p120zdg_bf1 = {
2455 .modes = &innolux_p120zdg_bf1_mode,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302456 .num_modes = 1,
2457 .bpc = 8,
2458 .size = {
Douglas Anderson8f054b62018-10-25 15:21:34 -07002459 .width = 254,
2460 .height = 169,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302461 },
Sean Paul22fd99e2018-08-13 17:30:40 -04002462 .delay = {
Douglas Anderson625d3b52018-10-25 15:21:31 -07002463 .hpd_absent_delay = 200,
Sean Paul22fd99e2018-08-13 17:30:40 -04002464 .unprepare = 500,
2465 },
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05302466};
2467
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002468static const struct drm_display_mode innolux_zj070na_01p_mode = {
2469 .clock = 51501,
2470 .hdisplay = 1024,
2471 .hsync_start = 1024 + 128,
2472 .hsync_end = 1024 + 128 + 64,
2473 .htotal = 1024 + 128 + 64 + 128,
2474 .vdisplay = 600,
2475 .vsync_start = 600 + 16,
2476 .vsync_end = 600 + 16 + 4,
2477 .vtotal = 600 + 16 + 4 + 16,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002478};
2479
2480static const struct panel_desc innolux_zj070na_01p = {
2481 .modes = &innolux_zj070na_01p_mode,
2482 .num_modes = 1,
2483 .bpc = 6,
2484 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02002485 .width = 154,
2486 .height = 90,
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01002487 },
2488};
2489
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07002490static const struct drm_display_mode ivo_m133nwf4_r0_mode = {
2491 .clock = 138778,
2492 .hdisplay = 1920,
2493 .hsync_start = 1920 + 24,
2494 .hsync_end = 1920 + 24 + 48,
2495 .htotal = 1920 + 24 + 48 + 88,
2496 .vdisplay = 1080,
2497 .vsync_start = 1080 + 3,
2498 .vsync_end = 1080 + 3 + 12,
2499 .vtotal = 1080 + 3 + 12 + 17,
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07002500 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2501};
2502
2503static const struct panel_desc ivo_m133nwf4_r0 = {
2504 .modes = &ivo_m133nwf4_r0_mode,
2505 .num_modes = 1,
2506 .bpc = 8,
2507 .size = {
2508 .width = 294,
2509 .height = 165,
2510 },
2511 .delay = {
2512 .hpd_absent_delay = 200,
2513 .unprepare = 500,
2514 },
2515 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2516 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
2517 .connector_type = DRM_MODE_CONNECTOR_eDP,
2518};
2519
Douglas Andersonfc26a372020-08-21 08:35:15 -07002520static const struct drm_display_mode kingdisplay_kd116n21_30nv_a010_mode = {
2521 .clock = 81000,
2522 .hdisplay = 1366,
2523 .hsync_start = 1366 + 40,
2524 .hsync_end = 1366 + 40 + 32,
2525 .htotal = 1366 + 40 + 32 + 62,
2526 .vdisplay = 768,
2527 .vsync_start = 768 + 5,
2528 .vsync_end = 768 + 5 + 5,
2529 .vtotal = 768 + 5 + 5 + 122,
2530 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2531};
2532
2533static const struct panel_desc kingdisplay_kd116n21_30nv_a010 = {
2534 .modes = &kingdisplay_kd116n21_30nv_a010_mode,
2535 .num_modes = 1,
2536 .bpc = 6,
2537 .size = {
2538 .width = 256,
2539 .height = 144,
2540 },
2541 .delay = {
2542 .hpd_absent_delay = 200,
2543 },
2544 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2545 .connector_type = DRM_MODE_CONNECTOR_eDP,
2546};
2547
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02002548static const struct display_timing koe_tx14d24vm1bpa_timing = {
2549 .pixelclock = { 5580000, 5850000, 6200000 },
2550 .hactive = { 320, 320, 320 },
2551 .hfront_porch = { 30, 30, 30 },
2552 .hback_porch = { 30, 30, 30 },
2553 .hsync_len = { 1, 5, 17 },
2554 .vactive = { 240, 240, 240 },
2555 .vfront_porch = { 6, 6, 6 },
2556 .vback_porch = { 5, 5, 5 },
2557 .vsync_len = { 1, 2, 11 },
2558 .flags = DISPLAY_FLAGS_DE_HIGH,
2559};
2560
2561static const struct panel_desc koe_tx14d24vm1bpa = {
2562 .timings = &koe_tx14d24vm1bpa_timing,
2563 .num_timings = 1,
2564 .bpc = 6,
2565 .size = {
2566 .width = 115,
2567 .height = 86,
2568 },
2569};
2570
Liu Ying8a070522020-06-01 14:11:20 +08002571static const struct display_timing koe_tx26d202vm0bwa_timing = {
2572 .pixelclock = { 151820000, 156720000, 159780000 },
2573 .hactive = { 1920, 1920, 1920 },
2574 .hfront_porch = { 105, 130, 142 },
2575 .hback_porch = { 45, 70, 82 },
2576 .hsync_len = { 30, 30, 30 },
2577 .vactive = { 1200, 1200, 1200},
2578 .vfront_porch = { 3, 5, 10 },
2579 .vback_porch = { 2, 5, 10 },
2580 .vsync_len = { 5, 5, 5 },
2581};
2582
2583static const struct panel_desc koe_tx26d202vm0bwa = {
2584 .timings = &koe_tx26d202vm0bwa_timing,
2585 .num_timings = 1,
2586 .bpc = 8,
2587 .size = {
2588 .width = 217,
2589 .height = 136,
2590 },
2591 .delay = {
2592 .prepare = 1000,
2593 .enable = 1000,
2594 .unprepare = 1000,
2595 .disable = 1000,
2596 },
2597 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002598 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Liu Ying8a070522020-06-01 14:11:20 +08002599 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2600};
2601
Jagan Teki8cfe8342018-02-04 23:19:28 +05302602static const struct display_timing koe_tx31d200vm0baa_timing = {
2603 .pixelclock = { 39600000, 43200000, 48000000 },
2604 .hactive = { 1280, 1280, 1280 },
2605 .hfront_porch = { 16, 36, 56 },
2606 .hback_porch = { 16, 36, 56 },
2607 .hsync_len = { 8, 8, 8 },
2608 .vactive = { 480, 480, 480 },
Stefan Agnerc9b6be72018-04-19 23:20:03 +02002609 .vfront_porch = { 6, 21, 33 },
2610 .vback_porch = { 6, 21, 33 },
Jagan Teki8cfe8342018-02-04 23:19:28 +05302611 .vsync_len = { 8, 8, 8 },
2612 .flags = DISPLAY_FLAGS_DE_HIGH,
2613};
2614
2615static const struct panel_desc koe_tx31d200vm0baa = {
2616 .timings = &koe_tx31d200vm0baa_timing,
2617 .num_timings = 1,
2618 .bpc = 6,
2619 .size = {
2620 .width = 292,
2621 .height = 109,
2622 },
2623 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002624 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Jagan Teki8cfe8342018-02-04 23:19:28 +05302625};
2626
Lucas Stach8def22e2015-12-02 19:41:11 +01002627static const struct display_timing kyo_tcg121xglp_timing = {
2628 .pixelclock = { 52000000, 65000000, 71000000 },
2629 .hactive = { 1024, 1024, 1024 },
2630 .hfront_porch = { 2, 2, 2 },
2631 .hback_porch = { 2, 2, 2 },
2632 .hsync_len = { 86, 124, 244 },
2633 .vactive = { 768, 768, 768 },
2634 .vfront_porch = { 2, 2, 2 },
2635 .vback_porch = { 2, 2, 2 },
2636 .vsync_len = { 6, 34, 73 },
2637 .flags = DISPLAY_FLAGS_DE_HIGH,
2638};
2639
2640static const struct panel_desc kyo_tcg121xglp = {
2641 .timings = &kyo_tcg121xglp_timing,
2642 .num_timings = 1,
2643 .bpc = 8,
2644 .size = {
2645 .width = 246,
2646 .height = 184,
2647 },
2648 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002649 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach8def22e2015-12-02 19:41:11 +01002650};
2651
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002652static const struct drm_display_mode lemaker_bl035_rgb_002_mode = {
2653 .clock = 7000,
2654 .hdisplay = 320,
2655 .hsync_start = 320 + 20,
2656 .hsync_end = 320 + 20 + 30,
2657 .htotal = 320 + 20 + 30 + 38,
2658 .vdisplay = 240,
2659 .vsync_start = 240 + 4,
2660 .vsync_end = 240 + 4 + 3,
2661 .vtotal = 240 + 4 + 3 + 15,
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01002662};
2663
2664static const struct panel_desc lemaker_bl035_rgb_002 = {
2665 .modes = &lemaker_bl035_rgb_002_mode,
2666 .num_modes = 1,
2667 .size = {
2668 .width = 70,
2669 .height = 52,
2670 },
2671 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2672 .bus_flags = DRM_BUS_FLAG_DE_LOW,
2673};
2674
Heiko Schocherdd015002015-05-22 10:25:57 +02002675static const struct drm_display_mode lg_lb070wv8_mode = {
2676 .clock = 33246,
2677 .hdisplay = 800,
2678 .hsync_start = 800 + 88,
2679 .hsync_end = 800 + 88 + 80,
2680 .htotal = 800 + 88 + 80 + 88,
2681 .vdisplay = 480,
2682 .vsync_start = 480 + 10,
2683 .vsync_end = 480 + 10 + 25,
2684 .vtotal = 480 + 10 + 25 + 10,
Heiko Schocherdd015002015-05-22 10:25:57 +02002685};
2686
2687static const struct panel_desc lg_lb070wv8 = {
2688 .modes = &lg_lb070wv8_mode,
2689 .num_modes = 1,
Laurent Pincharta6ae2fe2020-07-12 01:53:17 +03002690 .bpc = 8,
Heiko Schocherdd015002015-05-22 10:25:57 +02002691 .size = {
2692 .width = 151,
2693 .height = 91,
2694 },
2695 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002696 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Heiko Schocherdd015002015-05-22 10:25:57 +02002697};
2698
Yakir Yangc5ece402016-06-28 12:51:15 +08002699static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
2700 .clock = 200000,
2701 .hdisplay = 1536,
2702 .hsync_start = 1536 + 12,
2703 .hsync_end = 1536 + 12 + 16,
2704 .htotal = 1536 + 12 + 16 + 48,
2705 .vdisplay = 2048,
2706 .vsync_start = 2048 + 8,
2707 .vsync_end = 2048 + 8 + 4,
2708 .vtotal = 2048 + 8 + 4 + 8,
Yakir Yangc5ece402016-06-28 12:51:15 +08002709 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2710};
2711
2712static const struct panel_desc lg_lp079qx1_sp0v = {
2713 .modes = &lg_lp079qx1_sp0v_mode,
2714 .num_modes = 1,
2715 .size = {
2716 .width = 129,
2717 .height = 171,
2718 },
2719};
2720
Yakir Yang0355dde2016-06-12 10:56:02 +08002721static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
2722 .clock = 205210,
2723 .hdisplay = 2048,
2724 .hsync_start = 2048 + 150,
2725 .hsync_end = 2048 + 150 + 5,
2726 .htotal = 2048 + 150 + 5 + 5,
2727 .vdisplay = 1536,
2728 .vsync_start = 1536 + 3,
2729 .vsync_end = 1536 + 3 + 1,
2730 .vtotal = 1536 + 3 + 1 + 9,
Yakir Yang0355dde2016-06-12 10:56:02 +08002731};
2732
2733static const struct panel_desc lg_lp097qx1_spa1 = {
2734 .modes = &lg_lp097qx1_spa1_mode,
2735 .num_modes = 1,
2736 .size = {
2737 .width = 208,
2738 .height = 147,
2739 },
2740};
2741
Jitao Shi690d8fa2016-02-22 19:01:44 +08002742static const struct drm_display_mode lg_lp120up1_mode = {
2743 .clock = 162300,
2744 .hdisplay = 1920,
2745 .hsync_start = 1920 + 40,
2746 .hsync_end = 1920 + 40 + 40,
2747 .htotal = 1920 + 40 + 40+ 80,
2748 .vdisplay = 1280,
2749 .vsync_start = 1280 + 4,
2750 .vsync_end = 1280 + 4 + 4,
2751 .vtotal = 1280 + 4 + 4 + 12,
Jitao Shi690d8fa2016-02-22 19:01:44 +08002752};
2753
2754static const struct panel_desc lg_lp120up1 = {
2755 .modes = &lg_lp120up1_mode,
2756 .num_modes = 1,
2757 .bpc = 8,
2758 .size = {
2759 .width = 267,
2760 .height = 183,
2761 },
Enric Balletbo i Serrad53139b2020-04-16 18:44:03 +02002762 .connector_type = DRM_MODE_CONNECTOR_eDP,
Jitao Shi690d8fa2016-02-22 19:01:44 +08002763};
2764
Thierry Redingec7c5652013-11-15 15:59:32 +01002765static const struct drm_display_mode lg_lp129qe_mode = {
2766 .clock = 285250,
2767 .hdisplay = 2560,
2768 .hsync_start = 2560 + 48,
2769 .hsync_end = 2560 + 48 + 32,
2770 .htotal = 2560 + 48 + 32 + 80,
2771 .vdisplay = 1700,
2772 .vsync_start = 1700 + 3,
2773 .vsync_end = 1700 + 3 + 10,
2774 .vtotal = 1700 + 3 + 10 + 36,
Thierry Redingec7c5652013-11-15 15:59:32 +01002775};
2776
2777static const struct panel_desc lg_lp129qe = {
2778 .modes = &lg_lp129qe_mode,
2779 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07002780 .bpc = 8,
Thierry Redingec7c5652013-11-15 15:59:32 +01002781 .size = {
2782 .width = 272,
2783 .height = 181,
2784 },
2785};
2786
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01002787static const struct display_timing logictechno_lt161010_2nh_timing = {
2788 .pixelclock = { 26400000, 33300000, 46800000 },
2789 .hactive = { 800, 800, 800 },
2790 .hfront_porch = { 16, 210, 354 },
2791 .hback_porch = { 46, 46, 46 },
2792 .hsync_len = { 1, 20, 40 },
2793 .vactive = { 480, 480, 480 },
2794 .vfront_porch = { 7, 22, 147 },
2795 .vback_porch = { 23, 23, 23 },
2796 .vsync_len = { 1, 10, 20 },
2797 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2798 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
2799 DISPLAY_FLAGS_SYNC_POSEDGE,
2800};
2801
2802static const struct panel_desc logictechno_lt161010_2nh = {
2803 .timings = &logictechno_lt161010_2nh_timing,
2804 .num_timings = 1,
2805 .size = {
2806 .width = 154,
2807 .height = 86,
2808 },
2809 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2810 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
2811 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
2812 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
2813 .connector_type = DRM_MODE_CONNECTOR_DPI,
2814};
2815
2816static const struct display_timing logictechno_lt170410_2whc_timing = {
2817 .pixelclock = { 68900000, 71100000, 73400000 },
2818 .hactive = { 1280, 1280, 1280 },
2819 .hfront_porch = { 23, 60, 71 },
2820 .hback_porch = { 23, 60, 71 },
2821 .hsync_len = { 15, 40, 47 },
2822 .vactive = { 800, 800, 800 },
2823 .vfront_porch = { 5, 7, 10 },
2824 .vback_porch = { 5, 7, 10 },
2825 .vsync_len = { 6, 9, 12 },
2826 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
2827 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE |
2828 DISPLAY_FLAGS_SYNC_POSEDGE,
2829};
2830
2831static const struct panel_desc logictechno_lt170410_2whc = {
2832 .timings = &logictechno_lt170410_2whc_timing,
2833 .num_timings = 1,
2834 .size = {
2835 .width = 217,
2836 .height = 136,
2837 },
2838 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03002839 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01002840 .connector_type = DRM_MODE_CONNECTOR_LVDS,
2841};
2842
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002843static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
2844 .clock = 30400,
2845 .hdisplay = 800,
2846 .hsync_start = 800 + 0,
2847 .hsync_end = 800 + 1,
2848 .htotal = 800 + 0 + 1 + 160,
2849 .vdisplay = 480,
2850 .vsync_start = 480 + 0,
2851 .vsync_end = 480 + 48 + 1,
2852 .vtotal = 480 + 48 + 1 + 0,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002853 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
2854};
2855
Adam Ford0d354082019-10-16 08:51:45 -05002856static const struct drm_display_mode logicpd_type_28_mode = {
Ville Syrjäläf873c5d2020-03-02 22:34:40 +02002857 .clock = 9107,
Adam Ford0d354082019-10-16 08:51:45 -05002858 .hdisplay = 480,
2859 .hsync_start = 480 + 3,
2860 .hsync_end = 480 + 3 + 42,
2861 .htotal = 480 + 3 + 42 + 2,
2862
2863 .vdisplay = 272,
2864 .vsync_start = 272 + 2,
2865 .vsync_end = 272 + 2 + 11,
2866 .vtotal = 272 + 2 + 11 + 3,
Adam Ford0d354082019-10-16 08:51:45 -05002867 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
2868};
2869
2870static const struct panel_desc logicpd_type_28 = {
2871 .modes = &logicpd_type_28_mode,
2872 .num_modes = 1,
2873 .bpc = 8,
2874 .size = {
2875 .width = 105,
2876 .height = 67,
2877 },
2878 .delay = {
2879 .prepare = 200,
2880 .enable = 200,
2881 .unprepare = 200,
2882 .disable = 200,
2883 },
2884 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2885 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
2886 DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
Adam Fordefb94792020-06-15 08:19:34 -05002887 .connector_type = DRM_MODE_CONNECTOR_DPI,
Adam Ford0d354082019-10-16 08:51:45 -05002888};
2889
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002890static const struct panel_desc mitsubishi_aa070mc01 = {
2891 .modes = &mitsubishi_aa070mc01_mode,
2892 .num_modes = 1,
2893 .bpc = 8,
2894 .size = {
2895 .width = 152,
2896 .height = 91,
2897 },
2898
2899 .delay = {
2900 .enable = 200,
2901 .unprepare = 200,
2902 .disable = 400,
2903 },
2904 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002905 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski65c766c2017-10-21 00:18:37 +02002906 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
2907};
2908
Lucas Stach01bacc132017-06-08 20:07:55 +02002909static const struct display_timing nec_nl12880bc20_05_timing = {
2910 .pixelclock = { 67000000, 71000000, 75000000 },
2911 .hactive = { 1280, 1280, 1280 },
2912 .hfront_porch = { 2, 30, 30 },
2913 .hback_porch = { 6, 100, 100 },
2914 .hsync_len = { 2, 30, 30 },
2915 .vactive = { 800, 800, 800 },
2916 .vfront_porch = { 5, 5, 5 },
2917 .vback_porch = { 11, 11, 11 },
2918 .vsync_len = { 7, 7, 7 },
2919};
2920
2921static const struct panel_desc nec_nl12880bc20_05 = {
2922 .timings = &nec_nl12880bc20_05_timing,
2923 .num_timings = 1,
2924 .bpc = 8,
2925 .size = {
2926 .width = 261,
2927 .height = 163,
2928 },
2929 .delay = {
2930 .enable = 50,
2931 .disable = 50,
2932 },
2933 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03002934 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach01bacc132017-06-08 20:07:55 +02002935};
2936
jianwei wangc6e87f92015-07-29 16:30:02 +08002937static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
2938 .clock = 10870,
2939 .hdisplay = 480,
2940 .hsync_start = 480 + 2,
2941 .hsync_end = 480 + 2 + 41,
2942 .htotal = 480 + 2 + 41 + 2,
2943 .vdisplay = 272,
2944 .vsync_start = 272 + 2,
2945 .vsync_end = 272 + 2 + 4,
2946 .vtotal = 272 + 2 + 4 + 2,
Stefan Agner4bc390c2015-11-17 19:10:29 -08002947 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
jianwei wangc6e87f92015-07-29 16:30:02 +08002948};
2949
2950static const struct panel_desc nec_nl4827hc19_05b = {
2951 .modes = &nec_nl4827hc19_05b_mode,
2952 .num_modes = 1,
2953 .bpc = 8,
2954 .size = {
2955 .width = 95,
2956 .height = 54,
2957 },
Stefan Agner2c806612016-02-08 12:50:13 -08002958 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03002959 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
jianwei wangc6e87f92015-07-29 16:30:02 +08002960};
2961
Maxime Riparde6c2f062016-09-06 16:46:17 +02002962static const struct drm_display_mode netron_dy_e231732_mode = {
2963 .clock = 66000,
2964 .hdisplay = 1024,
2965 .hsync_start = 1024 + 160,
2966 .hsync_end = 1024 + 160 + 70,
2967 .htotal = 1024 + 160 + 70 + 90,
2968 .vdisplay = 600,
2969 .vsync_start = 600 + 127,
2970 .vsync_end = 600 + 127 + 20,
2971 .vtotal = 600 + 127 + 20 + 3,
Maxime Riparde6c2f062016-09-06 16:46:17 +02002972};
2973
2974static const struct panel_desc netron_dy_e231732 = {
2975 .modes = &netron_dy_e231732_mode,
2976 .num_modes = 1,
2977 .size = {
2978 .width = 154,
2979 .height = 87,
2980 },
2981 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2982};
2983
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08002984static const struct drm_display_mode neweast_wjfh116008a_modes[] = {
2985 {
2986 .clock = 138500,
2987 .hdisplay = 1920,
2988 .hsync_start = 1920 + 48,
2989 .hsync_end = 1920 + 48 + 32,
2990 .htotal = 1920 + 48 + 32 + 80,
2991 .vdisplay = 1080,
2992 .vsync_start = 1080 + 3,
2993 .vsync_end = 1080 + 3 + 5,
2994 .vtotal = 1080 + 3 + 5 + 23,
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08002995 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2996 }, {
2997 .clock = 110920,
2998 .hdisplay = 1920,
2999 .hsync_start = 1920 + 48,
3000 .hsync_end = 1920 + 48 + 32,
3001 .htotal = 1920 + 48 + 32 + 80,
3002 .vdisplay = 1080,
3003 .vsync_start = 1080 + 3,
3004 .vsync_end = 1080 + 3 + 5,
3005 .vtotal = 1080 + 3 + 5 + 23,
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08003006 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3007 }
3008};
3009
3010static const struct panel_desc neweast_wjfh116008a = {
3011 .modes = neweast_wjfh116008a_modes,
3012 .num_modes = 2,
3013 .bpc = 6,
3014 .size = {
3015 .width = 260,
3016 .height = 150,
3017 },
3018 .delay = {
3019 .prepare = 110,
3020 .enable = 20,
3021 .unprepare = 500,
3022 },
3023 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3024 .connector_type = DRM_MODE_CONNECTOR_eDP,
3025};
3026
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003027static const struct drm_display_mode newhaven_nhd_43_480272ef_atxl_mode = {
3028 .clock = 9000,
3029 .hdisplay = 480,
3030 .hsync_start = 480 + 2,
3031 .hsync_end = 480 + 2 + 41,
3032 .htotal = 480 + 2 + 41 + 2,
3033 .vdisplay = 272,
3034 .vsync_start = 272 + 2,
3035 .vsync_end = 272 + 2 + 10,
3036 .vtotal = 272 + 2 + 10 + 2,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003037 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3038};
3039
3040static const struct panel_desc newhaven_nhd_43_480272ef_atxl = {
3041 .modes = &newhaven_nhd_43_480272ef_atxl_mode,
3042 .num_modes = 1,
3043 .bpc = 8,
3044 .size = {
3045 .width = 95,
3046 .height = 54,
3047 },
3048 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003049 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3050 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Tomi Valkeinen8a4f5e12020-06-09 13:28:09 +03003051 .connector_type = DRM_MODE_CONNECTOR_DPI,
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03003052};
3053
Lucas Stach4177fa62017-06-08 20:07:57 +02003054static const struct display_timing nlt_nl192108ac18_02d_timing = {
3055 .pixelclock = { 130000000, 148350000, 163000000 },
3056 .hactive = { 1920, 1920, 1920 },
3057 .hfront_porch = { 80, 100, 100 },
3058 .hback_porch = { 100, 120, 120 },
3059 .hsync_len = { 50, 60, 60 },
3060 .vactive = { 1080, 1080, 1080 },
3061 .vfront_porch = { 12, 30, 30 },
3062 .vback_porch = { 4, 10, 10 },
3063 .vsync_len = { 4, 5, 5 },
3064};
3065
3066static const struct panel_desc nlt_nl192108ac18_02d = {
3067 .timings = &nlt_nl192108ac18_02d_timing,
3068 .num_timings = 1,
3069 .bpc = 8,
3070 .size = {
3071 .width = 344,
3072 .height = 194,
3073 },
3074 .delay = {
3075 .unprepare = 500,
3076 },
3077 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003078 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach4177fa62017-06-08 20:07:57 +02003079};
3080
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02003081static const struct drm_display_mode nvd_9128_mode = {
3082 .clock = 29500,
3083 .hdisplay = 800,
3084 .hsync_start = 800 + 130,
3085 .hsync_end = 800 + 130 + 98,
3086 .htotal = 800 + 0 + 130 + 98,
3087 .vdisplay = 480,
3088 .vsync_start = 480 + 10,
3089 .vsync_end = 480 + 10 + 50,
3090 .vtotal = 480 + 0 + 10 + 50,
3091};
3092
3093static const struct panel_desc nvd_9128 = {
3094 .modes = &nvd_9128_mode,
3095 .num_modes = 1,
3096 .bpc = 8,
3097 .size = {
3098 .width = 156,
3099 .height = 88,
3100 },
3101 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003102 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02003103};
3104
Gary Bissona99fb622015-06-10 18:44:23 +02003105static const struct display_timing okaya_rs800480t_7x0gp_timing = {
3106 .pixelclock = { 30000000, 30000000, 40000000 },
3107 .hactive = { 800, 800, 800 },
3108 .hfront_porch = { 40, 40, 40 },
3109 .hback_porch = { 40, 40, 40 },
3110 .hsync_len = { 1, 48, 48 },
3111 .vactive = { 480, 480, 480 },
3112 .vfront_porch = { 13, 13, 13 },
3113 .vback_porch = { 29, 29, 29 },
3114 .vsync_len = { 3, 3, 3 },
3115 .flags = DISPLAY_FLAGS_DE_HIGH,
3116};
3117
3118static const struct panel_desc okaya_rs800480t_7x0gp = {
3119 .timings = &okaya_rs800480t_7x0gp_timing,
3120 .num_timings = 1,
3121 .bpc = 6,
3122 .size = {
3123 .width = 154,
3124 .height = 87,
3125 },
3126 .delay = {
3127 .prepare = 41,
3128 .enable = 50,
3129 .unprepare = 41,
3130 .disable = 50,
3131 },
3132 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3133};
3134
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003135static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
3136 .clock = 9000,
3137 .hdisplay = 480,
3138 .hsync_start = 480 + 5,
3139 .hsync_end = 480 + 5 + 30,
3140 .htotal = 480 + 5 + 30 + 10,
3141 .vdisplay = 272,
3142 .vsync_start = 272 + 8,
3143 .vsync_end = 272 + 8 + 5,
3144 .vtotal = 272 + 8 + 5 + 3,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003145};
3146
3147static const struct panel_desc olimex_lcd_olinuxino_43ts = {
3148 .modes = &olimex_lcd_olinuxino_43ts_mode,
3149 .num_modes = 1,
3150 .size = {
Jonathan Liu30c6d7ab92017-07-20 20:29:43 +10003151 .width = 95,
3152 .height = 54,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003153 },
Jonathan Liu5c2a7c62016-09-11 20:46:55 +10003154 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01003155};
3156
Eric Anholte8b6f562016-03-24 17:23:48 -07003157/*
3158 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
3159 * pixel clocks, but this is the timing that was being used in the Adafruit
3160 * installation instructions.
3161 */
3162static const struct drm_display_mode ontat_yx700wv03_mode = {
3163 .clock = 29500,
3164 .hdisplay = 800,
3165 .hsync_start = 824,
3166 .hsync_end = 896,
3167 .htotal = 992,
3168 .vdisplay = 480,
3169 .vsync_start = 483,
3170 .vsync_end = 493,
3171 .vtotal = 500,
Eric Anholte8b6f562016-03-24 17:23:48 -07003172 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3173};
3174
3175/*
3176 * Specification at:
3177 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
3178 */
3179static const struct panel_desc ontat_yx700wv03 = {
3180 .modes = &ontat_yx700wv03_mode,
3181 .num_modes = 1,
3182 .bpc = 8,
3183 .size = {
3184 .width = 154,
3185 .height = 83,
3186 },
Eric Anholt5651e5e2018-03-09 15:33:32 -08003187 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Eric Anholte8b6f562016-03-24 17:23:48 -07003188};
3189
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003190static const struct drm_display_mode ortustech_com37h3m_mode = {
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003191 .clock = 22230,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003192 .hdisplay = 480,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003193 .hsync_start = 480 + 40,
3194 .hsync_end = 480 + 40 + 10,
3195 .htotal = 480 + 40 + 10 + 40,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003196 .vdisplay = 640,
3197 .vsync_start = 640 + 4,
H. Nikolaus Schaller855e7642020-03-10 08:43:19 +01003198 .vsync_end = 640 + 4 + 2,
3199 .vtotal = 640 + 4 + 2 + 4,
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003200 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3201};
3202
3203static const struct panel_desc ortustech_com37h3m = {
3204 .modes = &ortustech_com37h3m_mode,
3205 .num_modes = 1,
3206 .bpc = 8,
3207 .size = {
3208 .width = 56, /* 56.16mm */
3209 .height = 75, /* 74.88mm */
3210 },
3211 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003212 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02003213 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
3214};
3215
Philipp Zabel725c9d42015-02-11 18:50:11 +01003216static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
3217 .clock = 25000,
3218 .hdisplay = 480,
3219 .hsync_start = 480 + 10,
3220 .hsync_end = 480 + 10 + 10,
3221 .htotal = 480 + 10 + 10 + 15,
3222 .vdisplay = 800,
3223 .vsync_start = 800 + 3,
3224 .vsync_end = 800 + 3 + 3,
3225 .vtotal = 800 + 3 + 3 + 3,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003226};
3227
3228static const struct panel_desc ortustech_com43h4m85ulc = {
3229 .modes = &ortustech_com43h4m85ulc_mode,
3230 .num_modes = 1,
Laurent Pinchart3b809512020-08-24 03:32:54 +03003231 .bpc = 6,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003232 .size = {
3233 .width = 56,
3234 .height = 93,
3235 },
Laurent Pinchartf098f162020-08-13 01:02:44 +03003236 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003237 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Laurent Pinchart2ccedf42020-03-09 20:42:10 +02003238 .connector_type = DRM_MODE_CONNECTOR_DPI,
Philipp Zabel725c9d42015-02-11 18:50:11 +01003239};
3240
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003241static const struct drm_display_mode osddisplays_osd070t1718_19ts_mode = {
3242 .clock = 33000,
3243 .hdisplay = 800,
3244 .hsync_start = 800 + 210,
3245 .hsync_end = 800 + 210 + 30,
3246 .htotal = 800 + 210 + 30 + 16,
3247 .vdisplay = 480,
3248 .vsync_start = 480 + 22,
3249 .vsync_end = 480 + 22 + 13,
3250 .vtotal = 480 + 22 + 13 + 10,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003251 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3252};
3253
3254static const struct panel_desc osddisplays_osd070t1718_19ts = {
3255 .modes = &osddisplays_osd070t1718_19ts_mode,
3256 .num_modes = 1,
3257 .bpc = 8,
3258 .size = {
3259 .width = 152,
3260 .height = 91,
3261 },
3262 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Tomi Valkeinenfb0629e2019-11-14 11:39:50 +02003263 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
3264 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
Laurent Pincharta793f0e2019-09-04 16:37:23 +03003265 .connector_type = DRM_MODE_CONNECTOR_DPI,
Laurent Pinchart163f7a32018-12-07 22:13:44 +02003266};
3267
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003268static const struct drm_display_mode pda_91_00156_a0_mode = {
3269 .clock = 33300,
3270 .hdisplay = 800,
3271 .hsync_start = 800 + 1,
3272 .hsync_end = 800 + 1 + 64,
3273 .htotal = 800 + 1 + 64 + 64,
3274 .vdisplay = 480,
3275 .vsync_start = 480 + 1,
3276 .vsync_end = 480 + 1 + 23,
3277 .vtotal = 480 + 1 + 23 + 22,
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003278};
3279
3280static const struct panel_desc pda_91_00156_a0 = {
3281 .modes = &pda_91_00156_a0_mode,
3282 .num_modes = 1,
3283 .size = {
3284 .width = 152,
3285 .height = 91,
3286 },
3287 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3288};
3289
Marek Vasutd69de692020-07-28 14:12:46 +02003290static const struct drm_display_mode powertip_ph800480t013_idf02_mode = {
3291 .clock = 24750,
3292 .hdisplay = 800,
3293 .hsync_start = 800 + 54,
3294 .hsync_end = 800 + 54 + 2,
3295 .htotal = 800 + 54 + 2 + 44,
3296 .vdisplay = 480,
3297 .vsync_start = 480 + 49,
3298 .vsync_end = 480 + 49 + 2,
3299 .vtotal = 480 + 49 + 2 + 22,
3300};
3301
3302static const struct panel_desc powertip_ph800480t013_idf02 = {
3303 .modes = &powertip_ph800480t013_idf02_mode,
3304 .num_modes = 1,
3305 .size = {
3306 .width = 152,
3307 .height = 91,
3308 },
3309 .bus_flags = DRM_BUS_FLAG_DE_HIGH |
3310 DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
3311 DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE,
3312 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3313 .connector_type = DRM_MODE_CONNECTOR_DPI,
3314};
Eugen Hristev4ba3e562019-01-14 09:43:31 +00003315
Josh Wud2a6f0f2015-10-08 17:42:41 +02003316static const struct drm_display_mode qd43003c0_40_mode = {
3317 .clock = 9000,
3318 .hdisplay = 480,
3319 .hsync_start = 480 + 8,
3320 .hsync_end = 480 + 8 + 4,
3321 .htotal = 480 + 8 + 4 + 39,
3322 .vdisplay = 272,
3323 .vsync_start = 272 + 4,
3324 .vsync_end = 272 + 4 + 10,
3325 .vtotal = 272 + 4 + 10 + 2,
Josh Wud2a6f0f2015-10-08 17:42:41 +02003326};
3327
3328static const struct panel_desc qd43003c0_40 = {
3329 .modes = &qd43003c0_40_mode,
3330 .num_modes = 1,
3331 .bpc = 8,
3332 .size = {
3333 .width = 95,
3334 .height = 53,
3335 },
3336 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3337};
3338
Jagan Teki23167fa2018-06-07 19:16:48 +05303339static const struct display_timing rocktech_rk070er9427_timing = {
3340 .pixelclock = { 26400000, 33300000, 46800000 },
3341 .hactive = { 800, 800, 800 },
3342 .hfront_porch = { 16, 210, 354 },
3343 .hback_porch = { 46, 46, 46 },
3344 .hsync_len = { 1, 1, 1 },
3345 .vactive = { 480, 480, 480 },
3346 .vfront_porch = { 7, 22, 147 },
3347 .vback_porch = { 23, 23, 23 },
3348 .vsync_len = { 1, 1, 1 },
3349 .flags = DISPLAY_FLAGS_DE_HIGH,
3350};
3351
3352static const struct panel_desc rocktech_rk070er9427 = {
3353 .timings = &rocktech_rk070er9427_timing,
3354 .num_timings = 1,
3355 .bpc = 6,
3356 .size = {
3357 .width = 154,
3358 .height = 86,
3359 },
3360 .delay = {
3361 .prepare = 41,
3362 .enable = 50,
3363 .unprepare = 41,
3364 .disable = 50,
3365 },
3366 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3367};
3368
Jyri Sarhaf3050472020-02-11 14:17:18 +02003369static const struct drm_display_mode rocktech_rk101ii01d_ct_mode = {
3370 .clock = 71100,
3371 .hdisplay = 1280,
3372 .hsync_start = 1280 + 48,
3373 .hsync_end = 1280 + 48 + 32,
3374 .htotal = 1280 + 48 + 32 + 80,
3375 .vdisplay = 800,
3376 .vsync_start = 800 + 2,
3377 .vsync_end = 800 + 2 + 5,
3378 .vtotal = 800 + 2 + 5 + 16,
Jyri Sarhaf3050472020-02-11 14:17:18 +02003379};
3380
3381static const struct panel_desc rocktech_rk101ii01d_ct = {
3382 .modes = &rocktech_rk101ii01d_ct_mode,
3383 .num_modes = 1,
3384 .size = {
3385 .width = 217,
3386 .height = 136,
3387 },
3388 .delay = {
3389 .prepare = 50,
3390 .disable = 50,
3391 },
3392 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
3393 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3394 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3395};
3396
Yakir Yang0330eaf2016-06-12 10:56:13 +08003397static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
3398 .clock = 271560,
3399 .hdisplay = 2560,
3400 .hsync_start = 2560 + 48,
3401 .hsync_end = 2560 + 48 + 32,
3402 .htotal = 2560 + 48 + 32 + 80,
3403 .vdisplay = 1600,
3404 .vsync_start = 1600 + 2,
3405 .vsync_end = 1600 + 2 + 5,
3406 .vtotal = 1600 + 2 + 5 + 57,
Yakir Yang0330eaf2016-06-12 10:56:13 +08003407};
3408
3409static const struct panel_desc samsung_lsn122dl01_c01 = {
3410 .modes = &samsung_lsn122dl01_c01_mode,
3411 .num_modes = 1,
3412 .size = {
3413 .width = 263,
3414 .height = 164,
3415 },
3416};
3417
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003418static const struct drm_display_mode samsung_ltn101nt05_mode = {
3419 .clock = 54030,
3420 .hdisplay = 1024,
3421 .hsync_start = 1024 + 24,
3422 .hsync_end = 1024 + 24 + 136,
3423 .htotal = 1024 + 24 + 136 + 160,
3424 .vdisplay = 600,
3425 .vsync_start = 600 + 3,
3426 .vsync_end = 600 + 3 + 6,
3427 .vtotal = 600 + 3 + 6 + 61,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003428};
3429
3430static const struct panel_desc samsung_ltn101nt05 = {
3431 .modes = &samsung_ltn101nt05_mode,
3432 .num_modes = 1,
Stéphane Marchesin0208d512014-06-19 18:18:28 -07003433 .bpc = 6,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003434 .size = {
Thierry Reding81598842016-06-10 15:33:13 +02003435 .width = 223,
3436 .height = 125,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003437 },
Dmitry Osipenko85560822020-06-22 01:27:42 +03003438 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003439 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Dmitry Osipenko94f07912020-06-18 01:27:03 +03003440 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01003441};
3442
Stéphane Marchesin0c934302015-03-18 10:52:18 +01003443static const struct drm_display_mode samsung_ltn140at29_301_mode = {
3444 .clock = 76300,
3445 .hdisplay = 1366,
3446 .hsync_start = 1366 + 64,
3447 .hsync_end = 1366 + 64 + 48,
3448 .htotal = 1366 + 64 + 48 + 128,
3449 .vdisplay = 768,
3450 .vsync_start = 768 + 2,
3451 .vsync_end = 768 + 2 + 5,
3452 .vtotal = 768 + 2 + 5 + 17,
Stéphane Marchesin0c934302015-03-18 10:52:18 +01003453};
3454
3455static const struct panel_desc samsung_ltn140at29_301 = {
3456 .modes = &samsung_ltn140at29_301_mode,
3457 .num_modes = 1,
3458 .bpc = 6,
3459 .size = {
3460 .width = 320,
3461 .height = 187,
3462 },
3463};
3464
Miquel Raynal44c58c52020-01-09 19:40:37 +01003465static const struct display_timing satoz_sat050at40h12r2_timing = {
3466 .pixelclock = {33300000, 33300000, 50000000},
3467 .hactive = {800, 800, 800},
3468 .hfront_porch = {16, 210, 354},
3469 .hback_porch = {46, 46, 46},
3470 .hsync_len = {1, 1, 40},
3471 .vactive = {480, 480, 480},
3472 .vfront_porch = {7, 22, 147},
3473 .vback_porch = {23, 23, 23},
3474 .vsync_len = {1, 1, 20},
3475};
3476
3477static const struct panel_desc satoz_sat050at40h12r2 = {
3478 .timings = &satoz_sat050at40h12r2_timing,
3479 .num_timings = 1,
3480 .bpc = 8,
3481 .size = {
3482 .width = 108,
3483 .height = 65,
3484 },
Laurent Pinchart34ca6b52020-06-30 02:33:18 +03003485 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Miquel Raynal44c58c52020-01-09 19:40:37 +01003486 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3487};
3488
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07003489static const struct drm_display_mode sharp_ld_d5116z01b_mode = {
3490 .clock = 168480,
3491 .hdisplay = 1920,
3492 .hsync_start = 1920 + 48,
3493 .hsync_end = 1920 + 48 + 32,
3494 .htotal = 1920 + 48 + 32 + 80,
3495 .vdisplay = 1280,
3496 .vsync_start = 1280 + 3,
3497 .vsync_end = 1280 + 3 + 10,
3498 .vtotal = 1280 + 3 + 10 + 57,
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07003499 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3500};
3501
3502static const struct panel_desc sharp_ld_d5116z01b = {
3503 .modes = &sharp_ld_d5116z01b_mode,
3504 .num_modes = 1,
3505 .bpc = 8,
3506 .size = {
3507 .width = 260,
3508 .height = 120,
3509 },
3510 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3511 .bus_flags = DRM_BUS_FLAG_DATA_MSB_TO_LSB,
3512};
3513
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003514static const struct drm_display_mode sharp_lq070y3dg3b_mode = {
3515 .clock = 33260,
3516 .hdisplay = 800,
3517 .hsync_start = 800 + 64,
3518 .hsync_end = 800 + 64 + 128,
3519 .htotal = 800 + 64 + 128 + 64,
3520 .vdisplay = 480,
3521 .vsync_start = 480 + 8,
3522 .vsync_end = 480 + 8 + 2,
3523 .vtotal = 480 + 8 + 2 + 35,
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003524 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3525};
3526
3527static const struct panel_desc sharp_lq070y3dg3b = {
3528 .modes = &sharp_lq070y3dg3b_mode,
3529 .num_modes = 1,
3530 .bpc = 8,
3531 .size = {
3532 .width = 152, /* 152.4mm */
3533 .height = 91, /* 91.4mm */
3534 },
3535 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003536 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE |
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02003537 DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
3538};
3539
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003540static const struct drm_display_mode sharp_lq035q7db03_mode = {
3541 .clock = 5500,
3542 .hdisplay = 240,
3543 .hsync_start = 240 + 16,
3544 .hsync_end = 240 + 16 + 7,
3545 .htotal = 240 + 16 + 7 + 5,
3546 .vdisplay = 320,
3547 .vsync_start = 320 + 9,
3548 .vsync_end = 320 + 9 + 1,
3549 .vtotal = 320 + 9 + 1 + 7,
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03003550};
3551
3552static const struct panel_desc sharp_lq035q7db03 = {
3553 .modes = &sharp_lq035q7db03_mode,
3554 .num_modes = 1,
3555 .bpc = 6,
3556 .size = {
3557 .width = 54,
3558 .height = 72,
3559 },
3560 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3561};
3562
Joshua Clayton592aa022016-07-06 15:59:16 -07003563static const struct display_timing sharp_lq101k1ly04_timing = {
3564 .pixelclock = { 60000000, 65000000, 80000000 },
3565 .hactive = { 1280, 1280, 1280 },
3566 .hfront_porch = { 20, 20, 20 },
3567 .hback_porch = { 20, 20, 20 },
3568 .hsync_len = { 10, 10, 10 },
3569 .vactive = { 800, 800, 800 },
3570 .vfront_porch = { 4, 4, 4 },
3571 .vback_porch = { 4, 4, 4 },
3572 .vsync_len = { 4, 4, 4 },
3573 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
3574};
3575
3576static const struct panel_desc sharp_lq101k1ly04 = {
3577 .timings = &sharp_lq101k1ly04_timing,
3578 .num_timings = 1,
3579 .bpc = 8,
3580 .size = {
3581 .width = 217,
3582 .height = 136,
3583 },
3584 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003585 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Joshua Clayton592aa022016-07-06 15:59:16 -07003586};
3587
Sean Paul9f7bae22018-02-08 12:48:52 -05003588static const struct display_timing sharp_lq123p1jx31_timing = {
3589 .pixelclock = { 252750000, 252750000, 266604720 },
3590 .hactive = { 2400, 2400, 2400 },
3591 .hfront_porch = { 48, 48, 48 },
3592 .hback_porch = { 80, 80, 84 },
3593 .hsync_len = { 32, 32, 32 },
3594 .vactive = { 1600, 1600, 1600 },
3595 .vfront_porch = { 3, 3, 3 },
3596 .vback_porch = { 33, 33, 120 },
3597 .vsync_len = { 10, 10, 10 },
3598 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
Yakir Yang739c7de2016-06-12 10:56:35 +08003599};
3600
3601static const struct panel_desc sharp_lq123p1jx31 = {
Sean Paul9f7bae22018-02-08 12:48:52 -05003602 .timings = &sharp_lq123p1jx31_timing,
3603 .num_timings = 1,
zain wang5466a632016-11-19 10:27:16 +08003604 .bpc = 8,
Yakir Yang739c7de2016-06-12 10:56:35 +08003605 .size = {
3606 .width = 259,
3607 .height = 173,
3608 },
Yakir Yanga42f6e32016-07-21 21:14:34 +08003609 .delay = {
3610 .prepare = 110,
3611 .enable = 50,
3612 .unprepare = 550,
3613 },
Yakir Yang739c7de2016-06-12 10:56:35 +08003614};
3615
Paul Cercueil656b7592020-08-11 02:22:38 +02003616static const struct drm_display_mode sharp_ls020b1dd01d_modes[] = {
Paul Cercueile6c21e62020-08-11 02:22:40 +02003617 { /* 50 Hz */
3618 .clock = 3000,
3619 .hdisplay = 240,
3620 .hsync_start = 240 + 58,
3621 .hsync_end = 240 + 58 + 1,
3622 .htotal = 240 + 58 + 1 + 1,
3623 .vdisplay = 160,
3624 .vsync_start = 160 + 24,
3625 .vsync_end = 160 + 24 + 10,
3626 .vtotal = 160 + 24 + 10 + 6,
3627 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
3628 },
Paul Cercueil656b7592020-08-11 02:22:38 +02003629 { /* 60 Hz */
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003630 .clock = 3000,
Paul Cercueil656b7592020-08-11 02:22:38 +02003631 .hdisplay = 240,
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003632 .hsync_start = 240 + 8,
3633 .hsync_end = 240 + 8 + 1,
3634 .htotal = 240 + 8 + 1 + 1,
Paul Cercueil656b7592020-08-11 02:22:38 +02003635 .vdisplay = 160,
Paul Cercueilc1bd32b2020-08-11 02:22:39 +02003636 .vsync_start = 160 + 24,
3637 .vsync_end = 160 + 24 + 10,
3638 .vtotal = 160 + 24 + 10 + 6,
Paul Cercueil656b7592020-08-11 02:22:38 +02003639 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
3640 },
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003641};
3642
3643static const struct panel_desc sharp_ls020b1dd01d = {
Paul Cercueil656b7592020-08-11 02:22:38 +02003644 .modes = sharp_ls020b1dd01d_modes,
3645 .num_modes = ARRAY_SIZE(sharp_ls020b1dd01d_modes),
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003646 .bpc = 6,
3647 .size = {
3648 .width = 42,
3649 .height = 28,
3650 },
3651 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
3652 .bus_flags = DRM_BUS_FLAG_DE_HIGH
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003653 | DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02003654 | DRM_BUS_FLAG_SHARP_SIGNALS,
3655};
3656
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003657static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
3658 .clock = 33300,
3659 .hdisplay = 800,
3660 .hsync_start = 800 + 1,
3661 .hsync_end = 800 + 1 + 64,
3662 .htotal = 800 + 1 + 64 + 64,
3663 .vdisplay = 480,
3664 .vsync_start = 480 + 1,
3665 .vsync_end = 480 + 1 + 23,
3666 .vtotal = 480 + 1 + 23 + 22,
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01003667};
3668
3669static const struct panel_desc shelly_sca07010_bfn_lnn = {
3670 .modes = &shelly_sca07010_bfn_lnn_mode,
3671 .num_modes = 1,
3672 .size = {
3673 .width = 152,
3674 .height = 91,
3675 },
3676 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3677};
3678
Pascal Roeleven105235e2020-03-20 12:21:33 +01003679static const struct drm_display_mode starry_kr070pe2t_mode = {
3680 .clock = 33000,
3681 .hdisplay = 800,
3682 .hsync_start = 800 + 209,
3683 .hsync_end = 800 + 209 + 1,
3684 .htotal = 800 + 209 + 1 + 45,
3685 .vdisplay = 480,
3686 .vsync_start = 480 + 22,
3687 .vsync_end = 480 + 22 + 1,
3688 .vtotal = 480 + 22 + 1 + 22,
Pascal Roeleven105235e2020-03-20 12:21:33 +01003689};
3690
3691static const struct panel_desc starry_kr070pe2t = {
3692 .modes = &starry_kr070pe2t_mode,
3693 .num_modes = 1,
3694 .bpc = 8,
3695 .size = {
3696 .width = 152,
3697 .height = 86,
3698 },
3699 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
3700 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
Laurent Pinchart41fad302020-06-30 02:33:17 +03003701 .connector_type = DRM_MODE_CONNECTOR_DPI,
Pascal Roeleven105235e2020-03-20 12:21:33 +01003702};
3703
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003704static const struct drm_display_mode starry_kr122ea0sra_mode = {
3705 .clock = 147000,
3706 .hdisplay = 1920,
3707 .hsync_start = 1920 + 16,
3708 .hsync_end = 1920 + 16 + 16,
3709 .htotal = 1920 + 16 + 16 + 32,
3710 .vdisplay = 1200,
3711 .vsync_start = 1200 + 15,
3712 .vsync_end = 1200 + 15 + 2,
3713 .vtotal = 1200 + 15 + 2 + 18,
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003714 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3715};
3716
3717static const struct panel_desc starry_kr122ea0sra = {
3718 .modes = &starry_kr122ea0sra_mode,
3719 .num_modes = 1,
3720 .size = {
3721 .width = 263,
3722 .height = 164,
3723 },
Brian Norrisc46b9242016-08-26 14:32:14 -07003724 .delay = {
3725 .prepare = 10 + 200,
3726 .enable = 50,
3727 .unprepare = 10 + 500,
3728 },
Douglas Anderson9bb34c42016-06-10 10:02:07 -07003729};
3730
Jyri Sarha42161532019-03-22 10:33:36 +02003731static const struct drm_display_mode tfc_s9700rtwv43tr_01b_mode = {
3732 .clock = 30000,
3733 .hdisplay = 800,
3734 .hsync_start = 800 + 39,
3735 .hsync_end = 800 + 39 + 47,
3736 .htotal = 800 + 39 + 47 + 39,
3737 .vdisplay = 480,
3738 .vsync_start = 480 + 13,
3739 .vsync_end = 480 + 13 + 2,
3740 .vtotal = 480 + 13 + 2 + 29,
Jyri Sarha42161532019-03-22 10:33:36 +02003741};
3742
3743static const struct panel_desc tfc_s9700rtwv43tr_01b = {
3744 .modes = &tfc_s9700rtwv43tr_01b_mode,
3745 .num_modes = 1,
3746 .bpc = 8,
3747 .size = {
3748 .width = 155,
3749 .height = 90,
3750 },
3751 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003752 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Jyri Sarha42161532019-03-22 10:33:36 +02003753};
3754
Gary Bissonadb973e2016-12-02 09:52:08 +01003755static const struct display_timing tianma_tm070jdhg30_timing = {
3756 .pixelclock = { 62600000, 68200000, 78100000 },
3757 .hactive = { 1280, 1280, 1280 },
3758 .hfront_porch = { 15, 64, 159 },
3759 .hback_porch = { 5, 5, 5 },
3760 .hsync_len = { 1, 1, 256 },
3761 .vactive = { 800, 800, 800 },
3762 .vfront_porch = { 3, 40, 99 },
3763 .vback_porch = { 2, 2, 2 },
3764 .vsync_len = { 1, 1, 128 },
3765 .flags = DISPLAY_FLAGS_DE_HIGH,
3766};
3767
3768static const struct panel_desc tianma_tm070jdhg30 = {
3769 .timings = &tianma_tm070jdhg30_timing,
3770 .num_timings = 1,
3771 .bpc = 8,
3772 .size = {
3773 .width = 151,
3774 .height = 95,
3775 },
3776 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003777 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Gary Bissonadb973e2016-12-02 09:52:08 +01003778};
3779
Max Merchelb3bfcdf2020-06-12 09:22:19 +02003780static const struct panel_desc tianma_tm070jvhg33 = {
3781 .timings = &tianma_tm070jdhg30_timing,
3782 .num_timings = 1,
3783 .bpc = 8,
3784 .size = {
3785 .width = 150,
3786 .height = 94,
3787 },
3788 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
3789 .connector_type = DRM_MODE_CONNECTOR_LVDS,
3790};
3791
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003792static const struct display_timing tianma_tm070rvhg71_timing = {
3793 .pixelclock = { 27700000, 29200000, 39600000 },
3794 .hactive = { 800, 800, 800 },
3795 .hfront_porch = { 12, 40, 212 },
3796 .hback_porch = { 88, 88, 88 },
3797 .hsync_len = { 1, 1, 40 },
3798 .vactive = { 480, 480, 480 },
3799 .vfront_porch = { 1, 13, 88 },
3800 .vback_porch = { 32, 32, 32 },
3801 .vsync_len = { 1, 1, 3 },
3802 .flags = DISPLAY_FLAGS_DE_HIGH,
3803};
3804
3805static const struct panel_desc tianma_tm070rvhg71 = {
3806 .timings = &tianma_tm070rvhg71_timing,
3807 .num_timings = 1,
3808 .bpc = 8,
3809 .size = {
3810 .width = 154,
3811 .height = 86,
3812 },
3813 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003814 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lukasz Majewski870a0b12017-11-07 16:30:58 +01003815};
3816
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003817static const struct drm_display_mode ti_nspire_cx_lcd_mode[] = {
3818 {
3819 .clock = 10000,
3820 .hdisplay = 320,
3821 .hsync_start = 320 + 50,
3822 .hsync_end = 320 + 50 + 6,
3823 .htotal = 320 + 50 + 6 + 38,
3824 .vdisplay = 240,
3825 .vsync_start = 240 + 3,
3826 .vsync_end = 240 + 3 + 1,
3827 .vtotal = 240 + 3 + 1 + 17,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003828 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
3829 },
3830};
3831
3832static const struct panel_desc ti_nspire_cx_lcd_panel = {
3833 .modes = ti_nspire_cx_lcd_mode,
3834 .num_modes = 1,
3835 .bpc = 8,
3836 .size = {
3837 .width = 65,
3838 .height = 49,
3839 },
3840 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003841 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003842};
3843
3844static const struct drm_display_mode ti_nspire_classic_lcd_mode[] = {
3845 {
3846 .clock = 10000,
3847 .hdisplay = 320,
3848 .hsync_start = 320 + 6,
3849 .hsync_end = 320 + 6 + 6,
3850 .htotal = 320 + 6 + 6 + 6,
3851 .vdisplay = 240,
3852 .vsync_start = 240 + 0,
3853 .vsync_end = 240 + 0 + 1,
3854 .vtotal = 240 + 0 + 1 + 0,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003855 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
3856 },
3857};
3858
3859static const struct panel_desc ti_nspire_classic_lcd_panel = {
3860 .modes = ti_nspire_classic_lcd_mode,
3861 .num_modes = 1,
3862 /* The grayscale panel has 8 bit for the color .. Y (black) */
3863 .bpc = 8,
3864 .size = {
3865 .width = 71,
3866 .height = 53,
3867 },
3868 /* This is the grayscale bus format */
3869 .bus_format = MEDIA_BUS_FMT_Y8_1X8,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003870 .bus_flags = DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02003871};
3872
Lucas Stach06e733e2017-10-18 19:22:40 +02003873static const struct drm_display_mode toshiba_lt089ac29000_mode = {
3874 .clock = 79500,
3875 .hdisplay = 1280,
3876 .hsync_start = 1280 + 192,
3877 .hsync_end = 1280 + 192 + 128,
3878 .htotal = 1280 + 192 + 128 + 64,
3879 .vdisplay = 768,
3880 .vsync_start = 768 + 20,
3881 .vsync_end = 768 + 20 + 7,
3882 .vtotal = 768 + 20 + 7 + 3,
Lucas Stach06e733e2017-10-18 19:22:40 +02003883};
3884
3885static const struct panel_desc toshiba_lt089ac29000 = {
3886 .modes = &toshiba_lt089ac29000_mode,
3887 .num_modes = 1,
3888 .size = {
3889 .width = 194,
3890 .height = 116,
3891 },
Boris Brezillon9781bd12020-01-28 14:55:13 +01003892 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
Laurent Pinchartc4715832020-06-30 02:33:19 +03003893 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003894 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Lucas Stach06e733e2017-10-18 19:22:40 +02003895};
3896
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303897static const struct drm_display_mode tpk_f07a_0102_mode = {
3898 .clock = 33260,
3899 .hdisplay = 800,
3900 .hsync_start = 800 + 40,
3901 .hsync_end = 800 + 40 + 128,
3902 .htotal = 800 + 40 + 128 + 88,
3903 .vdisplay = 480,
3904 .vsync_start = 480 + 10,
3905 .vsync_end = 480 + 10 + 2,
3906 .vtotal = 480 + 10 + 2 + 33,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303907};
3908
3909static const struct panel_desc tpk_f07a_0102 = {
3910 .modes = &tpk_f07a_0102_mode,
3911 .num_modes = 1,
3912 .size = {
3913 .width = 152,
3914 .height = 91,
3915 },
Laurent Pinchart88bc4172018-09-22 15:02:42 +03003916 .bus_flags = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303917};
3918
3919static const struct drm_display_mode tpk_f10a_0102_mode = {
3920 .clock = 45000,
3921 .hdisplay = 1024,
3922 .hsync_start = 1024 + 176,
3923 .hsync_end = 1024 + 176 + 5,
3924 .htotal = 1024 + 176 + 5 + 88,
3925 .vdisplay = 600,
3926 .vsync_start = 600 + 20,
3927 .vsync_end = 600 + 20 + 5,
3928 .vtotal = 600 + 20 + 5 + 25,
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05303929};
3930
3931static const struct panel_desc tpk_f10a_0102 = {
3932 .modes = &tpk_f10a_0102_mode,
3933 .num_modes = 1,
3934 .size = {
3935 .width = 223,
3936 .height = 125,
3937 },
3938};
3939
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01003940static const struct display_timing urt_umsh_8596md_timing = {
3941 .pixelclock = { 33260000, 33260000, 33260000 },
3942 .hactive = { 800, 800, 800 },
3943 .hfront_porch = { 41, 41, 41 },
3944 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
3945 .hsync_len = { 71, 128, 128 },
3946 .vactive = { 480, 480, 480 },
3947 .vfront_porch = { 10, 10, 10 },
3948 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
3949 .vsync_len = { 2, 2, 2 },
3950 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
3951 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
3952};
3953
3954static const struct panel_desc urt_umsh_8596md_lvds = {
3955 .timings = &urt_umsh_8596md_timing,
3956 .num_timings = 1,
3957 .bpc = 6,
3958 .size = {
3959 .width = 152,
3960 .height = 91,
3961 },
3962 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
Laurent Pinchart9a2654c2019-09-04 16:28:03 +03003963 .connector_type = DRM_MODE_CONNECTOR_LVDS,
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01003964};
3965
3966static const struct panel_desc urt_umsh_8596md_parallel = {
3967 .timings = &urt_umsh_8596md_timing,
3968 .num_timings = 1,
3969 .bpc = 6,
3970 .size = {
3971 .width = 152,
3972 .height = 91,
3973 },
3974 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
3975};
3976
Fabio Estevam04206182019-02-18 21:27:06 -03003977static const struct drm_display_mode vl050_8048nt_c01_mode = {
3978 .clock = 33333,
3979 .hdisplay = 800,
3980 .hsync_start = 800 + 210,
3981 .hsync_end = 800 + 210 + 20,
3982 .htotal = 800 + 210 + 20 + 46,
3983 .vdisplay = 480,
3984 .vsync_start = 480 + 22,
3985 .vsync_end = 480 + 22 + 10,
3986 .vtotal = 480 + 22 + 10 + 23,
Fabio Estevam04206182019-02-18 21:27:06 -03003987 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
3988};
3989
3990static const struct panel_desc vl050_8048nt_c01 = {
3991 .modes = &vl050_8048nt_c01_mode,
3992 .num_modes = 1,
3993 .bpc = 8,
3994 .size = {
3995 .width = 120,
3996 .height = 76,
3997 },
3998 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
Sam Ravnborgf5436f72020-06-30 20:05:43 +02003999 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE,
Fabio Estevam04206182019-02-18 21:27:06 -03004000};
4001
Richard Genoude4bac402017-03-27 12:33:23 +02004002static const struct drm_display_mode winstar_wf35ltiacd_mode = {
4003 .clock = 6410,
4004 .hdisplay = 320,
4005 .hsync_start = 320 + 20,
4006 .hsync_end = 320 + 20 + 30,
4007 .htotal = 320 + 20 + 30 + 38,
4008 .vdisplay = 240,
4009 .vsync_start = 240 + 4,
4010 .vsync_end = 240 + 4 + 3,
4011 .vtotal = 240 + 4 + 3 + 15,
Richard Genoude4bac402017-03-27 12:33:23 +02004012 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4013};
4014
4015static const struct panel_desc winstar_wf35ltiacd = {
4016 .modes = &winstar_wf35ltiacd_mode,
4017 .num_modes = 1,
4018 .bpc = 8,
4019 .size = {
4020 .width = 70,
4021 .height = 53,
4022 },
4023 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
4024};
4025
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05304026static const struct drm_display_mode yes_optoelectronics_ytc700tlag_05_201c_mode = {
4027 .clock = 51200,
4028 .hdisplay = 1024,
4029 .hsync_start = 1024 + 100,
4030 .hsync_end = 1024 + 100 + 100,
4031 .htotal = 1024 + 100 + 100 + 120,
4032 .vdisplay = 600,
4033 .vsync_start = 600 + 10,
4034 .vsync_end = 600 + 10 + 10,
4035 .vtotal = 600 + 10 + 10 + 15,
4036 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
4037};
4038
4039static const struct panel_desc yes_optoelectronics_ytc700tlag_05_201c = {
4040 .modes = &yes_optoelectronics_ytc700tlag_05_201c_mode,
4041 .num_modes = 1,
4042 .bpc = 6,
4043 .size = {
4044 .width = 154,
4045 .height = 90,
4046 },
4047 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
4048 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
4049 .connector_type = DRM_MODE_CONNECTOR_LVDS,
4050};
4051
Linus Walleijfcec4162018-10-26 13:13:34 +02004052static const struct drm_display_mode arm_rtsm_mode[] = {
4053 {
4054 .clock = 65000,
4055 .hdisplay = 1024,
4056 .hsync_start = 1024 + 24,
4057 .hsync_end = 1024 + 24 + 136,
4058 .htotal = 1024 + 24 + 136 + 160,
4059 .vdisplay = 768,
4060 .vsync_start = 768 + 3,
4061 .vsync_end = 768 + 3 + 6,
4062 .vtotal = 768 + 3 + 6 + 29,
Linus Walleijfcec4162018-10-26 13:13:34 +02004063 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4064 },
4065};
4066
4067static const struct panel_desc arm_rtsm = {
4068 .modes = arm_rtsm_mode,
4069 .num_modes = 1,
4070 .bpc = 8,
4071 .size = {
4072 .width = 400,
4073 .height = 300,
4074 },
4075 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
4076};
4077
Thierry Reding280921d2013-08-30 15:10:14 +02004078static const struct of_device_id platform_of_match[] = {
4079 {
Jagan Tekibca684e2020-08-29 22:03:28 +05304080 .compatible = "ampire,am-1280800n3tzqw-t00h",
4081 .data = &ampire_am_1280800n3tzqw_t00h,
4082 }, {
Yannick Fertre966fea72017-03-28 11:44:49 +02004083 .compatible = "ampire,am-480272h3tmqw-t01h",
4084 .data = &ampire_am_480272h3tmqw_t01h,
4085 }, {
Philipp Zabel1c550fa12015-02-11 18:50:09 +01004086 .compatible = "ampire,am800480r3tmqwa1h",
4087 .data = &ampire_am800480r3tmqwa1h,
4088 }, {
Linus Walleijfcec4162018-10-26 13:13:34 +02004089 .compatible = "arm,rtsm-display",
4090 .data = &arm_rtsm,
4091 }, {
Sébastien Szymanskic479450f2019-05-07 17:27:12 +02004092 .compatible = "armadeus,st0700-adapt",
4093 .data = &armadeus_st0700_adapt,
4094 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004095 .compatible = "auo,b101aw03",
4096 .data = &auo_b101aw03,
4097 }, {
Huang Lina531bc32015-02-28 10:18:58 +08004098 .compatible = "auo,b101ean01",
4099 .data = &auo_b101ean01,
4100 }, {
Rob Clarkdac746e2014-08-01 17:01:06 -04004101 .compatible = "auo,b101xtn01",
4102 .data = &auo_b101xtn01,
4103 }, {
Rob Clarkda4582862020-01-08 15:53:56 -08004104 .compatible = "auo,b116xa01",
4105 .data = &auo_b116xak01,
4106 }, {
Ajay Kumare35e3052014-09-01 15:40:02 +05304107 .compatible = "auo,b116xw03",
4108 .data = &auo_b116xw03,
4109 }, {
Ajay Kumar3e51d602014-07-31 23:12:12 +05304110 .compatible = "auo,b133htn01",
4111 .data = &auo_b133htn01,
4112 }, {
Stéphane Marchesina333f7a2014-05-23 19:27:59 -07004113 .compatible = "auo,b133xtn01",
4114 .data = &auo_b133xtn01,
4115 }, {
Lukasz Majewskibccfaff2018-05-14 21:08:49 +02004116 .compatible = "auo,g070vvn01",
4117 .data = &auo_g070vvn01,
4118 }, {
Alex Gonzalez4fb86402018-10-25 17:09:30 +02004119 .compatible = "auo,g101evn010",
4120 .data = &auo_g101evn010,
4121 }, {
Christoph Fritz4451c282017-12-16 14:13:36 +01004122 .compatible = "auo,g104sn02",
4123 .data = &auo_g104sn02,
4124 }, {
Sebastian Reichel03e909a2020-04-15 19:27:25 +02004125 .compatible = "auo,g121ean01",
4126 .data = &auo_g121ean01,
4127 }, {
Lucas Stach697035c2016-11-30 14:09:55 +01004128 .compatible = "auo,g133han01",
4129 .data = &auo_g133han01,
4130 }, {
Sebastian Reicheld9ccd1f2020-04-15 19:27:24 +02004131 .compatible = "auo,g156xtn01",
4132 .data = &auo_g156xtn01,
4133 }, {
Lucas Stach8c31f602016-11-30 14:09:56 +01004134 .compatible = "auo,g185han01",
4135 .data = &auo_g185han01,
4136 }, {
Sebastian Reichel2f7b8322020-04-15 19:27:23 +02004137 .compatible = "auo,g190ean01",
4138 .data = &auo_g190ean01,
4139 }, {
Lucas Stach70c0d5b2017-06-08 20:07:58 +02004140 .compatible = "auo,p320hvn03",
4141 .data = &auo_p320hvn03,
4142 }, {
Haixia Shi7ee933a2016-10-11 14:59:16 -07004143 .compatible = "auo,t215hvn01",
4144 .data = &auo_t215hvn01,
4145 }, {
Philipp Zabeld47df632014-12-18 16:43:43 +01004146 .compatible = "avic,tm070ddh03",
4147 .data = &avic_tm070ddh03,
4148 }, {
Chen-Yu Tsai7ad8b412018-09-07 12:19:46 +08004149 .compatible = "bananapi,s070wv20-ct16",
4150 .data = &bananapi_s070wv20_ct16,
4151 }, {
Andrzej Hajdaae8cf412018-06-19 10:19:26 +02004152 .compatible = "boe,hv070wsa-100",
4153 .data = &boe_hv070wsa
4154 }, {
Caesar Wangcac1a412016-12-14 11:19:56 +08004155 .compatible = "boe,nv101wxmn51",
4156 .data = &boe_nv101wxmn51,
4157 }, {
Douglas Andersona96ee0f2020-11-09 17:00:58 -08004158 .compatible = "boe,nv110wtm-n61",
4159 .data = &boe_nv110wtm_n61,
4160 }, {
Bjorn Anderssonb0c664c2020-04-20 14:57:42 -07004161 .compatible = "boe,nv133fhm-n61",
4162 .data = &boe_nv133fhm_n61,
4163 }, {
Douglas Andersoncfe40d02020-05-08 15:59:02 -07004164 .compatible = "boe,nv133fhm-n62",
4165 .data = &boe_nv133fhm_n61,
4166 }, {
Tobias Schramma5119812020-01-09 12:29:52 +01004167 .compatible = "boe,nv140fhmn49",
4168 .data = &boe_nv140fhmn49,
4169 }, {
Giulio Benettie58edce2018-07-31 01:11:16 +02004170 .compatible = "cdtech,s043wq26h-ct7",
4171 .data = &cdtech_s043wq26h_ct7,
4172 }, {
Michael Krummsdorf0e3b67f2020-06-12 09:22:18 +02004173 .compatible = "cdtech,s070pws19hp-fc21",
4174 .data = &cdtech_s070pws19hp_fc21,
4175 }, {
4176 .compatible = "cdtech,s070swv29hg-dc44",
4177 .data = &cdtech_s070swv29hg_dc44,
4178 }, {
Giulio Benetti982f9442018-07-31 01:11:14 +02004179 .compatible = "cdtech,s070wv95-ct16",
4180 .data = &cdtech_s070wv95_ct16,
4181 }, {
Marek Vasut07c913c2020-07-28 22:12:42 +02004182 .compatible = "chefree,ch101olhlwh-002",
4183 .data = &chefree_ch101olhlwh_002,
4184 }, {
Randy Li2cb35c82016-09-20 03:02:51 +08004185 .compatible = "chunghwa,claa070wp03xg",
4186 .data = &chunghwa_claa070wp03xg,
4187 }, {
Stephen Warren4c930752014-01-07 16:46:26 -07004188 .compatible = "chunghwa,claa101wa01a",
4189 .data = &chunghwa_claa101wa01a
4190 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004191 .compatible = "chunghwa,claa101wb01",
4192 .data = &chunghwa_claa101wb01
4193 }, {
Michal Vokáč97ceb1f2018-06-25 14:41:30 +02004194 .compatible = "dataimage,scf0700c48ggu18",
4195 .data = &dataimage_scf0700c48ggu18,
4196 }, {
Philipp Zabel0ca0c822018-05-23 11:25:04 +02004197 .compatible = "dlc,dlc0700yzg-1",
4198 .data = &dlc_dlc0700yzg_1,
4199 }, {
Marco Felsch6cbe7cd2018-09-24 17:26:10 +02004200 .compatible = "dlc,dlc1010gig",
4201 .data = &dlc_dlc1010gig,
4202 }, {
Andreas Pretzschc2d24af2019-04-16 12:16:30 +02004203 .compatible = "edt,et035012dm6",
4204 .data = &edt_et035012dm6,
4205 }, {
Marian-Cristian Rotariu82d57a52020-01-30 12:08:38 +00004206 .compatible = "edt,etm043080dh6gp",
4207 .data = &edt_etm043080dh6gp,
4208 }, {
Marek Vasutfd819bf2019-02-19 15:04:38 +01004209 .compatible = "edt,etm0430g0dh6",
4210 .data = &edt_etm0430g0dh6,
4211 }, {
Stefan Agner26ab0062014-05-15 11:38:45 +02004212 .compatible = "edt,et057090dhu",
4213 .data = &edt_et057090dhu,
4214 }, {
Philipp Zabelfff5de42014-05-15 12:25:47 +02004215 .compatible = "edt,et070080dh6",
4216 .data = &edt_etm0700g0dh6,
4217 }, {
4218 .compatible = "edt,etm0700g0dh6",
4219 .data = &edt_etm0700g0dh6,
4220 }, {
Jan Tuerkaa7e6452018-06-19 11:55:44 +02004221 .compatible = "edt,etm0700g0bdh6",
4222 .data = &edt_etm0700g0bdh6,
4223 }, {
Jan Tuerkaad34de2018-06-19 11:55:45 +02004224 .compatible = "edt,etm0700g0edh6",
4225 .data = &edt_etm0700g0bdh6,
4226 }, {
Marco Felsch9158e3c2019-04-16 12:06:45 +02004227 .compatible = "evervision,vgg804821",
4228 .data = &evervision_vgg804821,
4229 }, {
Boris BREZILLON102932b2014-06-05 15:53:32 +02004230 .compatible = "foxlink,fl500wvr00-a0t",
4231 .data = &foxlink_fl500wvr00_a0t,
4232 }, {
Paul Cercueil7b6bd842020-01-13 13:17:41 -03004233 .compatible = "frida,frd350h54004",
4234 .data = &frida_frd350h54004,
4235 }, {
Jagan Teki3be20712019-05-07 18:37:07 +05304236 .compatible = "friendlyarm,hd702e",
4237 .data = &friendlyarm_hd702e,
4238 }, {
Philipp Zabeld435a2a2014-11-19 10:29:55 +01004239 .compatible = "giantplus,gpg482739qs5",
4240 .data = &giantplus_gpg482739qs5
4241 }, {
Paul Cercueil2c6574a2019-06-06 00:22:47 +02004242 .compatible = "giantplus,gpm940b0",
4243 .data = &giantplus_gpm940b0,
4244 }, {
Philipp Zabela8532052014-10-23 16:31:06 +02004245 .compatible = "hannstar,hsd070pww1",
4246 .data = &hannstar_hsd070pww1,
4247 }, {
Eric Nelsonc0d607e2015-04-13 15:09:26 -07004248 .compatible = "hannstar,hsd100pxn1",
4249 .data = &hannstar_hsd100pxn1,
4250 }, {
Lucas Stach61ac0bf2014-11-06 17:44:35 +01004251 .compatible = "hit,tx23d38vm0caa",
4252 .data = &hitachi_tx23d38vm0caa
4253 }, {
Nicolas Ferre41bcceb2015-03-19 14:43:01 +01004254 .compatible = "innolux,at043tn24",
4255 .data = &innolux_at043tn24,
4256 }, {
Riccardo Bortolato4fc24ab2016-04-20 15:37:15 +02004257 .compatible = "innolux,at070tn92",
4258 .data = &innolux_at070tn92,
4259 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02004260 .compatible = "innolux,g070y2-l01",
4261 .data = &innolux_g070y2_l01,
4262 }, {
4263 .compatible = "innolux,g101ice-l01",
Michael Olbrich1e29b842016-08-15 14:32:02 +02004264 .data = &innolux_g101ice_l01
4265 }, {
Christoph Fritza5d2ade2018-06-04 13:16:48 +02004266 .compatible = "innolux,g121i1-l01",
Lucas Stachd731f662014-11-06 17:44:33 +01004267 .data = &innolux_g121i1_l01
4268 }, {
Akshay Bhatf8fa17b2015-11-18 15:57:47 -05004269 .compatible = "innolux,g121x1-l03",
4270 .data = &innolux_g121x1_l03,
4271 }, {
Thierry Reding0a2288c2014-07-03 14:02:59 +02004272 .compatible = "innolux,n116bge",
4273 .data = &innolux_n116bge,
4274 }, {
Lukas F. Hartmanna14c6b02020-11-24 18:26:04 +01004275 .compatible = "innolux,n125hce-gn1",
4276 .data = &innolux_n125hce_gn1,
4277 }, {
Alban Bedelea447392014-07-22 08:38:55 +02004278 .compatible = "innolux,n156bge-l21",
4279 .data = &innolux_n156bge_l21,
4280 }, {
Douglas Anderson8f054b62018-10-25 15:21:34 -07004281 .compatible = "innolux,p120zdg-bf1",
4282 .data = &innolux_p120zdg_bf1,
spanda@codeaurora.orgda50bd42018-05-15 11:22:43 +05304283 }, {
Michael Grzeschikbccac3f2015-03-19 12:22:44 +01004284 .compatible = "innolux,zj070na-01p",
4285 .data = &innolux_zj070na_01p,
4286 }, {
Bjorn Anderssone1ca5182020-04-20 14:57:28 -07004287 .compatible = "ivo,m133nwf4-r0",
4288 .data = &ivo_m133nwf4_r0,
4289 }, {
Douglas Andersonfc26a372020-08-21 08:35:15 -07004290 .compatible = "kingdisplay,kd116n21-30nv-a010",
4291 .data = &kingdisplay_kd116n21_30nv_a010,
4292 }, {
Lukasz Majewski14bf60c2019-05-15 18:06:12 +02004293 .compatible = "koe,tx14d24vm1bpa",
4294 .data = &koe_tx14d24vm1bpa,
4295 }, {
Liu Ying8a070522020-06-01 14:11:20 +08004296 .compatible = "koe,tx26d202vm0bwa",
4297 .data = &koe_tx26d202vm0bwa,
4298 }, {
Jagan Teki8cfe8342018-02-04 23:19:28 +05304299 .compatible = "koe,tx31d200vm0baa",
4300 .data = &koe_tx31d200vm0baa,
4301 }, {
Lucas Stach8def22e2015-12-02 19:41:11 +01004302 .compatible = "kyo,tcg121xglp",
4303 .data = &kyo_tcg121xglp,
4304 }, {
Paul Kocialkowski27abdd82018-11-07 19:18:41 +01004305 .compatible = "lemaker,bl035-rgb-002",
4306 .data = &lemaker_bl035_rgb_002,
4307 }, {
Heiko Schocherdd015002015-05-22 10:25:57 +02004308 .compatible = "lg,lb070wv8",
4309 .data = &lg_lb070wv8,
4310 }, {
Yakir Yangc5ece402016-06-28 12:51:15 +08004311 .compatible = "lg,lp079qx1-sp0v",
4312 .data = &lg_lp079qx1_sp0v,
4313 }, {
Yakir Yang0355dde2016-06-12 10:56:02 +08004314 .compatible = "lg,lp097qx1-spa1",
4315 .data = &lg_lp097qx1_spa1,
4316 }, {
Jitao Shi690d8fa2016-02-22 19:01:44 +08004317 .compatible = "lg,lp120up1",
4318 .data = &lg_lp120up1,
4319 }, {
Thierry Redingec7c5652013-11-15 15:59:32 +01004320 .compatible = "lg,lp129qe",
4321 .data = &lg_lp129qe,
4322 }, {
Adam Ford0d354082019-10-16 08:51:45 -05004323 .compatible = "logicpd,type28",
4324 .data = &logicpd_type_28,
4325 }, {
Marcel Ziswiler5728fe72020-01-20 09:01:00 +01004326 .compatible = "logictechno,lt161010-2nhc",
4327 .data = &logictechno_lt161010_2nh,
4328 }, {
4329 .compatible = "logictechno,lt161010-2nhr",
4330 .data = &logictechno_lt161010_2nh,
4331 }, {
4332 .compatible = "logictechno,lt170410-2whc",
4333 .data = &logictechno_lt170410_2whc,
4334 }, {
Lukasz Majewski65c766c2017-10-21 00:18:37 +02004335 .compatible = "mitsubishi,aa070mc01-ca1",
4336 .data = &mitsubishi_aa070mc01,
4337 }, {
Lucas Stach01bacc132017-06-08 20:07:55 +02004338 .compatible = "nec,nl12880bc20-05",
4339 .data = &nec_nl12880bc20_05,
4340 }, {
jianwei wangc6e87f92015-07-29 16:30:02 +08004341 .compatible = "nec,nl4827hc19-05b",
4342 .data = &nec_nl4827hc19_05b,
4343 }, {
Maxime Riparde6c2f062016-09-06 16:46:17 +02004344 .compatible = "netron-dy,e231732",
4345 .data = &netron_dy_e231732,
4346 }, {
Vasily Khoruzhick258145e2020-02-26 00:10:10 -08004347 .compatible = "neweast,wjfh116008a",
4348 .data = &neweast_wjfh116008a,
4349 }, {
Tomi Valkeinen3b39ad72018-06-18 16:22:40 +03004350 .compatible = "newhaven,nhd-4.3-480272ef-atxl",
4351 .data = &newhaven_nhd_43_480272ef_atxl,
4352 }, {
Lucas Stach4177fa62017-06-08 20:07:57 +02004353 .compatible = "nlt,nl192108ac18-02d",
4354 .data = &nlt_nl192108ac18_02d,
4355 }, {
Fabien Lahoudere05ec0e42016-10-17 11:38:01 +02004356 .compatible = "nvd,9128",
4357 .data = &nvd_9128,
4358 }, {
Gary Bissona99fb622015-06-10 18:44:23 +02004359 .compatible = "okaya,rs800480t-7x0gp",
4360 .data = &okaya_rs800480t_7x0gp,
4361 }, {
Maxime Ripardcf5c9e62016-03-23 17:38:34 +01004362 .compatible = "olimex,lcd-olinuxino-43-ts",
4363 .data = &olimex_lcd_olinuxino_43ts,
4364 }, {
Eric Anholte8b6f562016-03-24 17:23:48 -07004365 .compatible = "ontat,yx700wv03",
4366 .data = &ontat_yx700wv03,
4367 }, {
H. Nikolaus Schaller9c31dcb2019-06-07 13:11:08 +02004368 .compatible = "ortustech,com37h3m05dtc",
4369 .data = &ortustech_com37h3m,
4370 }, {
4371 .compatible = "ortustech,com37h3m99dtc",
4372 .data = &ortustech_com37h3m,
4373 }, {
Philipp Zabel725c9d42015-02-11 18:50:11 +01004374 .compatible = "ortustech,com43h4m85ulc",
4375 .data = &ortustech_com43h4m85ulc,
4376 }, {
Laurent Pinchart163f7a32018-12-07 22:13:44 +02004377 .compatible = "osddisplays,osd070t1718-19ts",
4378 .data = &osddisplays_osd070t1718_19ts,
4379 }, {
Eugen Hristev4ba3e562019-01-14 09:43:31 +00004380 .compatible = "pda,91-00156-a0",
4381 .data = &pda_91_00156_a0,
4382 }, {
Marek Vasutd69de692020-07-28 14:12:46 +02004383 .compatible = "powertip,ph800480t013-idf02",
4384 .data = &powertip_ph800480t013_idf02,
4385 }, {
Josh Wud2a6f0f2015-10-08 17:42:41 +02004386 .compatible = "qiaodian,qd43003c0-40",
4387 .data = &qd43003c0_40,
4388 }, {
Jagan Teki23167fa2018-06-07 19:16:48 +05304389 .compatible = "rocktech,rk070er9427",
4390 .data = &rocktech_rk070er9427,
4391 }, {
Jyri Sarhaf3050472020-02-11 14:17:18 +02004392 .compatible = "rocktech,rk101ii01d-ct",
4393 .data = &rocktech_rk101ii01d_ct,
4394 }, {
Yakir Yang0330eaf2016-06-12 10:56:13 +08004395 .compatible = "samsung,lsn122dl01-c01",
4396 .data = &samsung_lsn122dl01_c01,
4397 }, {
Marc Dietrich6d54e3d2013-12-21 21:38:12 +01004398 .compatible = "samsung,ltn101nt05",
4399 .data = &samsung_ltn101nt05,
4400 }, {
Stéphane Marchesin0c934302015-03-18 10:52:18 +01004401 .compatible = "samsung,ltn140at29-301",
4402 .data = &samsung_ltn140at29_301,
4403 }, {
Miquel Raynal44c58c52020-01-09 19:40:37 +01004404 .compatible = "satoz,sat050at40h12r2",
4405 .data = &satoz_sat050at40h12r2,
4406 }, {
Jeffrey Hugocd5e1cb2019-07-08 09:58:11 -07004407 .compatible = "sharp,ld-d5116z01b",
4408 .data = &sharp_ld_d5116z01b,
4409 }, {
Vladimir Zapolskiy03e3ec92018-07-06 21:51:01 +03004410 .compatible = "sharp,lq035q7db03",
4411 .data = &sharp_lq035q7db03,
4412 }, {
H. Nikolaus Schallerdda0e4b2019-06-07 13:11:07 +02004413 .compatible = "sharp,lq070y3dg3b",
4414 .data = &sharp_lq070y3dg3b,
4415 }, {
Joshua Clayton592aa022016-07-06 15:59:16 -07004416 .compatible = "sharp,lq101k1ly04",
4417 .data = &sharp_lq101k1ly04,
4418 }, {
Yakir Yang739c7de2016-06-12 10:56:35 +08004419 .compatible = "sharp,lq123p1jx31",
4420 .data = &sharp_lq123p1jx31,
4421 }, {
Paul Cercueilf1bd37f2019-06-03 17:31:20 +02004422 .compatible = "sharp,ls020b1dd01d",
4423 .data = &sharp_ls020b1dd01d,
4424 }, {
Boris BREZILLON9c6615b2015-03-19 14:43:00 +01004425 .compatible = "shelly,sca07010-bfn-lnn",
4426 .data = &shelly_sca07010_bfn_lnn,
4427 }, {
Pascal Roeleven105235e2020-03-20 12:21:33 +01004428 .compatible = "starry,kr070pe2t",
4429 .data = &starry_kr070pe2t,
4430 }, {
Douglas Anderson9bb34c42016-06-10 10:02:07 -07004431 .compatible = "starry,kr122ea0sra",
4432 .data = &starry_kr122ea0sra,
4433 }, {
Jyri Sarha42161532019-03-22 10:33:36 +02004434 .compatible = "tfc,s9700rtwv43tr-01b",
4435 .data = &tfc_s9700rtwv43tr_01b,
4436 }, {
Gary Bissonadb973e2016-12-02 09:52:08 +01004437 .compatible = "tianma,tm070jdhg30",
4438 .data = &tianma_tm070jdhg30,
4439 }, {
Max Merchelb3bfcdf2020-06-12 09:22:19 +02004440 .compatible = "tianma,tm070jvhg33",
4441 .data = &tianma_tm070jvhg33,
4442 }, {
Lukasz Majewski870a0b12017-11-07 16:30:58 +01004443 .compatible = "tianma,tm070rvhg71",
4444 .data = &tianma_tm070rvhg71,
4445 }, {
Linus Walleijd8a0d6a2019-08-05 10:58:46 +02004446 .compatible = "ti,nspire-cx-lcd-panel",
4447 .data = &ti_nspire_cx_lcd_panel,
4448 }, {
4449 .compatible = "ti,nspire-classic-lcd-panel",
4450 .data = &ti_nspire_classic_lcd_panel,
4451 }, {
Lucas Stach06e733e2017-10-18 19:22:40 +02004452 .compatible = "toshiba,lt089ac29000",
4453 .data = &toshiba_lt089ac29000,
4454 }, {
Bhuvanchandra DV227e4f42016-05-05 11:47:07 +05304455 .compatible = "tpk,f07a-0102",
4456 .data = &tpk_f07a_0102,
4457 }, {
4458 .compatible = "tpk,f10a-0102",
4459 .data = &tpk_f10a_0102,
4460 }, {
Maciej S. Szmigiero06a9dc62016-02-13 22:52:03 +01004461 .compatible = "urt,umsh-8596md-t",
4462 .data = &urt_umsh_8596md_parallel,
4463 }, {
4464 .compatible = "urt,umsh-8596md-1t",
4465 .data = &urt_umsh_8596md_parallel,
4466 }, {
4467 .compatible = "urt,umsh-8596md-7t",
4468 .data = &urt_umsh_8596md_parallel,
4469 }, {
4470 .compatible = "urt,umsh-8596md-11t",
4471 .data = &urt_umsh_8596md_lvds,
4472 }, {
4473 .compatible = "urt,umsh-8596md-19t",
4474 .data = &urt_umsh_8596md_lvds,
4475 }, {
4476 .compatible = "urt,umsh-8596md-20t",
4477 .data = &urt_umsh_8596md_parallel,
4478 }, {
Fabio Estevam04206182019-02-18 21:27:06 -03004479 .compatible = "vxt,vl050-8048nt-c01",
4480 .data = &vl050_8048nt_c01,
4481 }, {
Richard Genoude4bac402017-03-27 12:33:23 +02004482 .compatible = "winstar,wf35ltiacd",
4483 .data = &winstar_wf35ltiacd,
4484 }, {
Jagan Teki7a1f4fa2020-09-04 23:38:21 +05304485 .compatible = "yes-optoelectronics,ytc700tlag-05-201c",
4486 .data = &yes_optoelectronics_ytc700tlag_05_201c,
4487 }, {
Sam Ravnborg4a1d0db2020-02-16 19:15:13 +01004488 /* Must be the last entry */
4489 .compatible = "panel-dpi",
4490 .data = &panel_dpi,
4491 }, {
Thierry Reding280921d2013-08-30 15:10:14 +02004492 /* sentinel */
4493 }
4494};
4495MODULE_DEVICE_TABLE(of, platform_of_match);
4496
4497static int panel_simple_platform_probe(struct platform_device *pdev)
4498{
4499 const struct of_device_id *id;
4500
4501 id = of_match_node(platform_of_match, pdev->dev.of_node);
4502 if (!id)
4503 return -ENODEV;
4504
4505 return panel_simple_probe(&pdev->dev, id->data);
4506}
4507
4508static int panel_simple_platform_remove(struct platform_device *pdev)
4509{
4510 return panel_simple_remove(&pdev->dev);
4511}
4512
Thierry Redingd02fd932014-04-29 17:21:21 +02004513static void panel_simple_platform_shutdown(struct platform_device *pdev)
4514{
4515 panel_simple_shutdown(&pdev->dev);
4516}
4517
Thierry Reding280921d2013-08-30 15:10:14 +02004518static struct platform_driver panel_simple_platform_driver = {
4519 .driver = {
4520 .name = "panel-simple",
Thierry Reding280921d2013-08-30 15:10:14 +02004521 .of_match_table = platform_of_match,
4522 },
4523 .probe = panel_simple_platform_probe,
4524 .remove = panel_simple_platform_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004525 .shutdown = panel_simple_platform_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004526};
4527
Thierry Reding210fcd92013-11-22 19:27:11 +01004528struct panel_desc_dsi {
4529 struct panel_desc desc;
4530
Thierry Reding462658b2014-03-14 11:24:57 +01004531 unsigned long flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004532 enum mipi_dsi_pixel_format format;
4533 unsigned int lanes;
4534};
4535
Thierry Redingd718d792015-04-08 16:52:33 +02004536static const struct drm_display_mode auo_b080uan01_mode = {
4537 .clock = 154500,
4538 .hdisplay = 1200,
4539 .hsync_start = 1200 + 62,
4540 .hsync_end = 1200 + 62 + 4,
4541 .htotal = 1200 + 62 + 4 + 62,
4542 .vdisplay = 1920,
4543 .vsync_start = 1920 + 9,
4544 .vsync_end = 1920 + 9 + 2,
4545 .vtotal = 1920 + 9 + 2 + 8,
Thierry Redingd718d792015-04-08 16:52:33 +02004546};
4547
4548static const struct panel_desc_dsi auo_b080uan01 = {
4549 .desc = {
4550 .modes = &auo_b080uan01_mode,
4551 .num_modes = 1,
4552 .bpc = 8,
4553 .size = {
4554 .width = 108,
4555 .height = 272,
4556 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004557 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Redingd718d792015-04-08 16:52:33 +02004558 },
4559 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
4560 .format = MIPI_DSI_FMT_RGB888,
4561 .lanes = 4,
4562};
4563
Chris Zhongc8521962015-11-20 16:15:37 +08004564static const struct drm_display_mode boe_tv080wum_nl0_mode = {
4565 .clock = 160000,
4566 .hdisplay = 1200,
4567 .hsync_start = 1200 + 120,
4568 .hsync_end = 1200 + 120 + 20,
4569 .htotal = 1200 + 120 + 20 + 21,
4570 .vdisplay = 1920,
4571 .vsync_start = 1920 + 21,
4572 .vsync_end = 1920 + 21 + 3,
4573 .vtotal = 1920 + 21 + 3 + 18,
Chris Zhongc8521962015-11-20 16:15:37 +08004574 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
4575};
4576
4577static const struct panel_desc_dsi boe_tv080wum_nl0 = {
4578 .desc = {
4579 .modes = &boe_tv080wum_nl0_mode,
4580 .num_modes = 1,
4581 .size = {
4582 .width = 107,
4583 .height = 172,
4584 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004585 .connector_type = DRM_MODE_CONNECTOR_DSI,
Chris Zhongc8521962015-11-20 16:15:37 +08004586 },
4587 .flags = MIPI_DSI_MODE_VIDEO |
4588 MIPI_DSI_MODE_VIDEO_BURST |
4589 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
4590 .format = MIPI_DSI_FMT_RGB888,
4591 .lanes = 4,
4592};
4593
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004594static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
4595 .clock = 71000,
4596 .hdisplay = 800,
4597 .hsync_start = 800 + 32,
4598 .hsync_end = 800 + 32 + 1,
4599 .htotal = 800 + 32 + 1 + 57,
4600 .vdisplay = 1280,
4601 .vsync_start = 1280 + 28,
4602 .vsync_end = 1280 + 28 + 1,
4603 .vtotal = 1280 + 28 + 1 + 14,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004604};
4605
4606static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
4607 .desc = {
4608 .modes = &lg_ld070wx3_sl01_mode,
4609 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004610 .bpc = 8,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004611 .size = {
4612 .width = 94,
4613 .height = 151,
4614 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004615 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004616 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004617 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004618 .format = MIPI_DSI_FMT_RGB888,
4619 .lanes = 4,
4620};
4621
Alexandre Courbot499ce852014-01-21 18:57:09 +09004622static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
4623 .clock = 67000,
4624 .hdisplay = 720,
4625 .hsync_start = 720 + 12,
4626 .hsync_end = 720 + 12 + 4,
4627 .htotal = 720 + 12 + 4 + 112,
4628 .vdisplay = 1280,
4629 .vsync_start = 1280 + 8,
4630 .vsync_end = 1280 + 8 + 4,
4631 .vtotal = 1280 + 8 + 4 + 12,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004632};
4633
4634static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
4635 .desc = {
4636 .modes = &lg_lh500wx1_sd03_mode,
4637 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004638 .bpc = 8,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004639 .size = {
4640 .width = 62,
4641 .height = 110,
4642 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004643 .connector_type = DRM_MODE_CONNECTOR_DSI,
Alexandre Courbot499ce852014-01-21 18:57:09 +09004644 },
4645 .flags = MIPI_DSI_MODE_VIDEO,
4646 .format = MIPI_DSI_FMT_RGB888,
4647 .lanes = 4,
4648};
4649
Thierry Reding280921d2013-08-30 15:10:14 +02004650static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
4651 .clock = 157200,
4652 .hdisplay = 1920,
4653 .hsync_start = 1920 + 154,
4654 .hsync_end = 1920 + 154 + 16,
4655 .htotal = 1920 + 154 + 16 + 32,
4656 .vdisplay = 1200,
4657 .vsync_start = 1200 + 17,
4658 .vsync_end = 1200 + 17 + 2,
4659 .vtotal = 1200 + 17 + 2 + 16,
Thierry Reding280921d2013-08-30 15:10:14 +02004660};
4661
Thierry Reding210fcd92013-11-22 19:27:11 +01004662static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
4663 .desc = {
4664 .modes = &panasonic_vvx10f004b00_mode,
4665 .num_modes = 1,
Thierry Redingd7a839c2014-11-06 10:11:01 +01004666 .bpc = 8,
Thierry Reding210fcd92013-11-22 19:27:11 +01004667 .size = {
4668 .width = 217,
4669 .height = 136,
4670 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004671 .connector_type = DRM_MODE_CONNECTOR_DSI,
Thierry Reding280921d2013-08-30 15:10:14 +02004672 },
Alexandre Courbot5e4cc272014-07-08 21:32:12 +09004673 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
4674 MIPI_DSI_CLOCK_NON_CONTINUOUS,
Thierry Reding210fcd92013-11-22 19:27:11 +01004675 .format = MIPI_DSI_FMT_RGB888,
4676 .lanes = 4,
4677};
4678
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004679static const struct drm_display_mode lg_acx467akm_7_mode = {
4680 .clock = 150000,
4681 .hdisplay = 1080,
4682 .hsync_start = 1080 + 2,
4683 .hsync_end = 1080 + 2 + 2,
4684 .htotal = 1080 + 2 + 2 + 2,
4685 .vdisplay = 1920,
4686 .vsync_start = 1920 + 2,
4687 .vsync_end = 1920 + 2 + 2,
4688 .vtotal = 1920 + 2 + 2 + 2,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004689};
4690
4691static const struct panel_desc_dsi lg_acx467akm_7 = {
4692 .desc = {
4693 .modes = &lg_acx467akm_7_mode,
4694 .num_modes = 1,
4695 .bpc = 8,
4696 .size = {
4697 .width = 62,
4698 .height = 110,
4699 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004700 .connector_type = DRM_MODE_CONNECTOR_DSI,
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004701 },
4702 .flags = 0,
4703 .format = MIPI_DSI_FMT_RGB888,
4704 .lanes = 4,
4705};
4706
Peter Ujfalusi62967232019-02-26 09:55:21 +02004707static const struct drm_display_mode osd101t2045_53ts_mode = {
4708 .clock = 154500,
4709 .hdisplay = 1920,
4710 .hsync_start = 1920 + 112,
4711 .hsync_end = 1920 + 112 + 16,
4712 .htotal = 1920 + 112 + 16 + 32,
4713 .vdisplay = 1200,
4714 .vsync_start = 1200 + 16,
4715 .vsync_end = 1200 + 16 + 2,
4716 .vtotal = 1200 + 16 + 2 + 16,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004717 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
4718};
4719
4720static const struct panel_desc_dsi osd101t2045_53ts = {
4721 .desc = {
4722 .modes = &osd101t2045_53ts_mode,
4723 .num_modes = 1,
4724 .bpc = 8,
4725 .size = {
4726 .width = 217,
4727 .height = 136,
4728 },
Laurent Pinchartcb62cde2020-06-02 20:12:40 +03004729 .connector_type = DRM_MODE_CONNECTOR_DSI,
Peter Ujfalusi62967232019-02-26 09:55:21 +02004730 },
4731 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
4732 MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
4733 MIPI_DSI_MODE_EOT_PACKET,
4734 .format = MIPI_DSI_FMT_RGB888,
4735 .lanes = 4,
4736};
4737
Thierry Reding210fcd92013-11-22 19:27:11 +01004738static const struct of_device_id dsi_of_match[] = {
4739 {
Thierry Redingd718d792015-04-08 16:52:33 +02004740 .compatible = "auo,b080uan01",
4741 .data = &auo_b080uan01
4742 }, {
Chris Zhongc8521962015-11-20 16:15:37 +08004743 .compatible = "boe,tv080wum-nl0",
4744 .data = &boe_tv080wum_nl0
4745 }, {
Alexandre Courbot712ac1b2014-01-21 18:57:10 +09004746 .compatible = "lg,ld070wx3-sl01",
4747 .data = &lg_ld070wx3_sl01
4748 }, {
Alexandre Courbot499ce852014-01-21 18:57:09 +09004749 .compatible = "lg,lh500wx1-sd03",
4750 .data = &lg_lh500wx1_sd03
4751 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01004752 .compatible = "panasonic,vvx10f004b00",
4753 .data = &panasonic_vvx10f004b00
4754 }, {
Jonathan Marekdebcd8f2018-11-24 15:06:28 -05004755 .compatible = "lg,acx467akm-7",
4756 .data = &lg_acx467akm_7
4757 }, {
Peter Ujfalusi62967232019-02-26 09:55:21 +02004758 .compatible = "osddisplays,osd101t2045-53ts",
4759 .data = &osd101t2045_53ts
4760 }, {
Thierry Reding210fcd92013-11-22 19:27:11 +01004761 /* sentinel */
4762 }
4763};
4764MODULE_DEVICE_TABLE(of, dsi_of_match);
4765
4766static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
4767{
4768 const struct panel_desc_dsi *desc;
4769 const struct of_device_id *id;
4770 int err;
4771
4772 id = of_match_node(dsi_of_match, dsi->dev.of_node);
4773 if (!id)
4774 return -ENODEV;
4775
4776 desc = id->data;
4777
4778 err = panel_simple_probe(&dsi->dev, &desc->desc);
4779 if (err < 0)
4780 return err;
4781
Thierry Reding462658b2014-03-14 11:24:57 +01004782 dsi->mode_flags = desc->flags;
Thierry Reding210fcd92013-11-22 19:27:11 +01004783 dsi->format = desc->format;
4784 dsi->lanes = desc->lanes;
4785
Peter Ujfalusi7ad9db62019-02-26 10:11:53 +02004786 err = mipi_dsi_attach(dsi);
4787 if (err) {
4788 struct panel_simple *panel = dev_get_drvdata(&dsi->dev);
4789
4790 drm_panel_remove(&panel->base);
4791 }
4792
4793 return err;
Thierry Reding210fcd92013-11-22 19:27:11 +01004794}
4795
4796static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
4797{
4798 int err;
4799
4800 err = mipi_dsi_detach(dsi);
4801 if (err < 0)
4802 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
4803
4804 return panel_simple_remove(&dsi->dev);
4805}
4806
Thierry Redingd02fd932014-04-29 17:21:21 +02004807static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
4808{
4809 panel_simple_shutdown(&dsi->dev);
4810}
4811
Thierry Reding210fcd92013-11-22 19:27:11 +01004812static struct mipi_dsi_driver panel_simple_dsi_driver = {
4813 .driver = {
4814 .name = "panel-simple-dsi",
Thierry Reding210fcd92013-11-22 19:27:11 +01004815 .of_match_table = dsi_of_match,
4816 },
4817 .probe = panel_simple_dsi_probe,
4818 .remove = panel_simple_dsi_remove,
Thierry Redingd02fd932014-04-29 17:21:21 +02004819 .shutdown = panel_simple_dsi_shutdown,
Thierry Reding280921d2013-08-30 15:10:14 +02004820};
4821
4822static int __init panel_simple_init(void)
4823{
Thierry Reding210fcd92013-11-22 19:27:11 +01004824 int err;
4825
4826 err = platform_driver_register(&panel_simple_platform_driver);
4827 if (err < 0)
4828 return err;
4829
4830 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
4831 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
Qinglang Miaof2e66f22020-10-31 09:18:56 +08004832 if (err < 0) {
4833 platform_driver_unregister(&panel_simple_platform_driver);
Thierry Reding210fcd92013-11-22 19:27:11 +01004834 return err;
Qinglang Miaof2e66f22020-10-31 09:18:56 +08004835 }
Thierry Reding210fcd92013-11-22 19:27:11 +01004836 }
4837
4838 return 0;
Thierry Reding280921d2013-08-30 15:10:14 +02004839}
4840module_init(panel_simple_init);
4841
4842static void __exit panel_simple_exit(void)
4843{
Thierry Reding210fcd92013-11-22 19:27:11 +01004844 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
4845 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
4846
Thierry Reding280921d2013-08-30 15:10:14 +02004847 platform_driver_unregister(&panel_simple_platform_driver);
4848}
4849module_exit(panel_simple_exit);
4850
4851MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
4852MODULE_DESCRIPTION("DRM Driver for Simple Panels");
4853MODULE_LICENSE("GPL and additional rights");