Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248303
b: refs/heads/master
c: 0754139
h: refs/heads/master
i:
  248301: 25c5bd0
  248299: 9b0346f
  248295: 311c163
  248287: f42bb4e
v: v3
  • Loading branch information
Stephen Warren authored and Mark Brown committed Apr 20, 2011
1 parent 1cff20e commit cac388c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: acb8303f15768c72796f3f95bb32a955333e0fbc
refs/heads/master: 075413966a6ea389f78f4cc2e957708c1d6db8c5
9 changes: 5 additions & 4 deletions trunk/sound/soc/tegra/tegra_asoc_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
#include "tegra_asoc_utils.h"

int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
int mclk, int *mclk_change)
int mclk)
{
int new_baseclock;
bool clk_change;
int err;

switch (srate) {
Expand All @@ -52,10 +53,10 @@ int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
return -EINVAL;
}

*mclk_change = ((new_baseclock != data->set_baseclock) ||
clk_change = ((new_baseclock != data->set_baseclock) ||
(mclk != data->set_mclk));
if (!*mclk_change)
return 0;
if (!clk_change)
return 0;

data->set_baseclock = 0;
data->set_mclk = 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/tegra/tegra_asoc_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct tegra_asoc_utils_data {
};

int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
int mclk, int *mclk_change);
int mclk);
int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data,
struct device *dev);
void tegra_asoc_utils_fini(struct tegra_asoc_utils_data *data);
Expand Down
17 changes: 7 additions & 10 deletions trunk/sound/soc/tegra/tegra_wm8903.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_card *card = codec->card;
struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
int srate, mclk, mclk_change;
int srate, mclk;
int err;

srate = params_rate(params);
Expand All @@ -90,8 +90,7 @@ static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream,
while (mclk < 6000000)
mclk *= 2;

err = tegra_asoc_utils_set_rate(&machine->util_data, srate, mclk,
&mclk_change);
err = tegra_asoc_utils_set_rate(&machine->util_data, srate, mclk);
if (err < 0) {
dev_err(card->dev, "Can't configure clocks\n");
return err;
Expand All @@ -115,13 +114,11 @@ static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream,
return err;
}

if (mclk_change) {
err = snd_soc_dai_set_sysclk(codec_dai, 0, mclk,
SND_SOC_CLOCK_IN);
if (err < 0) {
dev_err(card->dev, "codec_dai clock not set\n");
return err;
}
err = snd_soc_dai_set_sysclk(codec_dai, 0, mclk,
SND_SOC_CLOCK_IN);
if (err < 0) {
dev_err(card->dev, "codec_dai clock not set\n");
return err;
}

return 0;
Expand Down

0 comments on commit cac388c

Please sign in to comment.