Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (C) 2022, STMicroelectronics
0004  */
0005 
0006 #ifndef __RPMSG_CHRDEV_H__
0007 #define __RPMSG_CHRDEV_H__
0008 
0009 #if IS_ENABLED(CONFIG_RPMSG_CHAR)
0010 /**
0011  * rpmsg_chrdev_eptdev_create() - register char device based on an endpoint
0012  * @rpdev:  prepared rpdev to be used for creating endpoints
0013  * @parent: parent device
0014  * @chinfo: associated endpoint channel information.
0015  *
0016  * This function create a new rpmsg char endpoint device to instantiate a new
0017  * endpoint based on chinfo information.
0018  */
0019 int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,
0020                    struct rpmsg_channel_info chinfo);
0021 
0022 /**
0023  * rpmsg_chrdev_eptdev_destroy() - destroy created char device endpoint.
0024  * @data: private data associated to the endpoint device
0025  *
0026  * This function destroys a rpmsg char endpoint device created by the RPMSG_DESTROY_EPT_IOCTL
0027  * control.
0028  */
0029 int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data);
0030 
0031 #else  /*IS_ENABLED(CONFIG_RPMSG_CHAR) */
0032 
0033 static inline int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,
0034                          struct rpmsg_channel_info chinfo)
0035 {
0036     return -ENXIO;
0037 }
0038 
0039 static inline int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data)
0040 {
0041     return -ENXIO;
0042 }
0043 
0044 #endif /*IS_ENABLED(CONFIG_RPMSG_CHAR) */
0045 
0046 #endif /*__RPMSG_CHRDEV_H__ */