brintos

brintos / linux-shallow public Read only

0
0
Text · 1.3 KiB · 117d9cb Raw
47 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/*3 * Copyright (C) 2022, STMicroelectronics4 */5 6#ifndef __RPMSG_CHRDEV_H__7#define __RPMSG_CHRDEV_H__8 9#if IS_ENABLED(CONFIG_RPMSG_CHAR)10/**11 * rpmsg_chrdev_eptdev_create() - register char device based on an endpoint12 * @rpdev:  prepared rpdev to be used for creating endpoints13 * @parent: parent device14 * @chinfo: associated endpoint channel information.15 *16 * This function create a new rpmsg char endpoint device to instantiate a new17 * endpoint based on chinfo information.18 */19int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,20			       struct rpmsg_channel_info chinfo);21 22/**23 * rpmsg_chrdev_eptdev_destroy() - destroy created char device endpoint.24 * @data: private data associated to the endpoint device25 *26 * This function destroys a rpmsg char endpoint device created by the RPMSG_DESTROY_EPT_IOCTL27 * control.28 */29int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data);30 31#else  /*IS_ENABLED(CONFIG_RPMSG_CHAR) */32 33static inline int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,34					     struct rpmsg_channel_info chinfo)35{36	return -ENXIO;37}38 39static inline int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data)40{41	return -ENXIO;42}43 44#endif /*IS_ENABLED(CONFIG_RPMSG_CHAR) */45 46#endif /*__RPMSG_CHRDEV_H__ */47