xref: /linux/include/sound/sdca_asoc.h (revision bca53a176f3d46fdab67f9e2fb1a185e0233d98d)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * The MIPI SDCA specification is available for public downloads at
4  * https://www.mipi.org/mipi-sdca-v1-0-download
5  *
6  * Copyright (C) 2025 Cirrus Logic, Inc. and
7  *                    Cirrus Logic International Semiconductor Ltd.
8  */
9 
10 #ifndef __SDCA_ASOC_H__
11 #define __SDCA_ASOC_H__
12 
13 struct device;
14 struct regmap;
15 struct sdca_function_data;
16 struct snd_kcontrol_new;
17 struct snd_pcm_hw_params;
18 struct snd_pcm_substream;
19 struct snd_soc_component_driver;
20 struct snd_soc_dai;
21 struct snd_soc_dai_driver;
22 struct snd_soc_dai_ops;
23 struct snd_soc_dapm_route;
24 struct snd_soc_dapm_widget;
25 
26 int sdca_asoc_count_component(struct device *dev, struct sdca_function_data *function,
27 			      int *num_widgets, int *num_routes, int *num_controls,
28 			      int *num_dais);
29 
30 int sdca_asoc_populate_dapm(struct device *dev, struct sdca_function_data *function,
31 			    struct snd_soc_dapm_widget *widgets,
32 			    struct snd_soc_dapm_route *routes);
33 int sdca_asoc_populate_controls(struct device *dev,
34 				struct sdca_function_data *function,
35 				struct snd_kcontrol_new *kctl);
36 int sdca_asoc_populate_dais(struct device *dev, struct sdca_function_data *function,
37 			    struct snd_soc_dai_driver *dais,
38 			    const struct snd_soc_dai_ops *ops);
39 
40 int sdca_asoc_populate_component(struct device *dev,
41 				 struct sdca_function_data *function,
42 				 struct snd_soc_component_driver *component_drv,
43 				 struct snd_soc_dai_driver **dai_drv, int *num_dai_drv,
44 				 const struct snd_soc_dai_ops *ops);
45 
46 int sdca_asoc_set_constraints(struct device *dev, struct regmap *regmap,
47 			      struct sdca_function_data *function,
48 			      struct snd_pcm_substream *substream,
49 			      struct snd_soc_dai *dai);
50 void sdca_asoc_free_constraints(struct snd_pcm_substream *substream,
51 				struct snd_soc_dai *dai);
52 int sdca_asoc_get_port(struct device *dev, struct regmap *regmap,
53 		       struct sdca_function_data *function,
54 		       struct snd_soc_dai *dai);
55 int sdca_asoc_hw_params(struct device *dev, struct regmap *regmap,
56 			struct sdca_function_data *function,
57 			struct snd_pcm_substream *substream,
58 			struct snd_pcm_hw_params *params,
59 			struct snd_soc_dai *dai);
60 
61 #endif // __SDCA_ASOC_H__
62