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_am800480r3tmqwa1h_mode
= {
394 .hsync_start
= 800 + 0,
395 .hsync_end
= 800 + 0 + 255,
396 .htotal
= 800 + 0 + 255 + 0,
398 .vsync_start
= 480 + 2,
399 .vsync_end
= 480 + 2 + 45,
400 .vtotal
= 480 + 2 + 45 + 0,
402 .flags
= DRM_MODE_FLAG_PHSYNC
| DRM_MODE_FLAG_PVSYNC
,
405 static const struct panel_desc ampire_am800480r3tmqwa1h
= {
406 .modes
= &ire_am800480r3tmqwa1h_mode
,
413 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
416 static const struct drm_display_mode auo_b101aw03_mode
= {
419 .hsync_start
= 1024 + 156,
420 .hsync_end
= 1024 + 156 + 8,
421 .htotal
= 1024 + 156 + 8 + 156,
423 .vsync_start
= 600 + 16,
424 .vsync_end
= 600 + 16 + 6,
425 .vtotal
= 600 + 16 + 6 + 16,
429 static const struct panel_desc auo_b101aw03
= {
430 .modes
= &auo_b101aw03_mode
,
439 static const struct drm_display_mode auo_b101ean01_mode
= {
442 .hsync_start
= 1280 + 119,
443 .hsync_end
= 1280 + 119 + 32,
444 .htotal
= 1280 + 119 + 32 + 21,
446 .vsync_start
= 800 + 4,
447 .vsync_end
= 800 + 4 + 20,
448 .vtotal
= 800 + 4 + 20 + 8,
452 static const struct panel_desc auo_b101ean01
= {
453 .modes
= &auo_b101ean01_mode
,
462 static const struct drm_display_mode auo_b101xtn01_mode
= {
465 .hsync_start
= 1366 + 20,
466 .hsync_end
= 1366 + 20 + 70,
467 .htotal
= 1366 + 20 + 70,
469 .vsync_start
= 768 + 14,
470 .vsync_end
= 768 + 14 + 42,
471 .vtotal
= 768 + 14 + 42,
473 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
476 static const struct panel_desc auo_b101xtn01
= {
477 .modes
= &auo_b101xtn01_mode
,
486 static const struct drm_display_mode auo_b116xw03_mode
= {
489 .hsync_start
= 1366 + 40,
490 .hsync_end
= 1366 + 40 + 40,
491 .htotal
= 1366 + 40 + 40 + 32,
493 .vsync_start
= 768 + 10,
494 .vsync_end
= 768 + 10 + 12,
495 .vtotal
= 768 + 10 + 12 + 6,
499 static const struct panel_desc auo_b116xw03
= {
500 .modes
= &auo_b116xw03_mode
,
509 static const struct drm_display_mode auo_b133xtn01_mode
= {
512 .hsync_start
= 1366 + 48,
513 .hsync_end
= 1366 + 48 + 32,
514 .htotal
= 1366 + 48 + 32 + 20,
516 .vsync_start
= 768 + 3,
517 .vsync_end
= 768 + 3 + 6,
518 .vtotal
= 768 + 3 + 6 + 13,
522 static const struct panel_desc auo_b133xtn01
= {
523 .modes
= &auo_b133xtn01_mode
,
532 static const struct drm_display_mode auo_b133htn01_mode
= {
535 .hsync_start
= 1920 + 172,
536 .hsync_end
= 1920 + 172 + 80,
537 .htotal
= 1920 + 172 + 80 + 60,
539 .vsync_start
= 1080 + 25,
540 .vsync_end
= 1080 + 25 + 10,
541 .vtotal
= 1080 + 25 + 10 + 10,
545 static const struct panel_desc auo_b133htn01
= {
546 .modes
= &auo_b133htn01_mode
,
560 static const struct drm_display_mode avic_tm070ddh03_mode
= {
563 .hsync_start
= 1024 + 160,
564 .hsync_end
= 1024 + 160 + 4,
565 .htotal
= 1024 + 160 + 4 + 156,
567 .vsync_start
= 600 + 17,
568 .vsync_end
= 600 + 17 + 1,
569 .vtotal
= 600 + 17 + 1 + 17,
573 static const struct panel_desc avic_tm070ddh03
= {
574 .modes
= &avic_tm070ddh03_mode
,
588 static const struct drm_display_mode chunghwa_claa101wa01a_mode
= {
591 .hsync_start
= 1366 + 58,
592 .hsync_end
= 1366 + 58 + 58,
593 .htotal
= 1366 + 58 + 58 + 58,
595 .vsync_start
= 768 + 4,
596 .vsync_end
= 768 + 4 + 4,
597 .vtotal
= 768 + 4 + 4 + 4,
601 static const struct panel_desc chunghwa_claa101wa01a
= {
602 .modes
= &chunghwa_claa101wa01a_mode
,
611 static const struct drm_display_mode chunghwa_claa101wb01_mode
= {
614 .hsync_start
= 1366 + 48,
615 .hsync_end
= 1366 + 48 + 32,
616 .htotal
= 1366 + 48 + 32 + 20,
618 .vsync_start
= 768 + 16,
619 .vsync_end
= 768 + 16 + 8,
620 .vtotal
= 768 + 16 + 8 + 16,
624 static const struct panel_desc chunghwa_claa101wb01
= {
625 .modes
= &chunghwa_claa101wb01_mode
,
634 static const struct drm_display_mode edt_et057090dhu_mode
= {
637 .hsync_start
= 640 + 16,
638 .hsync_end
= 640 + 16 + 30,
639 .htotal
= 640 + 16 + 30 + 114,
641 .vsync_start
= 480 + 10,
642 .vsync_end
= 480 + 10 + 3,
643 .vtotal
= 480 + 10 + 3 + 32,
645 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
648 static const struct panel_desc edt_et057090dhu
= {
649 .modes
= &edt_et057090dhu_mode
,
658 static const struct drm_display_mode edt_etm0700g0dh6_mode
= {
661 .hsync_start
= 800 + 40,
662 .hsync_end
= 800 + 40 + 128,
663 .htotal
= 800 + 40 + 128 + 88,
665 .vsync_start
= 480 + 10,
666 .vsync_end
= 480 + 10 + 2,
667 .vtotal
= 480 + 10 + 2 + 33,
669 .flags
= DRM_MODE_FLAG_NHSYNC
| DRM_MODE_FLAG_NVSYNC
,
672 static const struct panel_desc edt_etm0700g0dh6
= {
673 .modes
= &edt_etm0700g0dh6_mode
,
682 static const struct drm_display_mode foxlink_fl500wvr00_a0t_mode
= {
685 .hsync_start
= 800 + 168,
686 .hsync_end
= 800 + 168 + 64,
687 .htotal
= 800 + 168 + 64 + 88,
689 .vsync_start
= 480 + 37,
690 .vsync_end
= 480 + 37 + 2,
691 .vtotal
= 480 + 37 + 2 + 8,
695 static const struct panel_desc foxlink_fl500wvr00_a0t
= {
696 .modes
= &foxlink_fl500wvr00_a0t_mode
,
703 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
706 static const struct drm_display_mode giantplus_gpg482739qs5_mode
= {
709 .hsync_start
= 480 + 5,
710 .hsync_end
= 480 + 5 + 1,
711 .htotal
= 480 + 5 + 1 + 40,
713 .vsync_start
= 272 + 8,
714 .vsync_end
= 272 + 8 + 1,
715 .vtotal
= 272 + 8 + 1 + 8,
719 static const struct panel_desc giantplus_gpg482739qs5
= {
720 .modes
= &giantplus_gpg482739qs5_mode
,
727 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
730 static const struct display_timing hannstar_hsd070pww1_timing
= {
731 .pixelclock
= { 64300000, 71100000, 82000000 },
732 .hactive
= { 1280, 1280, 1280 },
733 .hfront_porch
= { 1, 1, 10 },
734 .hback_porch
= { 1, 1, 10 },
736 * According to the data sheet, the minimum horizontal blanking interval
737 * is 54 clocks (1 + 52 + 1), but tests with a Nitrogen6X have shown the
738 * minimum working horizontal blanking interval to be 60 clocks.
740 .hsync_len
= { 58, 158, 661 },
741 .vactive
= { 800, 800, 800 },
742 .vfront_porch
= { 1, 1, 10 },
743 .vback_porch
= { 1, 1, 10 },
744 .vsync_len
= { 1, 21, 203 },
745 .flags
= DISPLAY_FLAGS_DE_HIGH
,
748 static const struct panel_desc hannstar_hsd070pww1
= {
749 .timings
= &hannstar_hsd070pww1_timing
,
756 .bus_format
= MEDIA_BUS_FMT_RGB666_1X7X3_SPWG
,
759 static const struct display_timing hannstar_hsd100pxn1_timing
= {
760 .pixelclock
= { 55000000, 65000000, 75000000 },
761 .hactive
= { 1024, 1024, 1024 },
762 .hfront_porch
= { 40, 40, 40 },
763 .hback_porch
= { 220, 220, 220 },
764 .hsync_len
= { 20, 60, 100 },
765 .vactive
= { 768, 768, 768 },
766 .vfront_porch
= { 7, 7, 7 },
767 .vback_porch
= { 21, 21, 21 },
768 .vsync_len
= { 10, 10, 10 },
769 .flags
= DISPLAY_FLAGS_DE_HIGH
,
772 static const struct panel_desc hannstar_hsd100pxn1
= {
773 .timings
= &hannstar_hsd100pxn1_timing
,
780 .bus_format
= MEDIA_BUS_FMT_RGB666_1X7X3_SPWG
,
783 static const struct drm_display_mode hitachi_tx23d38vm0caa_mode
= {
786 .hsync_start
= 800 + 85,
787 .hsync_end
= 800 + 85 + 86,
788 .htotal
= 800 + 85 + 86 + 85,
790 .vsync_start
= 480 + 16,
791 .vsync_end
= 480 + 16 + 13,
792 .vtotal
= 480 + 16 + 13 + 16,
796 static const struct panel_desc hitachi_tx23d38vm0caa
= {
797 .modes
= &hitachi_tx23d38vm0caa_mode
,
806 static const struct drm_display_mode innolux_at043tn24_mode
= {
809 .hsync_start
= 480 + 2,
810 .hsync_end
= 480 + 2 + 41,
811 .htotal
= 480 + 2 + 41 + 2,
813 .vsync_start
= 272 + 2,
814 .vsync_end
= 272 + 2 + 11,
815 .vtotal
= 272 + 2 + 11 + 2,
817 .flags
= DRM_MODE_FLAG_NHSYNC
| DRM_MODE_FLAG_NVSYNC
,
820 static const struct panel_desc innolux_at043tn24
= {
821 .modes
= &innolux_at043tn24_mode
,
828 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
831 static const struct drm_display_mode innolux_at070tn92_mode
= {
834 .hsync_start
= 800 + 210,
835 .hsync_end
= 800 + 210 + 20,
836 .htotal
= 800 + 210 + 20 + 46,
838 .vsync_start
= 480 + 22,
839 .vsync_end
= 480 + 22 + 10,
840 .vtotal
= 480 + 22 + 23 + 10,
844 static const struct panel_desc innolux_at070tn92
= {
845 .modes
= &innolux_at070tn92_mode
,
851 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
854 static const struct display_timing innolux_g101ice_l01_timing
= {
855 .pixelclock
= { 60400000, 71100000, 74700000 },
856 .hactive
= { 1280, 1280, 1280 },
857 .hfront_porch
= { 41, 80, 100 },
858 .hback_porch
= { 40, 79, 99 },
859 .hsync_len
= { 1, 1, 1 },
860 .vactive
= { 800, 800, 800 },
861 .vfront_porch
= { 5, 11, 14 },
862 .vback_porch
= { 4, 11, 14 },
863 .vsync_len
= { 1, 1, 1 },
864 .flags
= DISPLAY_FLAGS_DE_HIGH
,
867 static const struct panel_desc innolux_g101ice_l01
= {
868 .timings
= &innolux_g101ice_l01_timing
,
879 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
882 static const struct drm_display_mode innolux_g121i1_l01_mode
= {
885 .hsync_start
= 1280 + 64,
886 .hsync_end
= 1280 + 64 + 32,
887 .htotal
= 1280 + 64 + 32 + 64,
889 .vsync_start
= 800 + 9,
890 .vsync_end
= 800 + 9 + 6,
891 .vtotal
= 800 + 9 + 6 + 9,
895 static const struct panel_desc innolux_g121i1_l01
= {
896 .modes
= &innolux_g121i1_l01_mode
,
905 static const struct drm_display_mode innolux_g121x1_l03_mode
= {
908 .hsync_start
= 1024 + 0,
909 .hsync_end
= 1024 + 1,
910 .htotal
= 1024 + 0 + 1 + 320,
912 .vsync_start
= 768 + 38,
913 .vsync_end
= 768 + 38 + 1,
914 .vtotal
= 768 + 38 + 1 + 0,
916 .flags
= DRM_MODE_FLAG_NHSYNC
| DRM_MODE_FLAG_NVSYNC
,
919 static const struct panel_desc innolux_g121x1_l03
= {
920 .modes
= &innolux_g121x1_l03_mode
,
934 static const struct drm_display_mode innolux_n116bge_mode
= {
937 .hsync_start
= 1366 + 136,
938 .hsync_end
= 1366 + 136 + 30,
939 .htotal
= 1366 + 136 + 30 + 60,
941 .vsync_start
= 768 + 8,
942 .vsync_end
= 768 + 8 + 12,
943 .vtotal
= 768 + 8 + 12 + 12,
945 .flags
= DRM_MODE_FLAG_NHSYNC
| DRM_MODE_FLAG_NVSYNC
,
948 static const struct panel_desc innolux_n116bge
= {
949 .modes
= &innolux_n116bge_mode
,
958 static const struct drm_display_mode innolux_n156bge_l21_mode
= {
961 .hsync_start
= 1366 + 16,
962 .hsync_end
= 1366 + 16 + 34,
963 .htotal
= 1366 + 16 + 34 + 50,
965 .vsync_start
= 768 + 2,
966 .vsync_end
= 768 + 2 + 6,
967 .vtotal
= 768 + 2 + 6 + 12,
971 static const struct panel_desc innolux_n156bge_l21
= {
972 .modes
= &innolux_n156bge_l21_mode
,
981 static const struct drm_display_mode innolux_zj070na_01p_mode
= {
984 .hsync_start
= 1024 + 128,
985 .hsync_end
= 1024 + 128 + 64,
986 .htotal
= 1024 + 128 + 64 + 128,
988 .vsync_start
= 600 + 16,
989 .vsync_end
= 600 + 16 + 4,
990 .vtotal
= 600 + 16 + 4 + 16,
994 static const struct panel_desc innolux_zj070na_01p
= {
995 .modes
= &innolux_zj070na_01p_mode
,
1004 static const struct display_timing kyo_tcg121xglp_timing
= {
1005 .pixelclock
= { 52000000, 65000000, 71000000 },
1006 .hactive
= { 1024, 1024, 1024 },
1007 .hfront_porch
= { 2, 2, 2 },
1008 .hback_porch
= { 2, 2, 2 },
1009 .hsync_len
= { 86, 124, 244 },
1010 .vactive
= { 768, 768, 768 },
1011 .vfront_porch
= { 2, 2, 2 },
1012 .vback_porch
= { 2, 2, 2 },
1013 .vsync_len
= { 6, 34, 73 },
1014 .flags
= DISPLAY_FLAGS_DE_HIGH
,
1017 static const struct panel_desc kyo_tcg121xglp
= {
1018 .timings
= &kyo_tcg121xglp_timing
,
1025 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1028 static const struct drm_display_mode lg_lb070wv8_mode
= {
1031 .hsync_start
= 800 + 88,
1032 .hsync_end
= 800 + 88 + 80,
1033 .htotal
= 800 + 88 + 80 + 88,
1035 .vsync_start
= 480 + 10,
1036 .vsync_end
= 480 + 10 + 25,
1037 .vtotal
= 480 + 10 + 25 + 10,
1041 static const struct panel_desc lg_lb070wv8
= {
1042 .modes
= &lg_lb070wv8_mode
,
1049 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_SPWG
,
1052 static const struct drm_display_mode lg_lp079qx1_sp0v_mode
= {
1055 .hsync_start
= 1536 + 12,
1056 .hsync_end
= 1536 + 12 + 16,
1057 .htotal
= 1536 + 12 + 16 + 48,
1059 .vsync_start
= 2048 + 8,
1060 .vsync_end
= 2048 + 8 + 4,
1061 .vtotal
= 2048 + 8 + 4 + 8,
1063 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1066 static const struct panel_desc lg_lp079qx1_sp0v
= {
1067 .modes
= &lg_lp079qx1_sp0v_mode
,
1075 static const struct drm_display_mode lg_lp097qx1_spa1_mode
= {
1078 .hsync_start
= 2048 + 150,
1079 .hsync_end
= 2048 + 150 + 5,
1080 .htotal
= 2048 + 150 + 5 + 5,
1082 .vsync_start
= 1536 + 3,
1083 .vsync_end
= 1536 + 3 + 1,
1084 .vtotal
= 1536 + 3 + 1 + 9,
1088 static const struct panel_desc lg_lp097qx1_spa1
= {
1089 .modes
= &lg_lp097qx1_spa1_mode
,
1097 static const struct drm_display_mode lg_lp120up1_mode
= {
1100 .hsync_start
= 1920 + 40,
1101 .hsync_end
= 1920 + 40 + 40,
1102 .htotal
= 1920 + 40 + 40+ 80,
1104 .vsync_start
= 1280 + 4,
1105 .vsync_end
= 1280 + 4 + 4,
1106 .vtotal
= 1280 + 4 + 4 + 12,
1110 static const struct panel_desc lg_lp120up1
= {
1111 .modes
= &lg_lp120up1_mode
,
1120 static const struct drm_display_mode lg_lp129qe_mode
= {
1123 .hsync_start
= 2560 + 48,
1124 .hsync_end
= 2560 + 48 + 32,
1125 .htotal
= 2560 + 48 + 32 + 80,
1127 .vsync_start
= 1700 + 3,
1128 .vsync_end
= 1700 + 3 + 10,
1129 .vtotal
= 1700 + 3 + 10 + 36,
1133 static const struct panel_desc lg_lp129qe
= {
1134 .modes
= &lg_lp129qe_mode
,
1143 static const struct drm_display_mode nec_nl4827hc19_05b_mode
= {
1146 .hsync_start
= 480 + 2,
1147 .hsync_end
= 480 + 2 + 41,
1148 .htotal
= 480 + 2 + 41 + 2,
1150 .vsync_start
= 272 + 2,
1151 .vsync_end
= 272 + 2 + 4,
1152 .vtotal
= 272 + 2 + 4 + 2,
1154 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1157 static const struct panel_desc nec_nl4827hc19_05b
= {
1158 .modes
= &nec_nl4827hc19_05b_mode
,
1165 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1166 .bus_flags
= DRM_BUS_FLAG_PIXDATA_POSEDGE
,
1169 static const struct display_timing okaya_rs800480t_7x0gp_timing
= {
1170 .pixelclock
= { 30000000, 30000000, 40000000 },
1171 .hactive
= { 800, 800, 800 },
1172 .hfront_porch
= { 40, 40, 40 },
1173 .hback_porch
= { 40, 40, 40 },
1174 .hsync_len
= { 1, 48, 48 },
1175 .vactive
= { 480, 480, 480 },
1176 .vfront_porch
= { 13, 13, 13 },
1177 .vback_porch
= { 29, 29, 29 },
1178 .vsync_len
= { 3, 3, 3 },
1179 .flags
= DISPLAY_FLAGS_DE_HIGH
,
1182 static const struct panel_desc okaya_rs800480t_7x0gp
= {
1183 .timings
= &okaya_rs800480t_7x0gp_timing
,
1196 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
1199 static const struct drm_display_mode olimex_lcd_olinuxino_43ts_mode
= {
1202 .hsync_start
= 480 + 5,
1203 .hsync_end
= 480 + 5 + 30,
1204 .htotal
= 480 + 5 + 30 + 10,
1206 .vsync_start
= 272 + 8,
1207 .vsync_end
= 272 + 8 + 5,
1208 .vtotal
= 272 + 8 + 5 + 3,
1212 static const struct panel_desc olimex_lcd_olinuxino_43ts
= {
1213 .modes
= &olimex_lcd_olinuxino_43ts_mode
,
1219 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1223 * 800x480 CVT. The panel appears to be quite accepting, at least as far as
1224 * pixel clocks, but this is the timing that was being used in the Adafruit
1225 * installation instructions.
1227 static const struct drm_display_mode ontat_yx700wv03_mode
= {
1238 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1243 * https://www.adafruit.com/images/product-files/2406/c3163.pdf
1245 static const struct panel_desc ontat_yx700wv03
= {
1246 .modes
= &ontat_yx700wv03_mode
,
1253 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
1256 static const struct drm_display_mode ortustech_com43h4m85ulc_mode
= {
1259 .hsync_start
= 480 + 10,
1260 .hsync_end
= 480 + 10 + 10,
1261 .htotal
= 480 + 10 + 10 + 15,
1263 .vsync_start
= 800 + 3,
1264 .vsync_end
= 800 + 3 + 3,
1265 .vtotal
= 800 + 3 + 3 + 3,
1269 static const struct panel_desc ortustech_com43h4m85ulc
= {
1270 .modes
= &ortustech_com43h4m85ulc_mode
,
1277 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1278 .bus_flags
= DRM_BUS_FLAG_DE_HIGH
| DRM_BUS_FLAG_PIXDATA_POSEDGE
,
1281 static const struct drm_display_mode qd43003c0_40_mode
= {
1284 .hsync_start
= 480 + 8,
1285 .hsync_end
= 480 + 8 + 4,
1286 .htotal
= 480 + 8 + 4 + 39,
1288 .vsync_start
= 272 + 4,
1289 .vsync_end
= 272 + 4 + 10,
1290 .vtotal
= 272 + 4 + 10 + 2,
1294 static const struct panel_desc qd43003c0_40
= {
1295 .modes
= &qd43003c0_40_mode
,
1302 .bus_format
= MEDIA_BUS_FMT_RGB888_1X24
,
1305 static const struct drm_display_mode samsung_lsn122dl01_c01_mode
= {
1308 .hsync_start
= 2560 + 48,
1309 .hsync_end
= 2560 + 48 + 32,
1310 .htotal
= 2560 + 48 + 32 + 80,
1312 .vsync_start
= 1600 + 2,
1313 .vsync_end
= 1600 + 2 + 5,
1314 .vtotal
= 1600 + 2 + 5 + 57,
1318 static const struct panel_desc samsung_lsn122dl01_c01
= {
1319 .modes
= &samsung_lsn122dl01_c01_mode
,
1327 static const struct drm_display_mode samsung_ltn101nt05_mode
= {
1330 .hsync_start
= 1024 + 24,
1331 .hsync_end
= 1024 + 24 + 136,
1332 .htotal
= 1024 + 24 + 136 + 160,
1334 .vsync_start
= 600 + 3,
1335 .vsync_end
= 600 + 3 + 6,
1336 .vtotal
= 600 + 3 + 6 + 61,
1340 static const struct panel_desc samsung_ltn101nt05
= {
1341 .modes
= &samsung_ltn101nt05_mode
,
1350 static const struct drm_display_mode samsung_ltn140at29_301_mode
= {
1353 .hsync_start
= 1366 + 64,
1354 .hsync_end
= 1366 + 64 + 48,
1355 .htotal
= 1366 + 64 + 48 + 128,
1357 .vsync_start
= 768 + 2,
1358 .vsync_end
= 768 + 2 + 5,
1359 .vtotal
= 768 + 2 + 5 + 17,
1363 static const struct panel_desc samsung_ltn140at29_301
= {
1364 .modes
= &samsung_ltn140at29_301_mode
,
1373 static const struct display_timing sharp_lq101k1ly04_timing
= {
1374 .pixelclock
= { 60000000, 65000000, 80000000 },
1375 .hactive
= { 1280, 1280, 1280 },
1376 .hfront_porch
= { 20, 20, 20 },
1377 .hback_porch
= { 20, 20, 20 },
1378 .hsync_len
= { 10, 10, 10 },
1379 .vactive
= { 800, 800, 800 },
1380 .vfront_porch
= { 4, 4, 4 },
1381 .vback_porch
= { 4, 4, 4 },
1382 .vsync_len
= { 4, 4, 4 },
1383 .flags
= DISPLAY_FLAGS_PIXDATA_POSEDGE
,
1386 static const struct panel_desc sharp_lq101k1ly04
= {
1387 .timings
= &sharp_lq101k1ly04_timing
,
1394 .bus_format
= MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA
,
1397 static const struct drm_display_mode sharp_lq123p1jx31_mode
= {
1400 .hsync_start
= 2400 + 48,
1401 .hsync_end
= 2400 + 48 + 32,
1402 .htotal
= 2400 + 48 + 32 + 80,
1404 .vsync_start
= 1600 + 3,
1405 .vsync_end
= 1600 + 3 + 10,
1406 .vtotal
= 1600 + 3 + 10 + 33,
1408 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1411 static const struct panel_desc sharp_lq123p1jx31
= {
1412 .modes
= &sharp_lq123p1jx31_mode
,
1425 static const struct drm_display_mode shelly_sca07010_bfn_lnn_mode
= {
1428 .hsync_start
= 800 + 1,
1429 .hsync_end
= 800 + 1 + 64,
1430 .htotal
= 800 + 1 + 64 + 64,
1432 .vsync_start
= 480 + 1,
1433 .vsync_end
= 480 + 1 + 23,
1434 .vtotal
= 480 + 1 + 23 + 22,
1438 static const struct panel_desc shelly_sca07010_bfn_lnn
= {
1439 .modes
= &shelly_sca07010_bfn_lnn_mode
,
1445 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
1448 static const struct drm_display_mode starry_kr122ea0sra_mode
= {
1451 .hsync_start
= 1920 + 16,
1452 .hsync_end
= 1920 + 16 + 16,
1453 .htotal
= 1920 + 16 + 16 + 32,
1455 .vsync_start
= 1200 + 15,
1456 .vsync_end
= 1200 + 15 + 2,
1457 .vtotal
= 1200 + 15 + 2 + 18,
1459 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1462 static const struct panel_desc starry_kr122ea0sra
= {
1463 .modes
= &starry_kr122ea0sra_mode
,
1470 .prepare
= 10 + 200,
1472 .unprepare
= 10 + 500,
1476 static const struct drm_display_mode tpk_f07a_0102_mode
= {
1479 .hsync_start
= 800 + 40,
1480 .hsync_end
= 800 + 40 + 128,
1481 .htotal
= 800 + 40 + 128 + 88,
1483 .vsync_start
= 480 + 10,
1484 .vsync_end
= 480 + 10 + 2,
1485 .vtotal
= 480 + 10 + 2 + 33,
1489 static const struct panel_desc tpk_f07a_0102
= {
1490 .modes
= &tpk_f07a_0102_mode
,
1496 .bus_flags
= DRM_BUS_FLAG_PIXDATA_POSEDGE
,
1499 static const struct drm_display_mode tpk_f10a_0102_mode
= {
1502 .hsync_start
= 1024 + 176,
1503 .hsync_end
= 1024 + 176 + 5,
1504 .htotal
= 1024 + 176 + 5 + 88,
1506 .vsync_start
= 600 + 20,
1507 .vsync_end
= 600 + 20 + 5,
1508 .vtotal
= 600 + 20 + 5 + 25,
1512 static const struct panel_desc tpk_f10a_0102
= {
1513 .modes
= &tpk_f10a_0102_mode
,
1521 static const struct display_timing urt_umsh_8596md_timing
= {
1522 .pixelclock
= { 33260000, 33260000, 33260000 },
1523 .hactive
= { 800, 800, 800 },
1524 .hfront_porch
= { 41, 41, 41 },
1525 .hback_porch
= { 216 - 128, 216 - 128, 216 - 128 },
1526 .hsync_len
= { 71, 128, 128 },
1527 .vactive
= { 480, 480, 480 },
1528 .vfront_porch
= { 10, 10, 10 },
1529 .vback_porch
= { 35 - 2, 35 - 2, 35 - 2 },
1530 .vsync_len
= { 2, 2, 2 },
1531 .flags
= DISPLAY_FLAGS_DE_HIGH
| DISPLAY_FLAGS_PIXDATA_NEGEDGE
|
1532 DISPLAY_FLAGS_HSYNC_LOW
| DISPLAY_FLAGS_VSYNC_LOW
,
1535 static const struct panel_desc urt_umsh_8596md_lvds
= {
1536 .timings
= &urt_umsh_8596md_timing
,
1543 .bus_format
= MEDIA_BUS_FMT_RGB666_1X7X3_SPWG
,
1546 static const struct panel_desc urt_umsh_8596md_parallel
= {
1547 .timings
= &urt_umsh_8596md_timing
,
1554 .bus_format
= MEDIA_BUS_FMT_RGB666_1X18
,
1557 static const struct of_device_id platform_of_match
[] = {
1559 .compatible
= "ampire,am800480r3tmqwa1h",
1560 .data
= &ire_am800480r3tmqwa1h
,
1562 .compatible
= "auo,b101aw03",
1563 .data
= &auo_b101aw03
,
1565 .compatible
= "auo,b101ean01",
1566 .data
= &auo_b101ean01
,
1568 .compatible
= "auo,b101xtn01",
1569 .data
= &auo_b101xtn01
,
1571 .compatible
= "auo,b116xw03",
1572 .data
= &auo_b116xw03
,
1574 .compatible
= "auo,b133htn01",
1575 .data
= &auo_b133htn01
,
1577 .compatible
= "auo,b133xtn01",
1578 .data
= &auo_b133xtn01
,
1580 .compatible
= "avic,tm070ddh03",
1581 .data
= &avic_tm070ddh03
,
1583 .compatible
= "chunghwa,claa101wa01a",
1584 .data
= &chunghwa_claa101wa01a
1586 .compatible
= "chunghwa,claa101wb01",
1587 .data
= &chunghwa_claa101wb01
1589 .compatible
= "edt,et057090dhu",
1590 .data
= &edt_et057090dhu
,
1592 .compatible
= "edt,et070080dh6",
1593 .data
= &edt_etm0700g0dh6
,
1595 .compatible
= "edt,etm0700g0dh6",
1596 .data
= &edt_etm0700g0dh6
,
1598 .compatible
= "foxlink,fl500wvr00-a0t",
1599 .data
= &foxlink_fl500wvr00_a0t
,
1601 .compatible
= "giantplus,gpg482739qs5",
1602 .data
= &giantplus_gpg482739qs5
1604 .compatible
= "hannstar,hsd070pww1",
1605 .data
= &hannstar_hsd070pww1
,
1607 .compatible
= "hannstar,hsd100pxn1",
1608 .data
= &hannstar_hsd100pxn1
,
1610 .compatible
= "hit,tx23d38vm0caa",
1611 .data
= &hitachi_tx23d38vm0caa
1613 .compatible
= "innolux,at043tn24",
1614 .data
= &innolux_at043tn24
,
1616 .compatible
= "innolux,at070tn92",
1617 .data
= &innolux_at070tn92
,
1619 .compatible
="innolux,g101ice-l01",
1620 .data
= &innolux_g101ice_l01
1622 .compatible
="innolux,g121i1-l01",
1623 .data
= &innolux_g121i1_l01
1625 .compatible
= "innolux,g121x1-l03",
1626 .data
= &innolux_g121x1_l03
,
1628 .compatible
= "innolux,n116bge",
1629 .data
= &innolux_n116bge
,
1631 .compatible
= "innolux,n156bge-l21",
1632 .data
= &innolux_n156bge_l21
,
1634 .compatible
= "innolux,zj070na-01p",
1635 .data
= &innolux_zj070na_01p
,
1637 .compatible
= "kyo,tcg121xglp",
1638 .data
= &kyo_tcg121xglp
,
1640 .compatible
= "lg,lb070wv8",
1641 .data
= &lg_lb070wv8
,
1643 .compatible
= "lg,lp079qx1-sp0v",
1644 .data
= &lg_lp079qx1_sp0v
,
1646 .compatible
= "lg,lp097qx1-spa1",
1647 .data
= &lg_lp097qx1_spa1
,
1649 .compatible
= "lg,lp120up1",
1650 .data
= &lg_lp120up1
,
1652 .compatible
= "lg,lp129qe",
1653 .data
= &lg_lp129qe
,
1655 .compatible
= "nec,nl4827hc19-05b",
1656 .data
= &nec_nl4827hc19_05b
,
1658 .compatible
= "okaya,rs800480t-7x0gp",
1659 .data
= &okaya_rs800480t_7x0gp
,
1661 .compatible
= "olimex,lcd-olinuxino-43-ts",
1662 .data
= &olimex_lcd_olinuxino_43ts
,
1664 .compatible
= "ontat,yx700wv03",
1665 .data
= &ontat_yx700wv03
,
1667 .compatible
= "ortustech,com43h4m85ulc",
1668 .data
= &ortustech_com43h4m85ulc
,
1670 .compatible
= "qiaodian,qd43003c0-40",
1671 .data
= &qd43003c0_40
,
1673 .compatible
= "samsung,lsn122dl01-c01",
1674 .data
= &samsung_lsn122dl01_c01
,
1676 .compatible
= "samsung,ltn101nt05",
1677 .data
= &samsung_ltn101nt05
,
1679 .compatible
= "samsung,ltn140at29-301",
1680 .data
= &samsung_ltn140at29_301
,
1682 .compatible
= "sharp,lq101k1ly04",
1683 .data
= &sharp_lq101k1ly04
,
1685 .compatible
= "sharp,lq123p1jx31",
1686 .data
= &sharp_lq123p1jx31
,
1688 .compatible
= "shelly,sca07010-bfn-lnn",
1689 .data
= &shelly_sca07010_bfn_lnn
,
1691 .compatible
= "starry,kr122ea0sra",
1692 .data
= &starry_kr122ea0sra
,
1694 .compatible
= "tpk,f07a-0102",
1695 .data
= &tpk_f07a_0102
,
1697 .compatible
= "tpk,f10a-0102",
1698 .data
= &tpk_f10a_0102
,
1700 .compatible
= "urt,umsh-8596md-t",
1701 .data
= &urt_umsh_8596md_parallel
,
1703 .compatible
= "urt,umsh-8596md-1t",
1704 .data
= &urt_umsh_8596md_parallel
,
1706 .compatible
= "urt,umsh-8596md-7t",
1707 .data
= &urt_umsh_8596md_parallel
,
1709 .compatible
= "urt,umsh-8596md-11t",
1710 .data
= &urt_umsh_8596md_lvds
,
1712 .compatible
= "urt,umsh-8596md-19t",
1713 .data
= &urt_umsh_8596md_lvds
,
1715 .compatible
= "urt,umsh-8596md-20t",
1716 .data
= &urt_umsh_8596md_parallel
,
1721 MODULE_DEVICE_TABLE(of
, platform_of_match
);
1723 static int panel_simple_platform_probe(struct platform_device
*pdev
)
1725 const struct of_device_id
*id
;
1727 id
= of_match_node(platform_of_match
, pdev
->dev
.of_node
);
1731 return panel_simple_probe(&pdev
->dev
, id
->data
);
1734 static int panel_simple_platform_remove(struct platform_device
*pdev
)
1736 return panel_simple_remove(&pdev
->dev
);
1739 static void panel_simple_platform_shutdown(struct platform_device
*pdev
)
1741 panel_simple_shutdown(&pdev
->dev
);
1744 static struct platform_driver panel_simple_platform_driver
= {
1746 .name
= "panel-simple",
1747 .of_match_table
= platform_of_match
,
1749 .probe
= panel_simple_platform_probe
,
1750 .remove
= panel_simple_platform_remove
,
1751 .shutdown
= panel_simple_platform_shutdown
,
1754 struct panel_desc_dsi
{
1755 struct panel_desc desc
;
1757 unsigned long flags
;
1758 enum mipi_dsi_pixel_format format
;
1762 static const struct drm_display_mode auo_b080uan01_mode
= {
1765 .hsync_start
= 1200 + 62,
1766 .hsync_end
= 1200 + 62 + 4,
1767 .htotal
= 1200 + 62 + 4 + 62,
1769 .vsync_start
= 1920 + 9,
1770 .vsync_end
= 1920 + 9 + 2,
1771 .vtotal
= 1920 + 9 + 2 + 8,
1775 static const struct panel_desc_dsi auo_b080uan01
= {
1777 .modes
= &auo_b080uan01_mode
,
1785 .flags
= MIPI_DSI_MODE_VIDEO
| MIPI_DSI_CLOCK_NON_CONTINUOUS
,
1786 .format
= MIPI_DSI_FMT_RGB888
,
1790 static const struct drm_display_mode boe_tv080wum_nl0_mode
= {
1793 .hsync_start
= 1200 + 120,
1794 .hsync_end
= 1200 + 120 + 20,
1795 .htotal
= 1200 + 120 + 20 + 21,
1797 .vsync_start
= 1920 + 21,
1798 .vsync_end
= 1920 + 21 + 3,
1799 .vtotal
= 1920 + 21 + 3 + 18,
1801 .flags
= DRM_MODE_FLAG_NVSYNC
| DRM_MODE_FLAG_NHSYNC
,
1804 static const struct panel_desc_dsi boe_tv080wum_nl0
= {
1806 .modes
= &boe_tv080wum_nl0_mode
,
1813 .flags
= MIPI_DSI_MODE_VIDEO
|
1814 MIPI_DSI_MODE_VIDEO_BURST
|
1815 MIPI_DSI_MODE_VIDEO_SYNC_PULSE
,
1816 .format
= MIPI_DSI_FMT_RGB888
,
1820 static const struct drm_display_mode lg_ld070wx3_sl01_mode
= {
1823 .hsync_start
= 800 + 32,
1824 .hsync_end
= 800 + 32 + 1,
1825 .htotal
= 800 + 32 + 1 + 57,
1827 .vsync_start
= 1280 + 28,
1828 .vsync_end
= 1280 + 28 + 1,
1829 .vtotal
= 1280 + 28 + 1 + 14,
1833 static const struct panel_desc_dsi lg_ld070wx3_sl01
= {
1835 .modes
= &lg_ld070wx3_sl01_mode
,
1843 .flags
= MIPI_DSI_MODE_VIDEO
| MIPI_DSI_CLOCK_NON_CONTINUOUS
,
1844 .format
= MIPI_DSI_FMT_RGB888
,
1848 static const struct drm_display_mode lg_lh500wx1_sd03_mode
= {
1851 .hsync_start
= 720 + 12,
1852 .hsync_end
= 720 + 12 + 4,
1853 .htotal
= 720 + 12 + 4 + 112,
1855 .vsync_start
= 1280 + 8,
1856 .vsync_end
= 1280 + 8 + 4,
1857 .vtotal
= 1280 + 8 + 4 + 12,
1861 static const struct panel_desc_dsi lg_lh500wx1_sd03
= {
1863 .modes
= &lg_lh500wx1_sd03_mode
,
1871 .flags
= MIPI_DSI_MODE_VIDEO
,
1872 .format
= MIPI_DSI_FMT_RGB888
,
1876 static const struct drm_display_mode panasonic_vvx10f004b00_mode
= {
1879 .hsync_start
= 1920 + 154,
1880 .hsync_end
= 1920 + 154 + 16,
1881 .htotal
= 1920 + 154 + 16 + 32,
1883 .vsync_start
= 1200 + 17,
1884 .vsync_end
= 1200 + 17 + 2,
1885 .vtotal
= 1200 + 17 + 2 + 16,
1889 static const struct panel_desc_dsi panasonic_vvx10f004b00
= {
1891 .modes
= &panasonic_vvx10f004b00_mode
,
1899 .flags
= MIPI_DSI_MODE_VIDEO
| MIPI_DSI_MODE_VIDEO_SYNC_PULSE
|
1900 MIPI_DSI_CLOCK_NON_CONTINUOUS
,
1901 .format
= MIPI_DSI_FMT_RGB888
,
1905 static const struct of_device_id dsi_of_match
[] = {
1907 .compatible
= "auo,b080uan01",
1908 .data
= &auo_b080uan01
1910 .compatible
= "boe,tv080wum-nl0",
1911 .data
= &boe_tv080wum_nl0
1913 .compatible
= "lg,ld070wx3-sl01",
1914 .data
= &lg_ld070wx3_sl01
1916 .compatible
= "lg,lh500wx1-sd03",
1917 .data
= &lg_lh500wx1_sd03
1919 .compatible
= "panasonic,vvx10f004b00",
1920 .data
= &panasonic_vvx10f004b00
1925 MODULE_DEVICE_TABLE(of
, dsi_of_match
);
1927 static int panel_simple_dsi_probe(struct mipi_dsi_device
*dsi
)
1929 const struct panel_desc_dsi
*desc
;
1930 const struct of_device_id
*id
;
1933 id
= of_match_node(dsi_of_match
, dsi
->dev
.of_node
);
1939 err
= panel_simple_probe(&dsi
->dev
, &desc
->desc
);
1943 dsi
->mode_flags
= desc
->flags
;
1944 dsi
->format
= desc
->format
;
1945 dsi
->lanes
= desc
->lanes
;
1947 return mipi_dsi_attach(dsi
);
1950 static int panel_simple_dsi_remove(struct mipi_dsi_device
*dsi
)
1954 err
= mipi_dsi_detach(dsi
);
1956 dev_err(&dsi
->dev
, "failed to detach from DSI host: %d\n", err
);
1958 return panel_simple_remove(&dsi
->dev
);
1961 static void panel_simple_dsi_shutdown(struct mipi_dsi_device
*dsi
)
1963 panel_simple_shutdown(&dsi
->dev
);
1966 static struct mipi_dsi_driver panel_simple_dsi_driver
= {
1968 .name
= "panel-simple-dsi",
1969 .of_match_table
= dsi_of_match
,
1971 .probe
= panel_simple_dsi_probe
,
1972 .remove
= panel_simple_dsi_remove
,
1973 .shutdown
= panel_simple_dsi_shutdown
,
1976 static int __init
panel_simple_init(void)
1980 err
= platform_driver_register(&panel_simple_platform_driver
);
1984 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI
)) {
1985 err
= mipi_dsi_driver_register(&panel_simple_dsi_driver
);
1992 module_init(panel_simple_init
);
1994 static void __exit
panel_simple_exit(void)
1996 if (IS_ENABLED(CONFIG_DRM_MIPI_DSI
))
1997 mipi_dsi_driver_unregister(&panel_simple_dsi_driver
);
1999 platform_driver_unregister(&panel_simple_platform_driver
);
2001 module_exit(panel_simple_exit
);
2003 MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
2004 MODULE_DESCRIPTION("DRM Driver for Simple Panels");
2005 MODULE_LICENSE("GPL and additional rights");