qcom_common.h (1938B)
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef __RPROC_QCOM_COMMON_H__ 3#define __RPROC_QCOM_COMMON_H__ 4 5#include <linux/remoteproc.h> 6#include "remoteproc_internal.h" 7#include <linux/soc/qcom/qmi.h> 8 9struct qcom_sysmon; 10 11struct qcom_rproc_glink { 12 struct rproc_subdev subdev; 13 14 const char *ssr_name; 15 16 struct device *dev; 17 struct device_node *node; 18 struct qcom_glink *edge; 19}; 20 21struct qcom_rproc_subdev { 22 struct rproc_subdev subdev; 23 24 struct device *dev; 25 struct device_node *node; 26 struct qcom_smd_edge *edge; 27}; 28 29struct qcom_ssr_subsystem; 30 31struct qcom_rproc_ssr { 32 struct rproc_subdev subdev; 33 struct qcom_ssr_subsystem *info; 34}; 35 36void qcom_minidump(struct rproc *rproc, unsigned int minidump_id); 37 38void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink, 39 const char *ssr_name); 40void qcom_remove_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink); 41 42int qcom_register_dump_segments(struct rproc *rproc, const struct firmware *fw); 43 44void qcom_add_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd); 45void qcom_remove_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd); 46 47void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr, 48 const char *ssr_name); 49void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr); 50 51#if IS_ENABLED(CONFIG_QCOM_SYSMON) 52struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, 53 const char *name, 54 int ssctl_instance); 55void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon); 56bool qcom_sysmon_shutdown_acked(struct qcom_sysmon *sysmon); 57#else 58static inline struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, 59 const char *name, 60 int ssctl_instance) 61{ 62 return NULL; 63} 64 65static inline void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon) 66{ 67} 68 69static inline bool qcom_sysmon_shutdown_acked(struct qcom_sysmon *sysmon) 70{ 71 return false; 72} 73#endif 74 75#endif