qcom_common.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __RPROC_QCOM_COMMON_H__
  3. #define __RPROC_QCOM_COMMON_H__
  4. #include <linux/remoteproc.h>
  5. #include "remoteproc_internal.h"
  6. #include <linux/soc/qcom/qmi.h>
  7. struct qcom_sysmon;
  8. struct qcom_rproc_glink {
  9. struct rproc_subdev subdev;
  10. const char *ssr_name;
  11. struct device *dev;
  12. struct device_node *node;
  13. struct qcom_glink *edge;
  14. };
  15. struct qcom_rproc_subdev {
  16. struct rproc_subdev subdev;
  17. struct device *dev;
  18. struct device_node *node;
  19. struct qcom_smd_edge *edge;
  20. };
  21. struct qcom_ssr_subsystem;
  22. struct qcom_rproc_ssr {
  23. struct rproc_subdev subdev;
  24. struct qcom_ssr_subsystem *info;
  25. };
  26. void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink,
  27. const char *ssr_name);
  28. void qcom_remove_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink);
  29. int qcom_register_dump_segments(struct rproc *rproc, const struct firmware *fw);
  30. void qcom_add_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd);
  31. void qcom_remove_smd_subdev(struct rproc *rproc, struct qcom_rproc_subdev *smd);
  32. void qcom_add_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr,
  33. const char *ssr_name);
  34. void qcom_remove_ssr_subdev(struct rproc *rproc, struct qcom_rproc_ssr *ssr);
  35. #if IS_ENABLED(CONFIG_QCOM_SYSMON)
  36. struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
  37. const char *name,
  38. int ssctl_instance);
  39. void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon);
  40. #else
  41. static inline struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc,
  42. const char *name,
  43. int ssctl_instance)
  44. {
  45. return NULL;
  46. }
  47. static inline void qcom_remove_sysmon_subdev(struct qcom_sysmon *sysmon)
  48. {
  49. }
  50. #endif
  51. #endif