hda-sdw-bpt.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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) 2025 Intel Corporation.
  7. */
  8. #ifndef __HDA_SDW_BPT_H
  9. #define __HDA_SDW_BPT_H
  10. #include <linux/device.h>
  11. struct hdac_ext_stream;
  12. struct snd_dma_buffer;
  13. #if IS_ENABLED(CONFIG_SND_SOF_SOF_HDA_SDW_BPT)
  14. int hda_sdw_bpt_open(struct device *dev, int link_id, struct hdac_ext_stream **bpt_tx_stream,
  15. struct snd_dma_buffer *dmab_tx_bdl, u32 bpt_tx_num_bytes,
  16. u32 tx_dma_bandwidth, struct hdac_ext_stream **bpt_rx_stream,
  17. struct snd_dma_buffer *dmab_rx_bdl, u32 bpt_rx_num_bytes,
  18. u32 rx_dma_bandwidth);
  19. int hda_sdw_bpt_send_async(struct device *dev, struct hdac_ext_stream *bpt_tx_stream,
  20. struct hdac_ext_stream *bpt_rx_stream);
  21. int hda_sdw_bpt_wait(struct device *dev, struct hdac_ext_stream *bpt_tx_stream,
  22. struct hdac_ext_stream *bpt_rx_stream);
  23. int hda_sdw_bpt_close(struct device *dev, struct hdac_ext_stream *bpt_tx_stream,
  24. struct snd_dma_buffer *dmab_tx_bdl, struct hdac_ext_stream *bpt_rx_stream,
  25. struct snd_dma_buffer *dmab_rx_bdl);
  26. unsigned int hda_sdw_bpt_get_buf_size_alignment(unsigned int dma_bandwidth);
  27. #else
  28. static inline int hda_sdw_bpt_open(struct device *dev, int link_id,
  29. struct hdac_ext_stream **bpt_tx_stream,
  30. struct snd_dma_buffer *dmab_tx_bdl, u32 bpt_tx_num_bytes,
  31. u32 tx_dma_bandwidth, struct hdac_ext_stream **bpt_rx_stream,
  32. struct snd_dma_buffer *dmab_rx_bdl, u32 bpt_rx_num_bytes,
  33. u32 rx_dma_bandwidth)
  34. {
  35. WARN_ONCE(1, "SoundWire BPT is disabled");
  36. return -EOPNOTSUPP;
  37. }
  38. static inline int hda_sdw_bpt_send_async(struct device *dev, struct hdac_ext_stream *bpt_tx_stream,
  39. struct hdac_ext_stream *bpt_rx_stream)
  40. {
  41. WARN_ONCE(1, "SoundWire BPT is disabled");
  42. return -EOPNOTSUPP;
  43. }
  44. static inline int hda_sdw_bpt_wait(struct device *dev, struct hdac_ext_stream *bpt_tx_stream,
  45. struct hdac_ext_stream *bpt_rx_stream)
  46. {
  47. WARN_ONCE(1, "SoundWire BPT is disabled");
  48. return -EOPNOTSUPP;
  49. }
  50. static inline int hda_sdw_bpt_close(struct device *dev, struct hdac_ext_stream *bpt_tx_stream,
  51. struct snd_dma_buffer *dmab_tx_bdl,
  52. struct hdac_ext_stream *bpt_rx_stream,
  53. struct snd_dma_buffer *dmab_rx_bdl)
  54. {
  55. WARN_ONCE(1, "SoundWire BPT is disabled");
  56. return -EOPNOTSUPP;
  57. }
  58. static inline unsigned int hda_sdw_bpt_get_buf_size_alignment(unsigned int dma_bandwidth)
  59. {
  60. return 0;
  61. }
  62. #endif
  63. #endif /* __HDA_SDW_BPT_H */