.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * MIPI-DSI based s6e8aa0 AMOLED LCD 5.3 inch panel driver. |
---|
3 | 4 | * |
---|
.. | .. |
---|
9 | 10 | * Eunchul Kim <chulspro.kim@samsung.com> |
---|
10 | 11 | * Tomasz Figa <t.figa@samsung.com> |
---|
11 | 12 | * 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. |
---|
16 | 13 | */ |
---|
17 | 14 | |
---|
18 | | -#include <drm/drmP.h> |
---|
19 | | -#include <drm/drm_mipi_dsi.h> |
---|
20 | | -#include <drm/drm_panel.h> |
---|
21 | | - |
---|
| 15 | +#include <linux/delay.h> |
---|
22 | 16 | #include <linux/gpio/consumer.h> |
---|
| 17 | +#include <linux/module.h> |
---|
| 18 | +#include <linux/of.h> |
---|
23 | 19 | #include <linux/regulator/consumer.h> |
---|
24 | 20 | |
---|
25 | 21 | #include <video/mipi_display.h> |
---|
26 | 22 | #include <video/of_videomode.h> |
---|
27 | 23 | #include <video/videomode.h> |
---|
| 24 | + |
---|
| 25 | +#include <drm/drm_mipi_dsi.h> |
---|
| 26 | +#include <drm/drm_modes.h> |
---|
| 27 | +#include <drm/drm_panel.h> |
---|
28 | 28 | |
---|
29 | 29 | #define LDI_MTP_LENGTH 24 |
---|
30 | 30 | #define GAMMA_LEVEL_NUM 25 |
---|
.. | .. |
---|
919 | 919 | return 0; |
---|
920 | 920 | } |
---|
921 | 921 | |
---|
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) |
---|
923 | 924 | { |
---|
924 | | - struct drm_connector *connector = panel->connector; |
---|
925 | 925 | struct s6e8aa0 *ctx = panel_to_s6e8aa0(panel); |
---|
926 | 926 | struct drm_display_mode *mode; |
---|
927 | 927 | |
---|
928 | 928 | mode = drm_mode_create(connector->dev); |
---|
929 | 929 | 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"); |
---|
931 | 931 | return 0; |
---|
932 | 932 | } |
---|
933 | 933 | |
---|
.. | .. |
---|
1016 | 1016 | |
---|
1017 | 1017 | ctx->brightness = GAMMA_LEVEL_NUM - 1; |
---|
1018 | 1018 | |
---|
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); |
---|
1022 | 1021 | |
---|
1023 | | - ret = drm_panel_add(&ctx->panel); |
---|
1024 | | - if (ret < 0) |
---|
1025 | | - return ret; |
---|
| 1022 | + drm_panel_add(&ctx->panel); |
---|
1026 | 1023 | |
---|
1027 | 1024 | ret = mipi_dsi_attach(dsi); |
---|
1028 | 1025 | if (ret < 0) |
---|