1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __RPROC_QCOM_COMMON_H__
3 #define __RPROC_QCOM_COMMON_H__
5 #include <linux/remoteproc.h>
6 #include "remoteproc_internal.h"
7 #include <linux/soc/qcom/qmi.h>
9 struct qcom_glink_smem
;
12 struct qcom_rproc_glink
{
13 struct rproc_subdev subdev
;
18 struct device_node
*node
;
19 struct qcom_glink_smem
*edge
;
22 struct qcom_rproc_subdev
{
23 struct rproc_subdev subdev
;
26 struct device_node
*node
;
27 struct qcom_smd_edge
*edge
;
30 struct qcom_ssr_subsystem
;
32 struct qcom_rproc_ssr
{
33 struct rproc_subdev subdev
;
34 struct qcom_ssr_subsystem
*info
;
37 struct qcom_rproc_pdm
{
38 struct rproc_subdev subdev
;
41 struct auxiliary_device
*adev
;
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
,
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
);
53 int qcom_register_dump_segments(struct rproc
*rproc
, const struct firmware
*fw
);
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
);
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
);
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
);
65 #if IS_ENABLED(CONFIG_QCOM_SYSMON)
66 struct qcom_sysmon
*qcom_add_sysmon_subdev(struct rproc
*rproc
,
69 void qcom_remove_sysmon_subdev(struct qcom_sysmon
*sysmon
);
70 bool qcom_sysmon_shutdown_acked(struct qcom_sysmon
*sysmon
);
72 static inline struct qcom_sysmon
*qcom_add_sysmon_subdev(struct rproc
*rproc
,
79 static inline void qcom_remove_sysmon_subdev(struct qcom_sysmon
*sysmon
)
83 static inline bool qcom_sysmon_shutdown_acked(struct qcom_sysmon
*sysmon
)