ASoC: rk817: Fix wrong component assignment

Should use dai->component instead of the fixed rtd->codec[0],
because codec may be addressed in multi-codecs situation,
Obviously, it's wrong. the dais' one is always RIGHT.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I97cd09aa0886e2b89f2c2f257defb228168e93b0
This commit is contained in:
Sugar Zhang
2023-02-15 16:37:21 +08:00
committed by Tao Huang
parent 150af0ebb0
commit 53c5baa3cd

View File

@@ -892,8 +892,7 @@ static int rk817_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
struct snd_soc_component *component = dai->component;
struct rk817_codec_priv *rk817 = snd_soc_component_get_drvdata(component);
unsigned int rate = params_rate(params);
unsigned char apll_cfg3_val;