aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Lu <[email protected]>2024-04-26 10:25:28 -0500
committerMark Brown <[email protected]>2024-04-29 23:49:20 +0900
commit4524b1e3ef7884e0a54484dce8d921be7a06af13 (patch)
tree762f345794ad52bbddc349142e6f2c60ed33f4e2
parentb5aaf6a56dcafc2aeefdc7da1f9f86fa5cfa8df7 (diff)
ASoC: Intel: sof-rt5682: get bclk frequency from topology
A different bclk frequency 3.072MHz was introduced to tgl platform and is used in mtl topologies. Use SOF API to get frequency from topology instead of hardcoding. Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Brent Lu <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/intel/boards/sof_rt5682.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
index 6a79dd5271cc..c3b026868653 100644
--- a/sound/soc/intel/boards/sof_rt5682.c
+++ b/sound/soc/intel/boards/sof_rt5682.c
@@ -317,7 +317,12 @@ static int sof_rt5682_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
- pll_in = params_rate(params) * 50;
+ /* get the tplg configured bclk. */
+ pll_in = sof_dai_get_bclk(rtd);
+ if (pll_in <= 0) {
+ dev_err(rtd->dev, "invalid bclk freq %d\n", pll_in);
+ return -EINVAL;
+ }
}
pll_out = params_rate(params) * 512;