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/debugfs.h>
25 #include <linux/delay.h>
26 #include <linux/gpio/consumer.h>
27 #include <linux/iopoll.h>
28 #include <linux/module.h>
29 #include <linux/of_platform.h>
30 #include <linux/platform_device.h>
31 #include <linux/pm_runtime.h>
32 #include <linux/regulator/consumer.h>
34 #include <video/display_timing.h>
35 #include <video/of_display_timing.h>
36 #include <video/videomode.h>
38 #include <drm/display/drm_dp_aux_bus.h>
39 #include <drm/display/drm_dp_helper.h>
40 #include <drm/drm_crtc.h>
41 #include <drm/drm_device.h>
42 #include <drm/drm_edid.h>
43 #include <drm/drm_panel.h>
46 * struct panel_delay - Describes delays for a simple panel.
50 * @hpd_reliable: Time for HPD to be reliable
52 * The time (in milliseconds) that it takes after powering the panel
53 * before the HPD signal is reliable. Ideally this is 0 but some panels,
54 * board designs, or bad pulldown configs can cause a glitch here.
56 * NOTE: on some old panel data this number appears to be much too big.
57 * Presumably some old panels simply didn't have HPD hooked up and put
58 * the hpd_absent here because this field predates the
59 * hpd_absent. While that works, it's non-ideal.
61 unsigned int hpd_reliable;
64 * @hpd_absent: Time to wait if HPD isn't hooked up.
66 * Add this to the prepare delay if we know Hot Plug Detect isn't used.
68 * This is T3-max on eDP timing diagrams or the delay from power on
69 * until HPD is guaranteed to be asserted.
71 unsigned int hpd_absent;
74 * @powered_on_to_enable: Time between panel powered on and enable.
76 * The minimum time, in milliseconds, that needs to have passed
77 * between when panel powered on and enable may begin.
79 * This is (T3+T4+T5+T6+T8)-min on eDP timing diagrams or after the
80 * power supply enabled until we can turn the backlight on and see
83 * This doesn't normally need to be set if timings are already met by
84 * prepare_to_enable or enable.
86 unsigned int powered_on_to_enable;
89 * @prepare_to_enable: Time between prepare and enable.
91 * The minimum time, in milliseconds, that needs to have passed
92 * between when prepare finished and enable may begin. If at
93 * enable time less time has passed since prepare finished,
94 * the driver waits for the remaining time.
96 * If a fixed enable delay is also specified, we'll start
97 * counting before delaying for the fixed delay.
99 * If a fixed prepare delay is also specified, we won't start
100 * counting until after the fixed delay. We can't overlap this
101 * fixed delay with the min time because the fixed delay
102 * doesn't happen at the end of the function if a HPD GPIO was
108 * // do fixed prepare delay
109 * // wait for HPD GPIO if applicable
110 * // start counting for prepare_to_enable
113 * // do fixed enable delay
114 * // enforce prepare_to_enable min time
116 * This is not specified in a standard way on eDP timing diagrams.
117 * It is effectively the time from HPD going high till you can
118 * turn on the backlight.
120 unsigned int prepare_to_enable;
123 * @enable: Time for the panel to display a valid frame.
125 * The time (in milliseconds) that it takes for the panel to
126 * display the first valid frame after starting to receive
129 * This is (T6-min + max(T7-max, T8-min)) on eDP timing diagrams or
130 * the delay after link training finishes until we can turn the
131 * backlight on and see valid data.
136 * @disable: Time for the panel to turn the display off.
138 * The time (in milliseconds) that it takes for the panel to
139 * turn the display off (no content is visible).
141 * This is T9-min (delay from backlight off to end of valid video
142 * data) on eDP timing diagrams. It is not common to set.
144 unsigned int disable;
147 * @unprepare: Time to power down completely.
149 * The time (in milliseconds) that it takes for the panel
150 * to power itself down completely.
152 * This time is used to prevent a future "prepare" from
153 * starting until at least this many milliseconds has passed.
154 * If at prepare time less time has passed since unprepare
155 * finished, the driver waits for the remaining time.
157 * This is T12-min on eDP timing diagrams.
159 unsigned int unprepare;
163 * struct panel_desc - Describes a simple panel.
167 * @modes: Pointer to array of fixed modes appropriate for this panel.
169 * If only one mode then this can just be the address of the mode.
170 * NOTE: cannot be used with "timings" and also if this is specified
171 * then you cannot override the mode in the device tree.
173 const struct drm_display_mode *modes;
175 /** @num_modes: Number of elements in modes array. */
176 unsigned int num_modes;
179 * @timings: Pointer to array of display timings
181 * NOTE: cannot be used with "modes" and also these will be used to
182 * validate a device tree override if one is present.
184 const struct display_timing *timings;
186 /** @num_timings: Number of elements in timings array. */
187 unsigned int num_timings;
189 /** @bpc: Bits per color. */
192 /** @size: Structure containing the physical size of this panel. */
195 * @size.width: Width (in mm) of the active display area.
200 * @size.height: Height (in mm) of the active display area.
205 /** @delay: Structure containing various delay values for this panel. */
206 struct panel_delay delay;
210 * struct edp_panel_entry - Maps panel ID to delay / panel name.
212 struct edp_panel_entry {
213 /** @ident: edid identity used for panel matching. */
214 const struct drm_edid_ident ident;
216 /** @delay: The power sequencing delays needed for this panel. */
217 const struct panel_delay *delay;
219 /** @override_edid_mode: Override the mode obtained by edid. */
220 const struct drm_display_mode *override_edid_mode;
224 struct drm_panel base;
230 ktime_t prepared_time;
231 ktime_t powered_on_time;
232 ktime_t unprepared_time;
234 const struct panel_desc *desc;
236 struct regulator *supply;
237 struct i2c_adapter *ddc;
238 struct drm_dp_aux *aux;
240 struct gpio_desc *enable_gpio;
241 struct gpio_desc *hpd_gpio;
243 const struct edp_panel_entry *detected_panel;
245 const struct drm_edid *drm_edid;
247 struct drm_display_mode override_mode;
249 enum drm_panel_orientation orientation;
252 static inline struct panel_edp *to_panel_edp(struct drm_panel *panel)
254 return container_of(panel, struct panel_edp, base);
257 static unsigned int panel_edp_get_timings_modes(struct panel_edp *panel,
258 struct drm_connector *connector)
260 struct drm_display_mode *mode;
261 unsigned int i, num = 0;
263 for (i = 0; i < panel->desc->num_timings; i++) {
264 const struct display_timing *dt = &panel->desc->timings[i];
267 videomode_from_timing(dt, &vm);
268 mode = drm_mode_create(connector->dev);
270 dev_err(panel->base.dev, "failed to add mode %ux%u\n",
271 dt->hactive.typ, dt->vactive.typ);
275 drm_display_mode_from_videomode(&vm, mode);
277 mode->type |= DRM_MODE_TYPE_DRIVER;
279 if (panel->desc->num_timings == 1)
280 mode->type |= DRM_MODE_TYPE_PREFERRED;
282 drm_mode_probed_add(connector, mode);
289 static unsigned int panel_edp_get_display_modes(struct panel_edp *panel,
290 struct drm_connector *connector)
292 struct drm_display_mode *mode;
293 unsigned int i, num = 0;
295 for (i = 0; i < panel->desc->num_modes; i++) {
296 const struct drm_display_mode *m = &panel->desc->modes[i];
298 mode = drm_mode_duplicate(connector->dev, m);
300 dev_err(panel->base.dev, "failed to add mode %ux%u@%u\n",
301 m->hdisplay, m->vdisplay,
302 drm_mode_vrefresh(m));
306 mode->type |= DRM_MODE_TYPE_DRIVER;
308 if (panel->desc->num_modes == 1)
309 mode->type |= DRM_MODE_TYPE_PREFERRED;
311 drm_mode_set_name(mode);
313 drm_mode_probed_add(connector, mode);
320 static int panel_edp_override_edid_mode(struct panel_edp *panel,
321 struct drm_connector *connector,
322 const struct drm_display_mode *override_mode)
324 struct drm_display_mode *mode;
326 mode = drm_mode_duplicate(connector->dev, override_mode);
328 dev_err(panel->base.dev, "failed to add additional mode\n");
332 mode->type |= DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
333 drm_mode_set_name(mode);
334 drm_mode_probed_add(connector, mode);
338 static int panel_edp_get_non_edid_modes(struct panel_edp *panel,
339 struct drm_connector *connector)
341 struct drm_display_mode *mode;
342 bool has_override = panel->override_mode.type;
343 unsigned int num = 0;
349 mode = drm_mode_duplicate(connector->dev,
350 &panel->override_mode);
352 drm_mode_probed_add(connector, mode);
355 dev_err(panel->base.dev, "failed to add override mode\n");
359 /* Only add timings if override was not there or failed to validate */
360 if (num == 0 && panel->desc->num_timings)
361 num = panel_edp_get_timings_modes(panel, connector);
364 * Only add fixed modes if timings/override added no mode.
366 * We should only ever have either the display timings specified
367 * or a fixed mode. Anything else is rather bogus.
369 WARN_ON(panel->desc->num_timings && panel->desc->num_modes);
371 num = panel_edp_get_display_modes(panel, connector);
373 connector->display_info.bpc = panel->desc->bpc;
374 connector->display_info.width_mm = panel->desc->size.width;
375 connector->display_info.height_mm = panel->desc->size.height;
380 static void panel_edp_wait(ktime_t start_ktime, unsigned int min_ms)
382 ktime_t now_ktime, min_ktime;
387 min_ktime = ktime_add(start_ktime, ms_to_ktime(min_ms));
388 now_ktime = ktime_get_boottime();
390 if (ktime_before(now_ktime, min_ktime))
391 msleep(ktime_to_ms(ktime_sub(min_ktime, now_ktime)) + 1);
394 static int panel_edp_disable(struct drm_panel *panel)
396 struct panel_edp *p = to_panel_edp(panel);
401 if (p->desc->delay.disable)
402 msleep(p->desc->delay.disable);
409 static int panel_edp_suspend(struct device *dev)
411 struct panel_edp *p = dev_get_drvdata(dev);
413 drm_dp_dpcd_set_powered(p->aux, false);
414 gpiod_set_value_cansleep(p->enable_gpio, 0);
415 regulator_disable(p->supply);
416 p->unprepared_time = ktime_get_boottime();
421 static int panel_edp_unprepare(struct drm_panel *panel)
423 struct panel_edp *p = to_panel_edp(panel);
426 /* Unpreparing when already unprepared is a no-op */
430 ret = pm_runtime_put_sync_suspend(panel->dev);
438 static int panel_edp_get_hpd_gpio(struct device *dev, struct panel_edp *p)
440 p->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN);
441 if (IS_ERR(p->hpd_gpio))
442 return dev_err_probe(dev, PTR_ERR(p->hpd_gpio),
443 "failed to get 'hpd' GPIO\n");
448 static bool panel_edp_can_read_hpd(struct panel_edp *p)
450 return !p->no_hpd && (p->hpd_gpio || (p->aux && p->aux->wait_hpd_asserted));
453 static int panel_edp_prepare_once(struct panel_edp *p)
455 struct device *dev = p->base.dev;
459 unsigned long hpd_wait_us;
461 panel_edp_wait(p->unprepared_time, p->desc->delay.unprepare);
463 err = regulator_enable(p->supply);
465 dev_err(dev, "failed to enable supply: %d\n", err);
469 gpiod_set_value_cansleep(p->enable_gpio, 1);
470 drm_dp_dpcd_set_powered(p->aux, true);
472 p->powered_on_time = ktime_get_boottime();
474 delay = p->desc->delay.hpd_reliable;
476 delay = max(delay, p->desc->delay.hpd_absent);
480 if (panel_edp_can_read_hpd(p)) {
481 if (p->desc->delay.hpd_absent)
482 hpd_wait_us = p->desc->delay.hpd_absent * 1000UL;
484 hpd_wait_us = 2000000;
487 err = readx_poll_timeout(gpiod_get_value_cansleep,
488 p->hpd_gpio, hpd_asserted,
489 hpd_asserted, 1000, hpd_wait_us);
490 if (hpd_asserted < 0)
493 err = p->aux->wait_hpd_asserted(p->aux, hpd_wait_us);
497 if (err != -ETIMEDOUT)
499 "error waiting for hpd GPIO: %d\n", err);
504 p->prepared_time = ktime_get_boottime();
509 drm_dp_dpcd_set_powered(p->aux, false);
510 gpiod_set_value_cansleep(p->enable_gpio, 0);
511 regulator_disable(p->supply);
512 p->unprepared_time = ktime_get_boottime();
518 * Some panels simply don't always come up and need to be power cycled to
519 * work properly. We'll allow for a handful of retries.
521 #define MAX_PANEL_PREPARE_TRIES 5
523 static int panel_edp_resume(struct device *dev)
525 struct panel_edp *p = dev_get_drvdata(dev);
529 for (try = 0; try < MAX_PANEL_PREPARE_TRIES; try++) {
530 ret = panel_edp_prepare_once(p);
531 if (ret != -ETIMEDOUT)
535 if (ret == -ETIMEDOUT)
536 dev_err(dev, "Prepare timeout after %d tries\n", try);
538 dev_warn(dev, "Prepare needed %d retries\n", try);
543 static int panel_edp_prepare(struct drm_panel *panel)
545 struct panel_edp *p = to_panel_edp(panel);
548 /* Preparing when already prepared is a no-op */
552 ret = pm_runtime_get_sync(panel->dev);
554 pm_runtime_put_autosuspend(panel->dev);
563 static int panel_edp_enable(struct drm_panel *panel)
565 struct panel_edp *p = to_panel_edp(panel);
571 delay = p->desc->delay.enable;
574 * If there is a "prepare_to_enable" delay then that's supposed to be
575 * the delay from HPD going high until we can turn the backlight on.
576 * However, we can only count this if HPD is readable by the panel
579 * If we aren't handling the HPD pin ourselves then the best we
580 * can do is assume that HPD went high immediately before we were
581 * called (and link training took zero time). Note that "no-hpd"
582 * actually counts as handling HPD ourselves since we're doing the
583 * worst case delay (in prepare) ourselves.
585 * NOTE: if we ever end up in this "if" statement then we're
586 * guaranteed that the panel_edp_wait() call below will do no delay.
587 * It already handles that case, though, so we don't need any special
590 if (p->desc->delay.prepare_to_enable &&
591 !panel_edp_can_read_hpd(p) && !p->no_hpd)
592 delay = max(delay, p->desc->delay.prepare_to_enable);
597 panel_edp_wait(p->prepared_time, p->desc->delay.prepare_to_enable);
599 panel_edp_wait(p->powered_on_time, p->desc->delay.powered_on_to_enable);
606 static int panel_edp_get_modes(struct drm_panel *panel,
607 struct drm_connector *connector)
609 struct panel_edp *p = to_panel_edp(panel);
611 bool has_hard_coded_modes = p->desc->num_timings || p->desc->num_modes;
612 bool has_override_edid_mode = p->detected_panel &&
613 p->detected_panel != ERR_PTR(-EINVAL) &&
614 p->detected_panel->override_edid_mode;
616 /* probe EDID if a DDC bus is available */
618 pm_runtime_get_sync(panel->dev);
621 p->drm_edid = drm_edid_read_ddc(connector, p->ddc);
623 drm_edid_connector_update(connector, p->drm_edid);
626 * If both edid and hard-coded modes exists, skip edid modes to
627 * avoid multiple preferred modes.
629 if (p->drm_edid && !has_hard_coded_modes) {
630 if (has_override_edid_mode) {
632 * override_edid_mode is specified. Use
633 * override_edid_mode instead of from edid.
635 num += panel_edp_override_edid_mode(p, connector,
636 p->detected_panel->override_edid_mode);
638 num += drm_edid_connector_add_modes(connector);
642 pm_runtime_mark_last_busy(panel->dev);
643 pm_runtime_put_autosuspend(panel->dev);
646 if (has_hard_coded_modes)
647 num += panel_edp_get_non_edid_modes(p, connector);
649 dev_warn(p->base.dev, "No display modes\n");
652 * TODO: Remove once all drm drivers call
653 * drm_connector_set_orientation_from_panel()
655 drm_connector_set_panel_orientation(connector, p->orientation);
660 static int panel_edp_get_timings(struct drm_panel *panel,
661 unsigned int num_timings,
662 struct display_timing *timings)
664 struct panel_edp *p = to_panel_edp(panel);
667 if (p->desc->num_timings < num_timings)
668 num_timings = p->desc->num_timings;
671 for (i = 0; i < num_timings; i++)
672 timings[i] = p->desc->timings[i];
674 return p->desc->num_timings;
677 static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
679 struct panel_edp *p = to_panel_edp(panel);
681 return p->orientation;
684 static int detected_panel_show(struct seq_file *s, void *data)
686 struct drm_panel *panel = s->private;
687 struct panel_edp *p = to_panel_edp(panel);
689 if (IS_ERR(p->detected_panel))
690 seq_puts(s, "UNKNOWN\n");
691 else if (!p->detected_panel)
692 seq_puts(s, "HARDCODED\n");
694 seq_printf(s, "%s\n", p->detected_panel->ident.name);
699 DEFINE_SHOW_ATTRIBUTE(detected_panel);
701 static void panel_edp_debugfs_init(struct drm_panel *panel, struct dentry *root)
703 debugfs_create_file("detected_panel", 0600, root, panel, &detected_panel_fops);
706 static const struct drm_panel_funcs panel_edp_funcs = {
707 .disable = panel_edp_disable,
708 .unprepare = panel_edp_unprepare,
709 .prepare = panel_edp_prepare,
710 .enable = panel_edp_enable,
711 .get_modes = panel_edp_get_modes,
712 .get_orientation = panel_edp_get_orientation,
713 .get_timings = panel_edp_get_timings,
714 .debugfs_init = panel_edp_debugfs_init,
717 #define PANEL_EDP_BOUNDS_CHECK(to_check, bounds, field) \
718 (to_check->field.typ >= bounds->field.min && \
719 to_check->field.typ <= bounds->field.max)
720 static void panel_edp_parse_panel_timing_node(struct device *dev,
721 struct panel_edp *panel,
722 const struct display_timing *ot)
724 const struct panel_desc *desc = panel->desc;
728 if (WARN_ON(desc->num_modes)) {
729 dev_err(dev, "Reject override mode: panel has a fixed mode\n");
732 if (WARN_ON(!desc->num_timings)) {
733 dev_err(dev, "Reject override mode: no timings specified\n");
737 for (i = 0; i < panel->desc->num_timings; i++) {
738 const struct display_timing *dt = &panel->desc->timings[i];
740 if (!PANEL_EDP_BOUNDS_CHECK(ot, dt, hactive) ||
741 !PANEL_EDP_BOUNDS_CHECK(ot, dt, hfront_porch) ||
742 !PANEL_EDP_BOUNDS_CHECK(ot, dt, hback_porch) ||
743 !PANEL_EDP_BOUNDS_CHECK(ot, dt, hsync_len) ||
744 !PANEL_EDP_BOUNDS_CHECK(ot, dt, vactive) ||
745 !PANEL_EDP_BOUNDS_CHECK(ot, dt, vfront_porch) ||
746 !PANEL_EDP_BOUNDS_CHECK(ot, dt, vback_porch) ||
747 !PANEL_EDP_BOUNDS_CHECK(ot, dt, vsync_len))
750 if (ot->flags != dt->flags)
753 videomode_from_timing(ot, &vm);
754 drm_display_mode_from_videomode(&vm, &panel->override_mode);
755 panel->override_mode.type |= DRM_MODE_TYPE_DRIVER |
756 DRM_MODE_TYPE_PREFERRED;
760 if (WARN_ON(!panel->override_mode.type))
761 dev_err(dev, "Reject override mode: No display_timing found\n");
764 static const struct edp_panel_entry *find_edp_panel(u32 panel_id, const struct drm_edid *edid);
766 static void panel_edp_set_conservative_timings(struct panel_edp *panel, struct panel_desc *desc)
769 * It's highly likely that the panel will work if we use very
770 * conservative timings, so let's do that.
772 * Nearly all panels have a "unprepare" delay of 500 ms though
773 * there are a few with 1000. Let's stick 2000 in just to be
774 * super conservative.
776 * An "enable" delay of 80 ms seems the most common, but we'll
777 * throw in 200 ms to be safe.
779 desc->delay.unprepare = 2000;
780 desc->delay.enable = 200;
782 panel->detected_panel = ERR_PTR(-EINVAL);
785 static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
787 struct panel_desc *desc;
788 const struct drm_edid *base_block;
796 desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
802 * Read the dts properties for the initial probe. These are used by
803 * the runtime resume code which will get called by the
804 * pm_runtime_get_sync() call below.
806 of_property_read_u32(dev->of_node, "hpd-reliable-delay-ms", &reliable_ms);
807 desc->delay.hpd_reliable = reliable_ms;
808 of_property_read_u32(dev->of_node, "hpd-absent-delay-ms", &absent_ms);
809 desc->delay.hpd_absent = absent_ms;
811 /* Power the panel on so we can read the EDID */
812 ret = pm_runtime_get_sync(dev);
815 "Couldn't power on panel to ID it; using conservative timings: %d\n",
817 panel_edp_set_conservative_timings(panel, desc);
821 base_block = drm_edid_read_base_block(panel->ddc);
823 panel_id = drm_edid_get_panel_id(base_block);
825 dev_err(dev, "Couldn't read EDID for ID; using conservative timings\n");
826 panel_edp_set_conservative_timings(panel, desc);
829 drm_edid_decode_panel_id(panel_id, vend, &product_id);
831 panel->detected_panel = find_edp_panel(panel_id, base_block);
833 drm_edid_free(base_block);
836 * We're using non-optimized timings and want it really obvious that
837 * someone needs to add an entry to the table, so we'll do a WARN_ON
840 if (WARN_ON(!panel->detected_panel)) {
842 "Unknown panel %s %#06x, using conservative timings\n",
844 panel_edp_set_conservative_timings(panel, desc);
846 dev_info(dev, "Detected %s %s (%#06x)\n",
847 vend, panel->detected_panel->ident.name, product_id);
849 /* Update the delay; everything else comes from EDID */
850 desc->delay = *panel->detected_panel->delay;
854 pm_runtime_mark_last_busy(dev);
855 pm_runtime_put_autosuspend(dev);
860 static int panel_edp_probe(struct device *dev, const struct panel_desc *desc,
861 struct drm_dp_aux *aux)
863 struct panel_edp *panel;
864 struct display_timing dt;
865 struct device_node *ddc;
868 panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
872 panel->enabled = false;
873 panel->prepared_time = 0;
877 panel->no_hpd = of_property_read_bool(dev->of_node, "no-hpd");
878 if (!panel->no_hpd) {
879 err = panel_edp_get_hpd_gpio(dev, panel);
884 panel->supply = devm_regulator_get(dev, "power");
885 if (IS_ERR(panel->supply))
886 return PTR_ERR(panel->supply);
888 panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
890 if (IS_ERR(panel->enable_gpio))
891 return dev_err_probe(dev, PTR_ERR(panel->enable_gpio),
892 "failed to request GPIO\n");
894 err = of_drm_get_panel_orientation(dev->of_node, &panel->orientation);
896 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err);
900 ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
902 panel->ddc = of_find_i2c_adapter_by_node(ddc);
906 return -EPROBE_DEFER;
908 panel->ddc = &aux->ddc;
911 if (!of_get_display_timing(dev->of_node, "panel-timing", &dt))
912 panel_edp_parse_panel_timing_node(dev, panel, &dt);
914 dev_set_drvdata(dev, panel);
916 drm_panel_init(&panel->base, dev, &panel_edp_funcs, DRM_MODE_CONNECTOR_eDP);
918 err = drm_panel_of_backlight(&panel->base);
920 goto err_finished_ddc_init;
923 * We use runtime PM for prepare / unprepare since those power the panel
924 * on and off and those can be very slow operations. This is important
925 * to optimize powering the panel on briefly to read the EDID before
926 * fully enabling the panel.
928 pm_runtime_enable(dev);
929 pm_runtime_set_autosuspend_delay(dev, 1000);
930 pm_runtime_use_autosuspend(dev);
932 if (of_device_is_compatible(dev->of_node, "edp-panel")) {
933 err = generic_edp_panel_probe(dev, panel);
935 dev_err_probe(dev, err,
936 "Couldn't detect panel nor find a fallback\n");
937 goto err_finished_pm_runtime;
939 /* generic_edp_panel_probe() replaces desc in the panel */
941 } else if (desc->bpc != 6 && desc->bpc != 8 && desc->bpc != 10) {
942 dev_warn(dev, "Expected bpc in {6,8,10} but got: %u\n", desc->bpc);
945 if (!panel->base.backlight && panel->aux) {
946 pm_runtime_get_sync(dev);
947 err = drm_panel_dp_aux_backlight(&panel->base, panel->aux);
948 pm_runtime_mark_last_busy(dev);
949 pm_runtime_put_autosuspend(dev);
952 * Warn if we get an error, but don't consider it fatal. Having
953 * a panel where we can't control the backlight is better than
957 dev_warn(dev, "failed to register dp aux backlight: %d\n", err);
960 drm_panel_add(&panel->base);
964 err_finished_pm_runtime:
965 pm_runtime_dont_use_autosuspend(dev);
966 pm_runtime_disable(dev);
967 err_finished_ddc_init:
968 if (panel->ddc && (!panel->aux || panel->ddc != &panel->aux->ddc))
969 put_device(&panel->ddc->dev);
974 static void panel_edp_remove(struct device *dev)
976 struct panel_edp *panel = dev_get_drvdata(dev);
978 drm_panel_remove(&panel->base);
979 drm_panel_disable(&panel->base);
980 drm_panel_unprepare(&panel->base);
982 pm_runtime_dont_use_autosuspend(dev);
983 pm_runtime_disable(dev);
984 if (panel->ddc && (!panel->aux || panel->ddc != &panel->aux->ddc))
985 put_device(&panel->ddc->dev);
987 drm_edid_free(panel->drm_edid);
988 panel->drm_edid = NULL;
991 static void panel_edp_shutdown(struct device *dev)
993 struct panel_edp *panel = dev_get_drvdata(dev);
995 drm_panel_disable(&panel->base);
996 drm_panel_unprepare(&panel->base);
999 static const struct display_timing auo_b101ean01_timing = {
1000 .pixelclock = { 65300000, 72500000, 75000000 },
1001 .hactive = { 1280, 1280, 1280 },
1002 .hfront_porch = { 18, 119, 119 },
1003 .hback_porch = { 21, 21, 21 },
1004 .hsync_len = { 32, 32, 32 },
1005 .vactive = { 800, 800, 800 },
1006 .vfront_porch = { 4, 4, 4 },
1007 .vback_porch = { 8, 8, 8 },
1008 .vsync_len = { 18, 20, 20 },
1011 static const struct panel_desc auo_b101ean01 = {
1012 .timings = &auo_b101ean01_timing,
1021 static const struct drm_display_mode auo_b116xa3_mode = {
1024 .hsync_start = 1366 + 40,
1025 .hsync_end = 1366 + 40 + 40,
1026 .htotal = 1366 + 40 + 40 + 32,
1028 .vsync_start = 768 + 10,
1029 .vsync_end = 768 + 10 + 12,
1030 .vtotal = 768 + 10 + 12 + 6,
1031 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1034 static const struct drm_display_mode auo_b116xak01_mode = {
1037 .hsync_start = 1366 + 48,
1038 .hsync_end = 1366 + 48 + 32,
1039 .htotal = 1366 + 48 + 32 + 10,
1041 .vsync_start = 768 + 4,
1042 .vsync_end = 768 + 4 + 6,
1043 .vtotal = 768 + 4 + 6 + 15,
1044 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1047 static const struct panel_desc auo_b116xak01 = {
1048 .modes = &auo_b116xak01_mode,
1062 static const struct drm_display_mode auo_b133han05_mode = {
1065 .hsync_start = 1920 + 58,
1066 .hsync_end = 1920 + 58 + 42,
1067 .htotal = 1920 + 58 + 42 + 60,
1069 .vsync_start = 1080 + 3,
1070 .vsync_end = 1080 + 3 + 5,
1071 .vtotal = 1080 + 3 + 5 + 54,
1074 static const struct panel_desc auo_b133han05 = {
1075 .modes = &auo_b133han05_mode,
1083 .hpd_reliable = 100,
1089 static const struct drm_display_mode auo_b133htn01_mode = {
1092 .hsync_start = 1920 + 172,
1093 .hsync_end = 1920 + 172 + 80,
1094 .htotal = 1920 + 172 + 80 + 60,
1096 .vsync_start = 1080 + 25,
1097 .vsync_end = 1080 + 25 + 10,
1098 .vtotal = 1080 + 25 + 10 + 10,
1101 static const struct panel_desc auo_b133htn01 = {
1102 .modes = &auo_b133htn01_mode,
1110 .hpd_reliable = 105,
1116 static const struct drm_display_mode auo_b133xtn01_mode = {
1119 .hsync_start = 1366 + 48,
1120 .hsync_end = 1366 + 48 + 32,
1121 .htotal = 1366 + 48 + 32 + 20,
1123 .vsync_start = 768 + 3,
1124 .vsync_end = 768 + 3 + 6,
1125 .vtotal = 768 + 3 + 6 + 13,
1128 static const struct panel_desc auo_b133xtn01 = {
1129 .modes = &auo_b133xtn01_mode,
1138 static const struct drm_display_mode auo_b140han06_mode = {
1141 .hsync_start = 1920 + 16,
1142 .hsync_end = 1920 + 16 + 16,
1143 .htotal = 1920 + 16 + 16 + 152,
1145 .vsync_start = 1080 + 3,
1146 .vsync_end = 1080 + 3 + 14,
1147 .vtotal = 1080 + 3 + 14 + 19,
1150 static const struct panel_desc auo_b140han06 = {
1151 .modes = &auo_b140han06_mode,
1159 .hpd_reliable = 100,
1165 static const struct drm_display_mode boe_nv101wxmn51_modes[] = {
1169 .hsync_start = 1280 + 48,
1170 .hsync_end = 1280 + 48 + 32,
1171 .htotal = 1280 + 48 + 32 + 80,
1173 .vsync_start = 800 + 3,
1174 .vsync_end = 800 + 3 + 5,
1175 .vtotal = 800 + 3 + 5 + 24,
1180 .hsync_start = 1280 + 48,
1181 .hsync_end = 1280 + 48 + 32,
1182 .htotal = 1280 + 48 + 32 + 80,
1184 .vsync_start = 800 + 3,
1185 .vsync_end = 800 + 3 + 5,
1186 .vtotal = 800 + 3 + 5 + 24,
1190 static const struct panel_desc boe_nv101wxmn51 = {
1191 .modes = boe_nv101wxmn51_modes,
1192 .num_modes = ARRAY_SIZE(boe_nv101wxmn51_modes),
1199 /* TODO: should be hpd-absent and no-hpd should be set? */
1200 .hpd_reliable = 210,
1206 static const struct drm_display_mode boe_nv110wtm_n61_modes[] = {
1210 .hsync_start = 2160 + 48,
1211 .hsync_end = 2160 + 48 + 32,
1212 .htotal = 2160 + 48 + 32 + 100,
1214 .vsync_start = 1440 + 3,
1215 .vsync_end = 1440 + 3 + 6,
1216 .vtotal = 1440 + 3 + 6 + 31,
1217 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
1222 .hsync_start = 2160 + 48,
1223 .hsync_end = 2160 + 48 + 32,
1224 .htotal = 2160 + 48 + 32 + 100,
1226 .vsync_start = 1440 + 3,
1227 .vsync_end = 1440 + 3 + 6,
1228 .vtotal = 1440 + 3 + 6 + 31,
1229 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
1233 static const struct panel_desc boe_nv110wtm_n61 = {
1234 .modes = boe_nv110wtm_n61_modes,
1235 .num_modes = ARRAY_SIZE(boe_nv110wtm_n61_modes),
1243 .prepare_to_enable = 80,
1249 /* Also used for boe_nv133fhm_n62 */
1250 static const struct drm_display_mode boe_nv133fhm_n61_modes = {
1253 .hsync_start = 1920 + 48,
1254 .hsync_end = 1920 + 48 + 32,
1255 .htotal = 1920 + 48 + 32 + 200,
1257 .vsync_start = 1080 + 3,
1258 .vsync_end = 1080 + 3 + 6,
1259 .vtotal = 1080 + 3 + 6 + 31,
1260 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC,
1263 /* Also used for boe_nv133fhm_n62 */
1264 static const struct panel_desc boe_nv133fhm_n61 = {
1265 .modes = &boe_nv133fhm_n61_modes,
1274 * When power is first given to the panel there's a short
1275 * spike on the HPD line. It was explained that this spike
1276 * was until the TCON data download was complete. On
1277 * one system this was measured at 8 ms. We'll put 15 ms
1278 * in the prepare delay just to be safe. That means:
1279 * - If HPD isn't hooked up you still have 200 ms delay.
1280 * - If HPD is hooked up we won't try to look at it for the
1290 static const struct drm_display_mode boe_nv140fhmn49_modes[] = {
1294 .hsync_start = 1920 + 48,
1295 .hsync_end = 1920 + 48 + 32,
1298 .vsync_start = 1080 + 3,
1299 .vsync_end = 1080 + 3 + 5,
1304 static const struct panel_desc boe_nv140fhmn49 = {
1305 .modes = boe_nv140fhmn49_modes,
1306 .num_modes = ARRAY_SIZE(boe_nv140fhmn49_modes),
1313 /* TODO: should be hpd-absent and no-hpd should be set? */
1314 .hpd_reliable = 210,
1320 static const struct drm_display_mode innolux_n116bca_ea1_mode = {
1323 .hsync_start = 1366 + 136,
1324 .hsync_end = 1366 + 136 + 30,
1325 .htotal = 1366 + 136 + 30 + 60,
1327 .vsync_start = 768 + 8,
1328 .vsync_end = 768 + 8 + 12,
1329 .vtotal = 768 + 8 + 12 + 12,
1330 .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
1333 static const struct panel_desc innolux_n116bca_ea1 = {
1334 .modes = &innolux_n116bca_ea1_mode,
1350 * Datasheet specifies that at 60 Hz refresh rate:
1351 * - total horizontal time: { 1506, 1592, 1716 }
1352 * - total vertical time: { 788, 800, 868 }
1354 * ...but doesn't go into exactly how that should be split into a front
1355 * porch, back porch, or sync length. For now we'll leave a single setting
1356 * here which allows a bit of tweaking of the pixel clock at the expense of
1359 static const struct display_timing innolux_n116bge_timing = {
1360 .pixelclock = { 72600000, 76420000, 80240000 },
1361 .hactive = { 1366, 1366, 1366 },
1362 .hfront_porch = { 136, 136, 136 },
1363 .hback_porch = { 60, 60, 60 },
1364 .hsync_len = { 30, 30, 30 },
1365 .vactive = { 768, 768, 768 },
1366 .vfront_porch = { 8, 8, 8 },
1367 .vback_porch = { 12, 12, 12 },
1368 .vsync_len = { 12, 12, 12 },
1369 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
1372 static const struct panel_desc innolux_n116bge = {
1373 .timings = &innolux_n116bge_timing,
1382 static const struct drm_display_mode innolux_n125hce_gn1_mode = {
1385 .hsync_start = 1920 + 40,
1386 .hsync_end = 1920 + 40 + 40,
1387 .htotal = 1920 + 40 + 40 + 80,
1389 .vsync_start = 1080 + 4,
1390 .vsync_end = 1080 + 4 + 4,
1391 .vtotal = 1080 + 4 + 4 + 24,
1394 static const struct panel_desc innolux_n125hce_gn1 = {
1395 .modes = &innolux_n125hce_gn1_mode,
1404 static const struct drm_display_mode innolux_p120zdg_bf1_mode = {
1407 .hsync_start = 2160 + 48,
1408 .hsync_end = 2160 + 48 + 32,
1409 .htotal = 2160 + 48 + 32 + 80,
1411 .vsync_start = 1440 + 3,
1412 .vsync_end = 1440 + 3 + 10,
1413 .vtotal = 1440 + 3 + 10 + 27,
1414 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
1417 static const struct panel_desc innolux_p120zdg_bf1 = {
1418 .modes = &innolux_p120zdg_bf1_mode,
1431 static const struct drm_display_mode ivo_m133nwf4_r0_mode = {
1434 .hsync_start = 1920 + 24,
1435 .hsync_end = 1920 + 24 + 48,
1436 .htotal = 1920 + 24 + 48 + 88,
1438 .vsync_start = 1080 + 3,
1439 .vsync_end = 1080 + 3 + 12,
1440 .vtotal = 1080 + 3 + 12 + 17,
1441 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
1444 static const struct panel_desc ivo_m133nwf4_r0 = {
1445 .modes = &ivo_m133nwf4_r0_mode,
1458 static const struct drm_display_mode kingdisplay_kd116n21_30nv_a010_mode = {
1461 .hsync_start = 1366 + 40,
1462 .hsync_end = 1366 + 40 + 32,
1463 .htotal = 1366 + 40 + 32 + 62,
1465 .vsync_start = 768 + 5,
1466 .vsync_end = 768 + 5 + 5,
1467 .vtotal = 768 + 5 + 5 + 122,
1468 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1471 static const struct panel_desc kingdisplay_kd116n21_30nv_a010 = {
1472 .modes = &kingdisplay_kd116n21_30nv_a010_mode,
1484 static const struct drm_display_mode lg_lp079qx1_sp0v_mode = {
1487 .hsync_start = 1536 + 12,
1488 .hsync_end = 1536 + 12 + 16,
1489 .htotal = 1536 + 12 + 16 + 48,
1491 .vsync_start = 2048 + 8,
1492 .vsync_end = 2048 + 8 + 4,
1493 .vtotal = 2048 + 8 + 4 + 8,
1494 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1497 static const struct panel_desc lg_lp079qx1_sp0v = {
1498 .modes = &lg_lp079qx1_sp0v_mode,
1506 static const struct drm_display_mode lg_lp097qx1_spa1_mode = {
1509 .hsync_start = 2048 + 150,
1510 .hsync_end = 2048 + 150 + 5,
1511 .htotal = 2048 + 150 + 5 + 5,
1513 .vsync_start = 1536 + 3,
1514 .vsync_end = 1536 + 3 + 1,
1515 .vtotal = 1536 + 3 + 1 + 9,
1518 static const struct panel_desc lg_lp097qx1_spa1 = {
1519 .modes = &lg_lp097qx1_spa1_mode,
1527 static const struct drm_display_mode lg_lp120up1_mode = {
1530 .hsync_start = 1920 + 40,
1531 .hsync_end = 1920 + 40 + 40,
1532 .htotal = 1920 + 40 + 40 + 80,
1534 .vsync_start = 1280 + 4,
1535 .vsync_end = 1280 + 4 + 4,
1536 .vtotal = 1280 + 4 + 4 + 12,
1539 static const struct panel_desc lg_lp120up1 = {
1540 .modes = &lg_lp120up1_mode,
1549 static const struct drm_display_mode lg_lp129qe_mode = {
1552 .hsync_start = 2560 + 48,
1553 .hsync_end = 2560 + 48 + 32,
1554 .htotal = 2560 + 48 + 32 + 80,
1556 .vsync_start = 1700 + 3,
1557 .vsync_end = 1700 + 3 + 10,
1558 .vtotal = 1700 + 3 + 10 + 36,
1561 static const struct panel_desc lg_lp129qe = {
1562 .modes = &lg_lp129qe_mode,
1571 static const struct drm_display_mode neweast_wjfh116008a_modes[] = {
1575 .hsync_start = 1920 + 48,
1576 .hsync_end = 1920 + 48 + 32,
1577 .htotal = 1920 + 48 + 32 + 80,
1579 .vsync_start = 1080 + 3,
1580 .vsync_end = 1080 + 3 + 5,
1581 .vtotal = 1080 + 3 + 5 + 23,
1582 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1586 .hsync_start = 1920 + 48,
1587 .hsync_end = 1920 + 48 + 32,
1588 .htotal = 1920 + 48 + 32 + 80,
1590 .vsync_start = 1080 + 3,
1591 .vsync_end = 1080 + 3 + 5,
1592 .vtotal = 1080 + 3 + 5 + 23,
1593 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1597 static const struct panel_desc neweast_wjfh116008a = {
1598 .modes = neweast_wjfh116008a_modes,
1606 .hpd_reliable = 110,
1612 static const struct drm_display_mode samsung_lsn122dl01_c01_mode = {
1615 .hsync_start = 2560 + 48,
1616 .hsync_end = 2560 + 48 + 32,
1617 .htotal = 2560 + 48 + 32 + 80,
1619 .vsync_start = 1600 + 2,
1620 .vsync_end = 1600 + 2 + 5,
1621 .vtotal = 1600 + 2 + 5 + 57,
1624 static const struct panel_desc samsung_lsn122dl01_c01 = {
1625 .modes = &samsung_lsn122dl01_c01_mode,
1633 static const struct drm_display_mode samsung_ltn140at29_301_mode = {
1636 .hsync_start = 1366 + 64,
1637 .hsync_end = 1366 + 64 + 48,
1638 .htotal = 1366 + 64 + 48 + 128,
1640 .vsync_start = 768 + 2,
1641 .vsync_end = 768 + 2 + 5,
1642 .vtotal = 768 + 2 + 5 + 17,
1645 static const struct panel_desc samsung_ltn140at29_301 = {
1646 .modes = &samsung_ltn140at29_301_mode,
1655 static const struct drm_display_mode sharp_ld_d5116z01b_mode = {
1658 .hsync_start = 1920 + 48,
1659 .hsync_end = 1920 + 48 + 32,
1660 .htotal = 1920 + 48 + 32 + 80,
1662 .vsync_start = 1280 + 3,
1663 .vsync_end = 1280 + 3 + 10,
1664 .vtotal = 1280 + 3 + 10 + 57,
1665 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
1668 static const struct panel_desc sharp_ld_d5116z01b = {
1669 .modes = &sharp_ld_d5116z01b_mode,
1678 static const struct display_timing sharp_lq123p1jx31_timing = {
1679 .pixelclock = { 252750000, 252750000, 266604720 },
1680 .hactive = { 2400, 2400, 2400 },
1681 .hfront_porch = { 48, 48, 48 },
1682 .hback_porch = { 80, 80, 84 },
1683 .hsync_len = { 32, 32, 32 },
1684 .vactive = { 1600, 1600, 1600 },
1685 .vfront_porch = { 3, 3, 3 },
1686 .vback_porch = { 33, 33, 120 },
1687 .vsync_len = { 10, 10, 10 },
1688 .flags = DISPLAY_FLAGS_VSYNC_LOW | DISPLAY_FLAGS_HSYNC_LOW,
1691 static const struct panel_desc sharp_lq123p1jx31 = {
1692 .timings = &sharp_lq123p1jx31_timing,
1700 .hpd_reliable = 110,
1706 static const struct drm_display_mode sharp_lq140m1jw46_mode[] = {
1710 .hsync_start = 1920 + 48,
1711 .hsync_end = 1920 + 48 + 32,
1712 .htotal = 1920 + 48 + 32 + 80,
1714 .vsync_start = 1080 + 3,
1715 .vsync_end = 1080 + 3 + 5,
1716 .vtotal = 1080 + 3 + 5 + 69,
1717 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1721 .hsync_start = 1920 + 48,
1722 .hsync_end = 1920 + 48 + 32,
1723 .htotal = 1920 + 48 + 32 + 80,
1725 .vsync_start = 1080 + 3,
1726 .vsync_end = 1080 + 3 + 5,
1727 .vtotal = 1080 + 3 + 5 + 69,
1728 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1732 static const struct panel_desc sharp_lq140m1jw46 = {
1733 .modes = sharp_lq140m1jw46_mode,
1734 .num_modes = ARRAY_SIZE(sharp_lq140m1jw46_mode),
1747 static const struct drm_display_mode starry_kr122ea0sra_mode = {
1750 .hsync_start = 1920 + 16,
1751 .hsync_end = 1920 + 16 + 16,
1752 .htotal = 1920 + 16 + 16 + 32,
1754 .vsync_start = 1200 + 15,
1755 .vsync_end = 1200 + 15 + 2,
1756 .vtotal = 1200 + 15 + 2 + 18,
1757 .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
1760 static const struct panel_desc starry_kr122ea0sra = {
1761 .modes = &starry_kr122ea0sra_mode,
1768 /* TODO: should be hpd-absent and no-hpd should be set? */
1769 .hpd_reliable = 10 + 200,
1771 .unprepare = 10 + 500,
1775 static const struct of_device_id platform_of_match[] = {
1778 .compatible = "edp-panel",
1780 .compatible = "auo,b101ean01",
1781 .data = &auo_b101ean01,
1783 .compatible = "auo,b116xa01",
1784 .data = &auo_b116xak01,
1786 .compatible = "auo,b133han05",
1787 .data = &auo_b133han05,
1789 .compatible = "auo,b133htn01",
1790 .data = &auo_b133htn01,
1792 .compatible = "auo,b133xtn01",
1793 .data = &auo_b133xtn01,
1795 .compatible = "auo,b140han06",
1796 .data = &auo_b140han06,
1798 .compatible = "boe,nv101wxmn51",
1799 .data = &boe_nv101wxmn51,
1801 .compatible = "boe,nv110wtm-n61",
1802 .data = &boe_nv110wtm_n61,
1804 .compatible = "boe,nv133fhm-n61",
1805 .data = &boe_nv133fhm_n61,
1807 .compatible = "boe,nv133fhm-n62",
1808 .data = &boe_nv133fhm_n61,
1810 .compatible = "boe,nv140fhmn49",
1811 .data = &boe_nv140fhmn49,
1813 .compatible = "innolux,n116bca-ea1",
1814 .data = &innolux_n116bca_ea1,
1816 .compatible = "innolux,n116bge",
1817 .data = &innolux_n116bge,
1819 .compatible = "innolux,n125hce-gn1",
1820 .data = &innolux_n125hce_gn1,
1822 .compatible = "innolux,p120zdg-bf1",
1823 .data = &innolux_p120zdg_bf1,
1825 .compatible = "ivo,m133nwf4-r0",
1826 .data = &ivo_m133nwf4_r0,
1828 .compatible = "kingdisplay,kd116n21-30nv-a010",
1829 .data = &kingdisplay_kd116n21_30nv_a010,
1831 .compatible = "lg,lp079qx1-sp0v",
1832 .data = &lg_lp079qx1_sp0v,
1834 .compatible = "lg,lp097qx1-spa1",
1835 .data = &lg_lp097qx1_spa1,
1837 .compatible = "lg,lp120up1",
1838 .data = &lg_lp120up1,
1840 .compatible = "lg,lp129qe",
1841 .data = &lg_lp129qe,
1843 .compatible = "neweast,wjfh116008a",
1844 .data = &neweast_wjfh116008a,
1846 .compatible = "samsung,lsn122dl01-c01",
1847 .data = &samsung_lsn122dl01_c01,
1849 .compatible = "samsung,ltn140at29-301",
1850 .data = &samsung_ltn140at29_301,
1852 .compatible = "sharp,ld-d5116z01b",
1853 .data = &sharp_ld_d5116z01b,
1855 .compatible = "sharp,lq123p1jx31",
1856 .data = &sharp_lq123p1jx31,
1858 .compatible = "sharp,lq140m1jw46",
1859 .data = &sharp_lq140m1jw46,
1861 .compatible = "starry,kr122ea0sra",
1862 .data = &starry_kr122ea0sra,
1867 MODULE_DEVICE_TABLE(of, platform_of_match);
1869 static const struct panel_delay delay_200_500_p2e80 = {
1872 .prepare_to_enable = 80,
1875 static const struct panel_delay delay_200_500_e50_p2e80 = {
1879 .prepare_to_enable = 80,
1882 static const struct panel_delay delay_200_500_p2e100 = {
1885 .prepare_to_enable = 100,
1888 static const struct panel_delay delay_200_500_e50 = {
1894 static const struct panel_delay delay_200_500_e50_p2e200 = {
1898 .prepare_to_enable = 200,
1901 static const struct panel_delay delay_200_500_e80 = {
1907 static const struct panel_delay delay_200_500_e80_d50 = {
1914 static const struct panel_delay delay_100_500_e200 = {
1920 static const struct panel_delay delay_200_500_e200 = {
1926 static const struct panel_delay delay_200_500_e200_d200 = {
1933 static const struct panel_delay delay_200_500_e200_d10 = {
1940 static const struct panel_delay delay_200_150_e200 = {
1946 static const struct panel_delay delay_200_500_e50_po2e200 = {
1950 .powered_on_to_enable = 200,
1953 #define EDP_PANEL_ENTRY(vend_chr_0, vend_chr_1, vend_chr_2, product_id, _delay, _name) \
1957 .panel_id = drm_edid_encode_panel_id(vend_chr_0, vend_chr_1, vend_chr_2, \
1963 #define EDP_PANEL_ENTRY2(vend_chr_0, vend_chr_1, vend_chr_2, product_id, _delay, _name, _mode) \
1967 .panel_id = drm_edid_encode_panel_id(vend_chr_0, vend_chr_1, vend_chr_2, \
1971 .override_edid_mode = _mode \
1975 * This table is used to figure out power sequencing delays for panels that
1976 * are detected by EDID. Entries here may point to entries in the
1977 * platform_of_match table (if a panel is listed in both places).
1979 * Sort first by vendor, then by product ID.
1981 static const struct edp_panel_entry edp_panels[] = {
1982 EDP_PANEL_ENTRY('A', 'U', 'O', 0x105c, &delay_200_500_e50, "B116XTN01.0"),
1983 EDP_PANEL_ENTRY('A', 'U', 'O', 0x1062, &delay_200_500_e50, "B120XAN01.0"),
1984 EDP_PANEL_ENTRY('A', 'U', 'O', 0x125c, &delay_200_500_e50, "Unknown"),
1985 EDP_PANEL_ENTRY('A', 'U', 'O', 0x145c, &delay_200_500_e50, "B116XAB01.4"),
1986 EDP_PANEL_ENTRY('A', 'U', 'O', 0x1e9b, &delay_200_500_e50, "B133UAN02.1"),
1987 EDP_PANEL_ENTRY('A', 'U', 'O', 0x1ea5, &delay_200_500_e50, "B116XAK01.6"),
1988 EDP_PANEL_ENTRY('A', 'U', 'O', 0x208d, &delay_200_500_e50, "B140HTN02.1"),
1989 EDP_PANEL_ENTRY('A', 'U', 'O', 0x235c, &delay_200_500_e50, "B116XTN02.3"),
1990 EDP_PANEL_ENTRY('A', 'U', 'O', 0x239b, &delay_200_500_e50, "B116XAN06.1"),
1991 EDP_PANEL_ENTRY('A', 'U', 'O', 0x255c, &delay_200_500_e50, "B116XTN02.5"),
1992 EDP_PANEL_ENTRY('A', 'U', 'O', 0x403d, &delay_200_500_e50, "B140HAN04.0"),
1993 EDP_PANEL_ENTRY('A', 'U', 'O', 0x405c, &auo_b116xak01.delay, "B116XAN04.0"),
1994 EDP_PANEL_ENTRY2('A', 'U', 'O', 0x405c, &auo_b116xak01.delay, "B116XAK01.0",
1996 EDP_PANEL_ENTRY('A', 'U', 'O', 0x435c, &delay_200_500_e50, "Unknown"),
1997 EDP_PANEL_ENTRY('A', 'U', 'O', 0x582d, &delay_200_500_e50, "B133UAN01.0"),
1998 EDP_PANEL_ENTRY('A', 'U', 'O', 0x615c, &delay_200_500_e50, "B116XAN06.1"),
1999 EDP_PANEL_ENTRY('A', 'U', 'O', 0x635c, &delay_200_500_e50, "B116XAN06.3"),
2000 EDP_PANEL_ENTRY('A', 'U', 'O', 0x639c, &delay_200_500_e50, "B140HAK02.7"),
2001 EDP_PANEL_ENTRY('A', 'U', 'O', 0x723c, &delay_200_500_e50, "B140XTN07.2"),
2002 EDP_PANEL_ENTRY('A', 'U', 'O', 0x8594, &delay_200_500_e50, "B133UAN01.0"),
2003 EDP_PANEL_ENTRY('A', 'U', 'O', 0xd497, &delay_200_500_e50, "B120XAN01.0"),
2004 EDP_PANEL_ENTRY('A', 'U', 'O', 0xf390, &delay_200_500_e50, "B140XTN07.7"),
2006 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0607, &delay_200_500_e200, "Unknown"),
2007 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0608, &delay_200_500_e50, "NT116WHM-N11"),
2008 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0668, &delay_200_500_e200, "Unknown"),
2009 EDP_PANEL_ENTRY('B', 'O', 'E', 0x068f, &delay_200_500_e200, "Unknown"),
2010 EDP_PANEL_ENTRY('B', 'O', 'E', 0x06e5, &delay_200_500_e200, "Unknown"),
2011 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0705, &delay_200_500_e200, "Unknown"),
2012 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0715, &delay_200_150_e200, "NT116WHM-N21"),
2013 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0717, &delay_200_500_e50_po2e200, "NV133FHM-N42"),
2014 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0731, &delay_200_500_e80, "NT116WHM-N42"),
2015 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0741, &delay_200_500_e200, "NT116WHM-N44"),
2016 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0744, &delay_200_500_e200, "Unknown"),
2017 EDP_PANEL_ENTRY('B', 'O', 'E', 0x074c, &delay_200_500_e200, "Unknown"),
2018 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0751, &delay_200_500_e200, "Unknown"),
2019 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0754, &delay_200_500_e50_po2e200, "NV116WHM-N45"),
2020 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0771, &delay_200_500_e200, "Unknown"),
2021 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0786, &delay_200_500_p2e80, "NV116WHM-T01"),
2022 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0797, &delay_200_500_e200, "Unknown"),
2023 EDP_PANEL_ENTRY('B', 'O', 'E', 0x07d1, &boe_nv133fhm_n61.delay, "NV133FHM-N61"),
2024 EDP_PANEL_ENTRY('B', 'O', 'E', 0x07d3, &delay_200_500_e200, "Unknown"),
2025 EDP_PANEL_ENTRY('B', 'O', 'E', 0x07f6, &delay_200_500_e200, "NT140FHM-N44"),
2026 EDP_PANEL_ENTRY('B', 'O', 'E', 0x07f8, &delay_200_500_e200, "Unknown"),
2027 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0813, &delay_200_500_e200, "Unknown"),
2028 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0827, &delay_200_500_e50_p2e80, "NT140WHM-N44 V8.0"),
2029 EDP_PANEL_ENTRY('B', 'O', 'E', 0x082d, &boe_nv133fhm_n61.delay, "NV133FHM-N62"),
2030 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0843, &delay_200_500_e200, "Unknown"),
2031 EDP_PANEL_ENTRY('B', 'O', 'E', 0x08b2, &delay_200_500_e200, "NT140WHM-N49"),
2032 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0848, &delay_200_500_e200, "Unknown"),
2033 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0849, &delay_200_500_e200, "Unknown"),
2034 EDP_PANEL_ENTRY('B', 'O', 'E', 0x09c3, &delay_200_500_e50, "NT116WHM-N21,836X2"),
2035 EDP_PANEL_ENTRY('B', 'O', 'E', 0x094b, &delay_200_500_e50, "NT116WHM-N21"),
2036 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0951, &delay_200_500_e80, "NV116WHM-N47"),
2037 EDP_PANEL_ENTRY('B', 'O', 'E', 0x095f, &delay_200_500_e50, "NE135FBM-N41 v8.1"),
2038 EDP_PANEL_ENTRY('B', 'O', 'E', 0x096e, &delay_200_500_e50_po2e200, "NV116WHM-T07 V8.0"),
2039 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0979, &delay_200_500_e50, "NV116WHM-N49 V8.0"),
2040 EDP_PANEL_ENTRY('B', 'O', 'E', 0x098d, &boe_nv110wtm_n61.delay, "NV110WTM-N61"),
2041 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0993, &delay_200_500_e80, "NV116WHM-T14 V8.0"),
2042 EDP_PANEL_ENTRY('B', 'O', 'E', 0x09ad, &delay_200_500_e80, "NV116WHM-N47"),
2043 EDP_PANEL_ENTRY('B', 'O', 'E', 0x09ae, &delay_200_500_e200, "NT140FHM-N45"),
2044 EDP_PANEL_ENTRY('B', 'O', 'E', 0x09dd, &delay_200_500_e50, "NT116WHM-N21"),
2045 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0a36, &delay_200_500_e200, "Unknown"),
2046 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0a3e, &delay_200_500_e80, "NV116WHM-N49"),
2047 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0a5d, &delay_200_500_e50, "NV116WHM-N45"),
2048 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0ac5, &delay_200_500_e50, "NV116WHM-N4C"),
2049 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0b34, &delay_200_500_e80, "NV122WUM-N41"),
2050 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0b43, &delay_200_500_e200, "NV140FHM-T09"),
2051 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0b56, &delay_200_500_e80, "NT140FHM-N47"),
2052 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0c20, &delay_200_500_e80, "NT140FHM-N47"),
2053 EDP_PANEL_ENTRY('B', 'O', 'E', 0x0cb6, &delay_200_500_e200, "NT116WHM-N44"),
2055 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1130, &delay_200_500_e50, "N116BGE-EB2"),
2056 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1132, &delay_200_500_e80_d50, "N116BGE-EA2"),
2057 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1138, &innolux_n116bca_ea1.delay, "N116BCA-EA1-RC4"),
2058 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1139, &delay_200_500_e80_d50, "N116BGE-EA2"),
2059 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1141, &delay_200_500_e80_d50, "Unknown"),
2060 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1145, &delay_200_500_e80_d50, "N116BCN-EB1"),
2061 EDP_PANEL_ENTRY('C', 'M', 'N', 0x114a, &delay_200_500_e80_d50, "Unknown"),
2062 EDP_PANEL_ENTRY('C', 'M', 'N', 0x114c, &innolux_n116bca_ea1.delay, "N116BCA-EA1"),
2063 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1152, &delay_200_500_e80_d50, "N116BCN-EA1"),
2064 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1153, &delay_200_500_e80_d50, "N116BGE-EA2"),
2065 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1154, &delay_200_500_e80_d50, "N116BCA-EA2"),
2066 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1156, &delay_200_500_e80_d50, "Unknown"),
2067 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1157, &delay_200_500_e80_d50, "N116BGE-EA2"),
2068 EDP_PANEL_ENTRY('C', 'M', 'N', 0x115b, &delay_200_500_e80_d50, "N116BCN-EB1"),
2069 EDP_PANEL_ENTRY('C', 'M', 'N', 0x115e, &delay_200_500_e80_d50, "N116BCA-EA1"),
2070 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1247, &delay_200_500_e80_d50, "N120ACA-EA1"),
2071 EDP_PANEL_ENTRY('C', 'M', 'N', 0x142b, &delay_200_500_e80_d50, "N140HCA-EAC"),
2072 EDP_PANEL_ENTRY('C', 'M', 'N', 0x142e, &delay_200_500_e80_d50, "N140BGA-EA4"),
2073 EDP_PANEL_ENTRY('C', 'M', 'N', 0x144f, &delay_200_500_e80_d50, "N140HGA-EA1"),
2074 EDP_PANEL_ENTRY('C', 'M', 'N', 0x1468, &delay_200_500_e80, "N140HGA-EA1"),
2075 EDP_PANEL_ENTRY('C', 'M', 'N', 0x14d4, &delay_200_500_e80_d50, "N140HCA-EAC"),
2076 EDP_PANEL_ENTRY('C', 'M', 'N', 0x14d6, &delay_200_500_e80_d50, "N140BGA-EA4"),
2077 EDP_PANEL_ENTRY('C', 'M', 'N', 0x14e5, &delay_200_500_e80_d50, "N140HGA-EA1"),
2079 EDP_PANEL_ENTRY('C', 'S', 'O', 0x1200, &delay_200_500_e50_p2e200, "MNC207QS1-1"),
2081 EDP_PANEL_ENTRY('C', 'S', 'W', 0x1100, &delay_200_500_e80_d50, "MNB601LS1-1"),
2083 EDP_PANEL_ENTRY('H', 'K', 'C', 0x2d51, &delay_200_500_e200, "Unknown"),
2084 EDP_PANEL_ENTRY('H', 'K', 'C', 0x2d5b, &delay_200_500_e200, "Unknown"),
2085 EDP_PANEL_ENTRY('H', 'K', 'C', 0x2d5c, &delay_200_500_e200, "MB116AN01-2"),
2087 EDP_PANEL_ENTRY('I', 'V', 'O', 0x048e, &delay_200_500_e200_d10, "M116NWR6 R5"),
2088 EDP_PANEL_ENTRY('I', 'V', 'O', 0x057d, &delay_200_500_e200, "R140NWF5 RH"),
2089 EDP_PANEL_ENTRY('I', 'V', 'O', 0x854a, &delay_200_500_p2e100, "M133NW4J"),
2090 EDP_PANEL_ENTRY('I', 'V', 'O', 0x854b, &delay_200_500_p2e100, "R133NW4K-R0"),
2091 EDP_PANEL_ENTRY('I', 'V', 'O', 0x8c4d, &delay_200_150_e200, "R140NWFM R1"),
2093 EDP_PANEL_ENTRY('K', 'D', 'B', 0x044f, &delay_200_500_e80_d50, "Unknown"),
2094 EDP_PANEL_ENTRY('K', 'D', 'B', 0x0624, &kingdisplay_kd116n21_30nv_a010.delay, "116N21-30NV-A010"),
2095 EDP_PANEL_ENTRY('K', 'D', 'B', 0x1118, &delay_200_500_e50, "KD116N29-30NK-A005"),
2096 EDP_PANEL_ENTRY('K', 'D', 'B', 0x1120, &delay_200_500_e80_d50, "116N29-30NK-C007"),
2098 EDP_PANEL_ENTRY('K', 'D', 'C', 0x044f, &delay_200_500_e50, "KD116N9-30NH-F3"),
2099 EDP_PANEL_ENTRY('K', 'D', 'C', 0x05f1, &delay_200_500_e80_d50, "KD116N5-30NV-G7"),
2100 EDP_PANEL_ENTRY('K', 'D', 'C', 0x0809, &delay_200_500_e50, "KD116N2930A15"),
2102 EDP_PANEL_ENTRY('L', 'G', 'D', 0x0000, &delay_200_500_e200_d200, "Unknown"),
2103 EDP_PANEL_ENTRY('L', 'G', 'D', 0x048d, &delay_200_500_e200_d200, "Unknown"),
2104 EDP_PANEL_ENTRY('L', 'G', 'D', 0x0497, &delay_200_500_e200_d200, "LP116WH7-SPB1"),
2105 EDP_PANEL_ENTRY('L', 'G', 'D', 0x052c, &delay_200_500_e200_d200, "LP133WF2-SPL7"),
2106 EDP_PANEL_ENTRY('L', 'G', 'D', 0x0537, &delay_200_500_e200_d200, "Unknown"),
2107 EDP_PANEL_ENTRY('L', 'G', 'D', 0x054a, &delay_200_500_e200_d200, "LP116WH8-SPC1"),
2108 EDP_PANEL_ENTRY('L', 'G', 'D', 0x0567, &delay_200_500_e200_d200, "Unknown"),
2109 EDP_PANEL_ENTRY('L', 'G', 'D', 0x05af, &delay_200_500_e200_d200, "Unknown"),
2110 EDP_PANEL_ENTRY('L', 'G', 'D', 0x05f1, &delay_200_500_e200_d200, "Unknown"),
2112 EDP_PANEL_ENTRY('S', 'D', 'C', 0x416d, &delay_100_500_e200, "ATNA45AF01"),
2114 EDP_PANEL_ENTRY('S', 'H', 'P', 0x1511, &delay_200_500_e50, "LQ140M1JW48"),
2115 EDP_PANEL_ENTRY('S', 'H', 'P', 0x1523, &sharp_lq140m1jw46.delay, "LQ140M1JW46"),
2116 EDP_PANEL_ENTRY('S', 'H', 'P', 0x154c, &delay_200_500_p2e100, "LQ116M1JW10"),
2118 EDP_PANEL_ENTRY('S', 'T', 'A', 0x0100, &delay_100_500_e200, "2081116HHD028001-51D"),
2123 static const struct edp_panel_entry *find_edp_panel(u32 panel_id, const struct drm_edid *edid)
2125 const struct edp_panel_entry *panel;
2131 * Match with identity first. This allows handling the case where
2132 * vendors incorrectly reused the same panel ID for multiple panels that
2133 * need different settings. If there's no match, try again with panel
2134 * ID, which should be unique.
2136 for (panel = edp_panels; panel->ident.panel_id; panel++)
2137 if (drm_edid_match(edid, &panel->ident))
2140 for (panel = edp_panels; panel->ident.panel_id; panel++)
2141 if (panel->ident.panel_id == panel_id)
2147 static int panel_edp_platform_probe(struct platform_device *pdev)
2149 const struct of_device_id *id;
2151 /* Skip one since "edp-panel" is only supported on DP AUX bus */
2152 id = of_match_node(platform_of_match + 1, pdev->dev.of_node);
2156 return panel_edp_probe(&pdev->dev, id->data, NULL);
2159 static void panel_edp_platform_remove(struct platform_device *pdev)
2161 panel_edp_remove(&pdev->dev);
2164 static void panel_edp_platform_shutdown(struct platform_device *pdev)
2166 panel_edp_shutdown(&pdev->dev);
2169 static const struct dev_pm_ops panel_edp_pm_ops = {
2170 SET_RUNTIME_PM_OPS(panel_edp_suspend, panel_edp_resume, NULL)
2171 SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
2172 pm_runtime_force_resume)
2175 static struct platform_driver panel_edp_platform_driver = {
2177 .name = "panel-edp",
2178 .of_match_table = platform_of_match,
2179 .pm = &panel_edp_pm_ops,
2181 .probe = panel_edp_platform_probe,
2182 .remove_new = panel_edp_platform_remove,
2183 .shutdown = panel_edp_platform_shutdown,
2186 static int panel_edp_dp_aux_ep_probe(struct dp_aux_ep_device *aux_ep)
2188 const struct of_device_id *id;
2190 id = of_match_node(platform_of_match, aux_ep->dev.of_node);
2194 return panel_edp_probe(&aux_ep->dev, id->data, aux_ep->aux);
2197 static void panel_edp_dp_aux_ep_remove(struct dp_aux_ep_device *aux_ep)
2199 panel_edp_remove(&aux_ep->dev);
2202 static void panel_edp_dp_aux_ep_shutdown(struct dp_aux_ep_device *aux_ep)
2204 panel_edp_shutdown(&aux_ep->dev);
2207 static struct dp_aux_ep_driver panel_edp_dp_aux_ep_driver = {
2209 .name = "panel-simple-dp-aux",
2210 .of_match_table = platform_of_match, /* Same as platform one! */
2211 .pm = &panel_edp_pm_ops,
2213 .probe = panel_edp_dp_aux_ep_probe,
2214 .remove = panel_edp_dp_aux_ep_remove,
2215 .shutdown = panel_edp_dp_aux_ep_shutdown,
2218 static int __init panel_edp_init(void)
2222 err = platform_driver_register(&panel_edp_platform_driver);
2226 err = dp_aux_dp_driver_register(&panel_edp_dp_aux_ep_driver);
2228 goto err_did_platform_register;
2232 err_did_platform_register:
2233 platform_driver_unregister(&panel_edp_platform_driver);
2237 module_init(panel_edp_init);
2239 static void __exit panel_edp_exit(void)
2241 dp_aux_dp_driver_unregister(&panel_edp_dp_aux_ep_driver);
2242 platform_driver_unregister(&panel_edp_platform_driver);
2244 module_exit(panel_edp_exit);
2247 MODULE_DESCRIPTION("DRM Driver for Simple eDP Panels");
2248 MODULE_LICENSE("GPL and additional rights");