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 9 struct qcom_glink_smem; 10 struct qcom_sysmon; 11 12 struct qcom_rproc_glink { 13 struct rproc_subdev subdev; 14 15 const char *ssr_name; 16 17 struct device *dev; 18 struct device_node *node; 19 struct qcom_glink_smem *edge; 20 }; 21 22 struct qcom_rproc_subdev { 23 struct rproc_subdev subdev; 24 25 struct device *dev; 26 struct device_node *node; 27 struct qcom_smd_edge *edge; 28 }; 29 30 struct qcom_ssr_subsystem; 31 32 struct qcom_rproc_ssr { 33 struct rproc_subdev subdev; 34 struct qcom_ssr_subsystem *info; 35 }; 36 37 struct qcom_rproc_pdm { 38 struct rproc_subdev subdev; 39 struct device *dev; 40 int index; 41 struct auxiliary_device *adev; 42 }; 43 44 void qcom_minidump(struct rproc *rproc, unsigned int minidump_id, 45 void (*rproc_dumpfn_t)(struct rproc *rproc, 46 struct rproc_dump_segment *segment, void *dest, size_t offset, 47 size_t size)); 48 49 void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink, 50 const char *ssr_name); 51 void qcom_remove_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink); 52 53 int qcom_register_dump_segments(struct rproc *rproc, const struct firmware *fw); 54 55 void qcom_add_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd); 56 void qcom_remove_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd); 57 58 void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr, 59 const char *ssr_name); 60 void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr); 61 62 void qcom_add_pdm_subdev(struct rproc *rproc, struct qcom_rproc_pdm *pdm); 63 void qcom_remove_pdm_subdev(struct rproc *rproc, struct qcom_rproc_pdm *pdm); 64 65 #if IS_ENABLED(CONFIG_QCOM_SYSMON) 66 struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, 67 const char *name, 68 int ssctl_instance); 69 void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon); 70 bool qcom_sysmon_shutdown_acked(struct qcom_sysmon *sysmon); 71 #else 72 static inline struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, 73 const char *name, 74 int ssctl_instance) 75 { 76 return NULL; 77 } 78 79 static inline void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon) 80 { 81 } 82 83 static inline bool qcom_sysmon_shutdown_acked(struct qcom_sysmon *sysmon) 84 { 85 return false; 86 } 87 #endif 88 89 #endif 90