rpmsg_char.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2022, STMicroelectronics
  4. */
  5. #ifndef __RPMSG_CHRDEV_H__
  6. #define __RPMSG_CHRDEV_H__
  7. #if IS_ENABLED(CONFIG_RPMSG_CHAR)
  8. /**
  9. * rpmsg_chrdev_eptdev_create() - register char device based on an endpoint
  10. * @rpdev: prepared rpdev to be used for creating endpoints
  11. * @parent: parent device
  12. * @chinfo: associated endpoint channel information.
  13. *
  14. * This function create a new rpmsg char endpoint device to instantiate a new
  15. * endpoint based on chinfo information.
  16. */
  17. int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,
  18. struct rpmsg_channel_info chinfo);
  19. /**
  20. * rpmsg_chrdev_eptdev_destroy() - destroy created char device endpoint.
  21. * @data: private data associated to the endpoint device
  22. *
  23. * This function destroys a rpmsg char endpoint device created by the RPMSG_DESTROY_EPT_IOCTL
  24. * control.
  25. */
  26. int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data);
  27. #else /*IS_ENABLED(CONFIG_RPMSG_CHAR) */
  28. static inline int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,
  29. struct rpmsg_channel_info chinfo)
  30. {
  31. return -ENXIO;
  32. }
  33. static inline int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data)
  34. {
  35. return -ENXIO;
  36. }
  37. #endif /*IS_ENABLED(CONFIG_RPMSG_CHAR) */
  38. #endif /*__RPMSG_CHRDEV_H__ */