disp: msm: dsi: modify handling of debugfs initialization

Add support to allow creation of debugfs node only if
CONFIG_DEBUG_FS is enabled.

Change-Id: I1ae2c4188a99e3ed88f59fc021efc01407bf942d
Signed-off-by: Harigovindan P <harigovi@codeaurora.org>
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
This commit is contained in:
Harigovindan P
2020-03-18 17:35:55 +05:30
committed by Satya Rama Aditya Pinapala
parent a1143d12be
commit 1b9802c099
2 changed files with 46 additions and 18 deletions

View File

@@ -83,6 +83,7 @@ static const struct of_device_id msm_dsi_of_match[] = {
{} {}
}; };
#ifdef CONFIG_DEBUG_FS
static ssize_t debugfs_state_info_read(struct file *file, static ssize_t debugfs_state_info_read(struct file *file,
char __user *buff, char __user *buff,
size_t count, size_t count,
@@ -209,6 +210,11 @@ static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl,
struct dentry *dir, *state_file, *reg_dump; struct dentry *dir, *state_file, *reg_dump;
char dbg_name[DSI_DEBUG_NAME_LEN]; char dbg_name[DSI_DEBUG_NAME_LEN];
if (!dsi_ctrl || !parent) {
DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n");
return -EINVAL;
}
dir = debugfs_create_dir(dsi_ctrl->name, parent); dir = debugfs_create_dir(dsi_ctrl->name, parent);
if (IS_ERR_OR_NULL(dir)) { if (IS_ERR_OR_NULL(dir)) {
rc = PTR_ERR(dir); rc = PTR_ERR(dir);
@@ -256,6 +262,17 @@ static int dsi_ctrl_debugfs_deinit(struct dsi_ctrl *dsi_ctrl)
debugfs_remove(dsi_ctrl->debugfs_root); debugfs_remove(dsi_ctrl->debugfs_root);
return 0; return 0;
} }
#else
static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl,
struct dentry *parent)
{
return 0;
}
static int dsi_ctrl_debugfs_deinit(struct dsi_ctrl *dsi_ctrl)
{
return 0;
}
#endif /* CONFIG_DEBUG_FS */
static inline struct msm_gem_address_space* static inline struct msm_gem_address_space*
dsi_ctrl_get_aspace(struct dsi_ctrl *dsi_ctrl, dsi_ctrl_get_aspace(struct dsi_ctrl *dsi_ctrl,
@@ -2043,7 +2060,7 @@ int dsi_ctrl_drv_init(struct dsi_ctrl *dsi_ctrl, struct dentry *parent)
{ {
int rc = 0; int rc = 0;
if (!dsi_ctrl || !parent) { if (!dsi_ctrl) {
DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n"); DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n");
return -EINVAL; return -EINVAL;
} }

View File

@@ -476,23 +476,6 @@ error:
display->panel->esd_config.esd_enabled = false; display->panel->esd_config.esd_enabled = false;
} }
static bool dsi_display_is_te_based_esd(struct dsi_display *display)
{
u32 status_mode = 0;
if (!display->panel) {
DSI_ERR("Invalid panel data\n");
return false;
}
status_mode = display->panel->esd_config.status_mode;
if (status_mode == ESD_MODE_PANEL_TE &&
gpio_is_valid(display->disp_te_gpio))
return true;
return false;
}
/* Allocate memory for cmd dma tx buffer */ /* Allocate memory for cmd dma tx buffer */
static int dsi_host_alloc_cmd_tx_buffer(struct dsi_display *display) static int dsi_host_alloc_cmd_tx_buffer(struct dsi_display *display)
{ {
@@ -1081,6 +1064,24 @@ int dsi_display_set_power(struct drm_connector *connector,
return rc; return rc;
} }
#ifdef CONFIG_DEBUG_FS
static bool dsi_display_is_te_based_esd(struct dsi_display *display)
{
u32 status_mode = 0;
if (!display->panel) {
DSI_ERR("Invalid panel data\n");
return false;
}
status_mode = display->panel->esd_config.status_mode;
if (status_mode == ESD_MODE_PANEL_TE &&
gpio_is_valid(display->disp_te_gpio))
return true;
return false;
}
static ssize_t debugfs_dump_info_read(struct file *file, static ssize_t debugfs_dump_info_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t user_len, size_t user_len,
@@ -1649,6 +1650,16 @@ static int dsi_display_debugfs_deinit(struct dsi_display *display)
return 0; return 0;
} }
#else
static int dsi_display_debugfs_init(struct dsi_display *display)
{
return 0;
}
static int dsi_display_debugfs_deinit(struct dsi_display *display)
{
return 0;
}
#endif /* CONFIG_DEBUG_FS */
static void adjust_timing_by_ctrl_count(const struct dsi_display *display, static void adjust_timing_by_ctrl_count(const struct dsi_display *display,
struct dsi_display_mode *mode) struct dsi_display_mode *mode)