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);
191 gpiod_set_value_cansleep(p->enable_gpio, 0);
193 regulator_disable(p->supply);
195 if (p->desc->delay.unprepare)
196 msleep(p->desc->delay.unprepare);
203 static int panel_simple_prepare(struct drm_panel *panel)
205 struct panel_simple *p = to_panel_simple(panel);
211 err = regulator_enable(p->supply);
213 dev_err(panel->dev, "failed to enable supply: %d\n", err);
218 gpiod_set_value_cansleep(p->enable_gpio, 1);
220 if (p->desc->delay.prepare)
221 msleep(p->desc->delay.prepare);
228 static int panel_simple_enable(struct drm_panel *panel)
230 struct panel_simple *p = to_panel_simple(panel);
235 if (p->desc->delay.enable)
236 msleep(p->desc->delay.enable);
239 p->backlight->props.state &= ~BL_CORE_FBBLANK;
240 p->backlight->props.power = FB_BLANK_UNBLANK;
241 backlight_update_status(p->backlight);
249 static int panel_simple_get_modes(struct drm_panel *panel)
251 struct panel_simple *p = to_panel_simple(panel);
254 /* probe EDID if a DDC bus is available */
256 struct edid *edid = drm_get_edid(panel->connector, p->ddc);
257 drm_mode_connector_update_edid_property(panel->connector, edid);
259 num += drm_add_edid_modes(panel->connector, edid);
264 /* add hard-coded panel modes */
265 num += panel_simple_get_fixed_modes(p);
270 static int panel_simple_get_timings(struct drm_panel *panel,
271 unsigned int num_timings,
272 struct display_timing *timings)
274 struct panel_simple *p = to_panel_simple(panel);
277 if (p->desc->num_timings < num_timings)
278 num_timings = p->desc->num_timings;
281 for (i = 0; i < num_timings; i++)
282 timings[i] = p->desc->timings[i];
284 return p->desc->num_timings;
287 static const struct drm_panel_funcs panel_simple_funcs = {
288 .disable = panel_simple_disable,
289 .unprepare = panel_simple_unprepare,
290 .prepare = panel_simple_prepare,
291 .enable = panel_simple_enable,
292 .get_modes = panel_simple_get_modes,
293 .get_timings = panel_simple_get_timings,
296 static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
298 struct device_node *backlight, *ddc;
299 struct panel_simple *panel;
302 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
306 panel->enabled = false;
307 panel->prepared = false;
310 panel->supply = devm_regulator_get(dev, "power");
311 if (IS_ERR(panel->supply))
312 return PTR_ERR(panel->supply);
314 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
316 if (IS_ERR(panel->enable_gpio)) {
317 err = PTR_ERR(panel->enable_gpio);
318 dev_err(dev, "failed to request GPIO: %d\n", err);
322 backlight = of_parse_phandle(dev->of_node, "backlight", 0);
324 panel->backlight = of_find_backlight_by_node(backlight);
325 of_node_put(backlight);
327 if (!panel->backlight)
328 return -EPROBE_DEFER;
331 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
333 panel->ddc = of_find_i2c_adapter_by_node(ddc);
342 drm_panel_init(&panel->base);
343 panel->base.dev = dev;
344 panel->base.funcs = &panel_simple_funcs;
346 err = drm_panel_add(&panel->base);
350 dev_set_drvdata(dev, panel);
356 put_device(&panel->ddc->dev);
358 if (panel->backlight)
359 put_device(&panel->backlight->dev);
364 static int panel_simple_remove(struct device *dev)
366 struct panel_simple *panel = dev_get_drvdata(dev);
368 drm_panel_detach(&panel->base);
369 drm_panel_remove(&panel->base);
371 panel_simple_disable(&panel->base);
372 panel_simple_unprepare(&panel->base);
375 put_device(&panel->ddc->dev);
377 if (panel->backlight)
378 put_device(&panel->backlight->dev);
383 static void panel_simple_shutdown(struct device *dev)
385 struct panel_simple *panel = dev_get_drvdata(dev);
387 panel_simple_disable(&panel->base);
388 panel_simple_unprepare(&panel->base);
391 static const struct drm_display_mode ampire_am_480272h3tmqw_t01h_mode = {
394 .hsync_start = 480 + 2,
395 .hsync_end = 480 + 2 + 41,
396 .htotal = 480 + 2 + 41 + 2,
398 .vsync_start = 272 + 2,
399 .vsync_end = 272 + 2 + 10,
400 .vtotal = 272 + 2 + 10 + 2,
402 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
405 static const struct panel_desc ampire_am_480272h3tmqw_t01h = {
406 .modes = &ire_am_480272h3tmqw_t01h_mode,
413 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
416 static const struct drm_display_mode ampire_am800480r3tmqwa1h_mode = {
419 .hsync_start = 800 + 0,
420 .hsync_end = 800 + 0 + 255,
421 .htotal = 800 + 0 + 255 + 0,
423 .vsync_start = 480 + 2,
424 .vsync_end = 480 + 2 + 45,
425 .vtotal = 480 + 2 + 45 + 0,
427 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
430 static const struct panel_desc ampire_am800480r3tmqwa1h = {
431 .modes = &ire_am800480r3tmqwa1h_mode,
438 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
441 static const struct drm_display_mode auo_b101aw03_mode = {
444 .hsync_start = 1024 + 156,
445 .hsync_end = 1024 + 156 + 8,
446 .htotal = 1024 + 156 + 8 + 156,
448 .vsync_start = 600 + 16,
449 .vsync_end = 600 + 16 + 6,
450 .vtotal = 600 + 16 + 6 + 16,
454 static const struct panel_desc auo_b101aw03 = {
455 .modes = &auo_b101aw03_mode,
464 static const struct drm_display_mode auo_b101ean01_mode = {
467 .hsync_start = 1280 + 119,
468 .hsync_end = 1280 + 119 + 32,
469 .htotal = 1280 + 119 + 32 + 21,
471 .vsync_start = 800 + 4,
472 .vsync_end = 800 + 4 + 20,
473 .vtotal = 800 + 4 + 20 + 8,
477 static const struct panel_desc auo_b101ean01 = {
478 .modes = &auo_b101ean01_mode,
487 static const struct drm_display_mode auo_b101xtn01_mode = {
490 .hsync_start = 1366 + 20,
491 .hsync_end = 1366 + 20 + 70,
492 .htotal = 1366 + 20 + 70,
494 .vsync_start = 768 + 14,
495 .vsync_end = 768 + 14 + 42,
496 .vtotal = 768 + 14 + 42,
498 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
501 static const struct panel_desc auo_b101xtn01 = {
502 .modes = &auo_b101xtn01_mode,
511 static const struct drm_display_mode auo_b116xw03_mode = {
514 .hsync_start = 1366 + 40,
515 .hsync_end = 1366 + 40 + 40,
516 .htotal = 1366 + 40 + 40 + 32,
518 .vsync_start = 768 + 10,
519 .vsync_end = 768 + 10 + 12,
520 .vtotal = 768 + 10 + 12 + 6,
524 static const struct panel_desc auo_b116xw03 = {
525 .modes = &auo_b116xw03_mode,
534 static const struct drm_display_mode auo_b133xtn01_mode = {
537 .hsync_start = 1366 + 48,
538 .hsync_end = 1366 + 48 + 32,
539 .htotal = 1366 + 48 + 32 + 20,
541 .vsync_start = 768 + 3,
542 .vsync_end = 768 + 3 + 6,
543 .vtotal = 768 + 3 + 6 + 13,
547 static const struct panel_desc auo_b133xtn01 = {
548 .modes = &auo_b133xtn01_mode,
557 static const struct drm_display_mode auo_b133htn01_mode = {
560 .hsync_start = 1920 + 172,
561 .hsync_end = 1920 + 172 + 80,
562 .htotal = 1920 + 172 + 80 + 60,
564 .vsync_start = 1080 + 25,
565 .vsync_end = 1080 + 25 + 10,
566 .vtotal = 1080 + 25 + 10 + 10,
570 static const struct panel_desc auo_b133htn01 = {
571 .modes = &auo_b133htn01_mode,
585 static const struct display_timing auo_g133han01_timings = {
586 .pixelclock = { 134000000, 141200000, 149000000 },
587 .hactive = { 1920, 1920, 1920 },
588 .hfront_porch = { 39, 58, 77 },
589 .hback_porch = { 59, 88, 117 },
590 .hsync_len = { 28, 42, 56 },
591 .vactive = { 1080, 1080, 1080 },
592 .vfront_porch = { 3, 8, 11 },
593 .vback_porch = { 5, 14, 19 },
594 .vsync_len = { 4, 14, 19 },
597 static const struct panel_desc auo_g133han01 = {
598 .timings = &auo_g133han01_timings,
611 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
614 static const struct display_timing auo_g185han01_timings = {
615 .pixelclock = { 120000000, 144000000, 175000000 },
616 .hactive = { 1920, 1920, 1920 },
617 .hfront_porch = { 36, 120, 148 },
618 .hback_porch = { 24, 88, 108 },
619 .hsync_len = { 20, 48, 64 },
620 .vactive = { 1080, 1080, 1080 },
621 .vfront_porch = { 6, 10, 40 },
622 .vback_porch = { 2, 5, 20 },
623 .vsync_len = { 2, 5, 20 },
626 static const struct panel_desc auo_g185han01 = {
627 .timings = &auo_g185han01_timings,
640 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
643 static const struct display_timing auo_p320hvn03_timings = {
644 .pixelclock = { 106000000, 148500000, 164000000 },
645 .hactive = { 1920, 1920, 1920 },
646 .hfront_porch = { 25, 50, 130 },
647 .hback_porch = { 25, 50, 130 },
648 .hsync_len = { 20, 40, 105 },
649 .vactive = { 1080, 1080, 1080 },
650 .vfront_porch = { 8, 17, 150 },
651 .vback_porch = { 8, 17, 150 },
652 .vsync_len = { 4, 11, 100 },
655 static const struct panel_desc auo_p320hvn03 = {
656 .timings = &auo_p320hvn03_timings,
668 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
671 static const struct drm_display_mode auo_t215hvn01_mode = {
674 .hsync_start = 1920 + 88,
675 .hsync_end = 1920 + 88 + 44,
676 .htotal = 1920 + 88 + 44 + 148,
678 .vsync_start = 1080 + 4,
679 .vsync_end = 1080 + 4 + 5,
680 .vtotal = 1080 + 4 + 5 + 36,
684 static const struct panel_desc auo_t215hvn01 = {
685 .modes = &auo_t215hvn01_mode,
698 static const struct drm_display_mode avic_tm070ddh03_mode = {
701 .hsync_start = 1024 + 160,
702 .hsync_end = 1024 + 160 + 4,
703 .htotal = 1024 + 160 + 4 + 156,
705 .vsync_start = 600 + 17,
706 .vsync_end = 600 + 17 + 1,
707 .vtotal = 600 + 17 + 1 + 17,
711 static const struct panel_desc avic_tm070ddh03 = {
712 .modes = &avic_tm070ddh03_mode,
726 static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
730 .hsync_start = 1280 + 48,
731 .hsync_end = 1280 + 48 + 32,
732 .htotal = 1280 + 48 + 32 + 80,
734 .vsync_start = 800 + 3,
735 .vsync_end = 800 + 3 + 5,
736 .vtotal = 800 + 3 + 5 + 24,
742 .hsync_start = 1280 + 48,
743 .hsync_end = 1280 + 48 + 32,
744 .htotal = 1280 + 48 + 32 + 80,
746 .vsync_start = 800 + 3,
747 .vsync_end = 800 + 3 + 5,
748 .vtotal = 800 + 3 + 5 + 24,
753 static const struct panel_desc boe_nv101wxmn51 = {
754 .modes = boe_nv101wxmn51_modes,
755 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
768 static const struct drm_display_mode chunghwa_claa070wp03xg_mode = {
771 .hsync_start = 800 + 49,
772 .hsync_end = 800 + 49 + 33,
773 .htotal = 800 + 49 + 33 + 17,
775 .vsync_start = 1280 + 1,
776 .vsync_end = 1280 + 1 + 7,
777 .vtotal = 1280 + 1 + 7 + 15,
779 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
782 static const struct panel_desc chunghwa_claa070wp03xg = {
783 .modes = &chunghwa_claa070wp03xg_mode,
792 static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
795 .hsync_start = 1366 + 58,
796 .hsync_end = 1366 + 58 + 58,
797 .htotal = 1366 + 58 + 58 + 58,
799 .vsync_start = 768 + 4,
800 .vsync_end = 768 + 4 + 4,
801 .vtotal = 768 + 4 + 4 + 4,
805 static const struct panel_desc chunghwa_claa101wa01a = {
806 .modes = &chunghwa_claa101wa01a_mode,
815 static const struct drm_display_mode chunghwa_claa101wb01_mode = {
818 .hsync_start = 1366 + 48,
819 .hsync_end = 1366 + 48 + 32,
820 .htotal = 1366 + 48 + 32 + 20,
822 .vsync_start = 768 + 16,
823 .vsync_end = 768 + 16 + 8,
824 .vtotal = 768 + 16 + 8 + 16,
828 static const struct panel_desc chunghwa_claa101wb01 = {
829 .modes = &chunghwa_claa101wb01_mode,
838 static const struct drm_display_mode edt_et057090dhu_mode = {
841 .hsync_start = 640 + 16,
842 .hsync_end = 640 + 16 + 30,
843 .htotal = 640 + 16 + 30 + 114,
845 .vsync_start = 480 + 10,
846 .vsync_end = 480 + 10 + 3,
847 .vtotal = 480 + 10 + 3 + 32,
849 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
852 static const struct panel_desc edt_et057090dhu = {
853 .modes = &edt_et057090dhu_mode,
860 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
861 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
864 static const struct drm_display_mode edt_etm0700g0dh6_mode = {
867 .hsync_start = 800 + 40,
868 .hsync_end = 800 + 40 + 128,
869 .htotal = 800 + 40 + 128 + 88,
871 .vsync_start = 480 + 10,
872 .vsync_end = 480 + 10 + 2,
873 .vtotal = 480 + 10 + 2 + 33,
875 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
878 static const struct panel_desc edt_etm0700g0dh6 = {
879 .modes = &edt_etm0700g0dh6_mode,
886 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
887 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_NEGEDGE,
890 static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode = {
893 .hsync_start = 800 + 168,
894 .hsync_end = 800 + 168 + 64,
895 .htotal = 800 + 168 + 64 + 88,
897 .vsync_start = 480 + 37,
898 .vsync_end = 480 + 37 + 2,
899 .vtotal = 480 + 37 + 2 + 8,
903 static const struct panel_desc foxlink_fl500wvr00_a0t = {
904 .modes = &foxlink_fl500wvr00_a0t_mode,
911 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
914 static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
917 .hsync_start = 480 + 5,
918 .hsync_end = 480 + 5 + 1,
919 .htotal = 480 + 5 + 1 + 40,
921 .vsync_start = 272 + 8,
922 .vsync_end = 272 + 8 + 1,
923 .vtotal = 272 + 8 + 1 + 8,
927 static const struct panel_desc giantplus_gpg482739qs5 = {
928 .modes = &giantplus_gpg482739qs5_mode,
935 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
938 static const struct display_timing hannstar_hsd070pww1_timing = {
939 .pixelclock = { 64300000, 71100000, 82000000 },
940 .hactive = { 1280, 1280, 1280 },
941 .hfront_porch = { 1, 1, 10 },
942 .hback_porch = { 1, 1, 10 },
944 * According to the data sheet, the minimum horizontal blanking interval
945 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
946 * minimum working horizontal blanking interval to be 60 clocks.
948 .hsync_len = { 58, 158, 661 },
949 .vactive = { 800, 800, 800 },
950 .vfront_porch = { 1, 1, 10 },
951 .vback_porch = { 1, 1, 10 },
952 .vsync_len = { 1, 21, 203 },
953 .flags = DISPLAY_FLAGS_DE_HIGH,
956 static const struct panel_desc hannstar_hsd070pww1 = {
957 .timings = &hannstar_hsd070pww1_timing,
964 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
967 static const struct display_timing hannstar_hsd100pxn1_timing = {
968 .pixelclock = { 55000000, 65000000, 75000000 },
969 .hactive = { 1024, 1024, 1024 },
970 .hfront_porch = { 40, 40, 40 },
971 .hback_porch = { 220, 220, 220 },
972 .hsync_len = { 20, 60, 100 },
973 .vactive = { 768, 768, 768 },
974 .vfront_porch = { 7, 7, 7 },
975 .vback_porch = { 21, 21, 21 },
976 .vsync_len = { 10, 10, 10 },
977 .flags = DISPLAY_FLAGS_DE_HIGH,
980 static const struct panel_desc hannstar_hsd100pxn1 = {
981 .timings = &hannstar_hsd100pxn1_timing,
988 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
991 static const struct drm_display_mode hitachi_tx23d38vm0caa_mode = {
994 .hsync_start = 800 + 85,
995 .hsync_end = 800 + 85 + 86,
996 .htotal = 800 + 85 + 86 + 85,
998 .vsync_start = 480 + 16,
999 .vsync_end = 480 + 16 + 13,
1000 .vtotal = 480 + 16 + 13 + 16,
1004 static const struct panel_desc hitachi_tx23d38vm0caa = {
1005 .modes = &hitachi_tx23d38vm0caa_mode,
1014 static const struct drm_display_mode innolux_at043tn24_mode = {
1017 .hsync_start = 480 + 2,
1018 .hsync_end = 480 + 2 + 41,
1019 .htotal = 480 + 2 + 41 + 2,
1021 .vsync_start = 272 + 2,
1022 .vsync_end = 272 + 2 + 11,
1023 .vtotal = 272 + 2 + 11 + 2,
1025 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1028 static const struct panel_desc innolux_at043tn24 = {
1029 .modes = &innolux_at043tn24_mode,
1036 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1039 static const struct drm_display_mode innolux_at070tn92_mode = {
1042 .hsync_start = 800 + 210,
1043 .hsync_end = 800 + 210 + 20,
1044 .htotal = 800 + 210 + 20 + 46,
1046 .vsync_start = 480 + 22,
1047 .vsync_end = 480 + 22 + 10,
1048 .vtotal = 480 + 22 + 23 + 10,
1052 static const struct panel_desc innolux_at070tn92 = {
1053 .modes = &innolux_at070tn92_mode,
1059 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1062 static const struct display_timing innolux_g101ice_l01_timing = {
1063 .pixelclock = { 60400000, 71100000, 74700000 },
1064 .hactive = { 1280, 1280, 1280 },
1065 .hfront_porch = { 41, 80, 100 },
1066 .hback_porch = { 40, 79, 99 },
1067 .hsync_len = { 1, 1, 1 },
1068 .vactive = { 800, 800, 800 },
1069 .vfront_porch = { 5, 11, 14 },
1070 .vback_porch = { 4, 11, 14 },
1071 .vsync_len = { 1, 1, 1 },
1072 .flags = DISPLAY_FLAGS_DE_HIGH,
1075 static const struct panel_desc innolux_g101ice_l01 = {
1076 .timings = &innolux_g101ice_l01_timing,
1087 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1090 static const struct display_timing innolux_g121i1_l01_timing = {
1091 .pixelclock = { 67450000, 71000000, 74550000 },
1092 .hactive = { 1280, 1280, 1280 },
1093 .hfront_porch = { 40, 80, 160 },
1094 .hback_porch = { 39, 79, 159 },
1095 .hsync_len = { 1, 1, 1 },
1096 .vactive = { 800, 800, 800 },
1097 .vfront_porch = { 5, 11, 100 },
1098 .vback_porch = { 4, 11, 99 },
1099 .vsync_len = { 1, 1, 1 },
1102 static const struct panel_desc innolux_g121i1_l01 = {
1103 .timings = &innolux_g121i1_l01_timing,
1114 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1117 static const struct drm_display_mode innolux_g121x1_l03_mode = {
1120 .hsync_start = 1024 + 0,
1121 .hsync_end = 1024 + 1,
1122 .htotal = 1024 + 0 + 1 + 320,
1124 .vsync_start = 768 + 38,
1125 .vsync_end = 768 + 38 + 1,
1126 .vtotal = 768 + 38 + 1 + 0,
1128 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1131 static const struct panel_desc innolux_g121x1_l03 = {
1132 .modes = &innolux_g121x1_l03_mode,
1146 static const struct drm_display_mode innolux_n116bge_mode = {
1149 .hsync_start = 1366 + 136,
1150 .hsync_end = 1366 + 136 + 30,
1151 .htotal = 1366 + 136 + 30 + 60,
1153 .vsync_start = 768 + 8,
1154 .vsync_end = 768 + 8 + 12,
1155 .vtotal = 768 + 8 + 12 + 12,
1157 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1160 static const struct panel_desc innolux_n116bge = {
1161 .modes = &innolux_n116bge_mode,
1170 static const struct drm_display_mode innolux_n156bge_l21_mode = {
1173 .hsync_start = 1366 + 16,
1174 .hsync_end = 1366 + 16 + 34,
1175 .htotal = 1366 + 16 + 34 + 50,
1177 .vsync_start = 768 + 2,
1178 .vsync_end = 768 + 2 + 6,
1179 .vtotal = 768 + 2 + 6 + 12,
1183 static const struct panel_desc innolux_n156bge_l21 = {
1184 .modes = &innolux_n156bge_l21_mode,
1193 static const struct drm_display_mode innolux_zj070na_01p_mode = {
1196 .hsync_start = 1024 + 128,
1197 .hsync_end = 1024 + 128 + 64,
1198 .htotal = 1024 + 128 + 64 + 128,
1200 .vsync_start = 600 + 16,
1201 .vsync_end = 600 + 16 + 4,
1202 .vtotal = 600 + 16 + 4 + 16,
1206 static const struct panel_desc innolux_zj070na_01p = {
1207 .modes = &innolux_zj070na_01p_mode,
1216 static const struct display_timing kyo_tcg121xglp_timing = {
1217 .pixelclock = { 52000000, 65000000, 71000000 },
1218 .hactive = { 1024, 1024, 1024 },
1219 .hfront_porch = { 2, 2, 2 },
1220 .hback_porch = { 2, 2, 2 },
1221 .hsync_len = { 86, 124, 244 },
1222 .vactive = { 768, 768, 768 },
1223 .vfront_porch = { 2, 2, 2 },
1224 .vback_porch = { 2, 2, 2 },
1225 .vsync_len = { 6, 34, 73 },
1226 .flags = DISPLAY_FLAGS_DE_HIGH,
1229 static const struct panel_desc kyo_tcg121xglp = {
1230 .timings = &kyo_tcg121xglp_timing,
1237 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1240 static const struct drm_display_mode lg_lb070wv8_mode = {
1243 .hsync_start = 800 + 88,
1244 .hsync_end = 800 + 88 + 80,
1245 .htotal = 800 + 88 + 80 + 88,
1247 .vsync_start = 480 + 10,
1248 .vsync_end = 480 + 10 + 25,
1249 .vtotal = 480 + 10 + 25 + 10,
1253 static const struct panel_desc lg_lb070wv8 = {
1254 .modes = &lg_lb070wv8_mode,
1261 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1264 static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1267 .hsync_start = 1536 + 12,
1268 .hsync_end = 1536 + 12 + 16,
1269 .htotal = 1536 + 12 + 16 + 48,
1271 .vsync_start = 2048 + 8,
1272 .vsync_end = 2048 + 8 + 4,
1273 .vtotal = 2048 + 8 + 4 + 8,
1275 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1278 static const struct panel_desc lg_lp079qx1_sp0v = {
1279 .modes = &lg_lp079qx1_sp0v_mode,
1287 static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1290 .hsync_start = 2048 + 150,
1291 .hsync_end = 2048 + 150 + 5,
1292 .htotal = 2048 + 150 + 5 + 5,
1294 .vsync_start = 1536 + 3,
1295 .vsync_end = 1536 + 3 + 1,
1296 .vtotal = 1536 + 3 + 1 + 9,
1300 static const struct panel_desc lg_lp097qx1_spa1 = {
1301 .modes = &lg_lp097qx1_spa1_mode,
1309 static const struct drm_display_mode lg_lp120up1_mode = {
1312 .hsync_start = 1920 + 40,
1313 .hsync_end = 1920 + 40 + 40,
1314 .htotal = 1920 + 40 + 40+ 80,
1316 .vsync_start = 1280 + 4,
1317 .vsync_end = 1280 + 4 + 4,
1318 .vtotal = 1280 + 4 + 4 + 12,
1322 static const struct panel_desc lg_lp120up1 = {
1323 .modes = &lg_lp120up1_mode,
1332 static const struct drm_display_mode lg_lp129qe_mode = {
1335 .hsync_start = 2560 + 48,
1336 .hsync_end = 2560 + 48 + 32,
1337 .htotal = 2560 + 48 + 32 + 80,
1339 .vsync_start = 1700 + 3,
1340 .vsync_end = 1700 + 3 + 10,
1341 .vtotal = 1700 + 3 + 10 + 36,
1345 static const struct panel_desc lg_lp129qe = {
1346 .modes = &lg_lp129qe_mode,
1355 static const struct display_timing nec_nl12880bc20_05_timing = {
1356 .pixelclock = { 67000000, 71000000, 75000000 },
1357 .hactive = { 1280, 1280, 1280 },
1358 .hfront_porch = { 2, 30, 30 },
1359 .hback_porch = { 6, 100, 100 },
1360 .hsync_len = { 2, 30, 30 },
1361 .vactive = { 800, 800, 800 },
1362 .vfront_porch = { 5, 5, 5 },
1363 .vback_porch = { 11, 11, 11 },
1364 .vsync_len = { 7, 7, 7 },
1367 static const struct panel_desc nec_nl12880bc20_05 = {
1368 .timings = &nec_nl12880bc20_05_timing,
1379 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1382 static const struct drm_display_mode nec_nl4827hc19_05b_mode = {
1385 .hsync_start = 480 + 2,
1386 .hsync_end = 480 + 2 + 41,
1387 .htotal = 480 + 2 + 41 + 2,
1389 .vsync_start = 272 + 2,
1390 .vsync_end = 272 + 2 + 4,
1391 .vtotal = 272 + 2 + 4 + 2,
1393 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1396 static const struct panel_desc nec_nl4827hc19_05b = {
1397 .modes = &nec_nl4827hc19_05b_mode,
1404 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1405 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
1408 static const struct drm_display_mode netron_dy_e231732_mode = {
1411 .hsync_start = 1024 + 160,
1412 .hsync_end = 1024 + 160 + 70,
1413 .htotal = 1024 + 160 + 70 + 90,
1415 .vsync_start = 600 + 127,
1416 .vsync_end = 600 + 127 + 20,
1417 .vtotal = 600 + 127 + 20 + 3,
1421 static const struct panel_desc netron_dy_e231732 = {
1422 .modes = &netron_dy_e231732_mode,
1428 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1431 static const struct display_timing nlt_nl192108ac18_02d_timing = {
1432 .pixelclock = { 130000000, 148350000, 163000000 },
1433 .hactive = { 1920, 1920, 1920 },
1434 .hfront_porch = { 80, 100, 100 },
1435 .hback_porch = { 100, 120, 120 },
1436 .hsync_len = { 50, 60, 60 },
1437 .vactive = { 1080, 1080, 1080 },
1438 .vfront_porch = { 12, 30, 30 },
1439 .vback_porch = { 4, 10, 10 },
1440 .vsync_len = { 4, 5, 5 },
1443 static const struct panel_desc nlt_nl192108ac18_02d = {
1444 .timings = &nlt_nl192108ac18_02d_timing,
1454 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1457 static const struct drm_display_mode nvd_9128_mode = {
1460 .hsync_start = 800 + 130,
1461 .hsync_end = 800 + 130 + 98,
1462 .htotal = 800 + 0 + 130 + 98,
1464 .vsync_start = 480 + 10,
1465 .vsync_end = 480 + 10 + 50,
1466 .vtotal = 480 + 0 + 10 + 50,
1469 static const struct panel_desc nvd_9128 = {
1470 .modes = &nvd_9128_mode,
1477 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1480 static const struct display_timing okaya_rs800480t_7x0gp_timing = {
1481 .pixelclock = { 30000000, 30000000, 40000000 },
1482 .hactive = { 800, 800, 800 },
1483 .hfront_porch = { 40, 40, 40 },
1484 .hback_porch = { 40, 40, 40 },
1485 .hsync_len = { 1, 48, 48 },
1486 .vactive = { 480, 480, 480 },
1487 .vfront_porch = { 13, 13, 13 },
1488 .vback_porch = { 29, 29, 29 },
1489 .vsync_len = { 3, 3, 3 },
1490 .flags = DISPLAY_FLAGS_DE_HIGH,
1493 static const struct panel_desc okaya_rs800480t_7x0gp = {
1494 .timings = &okaya_rs800480t_7x0gp_timing,
1507 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1510 static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode = {
1513 .hsync_start = 480 + 5,
1514 .hsync_end = 480 + 5 + 30,
1515 .htotal = 480 + 5 + 30 + 10,
1517 .vsync_start = 272 + 8,
1518 .vsync_end = 272 + 8 + 5,
1519 .vtotal = 272 + 8 + 5 + 3,
1523 static const struct panel_desc olimex_lcd_olinuxino_43ts = {
1524 .modes = &olimex_lcd_olinuxino_43ts_mode,
1530 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1534 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1535 * pixel clocks, but this is the timing that was being used in the Adafruit
1536 * installation instructions.
1538 static const struct drm_display_mode ontat_yx700wv03_mode = {
1549 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1554 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1556 static const struct panel_desc ontat_yx700wv03 = {
1557 .modes = &ontat_yx700wv03_mode,
1564 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1567 static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
1570 .hsync_start = 480 + 10,
1571 .hsync_end = 480 + 10 + 10,
1572 .htotal = 480 + 10 + 10 + 15,
1574 .vsync_start = 800 + 3,
1575 .vsync_end = 800 + 3 + 3,
1576 .vtotal = 800 + 3 + 3 + 3,
1580 static const struct panel_desc ortustech_com43h4m85ulc = {
1581 .modes = &ortustech_com43h4m85ulc_mode,
1588 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1589 .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_POSEDGE,
1592 static const struct drm_display_mode qd43003c0_40_mode = {
1595 .hsync_start = 480 + 8,
1596 .hsync_end = 480 + 8 + 4,
1597 .htotal = 480 + 8 + 4 + 39,
1599 .vsync_start = 272 + 4,
1600 .vsync_end = 272 + 4 + 10,
1601 .vtotal = 272 + 4 + 10 + 2,
1605 static const struct panel_desc qd43003c0_40 = {
1606 .modes = &qd43003c0_40_mode,
1613 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1616 static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
1619 .hsync_start = 2560 + 48,
1620 .hsync_end = 2560 + 48 + 32,
1621 .htotal = 2560 + 48 + 32 + 80,
1623 .vsync_start = 1600 + 2,
1624 .vsync_end = 1600 + 2 + 5,
1625 .vtotal = 1600 + 2 + 5 + 57,
1629 static const struct panel_desc samsung_lsn122dl01_c01 = {
1630 .modes = &samsung_lsn122dl01_c01_mode,
1638 static const struct drm_display_mode samsung_ltn101nt05_mode = {
1641 .hsync_start = 1024 + 24,
1642 .hsync_end = 1024 + 24 + 136,
1643 .htotal = 1024 + 24 + 136 + 160,
1645 .vsync_start = 600 + 3,
1646 .vsync_end = 600 + 3 + 6,
1647 .vtotal = 600 + 3 + 6 + 61,
1651 static const struct panel_desc samsung_ltn101nt05 = {
1652 .modes = &samsung_ltn101nt05_mode,
1661 static const struct drm_display_mode samsung_ltn140at29_301_mode = {
1664 .hsync_start = 1366 + 64,
1665 .hsync_end = 1366 + 64 + 48,
1666 .htotal = 1366 + 64 + 48 + 128,
1668 .vsync_start = 768 + 2,
1669 .vsync_end = 768 + 2 + 5,
1670 .vtotal = 768 + 2 + 5 + 17,
1674 static const struct panel_desc samsung_ltn140at29_301 = {
1675 .modes = &samsung_ltn140at29_301_mode,
1684 static const struct display_timing sharp_lq101k1ly04_timing = {
1685 .pixelclock = { 60000000, 65000000, 80000000 },
1686 .hactive = { 1280, 1280, 1280 },
1687 .hfront_porch = { 20, 20, 20 },
1688 .hback_porch = { 20, 20, 20 },
1689 .hsync_len = { 10, 10, 10 },
1690 .vactive = { 800, 800, 800 },
1691 .vfront_porch = { 4, 4, 4 },
1692 .vback_porch = { 4, 4, 4 },
1693 .vsync_len = { 4, 4, 4 },
1694 .flags = DISPLAY_FLAGS_PIXDATA_POSEDGE,
1697 static const struct panel_desc sharp_lq101k1ly04 = {
1698 .timings = &sharp_lq101k1ly04_timing,
1705 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
1708 static const struct drm_display_mode sharp_lq123p1jx31_mode = {
1711 .hsync_start = 2400 + 48,
1712 .hsync_end = 2400 + 48 + 32,
1713 .htotal = 2400 + 48 + 32 + 80,
1715 .vsync_start = 1600 + 3,
1716 .vsync_end = 1600 + 3 + 10,
1717 .vtotal = 1600 + 3 + 10 + 33,
1719 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1722 static const struct panel_desc sharp_lq123p1jx31 = {
1723 .modes = &sharp_lq123p1jx31_mode,
1737 static const struct drm_display_mode sharp_lq150x1lg11_mode = {
1740 .hsync_start = 1024 + 168,
1741 .hsync_end = 1024 + 168 + 64,
1742 .htotal = 1024 + 168 + 64 + 88,
1744 .vsync_start = 768 + 37,
1745 .vsync_end = 768 + 37 + 2,
1746 .vtotal = 768 + 37 + 2 + 8,
1750 static const struct panel_desc sharp_lq150x1lg11 = {
1751 .modes = &sharp_lq150x1lg11_mode,
1758 .bus_format = MEDIA_BUS_FMT_RGB565_1X16,
1761 static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode = {
1764 .hsync_start = 800 + 1,
1765 .hsync_end = 800 + 1 + 64,
1766 .htotal = 800 + 1 + 64 + 64,
1768 .vsync_start = 480 + 1,
1769 .vsync_end = 480 + 1 + 23,
1770 .vtotal = 480 + 1 + 23 + 22,
1774 static const struct panel_desc shelly_sca07010_bfn_lnn = {
1775 .modes = &shelly_sca07010_bfn_lnn_mode,
1781 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1784 static const struct drm_display_mode starry_kr122ea0sra_mode = {
1787 .hsync_start = 1920 + 16,
1788 .hsync_end = 1920 + 16 + 16,
1789 .htotal = 1920 + 16 + 16 + 32,
1791 .vsync_start = 1200 + 15,
1792 .vsync_end = 1200 + 15 + 2,
1793 .vtotal = 1200 + 15 + 2 + 18,
1795 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1798 static const struct panel_desc starry_kr122ea0sra = {
1799 .modes = &starry_kr122ea0sra_mode,
1806 .prepare = 10 + 200,
1808 .unprepare = 10 + 500,
1812 static const struct display_timing tianma_tm070jdhg30_timing = {
1813 .pixelclock = { 62600000, 68200000, 78100000 },
1814 .hactive = { 1280, 1280, 1280 },
1815 .hfront_porch = { 15, 64, 159 },
1816 .hback_porch = { 5, 5, 5 },
1817 .hsync_len = { 1, 1, 256 },
1818 .vactive = { 800, 800, 800 },
1819 .vfront_porch = { 3, 40, 99 },
1820 .vback_porch = { 2, 2, 2 },
1821 .vsync_len = { 1, 1, 128 },
1822 .flags = DISPLAY_FLAGS_DE_HIGH,
1825 static const struct panel_desc tianma_tm070jdhg30 = {
1826 .timings = &tianma_tm070jdhg30_timing,
1833 .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
1836 static const struct drm_display_mode tpk_f07a_0102_mode = {
1839 .hsync_start = 800 + 40,
1840 .hsync_end = 800 + 40 + 128,
1841 .htotal = 800 + 40 + 128 + 88,
1843 .vsync_start = 480 + 10,
1844 .vsync_end = 480 + 10 + 2,
1845 .vtotal = 480 + 10 + 2 + 33,
1849 static const struct panel_desc tpk_f07a_0102 = {
1850 .modes = &tpk_f07a_0102_mode,
1856 .bus_flags = DRM_BUS_FLAG_PIXDATA_POSEDGE,
1859 static const struct drm_display_mode tpk_f10a_0102_mode = {
1862 .hsync_start = 1024 + 176,
1863 .hsync_end = 1024 + 176 + 5,
1864 .htotal = 1024 + 176 + 5 + 88,
1866 .vsync_start = 600 + 20,
1867 .vsync_end = 600 + 20 + 5,
1868 .vtotal = 600 + 20 + 5 + 25,
1872 static const struct panel_desc tpk_f10a_0102 = {
1873 .modes = &tpk_f10a_0102_mode,
1881 static const struct display_timing urt_umsh_8596md_timing = {
1882 .pixelclock = { 33260000, 33260000, 33260000 },
1883 .hactive = { 800, 800, 800 },
1884 .hfront_porch = { 41, 41, 41 },
1885 .hback_porch = { 216 - 128, 216 - 128, 216 - 128 },
1886 .hsync_len = { 71, 128, 128 },
1887 .vactive = { 480, 480, 480 },
1888 .vfront_porch = { 10, 10, 10 },
1889 .vback_porch = { 35 - 2, 35 - 2, 35 - 2 },
1890 .vsync_len = { 2, 2, 2 },
1891 .flags = DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE |
1892 DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW,
1895 static const struct panel_desc urt_umsh_8596md_lvds = {
1896 .timings = &urt_umsh_8596md_timing,
1903 .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG,
1906 static const struct panel_desc urt_umsh_8596md_parallel = {
1907 .timings = &urt_umsh_8596md_timing,
1914 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
1917 static const struct drm_display_mode winstar_wf35ltiacd_mode = {
1920 .hsync_start = 320 + 20,
1921 .hsync_end = 320 + 20 + 30,
1922 .htotal = 320 + 20 + 30 + 38,
1924 .vsync_start = 240 + 4,
1925 .vsync_end = 240 + 4 + 3,
1926 .vtotal = 240 + 4 + 3 + 15,
1928 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1931 static const struct panel_desc winstar_wf35ltiacd = {
1932 .modes = &winstar_wf35ltiacd_mode,
1939 .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
1942 static const struct of_device_id platform_of_match[] = {
1944 .compatible = "ampire,am-480272h3tmqw-t01h",
1945 .data = &ire_am_480272h3tmqw_t01h,
1947 .compatible = "ampire,am800480r3tmqwa1h",
1948 .data = &ire_am800480r3tmqwa1h,
1950 .compatible = "auo,b101aw03",
1951 .data = &auo_b101aw03,
1953 .compatible = "auo,b101ean01",
1954 .data = &auo_b101ean01,
1956 .compatible = "auo,b101xtn01",
1957 .data = &auo_b101xtn01,
1959 .compatible = "auo,b116xw03",
1960 .data = &auo_b116xw03,
1962 .compatible = "auo,b133htn01",
1963 .data = &auo_b133htn01,
1965 .compatible = "auo,b133xtn01",
1966 .data = &auo_b133xtn01,
1968 .compatible = "auo,g133han01",
1969 .data = &auo_g133han01,
1971 .compatible = "auo,g185han01",
1972 .data = &auo_g185han01,
1974 .compatible = "auo,p320hvn03",
1975 .data = &auo_p320hvn03,
1977 .compatible = "auo,t215hvn01",
1978 .data = &auo_t215hvn01,
1980 .compatible = "avic,tm070ddh03",
1981 .data = &avic_tm070ddh03,
1983 .compatible = "boe,nv101wxmn51",
1984 .data = &boe_nv101wxmn51,
1986 .compatible = "chunghwa,claa070wp03xg",
1987 .data = &chunghwa_claa070wp03xg,
1989 .compatible = "chunghwa,claa101wa01a",
1990 .data = &chunghwa_claa101wa01a
1992 .compatible = "chunghwa,claa101wb01",
1993 .data = &chunghwa_claa101wb01
1995 .compatible = "edt,et057090dhu",
1996 .data = &edt_et057090dhu,
1998 .compatible = "edt,et070080dh6",
1999 .data = &edt_etm0700g0dh6,
2001 .compatible = "edt,etm0700g0dh6",
2002 .data = &edt_etm0700g0dh6,
2004 .compatible = "foxlink,fl500wvr00-a0t",
2005 .data = &foxlink_fl500wvr00_a0t,
2007 .compatible = "giantplus,gpg482739qs5",
2008 .data = &giantplus_gpg482739qs5
2010 .compatible = "hannstar,hsd070pww1",
2011 .data = &hannstar_hsd070pww1,
2013 .compatible = "hannstar,hsd100pxn1",
2014 .data = &hannstar_hsd100pxn1,
2016 .compatible = "hit,tx23d38vm0caa",
2017 .data = &hitachi_tx23d38vm0caa
2019 .compatible = "innolux,at043tn24",
2020 .data = &innolux_at043tn24,
2022 .compatible = "innolux,at070tn92",
2023 .data = &innolux_at070tn92,
2025 .compatible ="innolux,g101ice-l01",
2026 .data = &innolux_g101ice_l01
2028 .compatible ="innolux,g121i1-l01",
2029 .data = &innolux_g121i1_l01
2031 .compatible = "innolux,g121x1-l03",
2032 .data = &innolux_g121x1_l03,
2034 .compatible = "innolux,n116bge",
2035 .data = &innolux_n116bge,
2037 .compatible = "innolux,n156bge-l21",
2038 .data = &innolux_n156bge_l21,
2040 .compatible = "innolux,zj070na-01p",
2041 .data = &innolux_zj070na_01p,
2043 .compatible = "kyo,tcg121xglp",
2044 .data = &kyo_tcg121xglp,
2046 .compatible = "lg,lb070wv8",
2047 .data = &lg_lb070wv8,
2049 .compatible = "lg,lp079qx1-sp0v",
2050 .data = &lg_lp079qx1_sp0v,
2052 .compatible = "lg,lp097qx1-spa1",
2053 .data = &lg_lp097qx1_spa1,
2055 .compatible = "lg,lp120up1",
2056 .data = &lg_lp120up1,
2058 .compatible = "lg,lp129qe",
2059 .data = &lg_lp129qe,
2061 .compatible = "nec,nl12880bc20-05",
2062 .data = &nec_nl12880bc20_05,
2064 .compatible = "nec,nl4827hc19-05b",
2065 .data = &nec_nl4827hc19_05b,
2067 .compatible = "netron-dy,e231732",
2068 .data = &netron_dy_e231732,
2070 .compatible = "nlt,nl192108ac18-02d",
2071 .data = &nlt_nl192108ac18_02d,
2073 .compatible = "nvd,9128",
2076 .compatible = "okaya,rs800480t-7x0gp",
2077 .data = &okaya_rs800480t_7x0gp,
2079 .compatible = "olimex,lcd-olinuxino-43-ts",
2080 .data = &olimex_lcd_olinuxino_43ts,
2082 .compatible = "ontat,yx700wv03",
2083 .data = &ontat_yx700wv03,
2085 .compatible = "ortustech,com43h4m85ulc",
2086 .data = &ortustech_com43h4m85ulc,
2088 .compatible = "qiaodian,qd43003c0-40",
2089 .data = &qd43003c0_40,
2091 .compatible = "samsung,lsn122dl01-c01",
2092 .data = &samsung_lsn122dl01_c01,
2094 .compatible = "samsung,ltn101nt05",
2095 .data = &samsung_ltn101nt05,
2097 .compatible = "samsung,ltn140at29-301",
2098 .data = &samsung_ltn140at29_301,
2100 .compatible = "sharp,lq101k1ly04",
2101 .data = &sharp_lq101k1ly04,
2103 .compatible = "sharp,lq123p1jx31",
2104 .data = &sharp_lq123p1jx31,
2106 .compatible = "sharp,lq150x1lg11",
2107 .data = &sharp_lq150x1lg11,
2109 .compatible = "shelly,sca07010-bfn-lnn",
2110 .data = &shelly_sca07010_bfn_lnn,
2112 .compatible = "starry,kr122ea0sra",
2113 .data = &starry_kr122ea0sra,
2115 .compatible = "tianma,tm070jdhg30",
2116 .data = &tianma_tm070jdhg30,
2118 .compatible = "tpk,f07a-0102",
2119 .data = &tpk_f07a_0102,
2121 .compatible = "tpk,f10a-0102",
2122 .data = &tpk_f10a_0102,
2124 .compatible = "urt,umsh-8596md-t",
2125 .data = &urt_umsh_8596md_parallel,
2127 .compatible = "urt,umsh-8596md-1t",
2128 .data = &urt_umsh_8596md_parallel,
2130 .compatible = "urt,umsh-8596md-7t",
2131 .data = &urt_umsh_8596md_parallel,
2133 .compatible = "urt,umsh-8596md-11t",
2134 .data = &urt_umsh_8596md_lvds,
2136 .compatible = "urt,umsh-8596md-19t",
2137 .data = &urt_umsh_8596md_lvds,
2139 .compatible = "urt,umsh-8596md-20t",
2140 .data = &urt_umsh_8596md_parallel,
2142 .compatible = "winstar,wf35ltiacd",
2143 .data = &winstar_wf35ltiacd,
2148 MODULE_DEVICE_TABLE(of, platform_of_match);
2150 static int panel_simple_platform_probe(struct platform_device *pdev)
2152 const struct of_device_id *id;
2154 id = of_match_node(platform_of_match, pdev->dev.of_node);
2158 return panel_simple_probe(&pdev->dev, id->data);
2161 static int panel_simple_platform_remove(struct platform_device *pdev)
2163 return panel_simple_remove(&pdev->dev);
2166 static void panel_simple_platform_shutdown(struct platform_device *pdev)
2168 panel_simple_shutdown(&pdev->dev);
2171 static struct platform_driver panel_simple_platform_driver = {
2173 .name = "panel-simple",
2174 .of_match_table = platform_of_match,
2176 .probe = panel_simple_platform_probe,
2177 .remove = panel_simple_platform_remove,
2178 .shutdown = panel_simple_platform_shutdown,
2181 struct panel_desc_dsi {
2182 struct panel_desc desc;
2184 unsigned long flags;
2185 enum mipi_dsi_pixel_format format;
2189 static const struct drm_display_mode auo_b080uan01_mode = {
2192 .hsync_start = 1200 + 62,
2193 .hsync_end = 1200 + 62 + 4,
2194 .htotal = 1200 + 62 + 4 + 62,
2196 .vsync_start = 1920 + 9,
2197 .vsync_end = 1920 + 9 + 2,
2198 .vtotal = 1920 + 9 + 2 + 8,
2202 static const struct panel_desc_dsi auo_b080uan01 = {
2204 .modes = &auo_b080uan01_mode,
2212 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2213 .format = MIPI_DSI_FMT_RGB888,
2217 static const struct drm_display_mode boe_tv080wum_nl0_mode = {
2220 .hsync_start = 1200 + 120,
2221 .hsync_end = 1200 + 120 + 20,
2222 .htotal = 1200 + 120 + 20 + 21,
2224 .vsync_start = 1920 + 21,
2225 .vsync_end = 1920 + 21 + 3,
2226 .vtotal = 1920 + 21 + 3 + 18,
2228 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
2231 static const struct panel_desc_dsi boe_tv080wum_nl0 = {
2233 .modes = &boe_tv080wum_nl0_mode,
2240 .flags = MIPI_DSI_MODE_VIDEO |
2241 MIPI_DSI_MODE_VIDEO_BURST |
2242 MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
2243 .format = MIPI_DSI_FMT_RGB888,
2247 static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
2250 .hsync_start = 800 + 32,
2251 .hsync_end = 800 + 32 + 1,
2252 .htotal = 800 + 32 + 1 + 57,
2254 .vsync_start = 1280 + 28,
2255 .vsync_end = 1280 + 28 + 1,
2256 .vtotal = 1280 + 28 + 1 + 14,
2260 static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
2262 .modes = &lg_ld070wx3_sl01_mode,
2270 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_CLOCK_NON_CONTINUOUS,
2271 .format = MIPI_DSI_FMT_RGB888,
2275 static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
2278 .hsync_start = 720 + 12,
2279 .hsync_end = 720 + 12 + 4,
2280 .htotal = 720 + 12 + 4 + 112,
2282 .vsync_start = 1280 + 8,
2283 .vsync_end = 1280 + 8 + 4,
2284 .vtotal = 1280 + 8 + 4 + 12,
2288 static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
2290 .modes = &lg_lh500wx1_sd03_mode,
2298 .flags = MIPI_DSI_MODE_VIDEO,
2299 .format = MIPI_DSI_FMT_RGB888,
2303 static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
2306 .hsync_start = 1920 + 154,
2307 .hsync_end = 1920 + 154 + 16,
2308 .htotal = 1920 + 154 + 16 + 32,
2310 .vsync_start = 1200 + 17,
2311 .vsync_end = 1200 + 17 + 2,
2312 .vtotal = 1200 + 17 + 2 + 16,
2316 static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
2318 .modes = &panasonic_vvx10f004b00_mode,
2326 .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
2327 MIPI_DSI_CLOCK_NON_CONTINUOUS,
2328 .format = MIPI_DSI_FMT_RGB888,
2332 static const struct of_device_id dsi_of_match[] = {
2334 .compatible = "auo,b080uan01",
2335 .data = &auo_b080uan01
2337 .compatible = "boe,tv080wum-nl0",
2338 .data = &boe_tv080wum_nl0
2340 .compatible = "lg,ld070wx3-sl01",
2341 .data = &lg_ld070wx3_sl01
2343 .compatible = "lg,lh500wx1-sd03",
2344 .data = &lg_lh500wx1_sd03
2346 .compatible = "panasonic,vvx10f004b00",
2347 .data = &panasonic_vvx10f004b00
2352 MODULE_DEVICE_TABLE(of, dsi_of_match);
2354 static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
2356 const struct panel_desc_dsi *desc;
2357 const struct of_device_id *id;
2360 id = of_match_node(dsi_of_match, dsi->dev.of_node);
2366 err = panel_simple_probe(&dsi->dev, &desc->desc);
2370 dsi->mode_flags = desc->flags;
2371 dsi->format = desc->format;
2372 dsi->lanes = desc->lanes;
2374 err = mipi_dsi_attach(dsi);
2376 struct panel_simple *panel = dev_get_drvdata(&dsi->dev);
2378 drm_panel_remove(&panel->base);
2384 static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
2388 err = mipi_dsi_detach(dsi);
2390 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
2392 return panel_simple_remove(&dsi->dev);
2395 static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
2397 panel_simple_shutdown(&dsi->dev);
2400 static struct mipi_dsi_driver panel_simple_dsi_driver = {
2402 .name = "panel-simple-dsi",
2403 .of_match_table = dsi_of_match,
2405 .probe = panel_simple_dsi_probe,
2406 .remove = panel_simple_dsi_remove,
2407 .shutdown = panel_simple_dsi_shutdown,
2410 static int __init panel_simple_init(void)
2414 err = platform_driver_register(&panel_simple_platform_driver);
2418 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
2419 err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
2426 module_init(panel_simple_init);
2428 static void __exit panel_simple_exit(void)
2430 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
2431 mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
2433 platform_driver_unregister(&panel_simple_platform_driver);
2435 module_exit(panel_simple_exit);
2437 MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
2438 MODULE_DESCRIPTION("DRM Driver for Simple Panels");
2439 MODULE_LICENSE("GPL and additional rights");