aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-06 14:12:44 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-06 16:47:28 -0400
commit85e9e766380fe40e1937b8316e8aa867544f09f1 (patch)
tree8a5dc0bec9d4f2bf2018f4a2a8462f31e2f46223
parentcc4c670a416a36464443f465f0ddbdc9940d16dd (diff)
ASoC: Manage Speyside system clocking only in bias management
Now that the CODEC driver supports it defer configuration of the system clock until bias management which is a much more idiomatic place to do system power control and makes things a lot more happy when we're using both interfaces. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
-rw-r--r--sound/soc/samsung/speyside.c50
1 files changed, 40 insertions, 10 deletions
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c
index 99fb0337ba5d..2515dba9f4aa 100644
--- a/sound/soc/samsung/speyside.c
+++ b/sound/soc/samsung/speyside.c
@@ -42,11 +42,51 @@ static int speyside_set_bias_level(struct snd_soc_card *card,
42 pr_err("Failed to stop FLL\n"); 42 pr_err("Failed to stop FLL\n");
43 return ret; 43 return ret;
44 } 44 }
45 break;
46
47 default:
48 break;
49 }
50
51 return 0;
52}
53
54static int speyside_set_bias_level_post(struct snd_soc_card *card,
55 struct snd_soc_dapm_context *dapm,
56 enum snd_soc_bias_level level)
57{
58 struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
59 int ret;
60
61 if (dapm->dev != codec_dai->dev)
62 return 0;
63
64 switch (level) {
65 case SND_SOC_BIAS_PREPARE:
66 if (card->dapm.bias_level == SND_SOC_BIAS_STANDBY) {
67 ret = snd_soc_dai_set_pll(codec_dai, 0,
68 WM8915_FLL_MCLK2,
69 32768, 48000 * 256);
70 if (ret < 0) {
71 pr_err("Failed to start FLL\n");
72 return ret;
73 }
74
75 ret = snd_soc_dai_set_sysclk(codec_dai,
76 WM8915_SYSCLK_FLL,
77 48000 * 256,
78 SND_SOC_CLOCK_IN);
79 if (ret < 0)
80 return ret;
81 }
82 break;
45 83
46 default: 84 default:
47 break; 85 break;
48 } 86 }
49 87
88 card->dapm.bias_level = level;
89
50 return 0; 90 return 0;
51} 91}
52 92
@@ -70,16 +110,6 @@ static int speyside_hw_params(struct snd_pcm_substream *substream,
70 if (ret < 0) 110 if (ret < 0)
71 return ret; 111 return ret;
72 112
73 ret = snd_soc_dai_set_pll(codec_dai, 0, WM8915_FLL_MCLK2,
74 32768, 256 * 48000);
75 if (ret < 0)
76 return ret;
77
78 ret = snd_soc_dai_set_sysclk(codec_dai, WM8915_SYSCLK_FLL,
79 256 * 48000, SND_SOC_CLOCK_IN);
80 if (ret < 0)
81 return ret;
82
83 return 0; 113 return 0;
84} 114}
85 115