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