From fdbabc0c0050339692cdf648094fc2037d5d31db Mon Sep 17 00:00:00 2001
From: Dietmar Muscholik <muscholik@keith-koep.com>
Date: Tue, 5 Sep 2023 13:56:52 +0200
Subject: [PATCH] drm:panel:panel-lvds: Added support for eDP panels added to
 panel-lvds

Added additional compatible entry to enable support for eDP displays.
---
 drivers/gpu/drm/panel/panel-lvds.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 59a8d99e777d3..5b626e5bd88cd 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -175,9 +175,13 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds)
 
 static int panel_lvds_probe(struct platform_device *pdev)
 {
+	const int *connector;
 	struct panel_lvds *lvds;
 	int ret;
 
+	connector = of_device_get_match_data(&pdev->dev);
+	if(!connector)
+		return -ENODEV;
 	lvds = devm_kzalloc(&pdev->dev, sizeof(*lvds), GFP_KERNEL);
 	if (!lvds)
 		return -ENOMEM;
@@ -230,7 +234,7 @@ static int panel_lvds_probe(struct platform_device *pdev)
 
 	/* Register the panel. */
 	drm_panel_init(&lvds->panel, lvds->dev, &panel_lvds_funcs,
-		       DRM_MODE_CONNECTOR_LVDS);
+		       *connector);
 
 	ret = drm_panel_of_backlight(&lvds->panel);
 	if (ret)
@@ -253,8 +257,12 @@ static int panel_lvds_remove(struct platform_device *pdev)
 	return 0;
 }
 
+int connector_lvds = DRM_MODE_CONNECTOR_LVDS;
+int connector_edp = DRM_MODE_CONNECTOR_eDP;
+
 static const struct of_device_id panel_lvds_of_table[] = {
-	{ .compatible = "panel-lvds", },
+	{ .compatible = "panel-lvds", .data = &connector_lvds},
+	{ .compatible = "panel-edp", .data = &connector_edp},
 	{ /* Sentinel */ },
 };
 
-- 
GitLab