Merge "ASoC: wcd934x-dsp-cntl: add debugfs node to perform debug dumps"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
9970fc4999
@@ -757,6 +757,7 @@ static int wcd_cntl_do_boot(struct wcd_dsp_cntl *cntl)
|
|||||||
if (!ret) {
|
if (!ret) {
|
||||||
dev_err(codec->dev, "%s: WDSP boot timed out\n",
|
dev_err(codec->dev, "%s: WDSP boot timed out\n",
|
||||||
__func__);
|
__func__);
|
||||||
|
if (cntl->dbg_dmp_enable)
|
||||||
wcd_cntl_collect_debug_dumps(cntl, true);
|
wcd_cntl_collect_debug_dumps(cntl, true);
|
||||||
ret = -ETIMEDOUT;
|
ret = -ETIMEDOUT;
|
||||||
goto err_boot;
|
goto err_boot;
|
||||||
@@ -976,6 +977,8 @@ static void wcd_cntl_debugfs_init(char *dir, struct wcd_dsp_cntl *cntl)
|
|||||||
cntl->entry, &cntl->debug_mode);
|
cntl->entry, &cntl->debug_mode);
|
||||||
debugfs_create_bool("ramdump_enable", 0644,
|
debugfs_create_bool("ramdump_enable", 0644,
|
||||||
cntl->entry, &cntl->ramdump_enable);
|
cntl->entry, &cntl->ramdump_enable);
|
||||||
|
debugfs_create_bool("debug_dump_enable", 0644,
|
||||||
|
cntl->entry, &cntl->dbg_dmp_enable);
|
||||||
done:
|
done:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1038,16 +1041,23 @@ static ssize_t wcd_miscdev_write(struct file *filep, const char __user *ubuf,
|
|||||||
} else if (val[0] == '0') {
|
} else if (val[0] == '0') {
|
||||||
if (cntl->boot_reqs == 0) {
|
if (cntl->boot_reqs == 0) {
|
||||||
dev_err(cntl->codec->dev,
|
dev_err(cntl->codec->dev,
|
||||||
"%s: WDSP already disabled\n", __func__);
|
"%s: WDSP already disabled\n",
|
||||||
|
__func__);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
cntl->boot_reqs--;
|
cntl->boot_reqs--;
|
||||||
vote = false;
|
vote = false;
|
||||||
} else if (!strcmp(val, "DEBUG_DUMP")) {
|
} else if (!strcmp(val, "DEBUG_DUMP")) {
|
||||||
|
if (cntl->dbg_dmp_enable) {
|
||||||
dev_dbg(cntl->codec->dev,
|
dev_dbg(cntl->codec->dev,
|
||||||
"%s: Collect dumps for debug use\n", __func__);
|
"%s: Collect dumps for debug use\n", __func__);
|
||||||
wcd_cntl_collect_debug_dumps(cntl, false);
|
wcd_cntl_collect_debug_dumps(cntl, false);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* simply ignore the request from userspace
|
||||||
|
* if dbg_dump_enable is not set from debugfs
|
||||||
|
*/
|
||||||
goto done;
|
goto done;
|
||||||
} else {
|
} else {
|
||||||
dev_err(cntl->codec->dev, "%s: Invalid value %s\n",
|
dev_err(cntl->codec->dev, "%s: Invalid value %s\n",
|
||||||
|
@@ -91,6 +91,7 @@ struct wcd_dsp_cntl {
|
|||||||
struct dentry *entry;
|
struct dentry *entry;
|
||||||
u32 debug_mode;
|
u32 debug_mode;
|
||||||
bool ramdump_enable;
|
bool ramdump_enable;
|
||||||
|
bool dbg_dmp_enable;
|
||||||
|
|
||||||
/* WDSP manager drivers data */
|
/* WDSP manager drivers data */
|
||||||
struct device *m_dev;
|
struct device *m_dev;
|
||||||
|
Reference in New Issue
Block a user