1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2022, STMicroelectronics
6 #ifndef __RPMSG_CHRDEV_H__
7 #define __RPMSG_CHRDEV_H__
9 #if IS_ENABLED(CONFIG_RPMSG_CHAR)
11 * rpmsg_chrdev_eptdev_create() - register char device based on an endpoint
12 * @rpdev: prepared rpdev to be used for creating endpoints
13 * @parent: parent device
14 * @chinfo: associated endpoint channel information.
16 * This function create a new rpmsg char endpoint device to instantiate a new
17 * endpoint based on chinfo information.
19 int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,
20 struct rpmsg_channel_info chinfo);
23 * rpmsg_chrdev_eptdev_destroy() - destroy created char device endpoint.
24 * @data: private data associated to the endpoint device
26 * This function destroys a rpmsg char endpoint device created by the RPMSG_DESTROY_EPT_IOCTL
29 int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data);
31 #else /*IS_ENABLED(CONFIG_RPMSG_CHAR) */
33 static inline int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,
34 struct rpmsg_channel_info chinfo)
39 static inline int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data)
44 #endif /*IS_ENABLED(CONFIG_RPMSG_CHAR) */
46 #endif /*__RPMSG_CHRDEV_H__ */