android_kernel_xiaomi_sm8450/include/soc/qcom/qcom_ramdump.h
Mukesh Ojha 7b92fc2502 soc: qcom: ramdump: Add support to create/destroy ramdump device
There was a requirement from client drivers to create ramdump
device with a given name so that they control the name of the elf.

This change adds the support to create/destroy ramdump device.

Change-Id: I411cc92a1b41d44e8b6fef95d383613280dae0c2
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
2022-06-06 20:31:58 +05:30

56 lines
1.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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 void *qcom_create_ramdump_device(const char *dev_name, struct device *parent);
extern void qcom_destroy_ramdump_device(void *dev);
extern int qcom_elf_dump(struct list_head *segs, struct device *dev, unsigned char class);
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 void *qcom_create_ramdump_device(const char *dev_name,
struct device *parent)
{
return NULL;
}
static inline void qcom_destroy_ramdump_device(void *dev)
{
}
static inline int qcom_elf_dump(struct list_head *segs, struct device *dev, unsigned char class)
{
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