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

Commit 15f2eb41 authored by Harigovindan P's avatar Harigovindan P
Browse files

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: default avatarHarigovindan P <harigovi@codeaurora.org>
parent 2ce4335f
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -79,6 +79,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,
				       char __user *buff,
				       size_t count,
@@ -205,6 +206,11 @@ static int dsi_ctrl_debugfs_init(struct dsi_ctrl *dsi_ctrl,
	struct dentry *dir, *state_file, *reg_dump;
	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);
	if (IS_ERR_OR_NULL(dir)) {
		rc = PTR_ERR(dir);
@@ -252,6 +258,17 @@ static int dsi_ctrl_debugfs_deinit(struct dsi_ctrl *dsi_ctrl)
	debugfs_remove(dsi_ctrl->debugfs_root);
	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*
dsi_ctrl_get_aspace(struct dsi_ctrl *dsi_ctrl,
@@ -2101,7 +2118,7 @@ int dsi_ctrl_drv_init(struct dsi_ctrl *dsi_ctrl, struct dentry *parent)
{
	int rc = 0;

	if (!dsi_ctrl || !parent) {
	if (!dsi_ctrl) {
		DSI_CTRL_ERR(dsi_ctrl, "Invalid params\n");
		return -EINVAL;
	}
+28 −17
Original line number Diff line number Diff line
@@ -476,23 +476,6 @@ static void dsi_display_register_te_irq(struct dsi_display *display)
		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 */
static int dsi_host_alloc_cmd_tx_buffer(struct dsi_display *display)
{
@@ -1093,6 +1076,24 @@ int dsi_display_set_power(struct drm_connector *connector,
	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,
				      char __user *user_buf,
				      size_t user_len,
@@ -1661,6 +1662,16 @@ static int dsi_display_debugfs_deinit(struct dsi_display *display)

	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,
					struct dsi_display_mode *mode)