Skip to contentSkip to conversation

ASoC: SDCA: export sdca_asoc_populate_rate_format() helper

PATCH In review [email protected] 2 participants 2 messages Jul 29 – Jul 30

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 2/3 ASoC: SDCA: export sdca_asoc_populate_rate_format() helper

From: Shuming Fan <[email protected]>

Export populate_rate_format() as sdca_asoc_populate_rate_format() so that it can be used by codec drivers.
The codec driver could get rate and format information for the IT/OT entity.

---
 include/sound/sdca_asoc.h  | 7 +++++++
 sound/soc/sdca/sdca_asoc.c | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)
include/sound/sdca_asoc.h +7 -0
index ca35d5a44370..d3024c3b38b9 100644
@@ -25,6 +25,8 @@ struct snd_soc_dai_driver;
 struct snd_soc_dai_ops;
 struct snd_soc_dapm_route;
 struct snd_soc_dapm_widget;
+struct snd_soc_pcm_stream;
+struct sdca_entity;
 
 /* convenient macro to handle the mono volume in 7.8 fixed format representation */
 #define SDCA_SINGLE_Q78_TLV(xname, xreg, xmin, xmax, xstep, tlv_array) \
@@ -82,6 +84,11 @@ int sdca_asoc_populate_component(struct device *dev,
 				 struct snd_soc_dai_driver **dai_drv, int *num_dai_drv,
 				 const struct snd_soc_dai_ops *ops);
 
+int sdca_asoc_populate_rate_format(struct device *dev,
+				struct sdca_function_data *function,
+				struct sdca_entity *entity,
+				struct snd_soc_pcm_stream *stream);
+
 int sdca_asoc_set_constraints(struct device *dev, struct regmap *regmap,
 			      struct sdca_function_data *function,
 			      struct snd_pcm_substream *substream,
sound/soc/sdca/sdca_asoc.c +3 -2
index b4dedba719dc..9a6c0036b7be 100644
@@ -1231,7 +1231,7 @@ static u64 width_find_mask(unsigned int bits)
 	}
 }
 
-static int populate_rate_format(struct device *dev,
+int sdca_asoc_populate_rate_format(struct device *dev,
 				struct sdca_function_data *function,
 				struct sdca_entity *entity,
 				struct snd_soc_pcm_stream *stream)
@@ -1292,6 +1292,7 @@ static int populate_rate_format(struct device *dev,
 
 	return 0;
 }
+EXPORT_SYMBOL_NS(sdca_asoc_populate_rate_format, "SND_SOC_SDCA");
 
 /**
  * sdca_asoc_populate_dais - fill in an array of DAI drivers for a Function
@@ -1344,7 +1345,7 @@ int sdca_asoc_populate_dais(struct device *dev, struct sdca_function_data *funct
 		stream->channels_min = 1;
 		stream->channels_max = SDCA_MAX_CHANNEL_COUNT;
 
-		ret = populate_rate_format(dev, function, entity, stream);
+		ret = sdca_asoc_populate_rate_format(dev, function, entity, stream);
 		if (ret)
 			return ret;
 
Signature · 1 line
2.54.0