Commit 914f674b authored by Shuming Fan's avatar Shuming Fan Committed by Mark Brown

ASoC: rt5682: move DAI clock registry to I2S mode

The SoundWire mode doesn't need the DAI clocks.
Therefore, the DAI clock registry moves to I2S mode case.
Signed-off-by: default avatarShuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20200327073849.18291-1-shumingf@realtek.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 17fb5433
...@@ -2856,6 +2856,16 @@ static int rt5682_probe(struct snd_soc_component *component) ...@@ -2856,6 +2856,16 @@ static int rt5682_probe(struct snd_soc_component *component)
#endif #endif
rt5682->component = component; rt5682->component = component;
if (rt5682->is_sdw) {
slave = rt5682->slave;
time = wait_for_completion_timeout(
&slave->initialization_complete,
msecs_to_jiffies(RT5682_PROBE_TIMEOUT));
if (!time) {
dev_err(&slave->dev, "Initialization not complete, timed out\n");
return -ETIMEDOUT;
}
} else {
#ifdef CONFIG_COMMON_CLK #ifdef CONFIG_COMMON_CLK
/* Check if MCLK provided */ /* Check if MCLK provided */
rt5682->mclk = devm_clk_get(component->dev, "mclk"); rt5682->mclk = devm_clk_get(component->dev, "mclk");
...@@ -2865,26 +2875,15 @@ static int rt5682_probe(struct snd_soc_component *component) ...@@ -2865,26 +2875,15 @@ static int rt5682_probe(struct snd_soc_component *component)
return ret; return ret;
} }
rt5682->mclk = NULL; rt5682->mclk = NULL;
} } else {
/* Register CCF DAI clock control */ /* Register CCF DAI clock control */
ret = rt5682_register_dai_clks(component); ret = rt5682_register_dai_clks(component);
if (ret) if (ret)
return ret; return ret;
}
/* Initial setup for CCF */ /* Initial setup for CCF */
rt5682->lrck[RT5682_AIF1] = CLK_48; rt5682->lrck[RT5682_AIF1] = CLK_48;
#endif #endif
if (rt5682->is_sdw) {
slave = rt5682->slave;
time = wait_for_completion_timeout(
&slave->initialization_complete,
msecs_to_jiffies(RT5682_PROBE_TIMEOUT));
if (!time) {
dev_err(&slave->dev, "Initialization not complete, timed out\n");
return -ETIMEDOUT;
}
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment