Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84e6857d authored by Anish Kumar's avatar Anish Kumar Committed by Jeevan Shriram
Browse files

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: default avatarAnish Kumar <kanish@codeaurora.org>
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
parent 90c59a8a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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;