hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/gpu/drm/panel/panel-samsung-ld9040.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * ld9040 AMOLED LCD drm_panel driver.
34 *
....@@ -5,22 +6,21 @@
56 * Derived from drivers/video/backlight/ld9040.c
67 *
78 * Andrzej Hajda <a.hajda@samsung.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
129 */
1310
14
-#include <drm/drmP.h>
15
-#include <drm/drm_panel.h>
16
-
11
+#include <linux/delay.h>
1712 #include <linux/gpio/consumer.h>
13
+#include <linux/module.h>
14
+#include <linux/of.h>
1815 #include <linux/regulator/consumer.h>
1916 #include <linux/spi/spi.h>
2017
2118 #include <video/mipi_display.h>
2219 #include <video/of_videomode.h>
2320 #include <video/videomode.h>
21
+
22
+#include <drm/drm_modes.h>
23
+#include <drm/drm_panel.h>
2424
2525 /* Manufacturer Command Set */
2626 #define MCS_MANPWR 0xb0
....@@ -260,15 +260,15 @@
260260 return 0;
261261 }
262262
263
-static int ld9040_get_modes(struct drm_panel *panel)
263
+static int ld9040_get_modes(struct drm_panel *panel,
264
+ struct drm_connector *connector)
264265 {
265
- struct drm_connector *connector = panel->connector;
266266 struct ld9040 *ctx = panel_to_ld9040(panel);
267267 struct drm_display_mode *mode;
268268
269269 mode = drm_mode_create(connector->dev);
270270 if (!mode) {
271
- DRM_ERROR("failed to create a new display mode\n");
271
+ dev_err(panel->dev, "failed to create a new display mode\n");
272272 return 0;
273273 }
274274
....@@ -350,11 +350,12 @@
350350 return ret;
351351 }
352352
353
- drm_panel_init(&ctx->panel);
354
- ctx->panel.dev = dev;
355
- ctx->panel.funcs = &ld9040_drm_funcs;
353
+ drm_panel_init(&ctx->panel, dev, &ld9040_drm_funcs,
354
+ DRM_MODE_CONNECTOR_DPI);
356355
357
- return drm_panel_add(&ctx->panel);
356
+ drm_panel_add(&ctx->panel);
357
+
358
+ return 0;
358359 }
359360
360361 static int ld9040_remove(struct spi_device *spi)
....@@ -373,6 +374,12 @@
373374 };
374375 MODULE_DEVICE_TABLE(of, ld9040_of_match);
375376
377
+static const struct spi_device_id ld9040_ids[] = {
378
+ { "ld9040", },
379
+ { /* sentinel */ }
380
+};
381
+MODULE_DEVICE_TABLE(spi, ld9040_ids);
382
+
376383 static struct spi_driver ld9040_driver = {
377384 .probe = ld9040_probe,
378385 .remove = ld9040_remove,