cdp_txrx_bus.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * @file cdp_txrx_bus.h
  20. * @brief Define the host data path bus related functions
  21. */
  22. #ifndef _CDP_TXRX_BUS_H_
  23. #define _CDP_TXRX_BUS_H_
  24. /**
  25. * cdp_bus_suspend() - suspend bus
  26. * @soc - data path soc handle
  27. * @ppdev: data path pdev handle
  28. *
  29. * suspend bus
  30. *
  31. * return QDF_STATUS_SUCCESS suspend is not implemented or suspend done
  32. */
  33. static inline QDF_STATUS cdp_bus_suspend(ol_txrx_soc_handle soc,
  34. struct cdp_pdev *ppdev)
  35. {
  36. if (!soc || !soc->ops || !soc->ops->bus_ops) {
  37. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  38. "%s invalid instance", __func__);
  39. return QDF_STATUS_E_INVAL;
  40. }
  41. if (soc->ops->bus_ops->bus_suspend)
  42. return soc->ops->bus_ops->bus_suspend(ppdev);
  43. return QDF_STATUS_E_NOSUPPORT;
  44. }
  45. /**
  46. * cdp_bus_resume() - resume bus
  47. * @soc - data path soc handle
  48. * @ppdev: data path pdev handle
  49. *
  50. * resume bus
  51. *
  52. * return QDF_STATUS_SUCCESS resume is not implemented or suspend done
  53. */
  54. static inline QDF_STATUS cdp_bus_resume(ol_txrx_soc_handle soc,
  55. struct cdp_pdev *ppdev)
  56. {
  57. if (!soc || !soc->ops || !soc->ops->bus_ops) {
  58. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  59. "%s invalid instance", __func__);
  60. return QDF_STATUS_E_INVAL;
  61. }
  62. if (soc->ops->bus_ops->bus_resume)
  63. return soc->ops->bus_ops->bus_resume(ppdev);
  64. return QDF_STATUS_E_NOSUPPORT;
  65. }
  66. #endif /* _CDP_TXRX_BUS_H_ */