blob: 58de71e4781c966b6757ec62e16e182d7cca79ba [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Bjorn Anderssonbde440e2017-01-27 02:28:32 -08002#ifndef __RPROC_QCOM_COMMON_H__
3#define __RPROC_QCOM_COMMON_H__
4
Bjorn Anderssonb90fcfc2017-01-27 07:04:54 -08005#include <linux/remoteproc.h>
6#include "remoteproc_internal.h"
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -07007#include <linux/soc/qcom/qmi.h>
8
9struct qcom_sysmon;
Bjorn Anderssonb90fcfc2017-01-27 07:04:54 -080010
Bjorn Anderssoneea07022017-08-29 16:13:35 -070011struct qcom_rproc_glink {
12 struct rproc_subdev subdev;
13
14 struct device *dev;
15 struct device_node *node;
16 struct qcom_glink *edge;
17};
18
Bjorn Anderssonb90fcfc2017-01-27 07:04:54 -080019struct qcom_rproc_subdev {
20 struct rproc_subdev subdev;
21
22 struct device *dev;
23 struct device_node *node;
24 struct qcom_smd_edge *edge;
25};
Bjorn Anderssonbde440e2017-01-27 02:28:32 -080026
Bjorn Andersson1e140df2017-07-24 22:56:43 -070027struct qcom_rproc_ssr {
28 struct rproc_subdev subdev;
29
30 const char *name;
31};
32
Bjorn Anderssoneea07022017-08-29 16:13:35 -070033void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink);
34void qcom_remove_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink);
35
Sarangdhar Joshidcb57ed2018-01-05 16:04:20 -080036int qcom_register_dump_segments(struct rproc *rproc, const struct firmware *fw);
37
Bjorn Anderssonb90fcfc2017-01-27 07:04:54 -080038void qcom_add_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd);
39void qcom_remove_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd);
40
Bjorn Andersson1e140df2017-07-24 22:56:43 -070041void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr,
42 const char *ssr_name);
43void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr);
44
Bjorn Andersson1fb82ee2017-08-27 21:51:38 -070045#if IS_ENABLED(CONFIG_QCOM_SYSMON)
46struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
47 const char *name,
48 int ssctl_instance);
49void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon);
50#else
51static inline struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
52 const char *name,
53 int ssctl_instance)
54{
55 return NULL;
56}
57
58static inline void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon)
59{
60}
61#endif
62
Bjorn Anderssonbde440e2017-01-27 02:28:32 -080063#endif