0001
0002 #ifndef __RPROC_QCOM_COMMON_H__
0003 #define __RPROC_QCOM_COMMON_H__
0004
0005 #include <linux/remoteproc.h>
0006 #include "remoteproc_internal.h"
0007 #include <linux/soc/qcom/qmi.h>
0008
0009 struct qcom_sysmon;
0010
0011 struct qcom_rproc_glink {
0012 struct rproc_subdev subdev;
0013
0014 const char *ssr_name;
0015
0016 struct device *dev;
0017 struct device_node *node;
0018 struct qcom_glink *edge;
0019 };
0020
0021 struct qcom_rproc_subdev {
0022 struct rproc_subdev subdev;
0023
0024 struct device *dev;
0025 struct device_node *node;
0026 struct qcom_smd_edge *edge;
0027 };
0028
0029 struct qcom_ssr_subsystem;
0030
0031 struct qcom_rproc_ssr {
0032 struct rproc_subdev subdev;
0033 struct qcom_ssr_subsystem *info;
0034 };
0035
0036 void qcom_minidump(struct rproc *rproc, unsigned int minidump_id);
0037
0038 void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink,
0039 const char *ssr_name);
0040 void qcom_remove_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink);
0041
0042 int qcom_register_dump_segments(struct rproc *rproc, const struct firmware *fw);
0043
0044 void qcom_add_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd);
0045 void qcom_remove_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd);
0046
0047 void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr,
0048 const char *ssr_name);
0049 void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr);
0050
0051 #if IS_ENABLED(CONFIG_QCOM_SYSMON)
0052 struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
0053 const char *name,
0054 int ssctl_instance);
0055 void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon);
0056 bool qcom_sysmon_shutdown_acked(struct qcom_sysmon *sysmon);
0057 #else
0058 static inline struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
0059 const char *name,
0060 int ssctl_instance)
0061 {
0062 return NULL;
0063 }
0064
0065 static inline void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon)
0066 {
0067 }
0068
0069 static inline bool qcom_sysmon_shutdown_acked(struct qcom_sysmon *sysmon)
0070 {
0071 return false;
0072 }
0073 #endif
0074
0075 #endif