diff mbox series

Revert "drm/panel-edp: Allow querying the detected panel via sysfs"

Message ID 20220201092152.1.Ibc65ec6fa05017e9856ba9ef557310268429c3ce@changeid (mailing list archive)
State New, archived
Headers show
Series Revert "drm/panel-edp: Allow querying the detected panel via sysfs" | expand

Commit Message

Doug Anderson Feb. 1, 2022, 5:21 p.m. UTC
This reverts commit 363c4c3811db330dee9ce27dd3cee6f590d44e4c.

Since the point of this attribute is for a test, this should be done
in debugfs, not sysfs. Let's revert and a new patch can be added later
doing it in debugfs.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/gpu/drm/panel/panel-edp.c | 39 ++++---------------------------
 1 file changed, 5 insertions(+), 34 deletions(-)

Comments

Doug Anderson Feb. 1, 2022, 5:42 p.m. UTC | #1
Hi,

On Tue, Feb 1, 2022 at 9:22 AM Douglas Anderson <dianders@chromium.org> wrote:
>
> This reverts commit 363c4c3811db330dee9ce27dd3cee6f590d44e4c.
>
> Since the point of this attribute is for a test, this should be done
> in debugfs, not sysfs. Let's revert and a new patch can be added later
> doing it in debugfs.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
>
>  drivers/gpu/drm/panel/panel-edp.c | 39 ++++---------------------------
>  1 file changed, 5 insertions(+), 34 deletions(-)

Pushed the revert with Javier's R-B, provided on #dri-devel IRC.

2bf68bbdb6f5 Revert "drm/panel-edp: Allow querying the detected panel via sysfs"

-Doug
diff mbox series

Patch

diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
index 23da4040e263..a394a15dc3fb 100644
--- a/drivers/gpu/drm/panel/panel-edp.c
+++ b/drivers/gpu/drm/panel/panel-edp.c
@@ -222,8 +222,6 @@  struct panel_edp {
 	struct gpio_desc *enable_gpio;
 	struct gpio_desc *hpd_gpio;
 
-	const struct edp_panel_entry *detected_panel;
-
 	struct edid *edid;
 
 	struct drm_display_mode override_mode;
@@ -668,6 +666,7 @@  static const struct edp_panel_entry *find_edp_panel(u32 panel_id);
 
 static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
 {
+	const struct edp_panel_entry *edp_panel;
 	struct panel_desc *desc;
 	u32 panel_id;
 	char vend[4];
@@ -706,14 +705,14 @@  static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
 	}
 	drm_edid_decode_panel_id(panel_id, vend, &product_id);
 
-	panel->detected_panel = find_edp_panel(panel_id);
+	edp_panel = find_edp_panel(panel_id);
 
 	/*
 	 * We're using non-optimized timings and want it really obvious that
 	 * someone needs to add an entry to the table, so we'll do a WARN_ON
 	 * splat.
 	 */
-	if (WARN_ON(!panel->detected_panel)) {
+	if (WARN_ON(!edp_panel)) {
 		dev_warn(dev,
 			 "Unknown panel %s %#06x, using conservative timings\n",
 			 vend, product_id);
@@ -735,14 +734,12 @@  static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
 		 */
 		desc->delay.unprepare = 2000;
 		desc->delay.enable = 200;
-
-		panel->detected_panel = ERR_PTR(-EINVAL);
 	} else {
 		dev_info(dev, "Detected %s %s (%#06x)\n",
-			 vend, panel->detected_panel->name, product_id);
+			 vend, edp_panel->name, product_id);
 
 		/* Update the delay; everything else comes from EDID */
-		desc->delay = *panel->detected_panel->delay;
+		desc->delay = *edp_panel->delay;
 	}
 
 	ret = 0;
@@ -753,28 +750,6 @@  static int generic_edp_panel_probe(struct device *dev, struct panel_edp *panel)
 	return ret;
 }
 
-static ssize_t detected_panel_show(struct device *dev,
-				   struct device_attribute *attr, char *buf)
-{
-	struct panel_edp *p = dev_get_drvdata(dev);
-
-	if (IS_ERR(p->detected_panel))
-		return sysfs_emit(buf, "UNKNOWN\n");
-	else if (!p->detected_panel)
-		return sysfs_emit(buf, "HARDCODED\n");
-	else
-		return sysfs_emit(buf, "%s\n", p->detected_panel->name);
-}
-
-static const DEVICE_ATTR_RO(detected_panel);
-
-static void edp_panel_remove_detected_panel(void *data)
-{
-	struct panel_edp *p = data;
-
-	device_remove_file(p->base.dev, &dev_attr_detected_panel);
-}
-
 static int panel_edp_probe(struct device *dev, const struct panel_desc *desc,
 			   struct drm_dp_aux *aux)
 {
@@ -874,10 +849,6 @@  static int panel_edp_probe(struct device *dev, const struct panel_desc *desc,
 
 	drm_panel_add(&panel->base);
 
-	err = device_create_file(dev, &dev_attr_detected_panel);
-	if (!err)
-		devm_add_action_or_reset(dev, edp_panel_remove_detected_panel, panel);
-
 	return 0;
 
 err_finished_pm_runtime: