diff options
author | Anish Kumar <kanish@codeaurora.org> | 2014-09-09 00:57:49 -0700 |
---|---|---|
committer | Jeevan Shriram <jshriram@codeaurora.org> | 2016-05-18 13:42:47 -0700 |
commit | 84e6857d3d454a427b72a07476e4b7a5b9a1361b (patch) | |
tree | d47c1f62b827f0d9a296b72c089663661c928c22 /sound/soc | |
parent | 90c59a8af3fdc5a501b3e1510978a4c665571225 (diff) |
ASoC: pcm: Add support for fixup callback
Fixup callback is added for dais which
do not follow the FE and BE convention
and is directly controlled by userspace
such as hostless dais. This will restrict
the hw_params based on what is supported by
hardware rather than blindly setting what
is given by userspace.
Change-Id: I401c70ab5de1df10363ec808cb68f72d8d74af96
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-pcm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 256b7e210f31..b4ffe3904dcc 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -887,6 +887,16 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); + /* perform any hw_params fixups */ + if ((rtd->dai_link->no_host_mode == SND_SOC_DAI_LINK_NO_HOST) && + rtd->dai_link->be_hw_params_fixup) { + ret = rtd->dai_link->be_hw_params_fixup(rtd, + params); + if (ret < 0) + dev_err(rtd->card->dev, "ASoC: fixup failed for %s\n", + rtd->dai_link->name); + } + ret = soc_pcm_params_symmetry(substream, params); if (ret) goto out; |