drivers: soc: qcom: Expose dump collection state

Expose a sysfs entry to userspace to enable dump collection.
Also add an api to expose the current dump collection state.

Change-Id: I4adb385d35eca71263e86095b8f3de68243abded
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
This commit is contained in:
Rishabh Bhatnagar 2020-10-13 12:30:57 -07:00 committed by Gerrit - the friendly Code Review server
parent dedefe9f7c
commit ab898431a4
2 changed files with 12 additions and 0 deletions

View File

@ -16,6 +16,13 @@
#include <linux/devcoredump.h>
#include <linux/soc/qcom/mdt_loader.h>
static int enable_dump_collection;
module_param(enable_dump_collection, int, 0644);
bool dump_enabled(void)
{
return enable_dump_collection;
}
int qcom_dump(struct list_head *segs, struct device *dev)
{

View File

@ -21,6 +21,7 @@ struct qcom_dump_segment {
extern int qcom_elf_dump(struct list_head *segs, struct device *dev);
extern int qcom_dump(struct list_head *head, struct device *dev);
extern int qcom_fw_elf_dump(struct firmware *fw, struct device *dev);
extern bool dump_enabled(void);
#else
static inline int qcom_elf_dump(struct list_head *segs, struct device *dev)
{
@ -34,6 +35,10 @@ static inline int qcom_fw_elf_dump(struct firmware *fw, struct device *dev)
{
return -ENODEV;
}
static inline bool dump_enabled(void)
{
return false;
}
#endif /* CONFIG_QCOM_RAMDUMP */
#endif