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: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
This commit is contained in:
@@ -1259,6 +1259,7 @@ static ssize_t debugfs_esd_trigger_check(struct file *file,
|
||||
struct dsi_display *display = file->private_data;
|
||||
char *buf;
|
||||
int rc = 0;
|
||||
struct drm_panel_esd_config *esd_config = &display->panel->esd_config;
|
||||
u32 esd_trigger;
|
||||
size_t len;
|
||||
|
||||
@@ -1278,6 +1279,11 @@ static ssize_t debugfs_esd_trigger_check(struct file *file,
|
||||
atomic_read(&display->panel->esd_recovery_pending))
|
||||
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);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
Reference in New Issue
Block a user