hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * MIPI-DSI based s6e8aa0 AMOLED LCD 5.3 inch panel driver.
34 *
....@@ -9,22 +10,21 @@
910 * Eunchul Kim <chulspro.kim@samsung.com>
1011 * Tomasz Figa <t.figa@samsung.com>
1112 * Andrzej Hajda <a.hajda@samsung.com>
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License version 2 as
15
- * published by the Free Software Foundation.
1613 */
1714
18
-#include <drm/drmP.h>
19
-#include <drm/drm_mipi_dsi.h>
20
-#include <drm/drm_panel.h>
21
-
15
+#include <linux/delay.h>
2216 #include <linux/gpio/consumer.h>
17
+#include <linux/module.h>
18
+#include <linux/of.h>
2319 #include <linux/regulator/consumer.h>
2420
2521 #include <video/mipi_display.h>
2622 #include <video/of_videomode.h>
2723 #include <video/videomode.h>
24
+
25
+#include <drm/drm_mipi_dsi.h>
26
+#include <drm/drm_modes.h>
27
+#include <drm/drm_panel.h>
2828
2929 #define LDI_MTP_LENGTH 24
3030 #define GAMMA_LEVEL_NUM 25
....@@ -919,15 +919,15 @@
919919 return 0;
920920 }
921921
922
-static int s6e8aa0_get_modes(struct drm_panel *panel)
922
+static int s6e8aa0_get_modes(struct drm_panel *panel,
923
+ struct drm_connector *connector)
923924 {
924
- struct drm_connector *connector = panel->connector;
925925 struct s6e8aa0 *ctx = panel_to_s6e8aa0(panel);
926926 struct drm_display_mode *mode;
927927
928928 mode = drm_mode_create(connector->dev);
929929 if (!mode) {
930
- DRM_ERROR("failed to create a new display mode\n");
930
+ dev_err(panel->dev, "failed to create a new display mode\n");
931931 return 0;
932932 }
933933
....@@ -1016,13 +1016,10 @@
10161016
10171017 ctx->brightness = GAMMA_LEVEL_NUM - 1;
10181018
1019
- drm_panel_init(&ctx->panel);
1020
- ctx->panel.dev = dev;
1021
- ctx->panel.funcs = &s6e8aa0_drm_funcs;
1019
+ drm_panel_init(&ctx->panel, dev, &s6e8aa0_drm_funcs,
1020
+ DRM_MODE_CONNECTOR_DSI);
10221021
1023
- ret = drm_panel_add(&ctx->panel);
1024
- if (ret < 0)
1025
- return ret;
1022
+ drm_panel_add(&ctx->panel);
10261023
10271024 ret = mipi_dsi_attach(dsi);
10281025 if (ret < 0)