android_kernel_xiaomi_sm8450/include/soc/qcom/qcom_ramdump.h
Rishabh Bhatnagar ab898431a4 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>
2020-10-29 09:38:05 -07:00

45 lines
1008 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
*/
#ifndef _QCOM_RAMDUMP_HEADER
#define _QCOM_RAMDUMP_HEADER
#include <linux/kernel.h>
#include <linux/firmware.h>
struct device;
struct qcom_dump_segment {
struct list_head node;
dma_addr_t da;
void *va;
size_t size;
};
#if IS_ENABLED(CONFIG_QCOM_RAMDUMP)
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)
{
return -ENODEV;
}
static inline int qcom_dump(struct list_head *head, struct device *dev)
{
return -ENODEV;
}
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