Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright 2019 Google LLC.
0004  */
0005 
0006 #ifndef __LINUX_RPMSG_MTK_RPMSG_H
0007 #define __LINUX_RPMSG_MTK_RPMSG_H
0008 
0009 #include <linux/platform_device.h>
0010 #include <linux/remoteproc.h>
0011 
0012 typedef void (*ipi_handler_t)(void *data, unsigned int len, void *priv);
0013 
0014 /*
0015  * struct mtk_rpmsg_info - IPI functions tied to the rpmsg device.
0016  * @register_ipi: register IPI handler for an IPI id.
0017  * @unregister_ipi: unregister IPI handler for a registered IPI id.
0018  * @send_ipi: send IPI to an IPI id. wait is the timeout (in msecs) to wait
0019  *            until response, or 0 if there's no timeout.
0020  * @ns_ipi_id: the IPI id used for name service, or -1 if name service isn't
0021  *             supported.
0022  */
0023 struct mtk_rpmsg_info {
0024     int (*register_ipi)(struct platform_device *pdev, u32 id,
0025                 ipi_handler_t handler, void *priv);
0026     void (*unregister_ipi)(struct platform_device *pdev, u32 id);
0027     int (*send_ipi)(struct platform_device *pdev, u32 id,
0028             void *buf, unsigned int len, unsigned int wait);
0029     int ns_ipi_id;
0030 };
0031 
0032 struct rproc_subdev *
0033 mtk_rpmsg_create_rproc_subdev(struct platform_device *pdev,
0034                   struct mtk_rpmsg_info *info);
0035 
0036 void mtk_rpmsg_destroy_rproc_subdev(struct rproc_subdev *subdev);
0037 
0038 #endif