hda-mlink.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
  2. /*
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * Copyright(c) 2022-2023 Intel Corporation
  7. */
  8. struct hdac_bus;
  9. struct hdac_ext_link;
  10. #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_MLINK)
  11. int hda_bus_ml_init(struct hdac_bus *bus);
  12. void hda_bus_ml_free(struct hdac_bus *bus);
  13. int hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid);
  14. void hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable);
  15. bool hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid);
  16. int hdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd);
  17. int hdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd);
  18. int hdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid);
  19. int hdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus);
  20. void hdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
  21. void hdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink);
  22. int hdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid);
  23. int hdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus);
  24. bool hdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid);
  25. bool hdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus);
  26. int hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink);
  27. int hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
  28. int hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink);
  29. int hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink);
  30. int hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink);
  31. int hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink);
  32. int hdac_bus_eml_sdw_get_lsdiid_unlocked(struct hdac_bus *bus, int sublink, u16 *lsdiid);
  33. int hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num);
  34. int hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,
  35. int channel_mask, int stream_id, int dir);
  36. void hda_bus_ml_put_all(struct hdac_bus *bus);
  37. void hda_bus_ml_reset_losidv(struct hdac_bus *bus);
  38. int hda_bus_ml_resume(struct hdac_bus *bus);
  39. int hda_bus_ml_suspend(struct hdac_bus *bus);
  40. struct hdac_ext_link *hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus);
  41. struct hdac_ext_link *hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus);
  42. struct hdac_ext_link *hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus);
  43. struct mutex *hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid);
  44. int hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable);
  45. #else
  46. static inline int
  47. hda_bus_ml_init(struct hdac_bus *bus) { return 0; }
  48. static inline void hda_bus_ml_free(struct hdac_bus *bus) { }
  49. static inline int
  50. hdac_bus_eml_get_count(struct hdac_bus *bus, bool alt, int elid) { return 0; }
  51. static inline void
  52. hdac_bus_eml_enable_interrupt(struct hdac_bus *bus, bool alt, int elid, bool enable) { }
  53. static inline bool
  54. hdac_bus_eml_check_interrupt(struct hdac_bus *bus, bool alt, int elid) { return false; }
  55. static inline int
  56. hdac_bus_eml_set_syncprd_unlocked(struct hdac_bus *bus, bool alt, int elid, u32 syncprd)
  57. {
  58. return 0;
  59. }
  60. static inline int
  61. hdac_bus_eml_sdw_set_syncprd_unlocked(struct hdac_bus *bus, u32 syncprd)
  62. {
  63. return 0;
  64. }
  65. static inline int
  66. hdac_bus_eml_wait_syncpu_unlocked(struct hdac_bus *bus, bool alt, int elid)
  67. {
  68. return 0;
  69. }
  70. static inline int
  71. hdac_bus_eml_sdw_wait_syncpu_unlocked(struct hdac_bus *bus) { return 0; }
  72. static inline void
  73. hdac_bus_eml_sync_arm_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink) { }
  74. static inline void
  75. hdac_bus_eml_sdw_sync_arm_unlocked(struct hdac_bus *bus, int sublink) { }
  76. static inline int
  77. hdac_bus_eml_sync_go_unlocked(struct hdac_bus *bus, bool alt, int elid) { return 0; }
  78. static inline int
  79. hdac_bus_eml_sdw_sync_go_unlocked(struct hdac_bus *bus) { return 0; }
  80. static inline bool
  81. hdac_bus_eml_check_cmdsync_unlocked(struct hdac_bus *bus, bool alt, int elid) { return false; }
  82. static inline bool
  83. hdac_bus_eml_sdw_check_cmdsync_unlocked(struct hdac_bus *bus) { return false; }
  84. static inline int
  85. hdac_bus_eml_power_up(struct hdac_bus *bus, bool alt, int elid, int sublink)
  86. {
  87. return 0;
  88. }
  89. static inline int
  90. hdac_bus_eml_power_up_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
  91. {
  92. return 0;
  93. }
  94. static inline int
  95. hdac_bus_eml_power_down(struct hdac_bus *bus, bool alt, int elid, int sublink)
  96. {
  97. return 0;
  98. }
  99. static inline int
  100. hdac_bus_eml_power_down_unlocked(struct hdac_bus *bus, bool alt, int elid, int sublink)
  101. {
  102. return 0;
  103. }
  104. static inline int
  105. hdac_bus_eml_sdw_power_up_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
  106. static inline int
  107. hdac_bus_eml_sdw_power_down_unlocked(struct hdac_bus *bus, int sublink) { return 0; }
  108. static inline int
  109. hdac_bus_eml_sdw_get_lsdiid_unlocked(struct hdac_bus *bus, int sublink, u16 *lsdiid) { return 0; }
  110. static inline int
  111. hdac_bus_eml_sdw_set_lsdiid(struct hdac_bus *bus, int sublink, int dev_num) { return 0; }
  112. static inline int
  113. hdac_bus_eml_sdw_map_stream_ch(struct hdac_bus *bus, int sublink, int y,
  114. int channel_mask, int stream_id, int dir)
  115. {
  116. return 0;
  117. }
  118. static inline void hda_bus_ml_put_all(struct hdac_bus *bus) { }
  119. static inline void hda_bus_ml_reset_losidv(struct hdac_bus *bus) { }
  120. static inline int hda_bus_ml_resume(struct hdac_bus *bus) { return 0; }
  121. static inline int hda_bus_ml_suspend(struct hdac_bus *bus) { return 0; }
  122. static inline struct hdac_ext_link *
  123. hdac_bus_eml_ssp_get_hlink(struct hdac_bus *bus) { return NULL; }
  124. static inline struct hdac_ext_link *
  125. hdac_bus_eml_dmic_get_hlink(struct hdac_bus *bus) { return NULL; }
  126. static inline struct hdac_ext_link *
  127. hdac_bus_eml_sdw_get_hlink(struct hdac_bus *bus) { return NULL; }
  128. static inline struct mutex *
  129. hdac_bus_eml_get_mutex(struct hdac_bus *bus, bool alt, int elid) { return NULL; }
  130. static inline int
  131. hdac_bus_eml_enable_offload(struct hdac_bus *bus, bool alt, int elid, bool enable)
  132. {
  133. return 0;
  134. }
  135. #endif /* CONFIG_SND_SOC_SOF_HDA_MLINK */