Skip to content

Commit 571b69f

Browse files
TE-N-ShengjiuWangbroonie
authored andcommitted
ASoC: imx-audmix: remove cpu_mclk which is from cpu dai device
When defer probe happens, there may be below error: platform 59820000.sai: Resources present before probing The cpu_mclk clock is from the cpu dai device, if it is not released, then the cpu dai device probe will fail for the second time. The cpu_mclk is used to get rate for rate constraint, rate constraint may be specific for each platform, which is not necessary for machine driver, so remove it. Fixes: b86ef53 ("ASoC: fsl: Add Audio Mixer machine driver") Signed-off-by: Shengjiu Wang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent f684130 commit 571b69f

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

sound/soc/fsl/imx-audmix.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ struct imx_audmix {
2323
struct snd_soc_card card;
2424
struct platform_device *audmix_pdev;
2525
struct platform_device *out_pdev;
26-
struct clk *cpu_mclk;
2726
int num_dai;
2827
struct snd_soc_dai_link *dai;
2928
int num_dai_conf;
@@ -32,34 +31,11 @@ struct imx_audmix {
3231
struct snd_soc_dapm_route *dapm_routes;
3332
};
3433

35-
static const u32 imx_audmix_rates[] = {
36-
8000, 12000, 16000, 24000, 32000, 48000, 64000, 96000,
37-
};
38-
39-
static const struct snd_pcm_hw_constraint_list imx_audmix_rate_constraints = {
40-
.count = ARRAY_SIZE(imx_audmix_rates),
41-
.list = imx_audmix_rates,
42-
};
43-
4434
static int imx_audmix_fe_startup(struct snd_pcm_substream *substream)
4535
{
46-
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
47-
struct imx_audmix *priv = snd_soc_card_get_drvdata(rtd->card);
4836
struct snd_pcm_runtime *runtime = substream->runtime;
49-
struct device *dev = rtd->card->dev;
50-
unsigned long clk_rate = clk_get_rate(priv->cpu_mclk);
5137
int ret;
5238

53-
if (clk_rate % 24576000 == 0) {
54-
ret = snd_pcm_hw_constraint_list(runtime, 0,
55-
SNDRV_PCM_HW_PARAM_RATE,
56-
&imx_audmix_rate_constraints);
57-
if (ret < 0)
58-
return ret;
59-
} else {
60-
dev_warn(dev, "mclk may be not supported %lu\n", clk_rate);
61-
}
62-
6339
ret = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_CHANNELS,
6440
1, 8);
6541
if (ret < 0)
@@ -323,13 +299,6 @@ static int imx_audmix_probe(struct platform_device *pdev)
323299
}
324300
put_device(&cpu_pdev->dev);
325301

326-
priv->cpu_mclk = devm_clk_get(&cpu_pdev->dev, "mclk1");
327-
if (IS_ERR(priv->cpu_mclk)) {
328-
ret = PTR_ERR(priv->cpu_mclk);
329-
dev_err(&cpu_pdev->dev, "failed to get DAI mclk1: %d\n", ret);
330-
return ret;
331-
}
332-
333302
priv->audmix_pdev = audmix_pdev;
334303
priv->out_pdev = cpu_pdev;
335304

0 commit comments

Comments
 (0)