2 * Copyright (C) 2013, NVIDIA Corporation. All rights reserved.
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:
11 * The above copyright notice and this permission notice (including the
12 * next paragraph) shall be included in all copies or substantial portions
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.
24 #include <linux/backlight.h>
25 #include <linux/gpio/consumer.h>
26 #include <linux/module.h>
27 #include <linux/of_platform.h>
28 #include <linux/platform_device.h>
29 #include <linux/regulator/consumer.h>
32 #include <drm/drm_crtc.h>
33 #include <drm/drm_mipi_dsi.h>
34 #include <drm/drm_panel.h>
36 #include <video/display_timing.h>
37 #include <video/videomode.h>
40 const struct drm_display_mode *modes;
41 unsigned int num_modes;
42 const struct display_timing *timings;
43 unsigned int num_timings;
48 * @width: width (in millimeters) of the panel's active display area
49 * @height: height (in millimeters) of the panel's active display area
57 * @prepare: the time (in milliseconds) that it takes for the panel to
58 * become ready and start receiving video data
59 * @enable: the time (in milliseconds) that it takes for the panel to
60 * display the first valid frame after starting to receive
62 * @disable: the time (in milliseconds) that it takes for the panel to
63 * turn the display off (no content is visible)
64 * @unprepare: the time (in milliseconds) that it takes for the panel
65 * to power itself down completely
71 unsigned int unprepare;
79 struct drm_panel base;
83 const struct panel_desc *desc;
85 struct backlight_device *backlight;
86 struct regulator *supply;
87 struct i2c_adapter *ddc;
89 struct gpio_desc *enable_gpio;
92 static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
94 return container_of(panel, struct panel_simple, base);
97 static int panel_simple_get_fixed_modes(struct panel_simple *panel)
99 struct drm_connector *connector = panel->base.connector;
100 struct drm_device *drm = panel->base.drm;
101 struct drm_display_mode *mode;
102 unsigned int i, num = 0;
107 for (i = 0; i < panel->desc->num_timings; i++) {
108 const struct display_timing *dt = &panel->desc->timings[i];
111 videomode_from_timing(dt, &vm);
112 mode = drm_mode_create(drm);
114 dev_err(drm->dev, "failed to add mode %ux%u\n",
115 dt->hactive.typ, dt->vactive.typ);
119 drm_display_mode_from_videomode(&vm, mode);
121 mode->type |= DRM_MODE_TYPE_DRIVER;
123 if (panel->desc->num_timings == 1)
124 mode->type |= DRM_MODE_TYPE_PREFERRED;
126 drm_mode_probed_add(connector, mode);
130 for (i = 0; i < panel->desc->num_modes; i++) {
131 const struct drm_display_mode *m = &panel->desc->modes[i];
133 mode = drm_mode_duplicate(drm, m);
135 dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
136 m->hdisplay, m->vdisplay, m->vrefresh);
140 mode->type |= DRM_MODE_TYPE_DRIVER;
142 if (panel->desc->num_modes == 1)
143 mode->type |= DRM_MODE_TYPE_PREFERRED;
145 drm_mode_set_name(mode);
147 drm_mode_probed_add(connector, mode);
151 connector->display_info.bpc = panel->desc->bpc;
152 connector->display_info.width_mm = panel->desc->size.width;
153 connector->display_info.height_mm = panel->desc->size.height;
154 if (panel->desc->bus_format)
155 drm_display_info_set_bus_formats(&connector->display_info,
156 &panel->desc->bus_format, 1);
157 connector->display_info.bus_flags = panel->desc->bus_flags;
162 static int panel_simple_disable(struct drm_panel *panel)
164 struct panel_simple *p = to_panel_simple(panel);
170 p->backlight->props.power = FB_BLANK_POWERDOWN;
171 p->backlight->props.state |= BL_CORE_FBBLANK;
172 backlight_update_status(p->backlight);
175 if (p->desc->delay.disable)
176 msleep(p->desc->delay.disable);
183 static int panel_simple_unprepare(struct drm_panel *panel)
185 struct panel_simple *p = to_panel_simple(panel);
190 gpiod_set_value_cansleep(p->enable_gpio, 0);
192 regulator_disable(p->supply);
194 if (p->desc->delay.unprepare)
195 msleep(p->desc->delay.unprepare);
202 static int panel_simple_prepare(struct drm_panel *panel)
204 struct panel_simple *p = to_panel_simple(panel);
210 err = regulator_enable(p->supply);
212 dev_err(panel->dev, "failed to enable supply: %d\n", err);
216 gpiod_set_value_cansleep(p->enable_gpio, 1);
218 if (p->desc->delay.prepare)
219 msleep(p->desc->delay.prepare);
226 static int panel_simple_enable(struct drm_panel *panel)
228 struct panel_simple *p = to_panel_simple(panel);
233 if (p->desc->delay.enable)
234 msleep(p->desc->delay.enable);
237 p->backlight->props.state &= ~BL_CORE_FBBLANK;
238 p->backlight->props.power = FB_BLANK_UNBLANK;
239 backlight_update_status(p->backlight);
247 static int panel_simple_get_modes(struct drm_panel *panel)
249 struct panel_simple *p = to_panel_simple(panel);
252 /* probe EDID if a DDC bus is available */
254 struct edid *edid = drm_get_edid(panel->connector, p->ddc);
255 drm_mode_connector_update_edid_property(panel->connector, edid);
257 num += drm_add_edid_modes(panel->connector, edid);
262 /* add hard-coded panel modes */
263 num += panel_simple_get_fixed_modes(p);
268 static int panel_simple_get_timings(struct drm_panel *panel,
269 unsigned int num_timings,
270 struct display_timing *timings)
272 struct panel_simple *p = to_panel_simple(panel);
275 if (p->desc->num_timings < num_timings)
276 num_timings = p->desc->num_timings;
279 for (i = 0; i < num_timings; i++)
280 timings[i] = p->desc->timings[i];
282 return p->desc->num_timings;
285 static const struct drm_panel_funcs panel_simple_funcs = {
286 .disable = panel_simple_disable,
287 .unprepare = panel_simple_unprepare,
288 .prepare = panel_simple_prepare,
289 .enable = panel_simple_enable,
290 .get_modes = panel_simple_get_modes,
291 .get_timings = panel_simple_get_timings,
294 static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
296 struct device_node *backlight, *ddc;
297 struct panel_simple *panel;
300 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
304 panel->enabled = false;
305 panel->prepared = false;
308 panel->supply = devm_regulator_get(dev, "power");
309 if (IS_ERR(panel->supply))
310 return PTR_ERR(panel->supply);
312 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
314 if (IS_ERR(panel->enable_gpio)) {
315 err = PTR_ERR(panel->enable_gpio);
316 if (err != -EPROBE_DEFER)
317 dev_err(dev, "failed to request GPIO: %d\n", err);
321 backlight = of_parse_phandle(dev->of_node, "backlight", 0);
323 panel->backlight = of_find_backlight_by_node(backlight);
324 of_node_put(backlight);
326 if (!panel->backlight)
327 return -EPROBE_DEFER;
330 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
332 panel->ddc = of_find_i2c_adapter_by_node(ddc);
341 drm_panel_init(&panel->base);
342 panel->base.dev = dev;
343 panel->base.funcs = &panel_simple_funcs;
345 err = drm_panel_add(&panel->base);
349 dev_set_drvdata(dev, panel);
355 put_device(&panel->ddc->dev);
357 if (panel->backlight)
358 put_device(&panel->backlight->dev);
363 static int panel_simple_remove(struct device *dev)
365 struct panel_simple *panel = dev_get_drvdata(dev);
367 drm_panel_detach(&panel->base);
368 drm_panel_remove(&panel->base);
370 panel_simple_disable(&panel->base);
371 panel_simple_unprepare(&panel->base);
374 put_device(&panel->ddc->dev);
376 if (panel->backlight)
377 put_device(&panel->backlight->dev);
382 static void panel_simple_shutdown(struct device *dev)
384 struct panel_simple *panel = dev_get_drvdata(dev);
386 panel_simple_disable(&panel->base);
387 panel_simple_unprepare(&panel->base);
390 static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
393 .hsync_start = 480 + 2,
394 .hsync_end = 480 + 2 + 41,
395 .htotal = 480 + 2 + 41 + 2,
397 .vsync_start = 272 + 2,
398 .vsync_end = 272 + 2 + 10,
399 .vtotal = 272 + 2 + 10 + 2,
401 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
404 static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
405 .modes = &ire_am_480272h3tmqw_t01h_mode,
412 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
415 static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
418 .hsync_start = 800 + 0,
419 .hsync_end = 800 + 0 + 255,
420 .htotal = 800 + 0 + 255 + 0,
422 .vsync_start = 480 + 2,
423 .vsync_end = 480 + 2 + 45,
424 .vtotal = 480 + 2 + 45 + 0,
426 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
429 static const struct panel_desc ampire_am800480r3tmqwa1h = {
430 .modes = &ire_am800480r3tmqwa1h_mode,
437 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
440 static const struct drm_display_mode auo_b101aw03_mode = {
443 .hsync_start = 1024 + 156,
444 .hsync_end = 1024 + 156 + 8,
445 .htotal = 1024 + 156 + 8 + 156,
447 .vsync_start = 600 + 16,
448 .vsync_end = 600 + 16 + 6,
449 .vtotal = 600 + 16 + 6 + 16,
453 static const struct panel_desc auo_b101aw03 = {
454 .modes = &auo_b101aw03_mode,
463 static const struct drm_display_mode auo_b101ean01_mode = {
466 .hsync_start = 1280 + 119,
467 .hsync_end = 1280 + 119 + 32,
468 .htotal = 1280 + 119 + 32 + 21,
470 .vsync_start = 800 + 4,
471 .vsync_end = 800 + 4 + 20,
472 .vtotal = 800 + 4 + 20 + 8,
476 static const struct panel_desc auo_b101ean01 = {
477 .modes = &auo_b101ean01_mode,
486 static const struct drm_display_mode auo_b101xtn01_mode = {
489 .hsync_start = 1366 + 20,
490 .hsync_end = 1366 + 20 + 70,
491 .htotal = 1366 + 20 + 70,
493 .vsync_start = 768 + 14,
494 .vsync_end = 768 + 14 + 42,
495 .vtotal = 768 + 14 + 42,
497 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
500 static const struct panel_desc auo_b101xtn01 = {
501 .modes = &auo_b101xtn01_mode,
510 static const struct drm_display_mode auo_b116xw03_mode = {
513 .hsync_start = 1366 + 40,
514 .hsync_end = 1366 + 40 + 40,
515 .htotal = 1366 + 40 + 40 + 32,
517 .vsync_start = 768 + 10,
518 .vsync_end = 768 + 10 + 12,
519 .vtotal = 768 + 10 + 12 + 6,
523 static const struct panel_desc auo_b116xw03 = {
524 .modes = &auo_b116xw03_mode,
533 static const struct drm_display_mode auo_b133xtn01_mode = {
536 .hsync_start = 1366 + 48,
537 .hsync_end = 1366 + 48 + 32,
538 .htotal = 1366 + 48 + 32 + 20,
540 .vsync_start = 768 + 3,
541 .vsync_end = 768 + 3 + 6,
542 .vtotal = 768 + 3 + 6 + 13,
546 static const struct panel_desc auo_b133xtn01 = {
547 .modes = &auo_b133xtn01_mode,
556 static const struct drm_display_mode auo_b133htn01_mode = {
559 .hsync_start = 1920 + 172,
560 .hsync_end = 1920 + 172 + 80,
561 .htotal = 1920 + 172 + 80 + 60,
563 .vsync_start = 1080 + 25,
564 .vsync_end = 1080 + 25 + 10,
565 .vtotal = 1080 + 25 + 10 + 10,
569 static const struct panel_desc auo_b133htn01 = {
570 .modes = &auo_b133htn01_mode,
584 static const struct drm_display_mode auo_g104sn02_mode = {
587 .hsync_start = 800 + 40,
588 .hsync_end = 800 + 40 + 216,
589 .htotal = 800 + 40 + 216 + 128,
591 .vsync_start = 600 + 10,
592 .vsync_end = 600 + 10 + 35,
593 .vtotal = 600 + 10 + 35 + 2,
597 static const struct panel_desc auo_g104sn02 = {
598 .modes = &auo_g104sn02_mode,
607 static const struct display_timing auo_g133han01_timings = {
608 .pixelclock = { 134000000, 141200000, 149000000 },
609 .hactive = { 1920, 1920, 1920 },
610 .hfront_porch = { 39, 58, 77 },
611 .hback_porch = { 59, 88, 117 },
612 .hsync_len = { 28, 42, 56 },
613 .vactive = { 1080, 1080, 1080 },
614 .vfront_porch = { 3, 8, 11 },
615 .vback_porch = { 5, 14, 19 },
616 .vsync_len = { 4, 14, 19 },
619 static const struct panel_desc auo_g133han01 = {
620 .timings = &auo_g133han01_timings,
633 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
636 static const struct display_timing auo_g185han01_timings = {
637 .pixelclock = { 120000000, 144000000, 175000000 },
638 .hactive = { 1920, 1920, 1920 },
639 .hfront_porch = { 18, 60, 74 },
640 .hback_porch = { 12, 44, 54 },
641 .hsync_len = { 10, 24, 32 },
642 .vactive = { 1080, 1080, 1080 },
643 .vfront_porch = { 6, 10, 40 },
644 .vback_porch = { 2, 5, 20 },
645 .vsync_len = { 2, 5, 20 },
648 static const struct panel_desc auo_g185han01 = {
649 .timings = &auo_g185han01_timings,
662 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
665 static const struct display_timing auo_p320hvn03_timings = {
666 .pixelclock = { 106000000, 148500000, 164000000 },
667 .hactive = { 1920, 1920, 1920 },
668 .hfront_porch = { 25, 50, 130 },
669 .hback_porch = { 25, 50, 130 },
670 .hsync_len = { 20, 40, 105 },
671 .vactive = { 1080, 1080, 1080 },
672 .vfront_porch = { 8, 17, 150 },
673 .vback_porch = { 8, 17, 150 },
674 .vsync_len = { 4, 11, 100 },
677 static const struct panel_desc auo_p320hvn03 = {
678 .timings = &auo_p320hvn03_timings,
690 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
693 static const struct drm_display_mode auo_t215hvn01_mode = {
696 .hsync_start = 1920 + 88,
697 .hsync_end = 1920 + 88 + 44,
698 .htotal = 1920 + 88 + 44 + 148,
700 .vsync_start = 1080 + 4,
701 .vsync_end = 1080 + 4 + 5,
702 .vtotal = 1080 + 4 + 5 + 36,
706 static const struct panel_desc auo_t215hvn01 = {
707 .modes = &auo_t215hvn01_mode,
720 static const struct drm_display_mode avic_tm070ddh03_mode = {
723 .hsync_start = 1024 + 160,
724 .hsync_end = 1024 + 160 + 4,
725 .htotal = 1024 + 160 + 4 + 156,
727 .vsync_start = 600 + 17,
728 .vsync_end = 600 + 17 + 1,
729 .vtotal = 600 + 17 + 1 + 17,
733 static const struct panel_desc avic_tm070ddh03 = {
734 .modes = &avic_tm070ddh03_mode,
748 static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
752 .hsync_start = 1280 + 48,
753 .hsync_end = 1280 + 48 + 32,
754 .htotal = 1280 + 48 + 32 + 80,
756 .vsync_start = 800 + 3,
757 .vsync_end = 800 + 3 + 5,
758 .vtotal = 800 + 3 + 5 + 24,
764 .hsync_start = 1280 + 48,
765 .hsync_end = 1280 + 48 + 32,
766 .htotal = 1280 + 48 + 32 + 80,
768 .vsync_start = 800 + 3,
769 .vsync_end = 800 + 3 + 5,
770 .vtotal = 800 + 3 + 5 + 24,
775 static const struct panel_desc boe_nv101wxmn51 = {
776 .modes = boe_nv101wxmn51_modes,
777 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
790 static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
793 .hsync_start = 800 + 49,
794 .hsync_end = 800 + 49 + 33,
795 .htotal = 800 + 49 + 33 + 17,
797 .vsync_start = 1280 + 1,
798 .vsync_end = 1280 + 1 + 7,
799 .vtotal = 1280 + 1 + 7 + 15,
801 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
804 static const struct panel_desc chunghwa_claa070wp03xg = {
805 .modes = &chunghwa_claa070wp03xg_mode,
814 static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
817 .hsync_start = 1366 + 58,
818 .hsync_end = 1366 + 58 + 58,
819 .htotal = 1366 + 58 + 58 + 58,
821 .vsync_start = 768 + 4,
822 .vsync_end = 768 + 4 + 4,
823 .vtotal = 768 + 4 + 4 + 4,
827 static const struct panel_desc chunghwa_claa101wa01a = {
828 .modes = &chunghwa_claa101wa01a_mode,
837 static const struct drm_display_mode chunghwa_claa101wb01_mode = {
840 .hsync_start = 1366 + 48,
841 .hsync_end = 1366 + 48 + 32,
842 .htotal = 1366 + 48 + 32 + 20,
844 .vsync_start = 768 + 16,
845 .vsync_end = 768 + 16 + 8,
846 .vtotal = 768 + 16 + 8 + 16,
850 static const struct panel_desc chunghwa_claa101wb01 = {
851 .modes = &chunghwa_claa101wb01_mode,
860 static const struct drm_display_mode edt_et057090dhu_mode = {
863 .hsync_start = 640 + 16,
864 .hsync_end = 640 + 16 + 30,
865 .htotal = 640 + 16 + 30 + 114,
867 .vsync_start = 480 + 10,
868 .vsync_end = 480 + 10 + 3,
869 .vtotal = 480 + 10 + 3 + 32,
871 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
874 static const struct panel_desc edt_et057090dhu = {
875 .modes = &edt_et057090dhu_mode,
882 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
883 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
886 static const struct drm_display_mode edt_etm0700g0dh6_mode = {
889 .hsync_start = 800 + 40,
890 .hsync_end = 800 + 40 + 128,
891 .htotal = 800 + 40 + 128 + 88,
893 .vsync_start = 480 + 10,
894 .vsync_end = 480 + 10 + 2,
895 .vtotal = 480 + 10 + 2 + 33,
897 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
900 static const struct panel_desc edt_etm0700g0dh6 = {
901 .modes = &edt_etm0700g0dh6_mode,
908 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
909 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
912 static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
915 .hsync_start = 800 + 168,
916 .hsync_end = 800 + 168 + 64,
917 .htotal = 800 + 168 + 64 + 88,
919 .vsync_start = 480 + 37,
920 .vsync_end = 480 + 37 + 2,
921 .vtotal = 480 + 37 + 2 + 8,
925 static const struct panel_desc foxlink_fl500wvr00_a0t = {
926 .modes = &foxlink_fl500wvr00_a0t_mode,
933 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
936 static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
939 .hsync_start = 480 + 5,
940 .hsync_end = 480 + 5 + 1,
941 .htotal = 480 + 5 + 1 + 40,
943 .vsync_start = 272 + 8,
944 .vsync_end = 272 + 8 + 1,
945 .vtotal = 272 + 8 + 1 + 8,
949 static const struct panel_desc giantplus_gpg482739qs5 = {
950 .modes = &giantplus_gpg482739qs5_mode,
957 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
960 static const struct display_timing hannstar_hsd070pww1_timing = {
961 .pixelclock = { 64300000, 71100000, 82000000 },
962 .hactive = { 1280, 1280, 1280 },
963 .hfront_porch = { 1, 1, 10 },
964 .hback_porch = { 1, 1, 10 },
966 * According to the data sheet, the minimum horizontal blanking interval
967 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
968 * minimum working horizontal blanking interval to be 60 clocks.
970 .hsync_len = { 58, 158, 661 },
971 .vactive = { 800, 800, 800 },
972 .vfront_porch = { 1, 1, 10 },
973 .vback_porch = { 1, 1, 10 },
974 .vsync_len = { 1, 21, 203 },
975 .flags = DISPLAY_FLAGS_DE_HIGH,
978 static const struct panel_desc hannstar_hsd070pww1 = {
979 .timings = &hannstar_hsd070pww1_timing,
986 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
989 static const struct display_timing hannstar_hsd100pxn1_timing = {
990 .pixelclock = { 55000000, 65000000, 75000000 },
991 .hactive = { 1024, 1024, 1024 },
992 .hfront_porch = { 40, 40, 40 },
993 .hback_porch = { 220, 220, 220 },
994 .hsync_len = { 20, 60, 100 },
995 .vactive = { 768, 768, 768 },
996 .vfront_porch = { 7, 7, 7 },
997 .vback_porch = { 21, 21, 21 },
998 .vsync_len = { 10, 10, 10 },
999 .flags = DISPLAY_FLAGS_DE_HIGH,
1002 static const struct panel_desc hannstar_hsd100pxn1 = {
1003 .timings = &hannstar_hsd100pxn1_timing,
1010 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1013 static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
1016 .hsync_start = 800 + 85,
1017 .hsync_end = 800 + 85 + 86,
1018 .htotal = 800 + 85 + 86 + 85,
1020 .vsync_start = 480 + 16,
1021 .vsync_end = 480 + 16 + 13,
1022 .vtotal = 480 + 16 + 13 + 16,
1026 static const struct panel_desc hitachi_tx23d38vm0caa = {
1027 .modes = &hitachi_tx23d38vm0caa_mode,
1040 static const struct drm_display_mode innolux_at043tn24_mode = {
1043 .hsync_start = 480 + 2,
1044 .hsync_end = 480 + 2 + 41,
1045 .htotal = 480 + 2 + 41 + 2,
1047 .vsync_start = 272 + 2,
1048 .vsync_end = 272 + 2 + 10,
1049 .vtotal = 272 + 2 + 10 + 2,
1051 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1054 static const struct panel_desc innolux_at043tn24 = {
1055 .modes = &innolux_at043tn24_mode,
1062 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1063 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
1066 static const struct drm_display_mode innolux_at070tn92_mode = {
1069 .hsync_start = 800 + 210,
1070 .hsync_end = 800 + 210 + 20,
1071 .htotal = 800 + 210 + 20 + 46,
1073 .vsync_start = 480 + 22,
1074 .vsync_end = 480 + 22 + 10,
1075 .vtotal = 480 + 22 + 23 + 10,
1079 static const struct panel_desc innolux_at070tn92 = {
1080 .modes = &innolux_at070tn92_mode,
1086 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1089 static const struct display_timing innolux_g101ice_l01_timing = {
1090 .pixelclock = { 60400000, 71100000, 74700000 },
1091 .hactive = { 1280, 1280, 1280 },
1092 .hfront_porch = { 41, 80, 100 },
1093 .hback_porch = { 40, 79, 99 },
1094 .hsync_len = { 1, 1, 1 },
1095 .vactive = { 800, 800, 800 },
1096 .vfront_porch = { 5, 11, 14 },
1097 .vback_porch = { 4, 11, 14 },
1098 .vsync_len = { 1, 1, 1 },
1099 .flags = DISPLAY_FLAGS_DE_HIGH,
1102 static const struct panel_desc innolux_g101ice_l01 = {
1103 .timings = &innolux_g101ice_l01_timing,
1114 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1117 static const struct display_timing innolux_g121i1_l01_timing = {
1118 .pixelclock = { 67450000, 71000000, 74550000 },
1119 .hactive = { 1280, 1280, 1280 },
1120 .hfront_porch = { 40, 80, 160 },
1121 .hback_porch = { 39, 79, 159 },
1122 .hsync_len = { 1, 1, 1 },
1123 .vactive = { 800, 800, 800 },
1124 .vfront_porch = { 5, 11, 100 },
1125 .vback_porch = { 4, 11, 99 },
1126 .vsync_len = { 1, 1, 1 },
1129 static const struct panel_desc innolux_g121i1_l01 = {
1130 .timings = &innolux_g121i1_l01_timing,
1141 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1144 static const struct drm_display_mode innolux_g121x1_l03_mode = {
1147 .hsync_start = 1024 + 0,
1148 .hsync_end = 1024 + 1,
1149 .htotal = 1024 + 0 + 1 + 320,
1151 .vsync_start = 768 + 38,
1152 .vsync_end = 768 + 38 + 1,
1153 .vtotal = 768 + 38 + 1 + 0,
1155 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1158 static const struct panel_desc innolux_g121x1_l03 = {
1159 .modes = &innolux_g121x1_l03_mode,
1173 static const struct drm_display_mode innolux_n116bge_mode = {
1176 .hsync_start = 1366 + 136,
1177 .hsync_end = 1366 + 136 + 30,
1178 .htotal = 1366 + 136 + 30 + 60,
1180 .vsync_start = 768 + 8,
1181 .vsync_end = 768 + 8 + 12,
1182 .vtotal = 768 + 8 + 12 + 12,
1184 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1187 static const struct panel_desc innolux_n116bge = {
1188 .modes = &innolux_n116bge_mode,
1197 static const struct drm_display_mode innolux_n156bge_l21_mode = {
1200 .hsync_start = 1366 + 16,
1201 .hsync_end = 1366 + 16 + 34,
1202 .htotal = 1366 + 16 + 34 + 50,
1204 .vsync_start = 768 + 2,
1205 .vsync_end = 768 + 2 + 6,
1206 .vtotal = 768 + 2 + 6 + 12,
1210 static const struct panel_desc innolux_n156bge_l21 = {
1211 .modes = &innolux_n156bge_l21_mode,
1220 static const struct drm_display_mode innolux_zj070na_01p_mode = {
1223 .hsync_start = 1024 + 128,
1224 .hsync_end = 1024 + 128 + 64,
1225 .htotal = 1024 + 128 + 64 + 128,
1227 .vsync_start = 600 + 16,
1228 .vsync_end = 600 + 16 + 4,
1229 .vtotal = 600 + 16 + 4 + 16,
1233 static const struct panel_desc innolux_zj070na_01p = {
1234 .modes = &innolux_zj070na_01p_mode,
1243 static const struct display_timing koe_tx31d200vm0baa_timing = {
1244 .pixelclock = { 39600000, 43200000, 48000000 },
1245 .hactive = { 1280, 1280, 1280 },
1246 .hfront_porch = { 16, 36, 56 },
1247 .hback_porch = { 16, 36, 56 },
1248 .hsync_len = { 8, 8, 8 },
1249 .vactive = { 480, 480, 480 },
1250 .vfront_porch = { 6, 21, 33.5 },
1251 .vback_porch = { 6, 21, 33.5 },
1252 .vsync_len = { 8, 8, 8 },
1253 .flags = DISPLAY_FLAGS_DE_HIGH,
1256 static const struct panel_desc koe_tx31d200vm0baa = {
1257 .timings = &koe_tx31d200vm0baa_timing,
1264 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1267 static const struct display_timing kyo_tcg121xglp_timing = {
1268 .pixelclock = { 52000000, 65000000, 71000000 },
1269 .hactive = { 1024, 1024, 1024 },
1270 .hfront_porch = { 2, 2, 2 },
1271 .hback_porch = { 2, 2, 2 },
1272 .hsync_len = { 86, 124, 244 },
1273 .vactive = { 768, 768, 768 },
1274 .vfront_porch = { 2, 2, 2 },
1275 .vback_porch = { 2, 2, 2 },
1276 .vsync_len = { 6, 34, 73 },
1277 .flags = DISPLAY_FLAGS_DE_HIGH,
1280 static const struct panel_desc kyo_tcg121xglp = {
1281 .timings = &kyo_tcg121xglp_timing,
1288 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1291 static const struct drm_display_mode lg_lb070wv8_mode = {
1294 .hsync_start = 800 + 88,
1295 .hsync_end = 800 + 88 + 80,
1296 .htotal = 800 + 88 + 80 + 88,
1298 .vsync_start = 480 + 10,
1299 .vsync_end = 480 + 10 + 25,
1300 .vtotal = 480 + 10 + 25 + 10,
1304 static const struct panel_desc lg_lb070wv8 = {
1305 .modes = &lg_lb070wv8_mode,
1312 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1315 static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1318 .hsync_start = 1536 + 12,
1319 .hsync_end = 1536 + 12 + 16,
1320 .htotal = 1536 + 12 + 16 + 48,
1322 .vsync_start = 2048 + 8,
1323 .vsync_end = 2048 + 8 + 4,
1324 .vtotal = 2048 + 8 + 4 + 8,
1326 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1329 static const struct panel_desc lg_lp079qx1_sp0v = {
1330 .modes = &lg_lp079qx1_sp0v_mode,
1338 static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1341 .hsync_start = 2048 + 150,
1342 .hsync_end = 2048 + 150 + 5,
1343 .htotal = 2048 + 150 + 5 + 5,
1345 .vsync_start = 1536 + 3,
1346 .vsync_end = 1536 + 3 + 1,
1347 .vtotal = 1536 + 3 + 1 + 9,
1351 static const struct panel_desc lg_lp097qx1_spa1 = {
1352 .modes = &lg_lp097qx1_spa1_mode,
1360 static const struct drm_display_mode lg_lp120up1_mode = {
1363 .hsync_start = 1920 + 40,
1364 .hsync_end = 1920 + 40 + 40,
1365 .htotal = 1920 + 40 + 40+ 80,
1367 .vsync_start = 1280 + 4,
1368 .vsync_end = 1280 + 4 + 4,
1369 .vtotal = 1280 + 4 + 4 + 12,
1373 static const struct panel_desc lg_lp120up1 = {
1374 .modes = &lg_lp120up1_mode,
1383 static const struct drm_display_mode lg_lp129qe_mode = {
1386 .hsync_start = 2560 + 48,
1387 .hsync_end = 2560 + 48 + 32,
1388 .htotal = 2560 + 48 + 32 + 80,
1390 .vsync_start = 1700 + 3,
1391 .vsync_end = 1700 + 3 + 10,
1392 .vtotal = 1700 + 3 + 10 + 36,
1396 static const struct panel_desc lg_lp129qe = {
1397 .modes = &lg_lp129qe_mode,
1406 static const struct drm_display_mode mitsubishi_aa070mc01_mode = {
1409 .hsync_start = 800 + 0,
1410 .hsync_end = 800 + 1,
1411 .htotal = 800 + 0 + 1 + 160,
1413 .vsync_start = 480 + 0,
1414 .vsync_end = 480 + 48 + 1,
1415 .vtotal = 480 + 48 + 1 + 0,
1417 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1420 static const struct panel_desc mitsubishi_aa070mc01 = {
1421 .modes = &mitsubishi_aa070mc01_mode,
1434 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1435 .bus_flags = DRM_BUS_FLAG_DE_HIGH,
1438 static const struct display_timing nec_nl12880bc20_05_timing = {
1439 .pixelclock = { 67000000, 71000000, 75000000 },
1440 .hactive = { 1280, 1280, 1280 },
1441 .hfront_porch = { 2, 30, 30 },
1442 .hback_porch = { 6, 100, 100 },
1443 .hsync_len = { 2, 30, 30 },
1444 .vactive = { 800, 800, 800 },
1445 .vfront_porch = { 5, 5, 5 },
1446 .vback_porch = { 11, 11, 11 },
1447 .vsync_len = { 7, 7, 7 },
1450 static const struct panel_desc nec_nl12880bc20_05 = {
1451 .timings = &nec_nl12880bc20_05_timing,
1462 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1465 static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
1468 .hsync_start = 480 + 2,
1469 .hsync_end = 480 + 2 + 41,
1470 .htotal = 480 + 2 + 41 + 2,
1472 .vsync_start = 272 + 2,
1473 .vsync_end = 272 + 2 + 4,
1474 .vtotal = 272 + 2 + 4 + 2,
1476 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1479 static const struct panel_desc nec_nl4827hc19_05b = {
1480 .modes = &nec_nl4827hc19_05b_mode,
1487 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1488 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
1491 static const struct drm_display_mode netron_dy_e231732_mode = {
1494 .hsync_start = 1024 + 160,
1495 .hsync_end = 1024 + 160 + 70,
1496 .htotal = 1024 + 160 + 70 + 90,
1498 .vsync_start = 600 + 127,
1499 .vsync_end = 600 + 127 + 20,
1500 .vtotal = 600 + 127 + 20 + 3,
1504 static const struct panel_desc netron_dy_e231732 = {
1505 .modes = &netron_dy_e231732_mode,
1511 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1514 static const struct display_timing nlt_nl192108ac18_02d_timing = {
1515 .pixelclock = { 130000000, 148350000, 163000000 },
1516 .hactive = { 1920, 1920, 1920 },
1517 .hfront_porch = { 80, 100, 100 },
1518 .hback_porch = { 100, 120, 120 },
1519 .hsync_len = { 50, 60, 60 },
1520 .vactive = { 1080, 1080, 1080 },
1521 .vfront_porch = { 12, 30, 30 },
1522 .vback_porch = { 4, 10, 10 },
1523 .vsync_len = { 4, 5, 5 },
1526 static const struct panel_desc nlt_nl192108ac18_02d = {
1527 .timings = &nlt_nl192108ac18_02d_timing,
1537 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1540 static const struct drm_display_mode nvd_9128_mode = {
1543 .hsync_start = 800 + 130,
1544 .hsync_end = 800 + 130 + 98,
1545 .htotal = 800 + 0 + 130 + 98,
1547 .vsync_start = 480 + 10,
1548 .vsync_end = 480 + 10 + 50,
1549 .vtotal = 480 + 0 + 10 + 50,
1552 static const struct panel_desc nvd_9128 = {
1553 .modes = &nvd_9128_mode,
1560 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1563 static const struct display_timing okaya_rs800480t_7x0gp_timing = {
1564 .pixelclock = { 30000000, 30000000, 40000000 },
1565 .hactive = { 800, 800, 800 },
1566 .hfront_porch = { 40, 40, 40 },
1567 .hback_porch = { 40, 40, 40 },
1568 .hsync_len = { 1, 48, 48 },
1569 .vactive = { 480, 480, 480 },
1570 .vfront_porch = { 13, 13, 13 },
1571 .vback_porch = { 29, 29, 29 },
1572 .vsync_len = { 3, 3, 3 },
1573 .flags = DISPLAY_FLAGS_DE_HIGH,
1576 static const struct panel_desc okaya_rs800480t_7x0gp = {
1577 .timings = &okaya_rs800480t_7x0gp_timing,
1590 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1593 static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
1596 .hsync_start = 480 + 5,
1597 .hsync_end = 480 + 5 + 30,
1598 .htotal = 480 + 5 + 30 + 10,
1600 .vsync_start = 272 + 8,
1601 .vsync_end = 272 + 8 + 5,
1602 .vtotal = 272 + 8 + 5 + 3,
1606 static const struct panel_desc olimex_lcd_olinuxino_43ts = {
1607 .modes = &olimex_lcd_olinuxino_43ts_mode,
1613 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1617 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1618 * pixel clocks, but this is the timing that was being used in the Adafruit
1619 * installation instructions.
1621 static const struct drm_display_mode ontat_yx700wv03_mode = {
1632 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1637 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1639 static const struct panel_desc ontat_yx700wv03 = {
1640 .modes = &ontat_yx700wv03_mode,
1647 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1650 static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
1653 .hsync_start = 480 + 10,
1654 .hsync_end = 480 + 10 + 10,
1655 .htotal = 480 + 10 + 10 + 15,
1657 .vsync_start = 800 + 3,
1658 .vsync_end = 800 + 3 + 3,
1659 .vtotal = 800 + 3 + 3 + 3,
1663 static const struct panel_desc ortustech_com43h4m85ulc = {
1664 .modes = &ortustech_com43h4m85ulc_mode,
1671 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1672 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
1675 static const struct drm_display_mode qd43003c0_40_mode = {
1678 .hsync_start = 480 + 8,
1679 .hsync_end = 480 + 8 + 4,
1680 .htotal = 480 + 8 + 4 + 39,
1682 .vsync_start = 272 + 4,
1683 .vsync_end = 272 + 4 + 10,
1684 .vtotal = 272 + 4 + 10 + 2,
1688 static const struct panel_desc qd43003c0_40 = {
1689 .modes = &qd43003c0_40_mode,
1696 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1699 static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
1702 .hsync_start = 2560 + 48,
1703 .hsync_end = 2560 + 48 + 32,
1704 .htotal = 2560 + 48 + 32 + 80,
1706 .vsync_start = 1600 + 2,
1707 .vsync_end = 1600 + 2 + 5,
1708 .vtotal = 1600 + 2 + 5 + 57,
1712 static const struct panel_desc samsung_lsn122dl01_c01 = {
1713 .modes = &samsung_lsn122dl01_c01_mode,
1721 static const struct drm_display_mode samsung_ltn101nt05_mode = {
1724 .hsync_start = 1024 + 24,
1725 .hsync_end = 1024 + 24 + 136,
1726 .htotal = 1024 + 24 + 136 + 160,
1728 .vsync_start = 600 + 3,
1729 .vsync_end = 600 + 3 + 6,
1730 .vtotal = 600 + 3 + 6 + 61,
1734 static const struct panel_desc samsung_ltn101nt05 = {
1735 .modes = &samsung_ltn101nt05_mode,
1744 static const struct drm_display_mode samsung_ltn140at29_301_mode = {
1747 .hsync_start = 1366 + 64,
1748 .hsync_end = 1366 + 64 + 48,
1749 .htotal = 1366 + 64 + 48 + 128,
1751 .vsync_start = 768 + 2,
1752 .vsync_end = 768 + 2 + 5,
1753 .vtotal = 768 + 2 + 5 + 17,
1757 static const struct panel_desc samsung_ltn140at29_301 = {
1758 .modes = &samsung_ltn140at29_301_mode,
1767 static const struct display_timing sharp_lq101k1ly04_timing = {
1768 .pixelclock = { 60000000, 65000000, 80000000 },
1769 .hactive = { 1280, 1280, 1280 },
1770 .hfront_porch = { 20, 20, 20 },
1771 .hback_porch = { 20, 20, 20 },
1772 .hsync_len = { 10, 10, 10 },
1773 .vactive = { 800, 800, 800 },
1774 .vfront_porch = { 4, 4, 4 },
1775 .vback_porch = { 4, 4, 4 },
1776 .vsync_len = { 4, 4, 4 },
1777 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
1780 static const struct panel_desc sharp_lq101k1ly04 = {
1781 .timings = &sharp_lq101k1ly04_timing,
1788 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
1791 static const struct display_timing sharp_lq123p1jx31_timing = {
1792 .pixelclock = { 252750000, 252750000, 266604720 },
1793 .hactive = { 2400, 2400, 2400 },
1794 .hfront_porch = { 48, 48, 48 },
1795 .hback_porch = { 80, 80, 84 },
1796 .hsync_len = { 32, 32, 32 },
1797 .vactive = { 1600, 1600, 1600 },
1798 .vfront_porch = { 3, 3, 3 },
1799 .vback_porch = { 33, 33, 120 },
1800 .vsync_len = { 10, 10, 10 },
1801 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
1804 static const struct panel_desc sharp_lq123p1jx31 = {
1805 .timings = &sharp_lq123p1jx31_timing,
1819 static const struct drm_display_mode sharp_lq150x1lg11_mode = {
1822 .hsync_start = 1024 + 168,
1823 .hsync_end = 1024 + 168 + 64,
1824 .htotal = 1024 + 168 + 64 + 88,
1826 .vsync_start = 768 + 37,
1827 .vsync_end = 768 + 37 + 2,
1828 .vtotal = 768 + 37 + 2 + 8,
1832 static const struct panel_desc sharp_lq150x1lg11 = {
1833 .modes = &sharp_lq150x1lg11_mode,
1840 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
1843 static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
1846 .hsync_start = 800 + 1,
1847 .hsync_end = 800 + 1 + 64,
1848 .htotal = 800 + 1 + 64 + 64,
1850 .vsync_start = 480 + 1,
1851 .vsync_end = 480 + 1 + 23,
1852 .vtotal = 480 + 1 + 23 + 22,
1856 static const struct panel_desc shelly_sca07010_bfn_lnn = {
1857 .modes = &shelly_sca07010_bfn_lnn_mode,
1863 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1866 static const struct drm_display_mode starry_kr122ea0sra_mode = {
1869 .hsync_start = 1920 + 16,
1870 .hsync_end = 1920 + 16 + 16,
1871 .htotal = 1920 + 16 + 16 + 32,
1873 .vsync_start = 1200 + 15,
1874 .vsync_end = 1200 + 15 + 2,
1875 .vtotal = 1200 + 15 + 2 + 18,
1877 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1880 static const struct panel_desc starry_kr122ea0sra = {
1881 .modes = &starry_kr122ea0sra_mode,
1888 .prepare = 10 + 200,
1890 .unprepare = 10 + 500,
1894 static const struct display_timing tianma_tm070jdhg30_timing = {
1895 .pixelclock = { 62600000, 68200000, 78100000 },
1896 .hactive = { 1280, 1280, 1280 },
1897 .hfront_porch = { 15, 64, 159 },
1898 .hback_porch = { 5, 5, 5 },
1899 .hsync_len = { 1, 1, 256 },
1900 .vactive = { 800, 800, 800 },
1901 .vfront_porch = { 3, 40, 99 },
1902 .vback_porch = { 2, 2, 2 },
1903 .vsync_len = { 1, 1, 128 },
1904 .flags = DISPLAY_FLAGS_DE_HIGH,
1907 static const struct panel_desc tianma_tm070jdhg30 = {
1908 .timings = &tianma_tm070jdhg30_timing,
1915 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1918 static const struct display_timing tianma_tm070rvhg71_timing = {
1919 .pixelclock = { 27700000, 29200000, 39600000 },
1920 .hactive = { 800, 800, 800 },
1921 .hfront_porch = { 12, 40, 212 },
1922 .hback_porch = { 88, 88, 88 },
1923 .hsync_len = { 1, 1, 40 },
1924 .vactive = { 480, 480, 480 },
1925 .vfront_porch = { 1, 13, 88 },
1926 .vback_porch = { 32, 32, 32 },
1927 .vsync_len = { 1, 1, 3 },
1928 .flags = DISPLAY_FLAGS_DE_HIGH,
1931 static const struct panel_desc tianma_tm070rvhg71 = {
1932 .timings = &tianma_tm070rvhg71_timing,
1939 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1942 static const struct drm_display_mode toshiba_lt089ac29000_mode = {
1945 .hsync_start = 1280 + 192,
1946 .hsync_end = 1280 + 192 + 128,
1947 .htotal = 1280 + 192 + 128 + 64,
1949 .vsync_start = 768 + 20,
1950 .vsync_end = 768 + 20 + 7,
1951 .vtotal = 768 + 20 + 7 + 3,
1955 static const struct panel_desc toshiba_lt089ac29000 = {
1956 .modes = &toshiba_lt089ac29000_mode,
1962 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1963 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
1966 static const struct drm_display_mode tpk_f07a_0102_mode = {
1969 .hsync_start = 800 + 40,
1970 .hsync_end = 800 + 40 + 128,
1971 .htotal = 800 + 40 + 128 + 88,
1973 .vsync_start = 480 + 10,
1974 .vsync_end = 480 + 10 + 2,
1975 .vtotal = 480 + 10 + 2 + 33,
1979 static const struct panel_desc tpk_f07a_0102 = {
1980 .modes = &tpk_f07a_0102_mode,
1986 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
1989 static const struct drm_display_mode tpk_f10a_0102_mode = {
1992 .hsync_start = 1024 + 176,
1993 .hsync_end = 1024 + 176 + 5,
1994 .htotal = 1024 + 176 + 5 + 88,
1996 .vsync_start = 600 + 20,
1997 .vsync_end = 600 + 20 + 5,
1998 .vtotal = 600 + 20 + 5 + 25,
2002 static const struct panel_desc tpk_f10a_0102 = {
2003 .modes = &tpk_f10a_0102_mode,
2011 static const struct display_timing urt_umsh_8596md_timing = {
2012 .pixelclock = { 33260000, 33260000, 33260000 },
2013 .hactive = { 800, 800, 800 },
2014 .hfront_porch = { 41, 41, 41 },
2015 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
2016 .hsync_len = { 71, 128, 128 },
2017 .vactive = { 480, 480, 480 },
2018 .vfront_porch = { 10, 10, 10 },
2019 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
2020 .vsync_len = { 2, 2, 2 },
2021 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
2022 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
2025 static const struct panel_desc urt_umsh_8596md_lvds = {
2026 .timings = &urt_umsh_8596md_timing,
2033 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
2036 static const struct panel_desc urt_umsh_8596md_parallel = {
2037 .timings = &urt_umsh_8596md_timing,
2044 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
2047 static const struct drm_display_mode winstar_wf35ltiacd_mode = {
2050 .hsync_start = 320 + 20,
2051 .hsync_end = 320 + 20 + 30,
2052 .htotal = 320 + 20 + 30 + 38,
2054 .vsync_start = 240 + 4,
2055 .vsync_end = 240 + 4 + 3,
2056 .vtotal = 240 + 4 + 3 + 15,
2058 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2061 static const struct panel_desc winstar_wf35ltiacd = {
2062 .modes = &winstar_wf35ltiacd_mode,
2069 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
2072 static const struct of_device_id platform_of_match[] = {
2074 .compatible = "ampire,am-480272h3tmqw-t01h",
2075 .data = &ire_am_480272h3tmqw_t01h,
2077 .compatible = "ampire,am800480r3tmqwa1h",
2078 .data = &ire_am800480r3tmqwa1h,
2080 .compatible = "auo,b101aw03",
2081 .data = &auo_b101aw03,
2083 .compatible = "auo,b101ean01",
2084 .data = &auo_b101ean01,
2086 .compatible = "auo,b101xtn01",
2087 .data = &auo_b101xtn01,
2089 .compatible = "auo,b116xw03",
2090 .data = &auo_b116xw03,
2092 .compatible = "auo,b133htn01",
2093 .data = &auo_b133htn01,
2095 .compatible = "auo,b133xtn01",
2096 .data = &auo_b133xtn01,
2098 .compatible = "auo,g104sn02",
2099 .data = &auo_g104sn02,
2101 .compatible = "auo,g133han01",
2102 .data = &auo_g133han01,
2104 .compatible = "auo,g185han01",
2105 .data = &auo_g185han01,
2107 .compatible = "auo,p320hvn03",
2108 .data = &auo_p320hvn03,
2110 .compatible = "auo,t215hvn01",
2111 .data = &auo_t215hvn01,
2113 .compatible = "avic,tm070ddh03",
2114 .data = &avic_tm070ddh03,
2116 .compatible = "boe,nv101wxmn51",
2117 .data = &boe_nv101wxmn51,
2119 .compatible = "chunghwa,claa070wp03xg",
2120 .data = &chunghwa_claa070wp03xg,
2122 .compatible = "chunghwa,claa101wa01a",
2123 .data = &chunghwa_claa101wa01a
2125 .compatible = "chunghwa,claa101wb01",
2126 .data = &chunghwa_claa101wb01
2128 .compatible = "edt,et057090dhu",
2129 .data = &edt_et057090dhu,
2131 .compatible = "edt,et070080dh6",
2132 .data = &edt_etm0700g0dh6,
2134 .compatible = "edt,etm0700g0dh6",
2135 .data = &edt_etm0700g0dh6,
2137 .compatible = "foxlink,fl500wvr00-a0t",
2138 .data = &foxlink_fl500wvr00_a0t,
2140 .compatible = "giantplus,gpg482739qs5",
2141 .data = &giantplus_gpg482739qs5
2143 .compatible = "hannstar,hsd070pww1",
2144 .data = &hannstar_hsd070pww1,
2146 .compatible = "hannstar,hsd100pxn1",
2147 .data = &hannstar_hsd100pxn1,
2149 .compatible = "hit,tx23d38vm0caa",
2150 .data = &hitachi_tx23d38vm0caa
2152 .compatible = "innolux,at043tn24",
2153 .data = &innolux_at043tn24,
2155 .compatible = "innolux,at070tn92",
2156 .data = &innolux_at070tn92,
2158 .compatible ="innolux,g101ice-l01",
2159 .data = &innolux_g101ice_l01
2161 .compatible ="innolux,g121i1-l01",
2162 .data = &innolux_g121i1_l01
2164 .compatible = "innolux,g121x1-l03",
2165 .data = &innolux_g121x1_l03,
2167 .compatible = "innolux,n116bge",
2168 .data = &innolux_n116bge,
2170 .compatible = "innolux,n156bge-l21",
2171 .data = &innolux_n156bge_l21,
2173 .compatible = "innolux,zj070na-01p",
2174 .data = &innolux_zj070na_01p,
2176 .compatible = "koe,tx31d200vm0baa",
2177 .data = &koe_tx31d200vm0baa,
2179 .compatible = "kyo,tcg121xglp",
2180 .data = &kyo_tcg121xglp,
2182 .compatible = "lg,lb070wv8",
2183 .data = &lg_lb070wv8,
2185 .compatible = "lg,lp079qx1-sp0v",
2186 .data = &lg_lp079qx1_sp0v,
2188 .compatible = "lg,lp097qx1-spa1",
2189 .data = &lg_lp097qx1_spa1,
2191 .compatible = "lg,lp120up1",
2192 .data = &lg_lp120up1,
2194 .compatible = "lg,lp129qe",
2195 .data = &lg_lp129qe,
2197 .compatible = "mitsubishi,aa070mc01-ca1",
2198 .data = &mitsubishi_aa070mc01,
2200 .compatible = "nec,nl12880bc20-05",
2201 .data = &nec_nl12880bc20_05,
2203 .compatible = "nec,nl4827hc19-05b",
2204 .data = &nec_nl4827hc19_05b,
2206 .compatible = "netron-dy,e231732",
2207 .data = &netron_dy_e231732,
2209 .compatible = "nlt,nl192108ac18-02d",
2210 .data = &nlt_nl192108ac18_02d,
2212 .compatible = "nvd,9128",
2215 .compatible = "okaya,rs800480t-7x0gp",
2216 .data = &okaya_rs800480t_7x0gp,
2218 .compatible = "olimex,lcd-olinuxino-43-ts",
2219 .data = &olimex_lcd_olinuxino_43ts,
2221 .compatible = "ontat,yx700wv03",
2222 .data = &ontat_yx700wv03,
2224 .compatible = "ortustech,com43h4m85ulc",
2225 .data = &ortustech_com43h4m85ulc,
2227 .compatible = "qiaodian,qd43003c0-40",
2228 .data = &qd43003c0_40,
2230 .compatible = "samsung,lsn122dl01-c01",
2231 .data = &samsung_lsn122dl01_c01,
2233 .compatible = "samsung,ltn101nt05",
2234 .data = &samsung_ltn101nt05,
2236 .compatible = "samsung,ltn140at29-301",
2237 .data = &samsung_ltn140at29_301,
2239 .compatible = "sharp,lq101k1ly04",
2240 .data = &sharp_lq101k1ly04,
2242 .compatible = "sharp,lq123p1jx31",
2243 .data = &sharp_lq123p1jx31,
2245 .compatible = "sharp,lq150x1lg11",
2246 .data = &sharp_lq150x1lg11,
2248 .compatible = "shelly,sca07010-bfn-lnn",
2249 .data = &shelly_sca07010_bfn_lnn,
2251 .compatible = "starry,kr122ea0sra",
2252 .data = &starry_kr122ea0sra,
2254 .compatible = "tianma,tm070jdhg30",
2255 .data = &tianma_tm070jdhg30,
2257 .compatible = "tianma,tm070rvhg71",
2258 .data = &tianma_tm070rvhg71,
2260 .compatible = "toshiba,lt089ac29000",
2261 .data = &toshiba_lt089ac29000,
2263 .compatible = "tpk,f07a-0102",
2264 .data = &tpk_f07a_0102,
2266 .compatible = "tpk,f10a-0102",
2267 .data = &tpk_f10a_0102,
2269 .compatible = "urt,umsh-8596md-t",
2270 .data = &urt_umsh_8596md_parallel,
2272 .compatible = "urt,umsh-8596md-1t",
2273 .data = &urt_umsh_8596md_parallel,
2275 .compatible = "urt,umsh-8596md-7t",
2276 .data = &urt_umsh_8596md_parallel,
2278 .compatible = "urt,umsh-8596md-11t",
2279 .data = &urt_umsh_8596md_lvds,
2281 .compatible = "urt,umsh-8596md-19t",
2282 .data = &urt_umsh_8596md_lvds,
2284 .compatible = "urt,umsh-8596md-20t",
2285 .data = &urt_umsh_8596md_parallel,
2287 .compatible = "winstar,wf35ltiacd",
2288 .data = &winstar_wf35ltiacd,
2293 MODULE_DEVICE_TABLE(of, platform_of_match);
2295 static int panel_simple_platform_probe(struct platform_device *pdev)
2297 const struct of_device_id *id;
2299 id = of_match_node(platform_of_match, pdev->dev.of_node);
2303 return panel_simple_probe(&pdev->dev, id->data);
2306 static int panel_simple_platform_remove(struct platform_device *pdev)
2308 return panel_simple_remove(&pdev->dev);
2311 static void panel_simple_platform_shutdown(struct platform_device *pdev)
2313 panel_simple_shutdown(&pdev->dev);
2316 static struct platform_driver panel_simple_platform_driver = {
2318 .name = "panel-simple",
2319 .of_match_table = platform_of_match,
2321 .probe = panel_simple_platform_probe,
2322 .remove = panel_simple_platform_remove,
2323 .shutdown = panel_simple_platform_shutdown,
2326 struct panel_desc_dsi {
2327 struct panel_desc desc;
2329 unsigned long flags;
2330 enum mipi_dsi_pixel_format format;
2334 static const struct drm_display_mode auo_b080uan01_mode = {
2337 .hsync_start = 1200 + 62,
2338 .hsync_end = 1200 + 62 + 4,
2339 .htotal = 1200 + 62 + 4 + 62,
2341 .vsync_start = 1920 + 9,
2342 .vsync_end = 1920 + 9 + 2,
2343 .vtotal = 1920 + 9 + 2 + 8,
2347 static const struct panel_desc_dsi auo_b080uan01 = {
2349 .modes = &auo_b080uan01_mode,
2357 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2358 .format = MIPI_DSI_FMT_RGB888,
2362 static const struct drm_display_mode boe_tv080wum_nl0_mode = {
2365 .hsync_start = 1200 + 120,
2366 .hsync_end = 1200 + 120 + 20,
2367 .htotal = 1200 + 120 + 20 + 21,
2369 .vsync_start = 1920 + 21,
2370 .vsync_end = 1920 + 21 + 3,
2371 .vtotal = 1920 + 21 + 3 + 18,
2373 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2376 static const struct panel_desc_dsi boe_tv080wum_nl0 = {
2378 .modes = &boe_tv080wum_nl0_mode,
2385 .flags = MIPI_DSI_MODE_VIDEO |
2386 MIPI_DSI_MODE_VIDEO_BURST |
2387 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
2388 .format = MIPI_DSI_FMT_RGB888,
2392 static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
2395 .hsync_start = 800 + 32,
2396 .hsync_end = 800 + 32 + 1,
2397 .htotal = 800 + 32 + 1 + 57,
2399 .vsync_start = 1280 + 28,
2400 .vsync_end = 1280 + 28 + 1,
2401 .vtotal = 1280 + 28 + 1 + 14,
2405 static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
2407 .modes = &lg_ld070wx3_sl01_mode,
2415 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2416 .format = MIPI_DSI_FMT_RGB888,
2420 static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
2423 .hsync_start = 720 + 12,
2424 .hsync_end = 720 + 12 + 4,
2425 .htotal = 720 + 12 + 4 + 112,
2427 .vsync_start = 1280 + 8,
2428 .vsync_end = 1280 + 8 + 4,
2429 .vtotal = 1280 + 8 + 4 + 12,
2433 static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
2435 .modes = &lg_lh500wx1_sd03_mode,
2443 .flags = MIPI_DSI_MODE_VIDEO,
2444 .format = MIPI_DSI_FMT_RGB888,
2448 static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
2451 .hsync_start = 1920 + 154,
2452 .hsync_end = 1920 + 154 + 16,
2453 .htotal = 1920 + 154 + 16 + 32,
2455 .vsync_start = 1200 + 17,
2456 .vsync_end = 1200 + 17 + 2,
2457 .vtotal = 1200 + 17 + 2 + 16,
2461 static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
2463 .modes = &panasonic_vvx10f004b00_mode,
2471 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
2472 MIPI_DSI_CLOCK_NON_CONTINUOUS,
2473 .format = MIPI_DSI_FMT_RGB888,
2477 static const struct of_device_id dsi_of_match[] = {
2479 .compatible = "auo,b080uan01",
2480 .data = &auo_b080uan01
2482 .compatible = "boe,tv080wum-nl0",
2483 .data = &boe_tv080wum_nl0
2485 .compatible = "lg,ld070wx3-sl01",
2486 .data = &lg_ld070wx3_sl01
2488 .compatible = "lg,lh500wx1-sd03",
2489 .data = &lg_lh500wx1_sd03
2491 .compatible = "panasonic,vvx10f004b00",
2492 .data = &panasonic_vvx10f004b00
2497 MODULE_DEVICE_TABLE(of, dsi_of_match);
2499 static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
2501 const struct panel_desc_dsi *desc;
2502 const struct of_device_id *id;
2505 id = of_match_node(dsi_of_match, dsi->dev.of_node);
2511 err = panel_simple_probe(&dsi->dev, &desc->desc);
2515 dsi->mode_flags = desc->flags;
2516 dsi->format = desc->format;
2517 dsi->lanes = desc->lanes;
2519 return mipi_dsi_attach(dsi);
2522 static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
2526 err = mipi_dsi_detach(dsi);
2528 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
2530 return panel_simple_remove(&dsi->dev);
2533 static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
2535 panel_simple_shutdown(&dsi->dev);
2538 static struct mipi_dsi_driver panel_simple_dsi_driver = {
2540 .name = "panel-simple-dsi",
2541 .of_match_table = dsi_of_match,
2543 .probe = panel_simple_dsi_probe,
2544 .remove = panel_simple_dsi_remove,
2545 .shutdown = panel_simple_dsi_shutdown,
2548 static int __init panel_simple_init(void)
2552 err = platform_driver_register(&panel_simple_platform_driver);
2556 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
2557 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
2564 module_init(panel_simple_init);
2566 static void __exit panel_simple_exit(void)
2568 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
2569 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
2571 platform_driver_unregister(&panel_simple_platform_driver);
2573 module_exit(panel_simple_exit);
2576 MODULE_DESCRIPTION("DRM Driver for Simple Panels");
2577 MODULE_LICENSE("GPL and additional rights");