Commit 60507fe1 authored by Matthias Reichl's avatar Matthias Reichl Committed by Mark Brown

ASoC: bcm2835: setup clock only if CPU is clock master

We only need to enable the clock if we are a clock master.

Code ported from bcm2708-i2s driver in Raspberry Pi tree.
Original work by Zoltan Szenczi.
Signed-off-by: default avatarMatthias Reichl <hias@horus.com>
Signed-off-by: default avatarMartin Sperl <kernel@martin.sperl.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a34b027d
...@@ -276,8 +276,15 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -276,8 +276,15 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream,
/* otherwise calculate a fitting block ratio */ /* otherwise calculate a fitting block ratio */
bclk_ratio = 2 * data_length; bclk_ratio = 2 * data_length;
/* set target clock rate*/ /* Clock should only be set up here if CPU is clock master */
switch (dev->fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS:
case SND_SOC_DAIFMT_CBS_CFM:
clk_set_rate(dev->clk, sampling_rate * bclk_ratio); clk_set_rate(dev->clk, sampling_rate * bclk_ratio);
break;
default:
break;
}
/* Setup the frame format */ /* Setup the frame format */
format = BCM2835_I2S_CHEN; format = BCM2835_I2S_CHEN;
......
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