summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-pcm.c
diff options
context:
space:
mode:
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>2018-07-02 11:59:54 -0400
committerMark Brown <broonie@kernel.org>2018-07-03 11:38:29 -0400
commita655de808cbde6c58b3298e704d786b53f59fb5d (patch)
treef096c0994bbebf6ea7fbdc1660bf09949ccb38dd /sound/soc/soc-pcm.c
parent2bd368d7bf21028f37a123041a138922254d4840 (diff)
ASoC: core: Allow topology to override machine driver FE DAI link config.
Machine drivers statically define a number of DAI links that currently cannot be changed or removed by topology. This means PCMs and platform components cannot be changed by topology at runtime AND machine drivers are tightly coupled to topology. This patch allows topology to override the machine driver DAI link config in order to reuse machine drivers with different topologies and platform components. The patch supports :- 1) create new FE PCMs with a topology defined PCM ID. 2) destroy existing static FE PCMs 3) change the platform component driver. 4) assign any new HW params fixups. 5) assign a new card name prefix to differentiate this topology to userspace. The patch requires no changes to the machine drivers, but does add some platform component flags that the platform component driver can assign before loading topologies. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r--sound/soc/soc-pcm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index c2a31b51da4f..b7e67b871c0c 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -859,8 +859,20 @@ int soc_dai_hw_params(struct snd_pcm_substream *substream,
859 struct snd_pcm_hw_params *params, 859 struct snd_pcm_hw_params *params,
860 struct snd_soc_dai *dai) 860 struct snd_soc_dai *dai)
861{ 861{
862 struct snd_soc_pcm_runtime *rtd = substream->private_data;
862 int ret; 863 int ret;
863 864
865 /* perform any topology hw_params fixups before DAI */
866 if (rtd->dai_link->be_hw_params_fixup) {
867 ret = rtd->dai_link->be_hw_params_fixup(rtd, params);
868 if (ret < 0) {
869 dev_err(rtd->dev,
870 "ASoC: hw_params topology fixup failed %d\n",
871 ret);
872 return ret;
873 }
874 }
875
864 if (dai->driver->ops->hw_params) { 876 if (dai->driver->ops->hw_params) {
865 ret = dai->driver->ops->hw_params(substream, params, dai); 877 ret = dai->driver->ops->hw_params(substream, params, dai);
866 if (ret < 0) { 878 if (ret < 0) {