xref: /openbmc/linux/sound/soc/qcom/common.h (revision 79d949a2)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (c) 2018, The Linux Foundation. All rights reserved.
3 
4 #ifndef __QCOM_SND_COMMON_H__
5 #define __QCOM_SND_COMMON_H__
6 
7 #include <sound/soc.h>
8 #include <linux/soundwire/sdw.h>
9 
10 int qcom_snd_parse_of(struct snd_soc_card *card);
11 int qcom_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd,
12 			    struct snd_soc_jack *jack, bool *jack_setup);
13 
14 #if IS_ENABLED(CONFIG_SOUNDWIRE)
15 int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream,
16 			 struct sdw_stream_runtime *runtime,
17 			 bool *stream_prepared);
18 int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream,
19 			   struct snd_pcm_hw_params *params,
20 			   struct sdw_stream_runtime **psruntime);
21 int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream,
22 			 struct sdw_stream_runtime *sruntime,
23 			 bool *stream_prepared);
24 #else
25 static inline int qcom_snd_sdw_prepare(struct snd_pcm_substream *substream,
26 				       struct sdw_stream_runtime *runtime,
27 				       bool *stream_prepared)
28 {
29 	return -ENOTSUPP;
30 }
31 
32 static inline int qcom_snd_sdw_hw_params(struct snd_pcm_substream *substream,
33 					 struct snd_pcm_hw_params *params,
34 					 struct sdw_stream_runtime **psruntime)
35 {
36 	return -ENOTSUPP;
37 }
38 
39 static inline int qcom_snd_sdw_hw_free(struct snd_pcm_substream *substream,
40 				       struct sdw_stream_runtime *sruntime,
41 				       bool *stream_prepared)
42 {
43 	return -ENOTSUPP;
44 }
45 #endif
46 #endif
47