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 display_timing auo_g133han01_timings
= {
585 .pixelclock
= { 134000000, 141200000, 149000000 },
586 .hactive
= { 1920, 1920, 1920 },
587 .hfront_porch
= { 39, 58, 77 },
588 .hback_porch
= { 59, 88, 117 },
589 .hsync_len
= { 28, 42, 56 },
590 .vactive
= { 1080, 1080, 1080 },
591 .vfront_porch
= { 3, 8, 11 },
592 .vback_porch
= { 5, 14, 19 },
593 .vsync_len
= { 4, 14, 19 },
596 static const struct panel_desc auo_g133han01
= {
597 .timings
= &auo_g133han01_timings
,
610 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA
,
613 static const struct display_timing auo_g185han01_timings
= {
614 .pixelclock
= { 120000000, 144000000, 175000000 },
615 .hactive
= { 1920, 1920, 1920 },
616 .hfront_porch
= { 18, 60, 74 },
617 .hback_porch
= { 12, 44, 54 },
618 .hsync_len
= { 10, 24, 32 },
619 .vactive
= { 1080, 1080, 1080 },
620 .vfront_porch
= { 6, 10, 40 },
621 .vback_porch
= { 2, 5, 20 },
622 .vsync_len
= { 2, 5, 20 },
625 static const struct panel_desc auo_g185han01
= {
626 .timings
= &auo_g185han01_timings
,
639 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
642 static const struct display_timing auo_p320hvn03_timings
= {
643 .pixelclock
= { 106000000, 148500000, 164000000 },
644 .hactive
= { 1920, 1920, 1920 },
645 .hfront_porch
= { 25, 50, 130 },
646 .hback_porch
= { 25, 50, 130 },
647 .hsync_len
= { 20, 40, 105 },
648 .vactive
= { 1080, 1080, 1080 },
649 .vfront_porch
= { 8, 17, 150 },
650 .vback_porch
= { 8, 17, 150 },
651 .vsync_len
= { 4, 11, 100 },
654 static const struct panel_desc auo_p320hvn03
= {
655 .timings
= &auo_p320hvn03_timings
,
667 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA
,
670 static const struct drm_display_mode auo_t215hvn01_mode
= {
673 .hsync_start
= 1920 + 88,
674 .hsync_end
= 1920 + 88 + 44,
675 .htotal
= 1920 + 88 + 44 + 148,
677 .vsync_start
= 1080 + 4,
678 .vsync_end
= 1080 + 4 + 5,
679 .vtotal
= 1080 + 4 + 5 + 36,
683 static const struct panel_desc auo_t215hvn01
= {
684 .modes
= &auo_t215hvn01_mode
,
697 static const struct drm_display_mode avic_tm070ddh03_mode
= {
700 .hsync_start
= 1024 + 160,
701 .hsync_end
= 1024 + 160 + 4,
702 .htotal
= 1024 + 160 + 4 + 156,
704 .vsync_start
= 600 + 17,
705 .vsync_end
= 600 + 17 + 1,
706 .vtotal
= 600 + 17 + 1 + 17,
710 static const struct panel_desc avic_tm070ddh03
= {
711 .modes
= &avic_tm070ddh03_mode
,
725 static const struct drm_display_mode boe_nv101wxmn51_modes
[] = {
729 .hsync_start
= 1280 + 48,
730 .hsync_end
= 1280 + 48 + 32,
731 .htotal
= 1280 + 48 + 32 + 80,
733 .vsync_start
= 800 + 3,
734 .vsync_end
= 800 + 3 + 5,
735 .vtotal
= 800 + 3 + 5 + 24,
741 .hsync_start
= 1280 + 48,
742 .hsync_end
= 1280 + 48 + 32,
743 .htotal
= 1280 + 48 + 32 + 80,
745 .vsync_start
= 800 + 3,
746 .vsync_end
= 800 + 3 + 5,
747 .vtotal
= 800 + 3 + 5 + 24,
752 static const struct panel_desc boe_nv101wxmn51
= {
753 .modes
= boe_nv101wxmn51_modes
,
754 .num_modes
= ARRAY_SIZE(boe_nv101wxmn51_modes
),
767 static const struct drm_display_mode chunghwa_claa070wp03xg_mode
= {
770 .hsync_start
= 800 + 49,
771 .hsync_end
= 800 + 49 + 33,
772 .htotal
= 800 + 49 + 33 + 17,
774 .vsync_start
= 1280 + 1,
775 .vsync_end
= 1280 + 1 + 7,
776 .vtotal
= 1280 + 1 + 7 + 15,
778 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
781 static const struct panel_desc chunghwa_claa070wp03xg
= {
782 .modes
= &chunghwa_claa070wp03xg_mode
,
791 static const struct drm_display_mode chunghwa_claa101wa01a_mode
= {
794 .hsync_start
= 1366 + 58,
795 .hsync_end
= 1366 + 58 + 58,
796 .htotal
= 1366 + 58 + 58 + 58,
798 .vsync_start
= 768 + 4,
799 .vsync_end
= 768 + 4 + 4,
800 .vtotal
= 768 + 4 + 4 + 4,
804 static const struct panel_desc chunghwa_claa101wa01a
= {
805 .modes
= &chunghwa_claa101wa01a_mode
,
814 static const struct drm_display_mode chunghwa_claa101wb01_mode
= {
817 .hsync_start
= 1366 + 48,
818 .hsync_end
= 1366 + 48 + 32,
819 .htotal
= 1366 + 48 + 32 + 20,
821 .vsync_start
= 768 + 16,
822 .vsync_end
= 768 + 16 + 8,
823 .vtotal
= 768 + 16 + 8 + 16,
827 static const struct panel_desc chunghwa_claa101wb01
= {
828 .modes
= &chunghwa_claa101wb01_mode
,
837 static const struct drm_display_mode edt_et057090dhu_mode
= {
840 .hsync_start
= 640 + 16,
841 .hsync_end
= 640 + 16 + 30,
842 .htotal
= 640 + 16 + 30 + 114,
844 .vsync_start
= 480 + 10,
845 .vsync_end
= 480 + 10 + 3,
846 .vtotal
= 480 + 10 + 3 + 32,
848 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
851 static const struct panel_desc edt_et057090dhu
= {
852 .modes
= &edt_et057090dhu_mode
,
859 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
860 .bus_flags
= DRM_BUS_FLAG_DE_HIGH
| DRM_BUS_FLAG_PIXDATA_NEGEDGE
,
863 static const struct drm_display_mode edt_etm0700g0dh6_mode
= {
866 .hsync_start
= 800 + 40,
867 .hsync_end
= 800 + 40 + 128,
868 .htotal
= 800 + 40 + 128 + 88,
870 .vsync_start
= 480 + 10,
871 .vsync_end
= 480 + 10 + 2,
872 .vtotal
= 480 + 10 + 2 + 33,
874 .flags
= DRM_MODE_FLAG_NHSYNC
| DRM_MODE_FLAG_NVSYNC
,
877 static const struct panel_desc edt_etm0700g0dh6
= {
878 .modes
= &edt_etm0700g0dh6_mode
,
885 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
886 .bus_flags
= DRM_BUS_FLAG_DE_HIGH
| DRM_BUS_FLAG_PIXDATA_NEGEDGE
,
889 static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode
= {
892 .hsync_start
= 800 + 168,
893 .hsync_end
= 800 + 168 + 64,
894 .htotal
= 800 + 168 + 64 + 88,
896 .vsync_start
= 480 + 37,
897 .vsync_end
= 480 + 37 + 2,
898 .vtotal
= 480 + 37 + 2 + 8,
902 static const struct panel_desc foxlink_fl500wvr00_a0t
= {
903 .modes
= &foxlink_fl500wvr00_a0t_mode
,
910 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
913 static const struct drm_display_mode giantplus_gpg482739qs5_mode
= {
916 .hsync_start
= 480 + 5,
917 .hsync_end
= 480 + 5 + 1,
918 .htotal
= 480 + 5 + 1 + 40,
920 .vsync_start
= 272 + 8,
921 .vsync_end
= 272 + 8 + 1,
922 .vtotal
= 272 + 8 + 1 + 8,
926 static const struct panel_desc giantplus_gpg482739qs5
= {
927 .modes
= &giantplus_gpg482739qs5_mode
,
934 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
937 static const struct display_timing hannstar_hsd070pww1_timing
= {
938 .pixelclock
= { 64300000, 71100000, 82000000 },
939 .hactive
= { 1280, 1280, 1280 },
940 .hfront_porch
= { 1, 1, 10 },
941 .hback_porch
= { 1, 1, 10 },
943 * According to the data sheet, the minimum horizontal blanking interval
944 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
945 * minimum working horizontal blanking interval to be 60 clocks.
947 .hsync_len
= { 58, 158, 661 },
948 .vactive
= { 800, 800, 800 },
949 .vfront_porch
= { 1, 1, 10 },
950 .vback_porch
= { 1, 1, 10 },
951 .vsync_len
= { 1, 21, 203 },
952 .flags
= DISPLAY_FLAGS_DE_HIGH
,
955 static const struct panel_desc hannstar_hsd070pww1
= {
956 .timings
= &hannstar_hsd070pww1_timing
,
963 .bus_format
= MEDIA_BUS_FMT_RGB666_1X7X3_SPWG
,
966 static const struct display_timing hannstar_hsd100pxn1_timing
= {
967 .pixelclock
= { 55000000, 65000000, 75000000 },
968 .hactive
= { 1024, 1024, 1024 },
969 .hfront_porch
= { 40, 40, 40 },
970 .hback_porch
= { 220, 220, 220 },
971 .hsync_len
= { 20, 60, 100 },
972 .vactive
= { 768, 768, 768 },
973 .vfront_porch
= { 7, 7, 7 },
974 .vback_porch
= { 21, 21, 21 },
975 .vsync_len
= { 10, 10, 10 },
976 .flags
= DISPLAY_FLAGS_DE_HIGH
,
979 static const struct panel_desc hannstar_hsd100pxn1
= {
980 .timings
= &hannstar_hsd100pxn1_timing
,
987 .bus_format
= MEDIA_BUS_FMT_RGB666_1X7X3_SPWG
,
990 static const struct drm_display_mode hitachi_tx23d38vm0caa_mode
= {
993 .hsync_start
= 800 + 85,
994 .hsync_end
= 800 + 85 + 86,
995 .htotal
= 800 + 85 + 86 + 85,
997 .vsync_start
= 480 + 16,
998 .vsync_end
= 480 + 16 + 13,
999 .vtotal
= 480 + 16 + 13 + 16,
1003 static const struct panel_desc hitachi_tx23d38vm0caa
= {
1004 .modes
= &hitachi_tx23d38vm0caa_mode
,
1017 static const struct drm_display_mode innolux_at043tn24_mode
= {
1020 .hsync_start
= 480 + 2,
1021 .hsync_end
= 480 + 2 + 41,
1022 .htotal
= 480 + 2 + 41 + 2,
1024 .vsync_start
= 272 + 2,
1025 .vsync_end
= 272 + 2 + 10,
1026 .vtotal
= 272 + 2 + 10 + 2,
1028 .flags
= DRM_MODE_FLAG_NHSYNC
| DRM_MODE_FLAG_NVSYNC
,
1031 static const struct panel_desc innolux_at043tn24
= {
1032 .modes
= &innolux_at043tn24_mode
,
1039 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1040 .bus_flags
= DRM_BUS_FLAG_DE_HIGH
| DRM_BUS_FLAG_PIXDATA_POSEDGE
,
1043 static const struct drm_display_mode innolux_at070tn92_mode
= {
1046 .hsync_start
= 800 + 210,
1047 .hsync_end
= 800 + 210 + 20,
1048 .htotal
= 800 + 210 + 20 + 46,
1050 .vsync_start
= 480 + 22,
1051 .vsync_end
= 480 + 22 + 10,
1052 .vtotal
= 480 + 22 + 23 + 10,
1056 static const struct panel_desc innolux_at070tn92
= {
1057 .modes
= &innolux_at070tn92_mode
,
1063 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1066 static const struct display_timing innolux_g101ice_l01_timing
= {
1067 .pixelclock
= { 60400000, 71100000, 74700000 },
1068 .hactive
= { 1280, 1280, 1280 },
1069 .hfront_porch
= { 41, 80, 100 },
1070 .hback_porch
= { 40, 79, 99 },
1071 .hsync_len
= { 1, 1, 1 },
1072 .vactive
= { 800, 800, 800 },
1073 .vfront_porch
= { 5, 11, 14 },
1074 .vback_porch
= { 4, 11, 14 },
1075 .vsync_len
= { 1, 1, 1 },
1076 .flags
= DISPLAY_FLAGS_DE_HIGH
,
1079 static const struct panel_desc innolux_g101ice_l01
= {
1080 .timings
= &innolux_g101ice_l01_timing
,
1091 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1094 static const struct display_timing innolux_g121i1_l01_timing
= {
1095 .pixelclock
= { 67450000, 71000000, 74550000 },
1096 .hactive
= { 1280, 1280, 1280 },
1097 .hfront_porch
= { 40, 80, 160 },
1098 .hback_porch
= { 39, 79, 159 },
1099 .hsync_len
= { 1, 1, 1 },
1100 .vactive
= { 800, 800, 800 },
1101 .vfront_porch
= { 5, 11, 100 },
1102 .vback_porch
= { 4, 11, 99 },
1103 .vsync_len
= { 1, 1, 1 },
1106 static const struct panel_desc innolux_g121i1_l01
= {
1107 .timings
= &innolux_g121i1_l01_timing
,
1118 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1121 static const struct drm_display_mode innolux_g121x1_l03_mode
= {
1124 .hsync_start
= 1024 + 0,
1125 .hsync_end
= 1024 + 1,
1126 .htotal
= 1024 + 0 + 1 + 320,
1128 .vsync_start
= 768 + 38,
1129 .vsync_end
= 768 + 38 + 1,
1130 .vtotal
= 768 + 38 + 1 + 0,
1132 .flags
= DRM_MODE_FLAG_NHSYNC
| DRM_MODE_FLAG_NVSYNC
,
1135 static const struct panel_desc innolux_g121x1_l03
= {
1136 .modes
= &innolux_g121x1_l03_mode
,
1150 static const struct drm_display_mode innolux_n116bge_mode
= {
1153 .hsync_start
= 1366 + 136,
1154 .hsync_end
= 1366 + 136 + 30,
1155 .htotal
= 1366 + 136 + 30 + 60,
1157 .vsync_start
= 768 + 8,
1158 .vsync_end
= 768 + 8 + 12,
1159 .vtotal
= 768 + 8 + 12 + 12,
1161 .flags
= DRM_MODE_FLAG_NHSYNC
| DRM_MODE_FLAG_NVSYNC
,
1164 static const struct panel_desc innolux_n116bge
= {
1165 .modes
= &innolux_n116bge_mode
,
1174 static const struct drm_display_mode innolux_n156bge_l21_mode
= {
1177 .hsync_start
= 1366 + 16,
1178 .hsync_end
= 1366 + 16 + 34,
1179 .htotal
= 1366 + 16 + 34 + 50,
1181 .vsync_start
= 768 + 2,
1182 .vsync_end
= 768 + 2 + 6,
1183 .vtotal
= 768 + 2 + 6 + 12,
1187 static const struct panel_desc innolux_n156bge_l21
= {
1188 .modes
= &innolux_n156bge_l21_mode
,
1197 static const struct drm_display_mode innolux_zj070na_01p_mode
= {
1200 .hsync_start
= 1024 + 128,
1201 .hsync_end
= 1024 + 128 + 64,
1202 .htotal
= 1024 + 128 + 64 + 128,
1204 .vsync_start
= 600 + 16,
1205 .vsync_end
= 600 + 16 + 4,
1206 .vtotal
= 600 + 16 + 4 + 16,
1210 static const struct panel_desc innolux_zj070na_01p
= {
1211 .modes
= &innolux_zj070na_01p_mode
,
1220 static const struct display_timing kyo_tcg121xglp_timing
= {
1221 .pixelclock
= { 52000000, 65000000, 71000000 },
1222 .hactive
= { 1024, 1024, 1024 },
1223 .hfront_porch
= { 2, 2, 2 },
1224 .hback_porch
= { 2, 2, 2 },
1225 .hsync_len
= { 86, 124, 244 },
1226 .vactive
= { 768, 768, 768 },
1227 .vfront_porch
= { 2, 2, 2 },
1228 .vback_porch
= { 2, 2, 2 },
1229 .vsync_len
= { 6, 34, 73 },
1230 .flags
= DISPLAY_FLAGS_DE_HIGH
,
1233 static const struct panel_desc kyo_tcg121xglp
= {
1234 .timings
= &kyo_tcg121xglp_timing
,
1241 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1244 static const struct drm_display_mode lg_lb070wv8_mode
= {
1247 .hsync_start
= 800 + 88,
1248 .hsync_end
= 800 + 88 + 80,
1249 .htotal
= 800 + 88 + 80 + 88,
1251 .vsync_start
= 480 + 10,
1252 .vsync_end
= 480 + 10 + 25,
1253 .vtotal
= 480 + 10 + 25 + 10,
1257 static const struct panel_desc lg_lb070wv8
= {
1258 .modes
= &lg_lb070wv8_mode
,
1265 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1268 static const struct drm_display_mode lg_lp079qx1_sp0v_mode
= {
1271 .hsync_start
= 1536 + 12,
1272 .hsync_end
= 1536 + 12 + 16,
1273 .htotal
= 1536 + 12 + 16 + 48,
1275 .vsync_start
= 2048 + 8,
1276 .vsync_end
= 2048 + 8 + 4,
1277 .vtotal
= 2048 + 8 + 4 + 8,
1279 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1282 static const struct panel_desc lg_lp079qx1_sp0v
= {
1283 .modes
= &lg_lp079qx1_sp0v_mode
,
1291 static const struct drm_display_mode lg_lp097qx1_spa1_mode
= {
1294 .hsync_start
= 2048 + 150,
1295 .hsync_end
= 2048 + 150 + 5,
1296 .htotal
= 2048 + 150 + 5 + 5,
1298 .vsync_start
= 1536 + 3,
1299 .vsync_end
= 1536 + 3 + 1,
1300 .vtotal
= 1536 + 3 + 1 + 9,
1304 static const struct panel_desc lg_lp097qx1_spa1
= {
1305 .modes
= &lg_lp097qx1_spa1_mode
,
1313 static const struct drm_display_mode lg_lp120up1_mode
= {
1316 .hsync_start
= 1920 + 40,
1317 .hsync_end
= 1920 + 40 + 40,
1318 .htotal
= 1920 + 40 + 40+ 80,
1320 .vsync_start
= 1280 + 4,
1321 .vsync_end
= 1280 + 4 + 4,
1322 .vtotal
= 1280 + 4 + 4 + 12,
1326 static const struct panel_desc lg_lp120up1
= {
1327 .modes
= &lg_lp120up1_mode
,
1336 static const struct drm_display_mode lg_lp129qe_mode
= {
1339 .hsync_start
= 2560 + 48,
1340 .hsync_end
= 2560 + 48 + 32,
1341 .htotal
= 2560 + 48 + 32 + 80,
1343 .vsync_start
= 1700 + 3,
1344 .vsync_end
= 1700 + 3 + 10,
1345 .vtotal
= 1700 + 3 + 10 + 36,
1349 static const struct panel_desc lg_lp129qe
= {
1350 .modes
= &lg_lp129qe_mode
,
1359 static const struct drm_display_mode mitsubishi_aa070mc01_mode
= {
1362 .hsync_start
= 800 + 0,
1363 .hsync_end
= 800 + 1,
1364 .htotal
= 800 + 0 + 1 + 160,
1366 .vsync_start
= 480 + 0,
1367 .vsync_end
= 480 + 48 + 1,
1368 .vtotal
= 480 + 48 + 1 + 0,
1370 .flags
= DRM_MODE_FLAG_NHSYNC
| DRM_MODE_FLAG_NVSYNC
,
1373 static const struct panel_desc mitsubishi_aa070mc01
= {
1374 .modes
= &mitsubishi_aa070mc01_mode
,
1387 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1388 .bus_flags
= DRM_BUS_FLAG_DE_HIGH
,
1391 static const struct display_timing nec_nl12880bc20_05_timing
= {
1392 .pixelclock
= { 67000000, 71000000, 75000000 },
1393 .hactive
= { 1280, 1280, 1280 },
1394 .hfront_porch
= { 2, 30, 30 },
1395 .hback_porch
= { 6, 100, 100 },
1396 .hsync_len
= { 2, 30, 30 },
1397 .vactive
= { 800, 800, 800 },
1398 .vfront_porch
= { 5, 5, 5 },
1399 .vback_porch
= { 11, 11, 11 },
1400 .vsync_len
= { 7, 7, 7 },
1403 static const struct panel_desc nec_nl12880bc20_05
= {
1404 .timings
= &nec_nl12880bc20_05_timing
,
1415 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1418 static const struct drm_display_mode nec_nl4827hc19_05b_mode
= {
1421 .hsync_start
= 480 + 2,
1422 .hsync_end
= 480 + 2 + 41,
1423 .htotal
= 480 + 2 + 41 + 2,
1425 .vsync_start
= 272 + 2,
1426 .vsync_end
= 272 + 2 + 4,
1427 .vtotal
= 272 + 2 + 4 + 2,
1429 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1432 static const struct panel_desc nec_nl4827hc19_05b
= {
1433 .modes
= &nec_nl4827hc19_05b_mode
,
1440 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1441 .bus_flags
= DRM_BUS_FLAG_PIXDATA_POSEDGE
,
1444 static const struct drm_display_mode netron_dy_e231732_mode
= {
1447 .hsync_start
= 1024 + 160,
1448 .hsync_end
= 1024 + 160 + 70,
1449 .htotal
= 1024 + 160 + 70 + 90,
1451 .vsync_start
= 600 + 127,
1452 .vsync_end
= 600 + 127 + 20,
1453 .vtotal
= 600 + 127 + 20 + 3,
1457 static const struct panel_desc netron_dy_e231732
= {
1458 .modes
= &netron_dy_e231732_mode
,
1464 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
1467 static const struct display_timing nlt_nl192108ac18_02d_timing
= {
1468 .pixelclock
= { 130000000, 148350000, 163000000 },
1469 .hactive
= { 1920, 1920, 1920 },
1470 .hfront_porch
= { 80, 100, 100 },
1471 .hback_porch
= { 100, 120, 120 },
1472 .hsync_len
= { 50, 60, 60 },
1473 .vactive
= { 1080, 1080, 1080 },
1474 .vfront_porch
= { 12, 30, 30 },
1475 .vback_porch
= { 4, 10, 10 },
1476 .vsync_len
= { 4, 5, 5 },
1479 static const struct panel_desc nlt_nl192108ac18_02d
= {
1480 .timings
= &nlt_nl192108ac18_02d_timing
,
1490 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1493 static const struct drm_display_mode nvd_9128_mode
= {
1496 .hsync_start
= 800 + 130,
1497 .hsync_end
= 800 + 130 + 98,
1498 .htotal
= 800 + 0 + 130 + 98,
1500 .vsync_start
= 480 + 10,
1501 .vsync_end
= 480 + 10 + 50,
1502 .vtotal
= 480 + 0 + 10 + 50,
1505 static const struct panel_desc nvd_9128
= {
1506 .modes
= &nvd_9128_mode
,
1513 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1516 static const struct display_timing okaya_rs800480t_7x0gp_timing
= {
1517 .pixelclock
= { 30000000, 30000000, 40000000 },
1518 .hactive
= { 800, 800, 800 },
1519 .hfront_porch
= { 40, 40, 40 },
1520 .hback_porch
= { 40, 40, 40 },
1521 .hsync_len
= { 1, 48, 48 },
1522 .vactive
= { 480, 480, 480 },
1523 .vfront_porch
= { 13, 13, 13 },
1524 .vback_porch
= { 29, 29, 29 },
1525 .vsync_len
= { 3, 3, 3 },
1526 .flags
= DISPLAY_FLAGS_DE_HIGH
,
1529 static const struct panel_desc okaya_rs800480t_7x0gp
= {
1530 .timings
= &okaya_rs800480t_7x0gp_timing
,
1543 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
1546 static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode
= {
1549 .hsync_start
= 480 + 5,
1550 .hsync_end
= 480 + 5 + 30,
1551 .htotal
= 480 + 5 + 30 + 10,
1553 .vsync_start
= 272 + 8,
1554 .vsync_end
= 272 + 8 + 5,
1555 .vtotal
= 272 + 8 + 5 + 3,
1559 static const struct panel_desc olimex_lcd_olinuxino_43ts
= {
1560 .modes
= &olimex_lcd_olinuxino_43ts_mode
,
1566 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1570 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1571 * pixel clocks, but this is the timing that was being used in the Adafruit
1572 * installation instructions.
1574 static const struct drm_display_mode ontat_yx700wv03_mode
= {
1585 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1590 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1592 static const struct panel_desc ontat_yx700wv03
= {
1593 .modes
= &ontat_yx700wv03_mode
,
1600 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1603 static const struct drm_display_mode ortustech_com43h4m85ulc_mode
= {
1606 .hsync_start
= 480 + 10,
1607 .hsync_end
= 480 + 10 + 10,
1608 .htotal
= 480 + 10 + 10 + 15,
1610 .vsync_start
= 800 + 3,
1611 .vsync_end
= 800 + 3 + 3,
1612 .vtotal
= 800 + 3 + 3 + 3,
1616 static const struct panel_desc ortustech_com43h4m85ulc
= {
1617 .modes
= &ortustech_com43h4m85ulc_mode
,
1624 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1625 .bus_flags
= DRM_BUS_FLAG_DE_HIGH
| DRM_BUS_FLAG_PIXDATA_POSEDGE
,
1628 static const struct drm_display_mode qd43003c0_40_mode
= {
1631 .hsync_start
= 480 + 8,
1632 .hsync_end
= 480 + 8 + 4,
1633 .htotal
= 480 + 8 + 4 + 39,
1635 .vsync_start
= 272 + 4,
1636 .vsync_end
= 272 + 4 + 10,
1637 .vtotal
= 272 + 4 + 10 + 2,
1641 static const struct panel_desc qd43003c0_40
= {
1642 .modes
= &qd43003c0_40_mode
,
1649 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1652 static const struct drm_display_mode samsung_lsn122dl01_c01_mode
= {
1655 .hsync_start
= 2560 + 48,
1656 .hsync_end
= 2560 + 48 + 32,
1657 .htotal
= 2560 + 48 + 32 + 80,
1659 .vsync_start
= 1600 + 2,
1660 .vsync_end
= 1600 + 2 + 5,
1661 .vtotal
= 1600 + 2 + 5 + 57,
1665 static const struct panel_desc samsung_lsn122dl01_c01
= {
1666 .modes
= &samsung_lsn122dl01_c01_mode
,
1674 static const struct drm_display_mode samsung_ltn101nt05_mode
= {
1677 .hsync_start
= 1024 + 24,
1678 .hsync_end
= 1024 + 24 + 136,
1679 .htotal
= 1024 + 24 + 136 + 160,
1681 .vsync_start
= 600 + 3,
1682 .vsync_end
= 600 + 3 + 6,
1683 .vtotal
= 600 + 3 + 6 + 61,
1687 static const struct panel_desc samsung_ltn101nt05
= {
1688 .modes
= &samsung_ltn101nt05_mode
,
1697 static const struct drm_display_mode samsung_ltn140at29_301_mode
= {
1700 .hsync_start
= 1366 + 64,
1701 .hsync_end
= 1366 + 64 + 48,
1702 .htotal
= 1366 + 64 + 48 + 128,
1704 .vsync_start
= 768 + 2,
1705 .vsync_end
= 768 + 2 + 5,
1706 .vtotal
= 768 + 2 + 5 + 17,
1710 static const struct panel_desc samsung_ltn140at29_301
= {
1711 .modes
= &samsung_ltn140at29_301_mode
,
1720 static const struct display_timing sharp_lq101k1ly04_timing
= {
1721 .pixelclock
= { 60000000, 65000000, 80000000 },
1722 .hactive
= { 1280, 1280, 1280 },
1723 .hfront_porch
= { 20, 20, 20 },
1724 .hback_porch
= { 20, 20, 20 },
1725 .hsync_len
= { 10, 10, 10 },
1726 .vactive
= { 800, 800, 800 },
1727 .vfront_porch
= { 4, 4, 4 },
1728 .vback_porch
= { 4, 4, 4 },
1729 .vsync_len
= { 4, 4, 4 },
1730 .flags
= DISPLAY_FLAGS_PIXDATA_POSEDGE
,
1733 static const struct panel_desc sharp_lq101k1ly04
= {
1734 .timings
= &sharp_lq101k1ly04_timing
,
1741 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA
,
1744 static const struct drm_display_mode sharp_lq123p1jx31_mode
= {
1747 .hsync_start
= 2400 + 48,
1748 .hsync_end
= 2400 + 48 + 32,
1749 .htotal
= 2400 + 48 + 32 + 80,
1751 .vsync_start
= 1600 + 3,
1752 .vsync_end
= 1600 + 3 + 10,
1753 .vtotal
= 1600 + 3 + 10 + 33,
1755 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1758 static const struct panel_desc sharp_lq123p1jx31
= {
1759 .modes
= &sharp_lq123p1jx31_mode
,
1773 static const struct drm_display_mode sharp_lq150x1lg11_mode
= {
1776 .hsync_start
= 1024 + 168,
1777 .hsync_end
= 1024 + 168 + 64,
1778 .htotal
= 1024 + 168 + 64 + 88,
1780 .vsync_start
= 768 + 37,
1781 .vsync_end
= 768 + 37 + 2,
1782 .vtotal
= 768 + 37 + 2 + 8,
1786 static const struct panel_desc sharp_lq150x1lg11
= {
1787 .modes
= &sharp_lq150x1lg11_mode
,
1794 .bus_format
= MEDIA_BUS_FMT_RGB565_1X16
,
1797 static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode
= {
1800 .hsync_start
= 800 + 1,
1801 .hsync_end
= 800 + 1 + 64,
1802 .htotal
= 800 + 1 + 64 + 64,
1804 .vsync_start
= 480 + 1,
1805 .vsync_end
= 480 + 1 + 23,
1806 .vtotal
= 480 + 1 + 23 + 22,
1810 static const struct panel_desc shelly_sca07010_bfn_lnn
= {
1811 .modes
= &shelly_sca07010_bfn_lnn_mode
,
1817 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
1820 static const struct drm_display_mode starry_kr122ea0sra_mode
= {
1823 .hsync_start
= 1920 + 16,
1824 .hsync_end
= 1920 + 16 + 16,
1825 .htotal
= 1920 + 16 + 16 + 32,
1827 .vsync_start
= 1200 + 15,
1828 .vsync_end
= 1200 + 15 + 2,
1829 .vtotal
= 1200 + 15 + 2 + 18,
1831 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1834 static const struct panel_desc starry_kr122ea0sra
= {
1835 .modes
= &starry_kr122ea0sra_mode
,
1842 .prepare
= 10 + 200,
1844 .unprepare
= 10 + 500,
1848 static const struct display_timing tianma_tm070jdhg30_timing
= {
1849 .pixelclock
= { 62600000, 68200000, 78100000 },
1850 .hactive
= { 1280, 1280, 1280 },
1851 .hfront_porch
= { 15, 64, 159 },
1852 .hback_porch
= { 5, 5, 5 },
1853 .hsync_len
= { 1, 1, 256 },
1854 .vactive
= { 800, 800, 800 },
1855 .vfront_porch
= { 3, 40, 99 },
1856 .vback_porch
= { 2, 2, 2 },
1857 .vsync_len
= { 1, 1, 128 },
1858 .flags
= DISPLAY_FLAGS_DE_HIGH
,
1861 static const struct panel_desc tianma_tm070jdhg30
= {
1862 .timings
= &tianma_tm070jdhg30_timing
,
1869 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1872 static const struct display_timing tianma_tm070rvhg71_timing
= {
1873 .pixelclock
= { 27700000, 29200000, 39600000 },
1874 .hactive
= { 800, 800, 800 },
1875 .hfront_porch
= { 12, 40, 212 },
1876 .hback_porch
= { 88, 88, 88 },
1877 .hsync_len
= { 1, 1, 40 },
1878 .vactive
= { 480, 480, 480 },
1879 .vfront_porch
= { 1, 13, 88 },
1880 .vback_porch
= { 32, 32, 32 },
1881 .vsync_len
= { 1, 1, 3 },
1882 .flags
= DISPLAY_FLAGS_DE_HIGH
,
1885 static const struct panel_desc tianma_tm070rvhg71
= {
1886 .timings
= &tianma_tm070rvhg71_timing
,
1893 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1896 static const struct drm_display_mode toshiba_lt089ac29000_mode
= {
1899 .hsync_start
= 1280 + 192,
1900 .hsync_end
= 1280 + 192 + 128,
1901 .htotal
= 1280 + 192 + 128 + 64,
1903 .vsync_start
= 768 + 20,
1904 .vsync_end
= 768 + 20 + 7,
1905 .vtotal
= 768 + 20 + 7 + 3,
1909 static const struct panel_desc toshiba_lt089ac29000
= {
1910 .modes
= &toshiba_lt089ac29000_mode
,
1916 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1917 .bus_flags
= DRM_BUS_FLAG_DE_HIGH
| DRM_BUS_FLAG_PIXDATA_POSEDGE
,
1920 static const struct drm_display_mode tpk_f07a_0102_mode
= {
1923 .hsync_start
= 800 + 40,
1924 .hsync_end
= 800 + 40 + 128,
1925 .htotal
= 800 + 40 + 128 + 88,
1927 .vsync_start
= 480 + 10,
1928 .vsync_end
= 480 + 10 + 2,
1929 .vtotal
= 480 + 10 + 2 + 33,
1933 static const struct panel_desc tpk_f07a_0102
= {
1934 .modes
= &tpk_f07a_0102_mode
,
1940 .bus_flags
= DRM_BUS_FLAG_PIXDATA_POSEDGE
,
1943 static const struct drm_display_mode tpk_f10a_0102_mode
= {
1946 .hsync_start
= 1024 + 176,
1947 .hsync_end
= 1024 + 176 + 5,
1948 .htotal
= 1024 + 176 + 5 + 88,
1950 .vsync_start
= 600 + 20,
1951 .vsync_end
= 600 + 20 + 5,
1952 .vtotal
= 600 + 20 + 5 + 25,
1956 static const struct panel_desc tpk_f10a_0102
= {
1957 .modes
= &tpk_f10a_0102_mode
,
1965 static const struct display_timing urt_umsh_8596md_timing
= {
1966 .pixelclock
= { 33260000, 33260000, 33260000 },
1967 .hactive
= { 800, 800, 800 },
1968 .hfront_porch
= { 41, 41, 41 },
1969 .hback_porch
= { 216 - 128, 216 - 128, 216 - 128 },
1970 .hsync_len
= { 71, 128, 128 },
1971 .vactive
= { 480, 480, 480 },
1972 .vfront_porch
= { 10, 10, 10 },
1973 .vback_porch
= { 35 - 2, 35 - 2, 35 - 2 },
1974 .vsync_len
= { 2, 2, 2 },
1975 .flags
= DISPLAY_FLAGS_DE_HIGH
| DISPLAY_FLAGS_PIXDATA_NEGEDGE
|
1976 DISPLAY_FLAGS_HSYNC_LOW
| DISPLAY_FLAGS_VSYNC_LOW
,
1979 static const struct panel_desc urt_umsh_8596md_lvds
= {
1980 .timings
= &urt_umsh_8596md_timing
,
1987 .bus_format
= MEDIA_BUS_FMT_RGB666_1X7X3_SPWG
,
1990 static const struct panel_desc urt_umsh_8596md_parallel
= {
1991 .timings
= &urt_umsh_8596md_timing
,
1998 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
2001 static const struct drm_display_mode winstar_wf35ltiacd_mode
= {
2004 .hsync_start
= 320 + 20,
2005 .hsync_end
= 320 + 20 + 30,
2006 .htotal
= 320 + 20 + 30 + 38,
2008 .vsync_start
= 240 + 4,
2009 .vsync_end
= 240 + 4 + 3,
2010 .vtotal
= 240 + 4 + 3 + 15,
2012 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
2015 static const struct panel_desc winstar_wf35ltiacd
= {
2016 .modes
= &winstar_wf35ltiacd_mode
,
2023 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
2026 static const struct of_device_id platform_of_match
[] = {
2028 .compatible
= "ampire,am-480272h3tmqw-t01h",
2029 .data
= &ire_am_480272h3tmqw_t01h
,
2031 .compatible
= "ampire,am800480r3tmqwa1h",
2032 .data
= &ire_am800480r3tmqwa1h
,
2034 .compatible
= "auo,b101aw03",
2035 .data
= &auo_b101aw03
,
2037 .compatible
= "auo,b101ean01",
2038 .data
= &auo_b101ean01
,
2040 .compatible
= "auo,b101xtn01",
2041 .data
= &auo_b101xtn01
,
2043 .compatible
= "auo,b116xw03",
2044 .data
= &auo_b116xw03
,
2046 .compatible
= "auo,b133htn01",
2047 .data
= &auo_b133htn01
,
2049 .compatible
= "auo,b133xtn01",
2050 .data
= &auo_b133xtn01
,
2052 .compatible
= "auo,g133han01",
2053 .data
= &auo_g133han01
,
2055 .compatible
= "auo,g185han01",
2056 .data
= &auo_g185han01
,
2058 .compatible
= "auo,p320hvn03",
2059 .data
= &auo_p320hvn03
,
2061 .compatible
= "auo,t215hvn01",
2062 .data
= &auo_t215hvn01
,
2064 .compatible
= "avic,tm070ddh03",
2065 .data
= &avic_tm070ddh03
,
2067 .compatible
= "boe,nv101wxmn51",
2068 .data
= &boe_nv101wxmn51
,
2070 .compatible
= "chunghwa,claa070wp03xg",
2071 .data
= &chunghwa_claa070wp03xg
,
2073 .compatible
= "chunghwa,claa101wa01a",
2074 .data
= &chunghwa_claa101wa01a
2076 .compatible
= "chunghwa,claa101wb01",
2077 .data
= &chunghwa_claa101wb01
2079 .compatible
= "edt,et057090dhu",
2080 .data
= &edt_et057090dhu
,
2082 .compatible
= "edt,et070080dh6",
2083 .data
= &edt_etm0700g0dh6
,
2085 .compatible
= "edt,etm0700g0dh6",
2086 .data
= &edt_etm0700g0dh6
,
2088 .compatible
= "foxlink,fl500wvr00-a0t",
2089 .data
= &foxlink_fl500wvr00_a0t
,
2091 .compatible
= "giantplus,gpg482739qs5",
2092 .data
= &giantplus_gpg482739qs5
2094 .compatible
= "hannstar,hsd070pww1",
2095 .data
= &hannstar_hsd070pww1
,
2097 .compatible
= "hannstar,hsd100pxn1",
2098 .data
= &hannstar_hsd100pxn1
,
2100 .compatible
= "hit,tx23d38vm0caa",
2101 .data
= &hitachi_tx23d38vm0caa
2103 .compatible
= "innolux,at043tn24",
2104 .data
= &innolux_at043tn24
,
2106 .compatible
= "innolux,at070tn92",
2107 .data
= &innolux_at070tn92
,
2109 .compatible
="innolux,g101ice-l01",
2110 .data
= &innolux_g101ice_l01
2112 .compatible
="innolux,g121i1-l01",
2113 .data
= &innolux_g121i1_l01
2115 .compatible
= "innolux,g121x1-l03",
2116 .data
= &innolux_g121x1_l03
,
2118 .compatible
= "innolux,n116bge",
2119 .data
= &innolux_n116bge
,
2121 .compatible
= "innolux,n156bge-l21",
2122 .data
= &innolux_n156bge_l21
,
2124 .compatible
= "innolux,zj070na-01p",
2125 .data
= &innolux_zj070na_01p
,
2127 .compatible
= "kyo,tcg121xglp",
2128 .data
= &kyo_tcg121xglp
,
2130 .compatible
= "lg,lb070wv8",
2131 .data
= &lg_lb070wv8
,
2133 .compatible
= "lg,lp079qx1-sp0v",
2134 .data
= &lg_lp079qx1_sp0v
,
2136 .compatible
= "lg,lp097qx1-spa1",
2137 .data
= &lg_lp097qx1_spa1
,
2139 .compatible
= "lg,lp120up1",
2140 .data
= &lg_lp120up1
,
2142 .compatible
= "lg,lp129qe",
2143 .data
= &lg_lp129qe
,
2145 .compatible
= "mitsubishi,aa070mc01-ca1",
2146 .data
= &mitsubishi_aa070mc01
,
2148 .compatible
= "nec,nl12880bc20-05",
2149 .data
= &nec_nl12880bc20_05
,
2151 .compatible
= "nec,nl4827hc19-05b",
2152 .data
= &nec_nl4827hc19_05b
,
2154 .compatible
= "netron-dy,e231732",
2155 .data
= &netron_dy_e231732
,
2157 .compatible
= "nlt,nl192108ac18-02d",
2158 .data
= &nlt_nl192108ac18_02d
,
2160 .compatible
= "nvd,9128",
2163 .compatible
= "okaya,rs800480t-7x0gp",
2164 .data
= &okaya_rs800480t_7x0gp
,
2166 .compatible
= "olimex,lcd-olinuxino-43-ts",
2167 .data
= &olimex_lcd_olinuxino_43ts
,
2169 .compatible
= "ontat,yx700wv03",
2170 .data
= &ontat_yx700wv03
,
2172 .compatible
= "ortustech,com43h4m85ulc",
2173 .data
= &ortustech_com43h4m85ulc
,
2175 .compatible
= "qiaodian,qd43003c0-40",
2176 .data
= &qd43003c0_40
,
2178 .compatible
= "samsung,lsn122dl01-c01",
2179 .data
= &samsung_lsn122dl01_c01
,
2181 .compatible
= "samsung,ltn101nt05",
2182 .data
= &samsung_ltn101nt05
,
2184 .compatible
= "samsung,ltn140at29-301",
2185 .data
= &samsung_ltn140at29_301
,
2187 .compatible
= "sharp,lq101k1ly04",
2188 .data
= &sharp_lq101k1ly04
,
2190 .compatible
= "sharp,lq123p1jx31",
2191 .data
= &sharp_lq123p1jx31
,
2193 .compatible
= "sharp,lq150x1lg11",
2194 .data
= &sharp_lq150x1lg11
,
2196 .compatible
= "shelly,sca07010-bfn-lnn",
2197 .data
= &shelly_sca07010_bfn_lnn
,
2199 .compatible
= "starry,kr122ea0sra",
2200 .data
= &starry_kr122ea0sra
,
2202 .compatible
= "tianma,tm070jdhg30",
2203 .data
= &tianma_tm070jdhg30
,
2205 .compatible
= "tianma,tm070rvhg71",
2206 .data
= &tianma_tm070rvhg71
,
2208 .compatible
= "toshiba,lt089ac29000",
2209 .data
= &toshiba_lt089ac29000
,
2211 .compatible
= "tpk,f07a-0102",
2212 .data
= &tpk_f07a_0102
,
2214 .compatible
= "tpk,f10a-0102",
2215 .data
= &tpk_f10a_0102
,
2217 .compatible
= "urt,umsh-8596md-t",
2218 .data
= &urt_umsh_8596md_parallel
,
2220 .compatible
= "urt,umsh-8596md-1t",
2221 .data
= &urt_umsh_8596md_parallel
,
2223 .compatible
= "urt,umsh-8596md-7t",
2224 .data
= &urt_umsh_8596md_parallel
,
2226 .compatible
= "urt,umsh-8596md-11t",
2227 .data
= &urt_umsh_8596md_lvds
,
2229 .compatible
= "urt,umsh-8596md-19t",
2230 .data
= &urt_umsh_8596md_lvds
,
2232 .compatible
= "urt,umsh-8596md-20t",
2233 .data
= &urt_umsh_8596md_parallel
,
2235 .compatible
= "winstar,wf35ltiacd",
2236 .data
= &winstar_wf35ltiacd
,
2241 MODULE_DEVICE_TABLE(of
, platform_of_match
);
2243 static int panel_simple_platform_probe(struct platform_device
*pdev
)
2245 const struct of_device_id
*id
;
2247 id
= of_match_node(platform_of_match
, pdev
->dev
.of_node
);
2251 return panel_simple_probe(&pdev
->dev
, id
->data
);
2254 static int panel_simple_platform_remove(struct platform_device
*pdev
)
2256 return panel_simple_remove(&pdev
->dev
);
2259 static void panel_simple_platform_shutdown(struct platform_device
*pdev
)
2261 panel_simple_shutdown(&pdev
->dev
);
2264 static struct platform_driver panel_simple_platform_driver
= {
2266 .name
= "panel-simple",
2267 .of_match_table
= platform_of_match
,
2269 .probe
= panel_simple_platform_probe
,
2270 .remove
= panel_simple_platform_remove
,
2271 .shutdown
= panel_simple_platform_shutdown
,
2274 struct panel_desc_dsi
{
2275 struct panel_desc desc
;
2277 unsigned long flags
;
2278 enum mipi_dsi_pixel_format format
;
2282 static const struct drm_display_mode auo_b080uan01_mode
= {
2285 .hsync_start
= 1200 + 62,
2286 .hsync_end
= 1200 + 62 + 4,
2287 .htotal
= 1200 + 62 + 4 + 62,
2289 .vsync_start
= 1920 + 9,
2290 .vsync_end
= 1920 + 9 + 2,
2291 .vtotal
= 1920 + 9 + 2 + 8,
2295 static const struct panel_desc_dsi auo_b080uan01
= {
2297 .modes
= &auo_b080uan01_mode
,
2305 .flags
= MIPI_DSI_MODE_VIDEO
| MIPI_DSI_CLOCK_NON_CONTINUOUS
,
2306 .format
= MIPI_DSI_FMT_RGB888
,
2310 static const struct drm_display_mode boe_tv080wum_nl0_mode
= {
2313 .hsync_start
= 1200 + 120,
2314 .hsync_end
= 1200 + 120 + 20,
2315 .htotal
= 1200 + 120 + 20 + 21,
2317 .vsync_start
= 1920 + 21,
2318 .vsync_end
= 1920 + 21 + 3,
2319 .vtotal
= 1920 + 21 + 3 + 18,
2321 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
2324 static const struct panel_desc_dsi boe_tv080wum_nl0
= {
2326 .modes
= &boe_tv080wum_nl0_mode
,
2333 .flags
= MIPI_DSI_MODE_VIDEO
|
2334 MIPI_DSI_MODE_VIDEO_BURST
|
2335 MIPI_DSI_MODE_VIDEO_SYNC_PULSE
,
2336 .format
= MIPI_DSI_FMT_RGB888
,
2340 static const struct drm_display_mode lg_ld070wx3_sl01_mode
= {
2343 .hsync_start
= 800 + 32,
2344 .hsync_end
= 800 + 32 + 1,
2345 .htotal
= 800 + 32 + 1 + 57,
2347 .vsync_start
= 1280 + 28,
2348 .vsync_end
= 1280 + 28 + 1,
2349 .vtotal
= 1280 + 28 + 1 + 14,
2353 static const struct panel_desc_dsi lg_ld070wx3_sl01
= {
2355 .modes
= &lg_ld070wx3_sl01_mode
,
2363 .flags
= MIPI_DSI_MODE_VIDEO
| MIPI_DSI_CLOCK_NON_CONTINUOUS
,
2364 .format
= MIPI_DSI_FMT_RGB888
,
2368 static const struct drm_display_mode lg_lh500wx1_sd03_mode
= {
2371 .hsync_start
= 720 + 12,
2372 .hsync_end
= 720 + 12 + 4,
2373 .htotal
= 720 + 12 + 4 + 112,
2375 .vsync_start
= 1280 + 8,
2376 .vsync_end
= 1280 + 8 + 4,
2377 .vtotal
= 1280 + 8 + 4 + 12,
2381 static const struct panel_desc_dsi lg_lh500wx1_sd03
= {
2383 .modes
= &lg_lh500wx1_sd03_mode
,
2391 .flags
= MIPI_DSI_MODE_VIDEO
,
2392 .format
= MIPI_DSI_FMT_RGB888
,
2396 static const struct drm_display_mode panasonic_vvx10f004b00_mode
= {
2399 .hsync_start
= 1920 + 154,
2400 .hsync_end
= 1920 + 154 + 16,
2401 .htotal
= 1920 + 154 + 16 + 32,
2403 .vsync_start
= 1200 + 17,
2404 .vsync_end
= 1200 + 17 + 2,
2405 .vtotal
= 1200 + 17 + 2 + 16,
2409 static const struct panel_desc_dsi panasonic_vvx10f004b00
= {
2411 .modes
= &panasonic_vvx10f004b00_mode
,
2419 .flags
= MIPI_DSI_MODE_VIDEO
| MIPI_DSI_MODE_VIDEO_SYNC_PULSE
|
2420 MIPI_DSI_CLOCK_NON_CONTINUOUS
,
2421 .format
= MIPI_DSI_FMT_RGB888
,
2425 static const struct of_device_id dsi_of_match
[] = {
2427 .compatible
= "auo,b080uan01",
2428 .data
= &auo_b080uan01
2430 .compatible
= "boe,tv080wum-nl0",
2431 .data
= &boe_tv080wum_nl0
2433 .compatible
= "lg,ld070wx3-sl01",
2434 .data
= &lg_ld070wx3_sl01
2436 .compatible
= "lg,lh500wx1-sd03",
2437 .data
= &lg_lh500wx1_sd03
2439 .compatible
= "panasonic,vvx10f004b00",
2440 .data
= &panasonic_vvx10f004b00
2445 MODULE_DEVICE_TABLE(of
, dsi_of_match
);
2447 static int panel_simple_dsi_probe(struct mipi_dsi_device
*dsi
)
2449 const struct panel_desc_dsi
*desc
;
2450 const struct of_device_id
*id
;
2453 id
= of_match_node(dsi_of_match
, dsi
->dev
.of_node
);
2459 err
= panel_simple_probe(&dsi
->dev
, &desc
->desc
);
2463 dsi
->mode_flags
= desc
->flags
;
2464 dsi
->format
= desc
->format
;
2465 dsi
->lanes
= desc
->lanes
;
2467 return mipi_dsi_attach(dsi
);
2470 static int panel_simple_dsi_remove(struct mipi_dsi_device
*dsi
)
2474 err
= mipi_dsi_detach(dsi
);
2476 dev_err(&dsi
->dev
, "failed to detach from DSI host: %d\n", err
);
2478 return panel_simple_remove(&dsi
->dev
);
2481 static void panel_simple_dsi_shutdown(struct mipi_dsi_device
*dsi
)
2483 panel_simple_shutdown(&dsi
->dev
);
2486 static struct mipi_dsi_driver panel_simple_dsi_driver
= {
2488 .name
= "panel-simple-dsi",
2489 .of_match_table
= dsi_of_match
,
2491 .probe
= panel_simple_dsi_probe
,
2492 .remove
= panel_simple_dsi_remove
,
2493 .shutdown
= panel_simple_dsi_shutdown
,
2496 static int __init
panel_simple_init(void)
2500 err
= platform_driver_register(&panel_simple_platform_driver
);
2504 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI
)) {
2505 err
= mipi_dsi_driver_register(&panel_simple_dsi_driver
);
2512 module_init(panel_simple_init
);
2514 static void __exit
panel_simple_exit(void)
2516 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI
))
2517 mipi_dsi_driver_unregister(&panel_simple_dsi_driver
);
2519 platform_driver_unregister(&panel_simple_platform_driver
);
2521 module_exit(panel_simple_exit
);
2523 MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
2524 MODULE_DESCRIPTION("DRM Driver for Simple Panels");
2525 MODULE_LICENSE("GPL and additional rights");