mtk_rpmsg.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright 2019 Google LLC.
  4. */
  5. #ifndef __LINUX_RPMSG_MTK_RPMSG_H
  6. #define __LINUX_RPMSG_MTK_RPMSG_H
  7. #include <linux/platform_device.h>
  8. #include <linux/remoteproc.h>
  9. typedef void (*ipi_handler_t)(void *data, unsigned int len, void *priv);
  10. /*
  11. * struct mtk_rpmsg_info - IPI functions tied to the rpmsg device.
  12. * @register_ipi: register IPI handler for an IPI id.
  13. * @unregister_ipi: unregister IPI handler for a registered IPI id.
  14. * @send_ipi: send IPI to an IPI id. wait is the timeout (in msecs) to wait
  15. * until response, or 0 if there's no timeout.
  16. * @ns_ipi_id: the IPI id used for name service, or -1 if name service isn't
  17. * supported.
  18. */
  19. struct mtk_rpmsg_info {
  20. int (*register_ipi)(struct platform_device *pdev, u32 id,
  21. ipi_handler_t handler, void *priv);
  22. void (*unregister_ipi)(struct platform_device *pdev, u32 id);
  23. int (*send_ipi)(struct platform_device *pdev, u32 id,
  24. void *buf, unsigned int len, unsigned int wait);
  25. int ns_ipi_id;
  26. };
  27. struct rproc_subdev *
  28. mtk_rpmsg_create_rproc_subdev(struct platform_device *pdev,
  29. struct mtk_rpmsg_info *info);
  30. void mtk_rpmsg_destroy_rproc_subdev(struct rproc_subdev *subdev);
  31. #endif