Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b76eb58 authored by Satya Rama Aditya Pinapala's avatar Satya Rama Aditya Pinapala
Browse files

disp: msm: dsi: deny an ESD trigger when not enabled



During an ESD trigger, a check must be done to ensure
that ESD is enabled on the particular panel. If not the
panel might end up in a bad state, if the trigger is
propagated successfully instead of reporting a failure.

Change-Id: I310578e7136301ab75ba7f44f14d36ed7e6a519c
Signed-off-by: default avatarSatya Rama Aditya Pinapala <psraditya30@codeaurora.org>
parent a6bfb7fc
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -1259,6 +1259,7 @@ static ssize_t debugfs_esd_trigger_check(struct file *file,
	struct dsi_display *display = file->private_data;
	struct dsi_display *display = file->private_data;
	char *buf;
	char *buf;
	int rc = 0;
	int rc = 0;
	struct drm_panel_esd_config *esd_config = &display->panel->esd_config;
	u32 esd_trigger;
	u32 esd_trigger;
	size_t len;
	size_t len;


@@ -1278,6 +1279,11 @@ static ssize_t debugfs_esd_trigger_check(struct file *file,
		atomic_read(&display->panel->esd_recovery_pending))
		atomic_read(&display->panel->esd_recovery_pending))
		return user_len;
		return user_len;


	if (!esd_config->esd_enabled) {
		DSI_ERR("ESD feature is not enabled\n");
		return -EINVAL;
	}

	buf = kzalloc(ESD_TRIGGER_STRING_MAX_LEN, GFP_KERNEL);
	buf = kzalloc(ESD_TRIGGER_STRING_MAX_LEN, GFP_KERNEL);
	if (!buf)
	if (!buf)
		return -ENOMEM;
		return -ENOMEM;