diff options
Diffstat (limited to 'sound/soc/samsung/speyside.c')
-rw-r--r-- | sound/soc/samsung/speyside.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c index 6ec44a354a6d..1e51750fd3a2 100644 --- a/sound/soc/samsung/speyside.c +++ b/sound/soc/samsung/speyside.c | |||
@@ -14,6 +14,33 @@ | |||
14 | 14 | ||
15 | #include "../codecs/wm8915.h" | 15 | #include "../codecs/wm8915.h" |
16 | 16 | ||
17 | static int speyside_set_bias_level(struct snd_soc_card *card, | ||
18 | enum snd_soc_bias_level level) | ||
19 | { | ||
20 | struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; | ||
21 | int ret; | ||
22 | |||
23 | switch (level) { | ||
24 | case SND_SOC_BIAS_STANDBY: | ||
25 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8915_SYSCLK_MCLK1, | ||
26 | 32768, SND_SOC_CLOCK_IN); | ||
27 | if (ret < 0) | ||
28 | return ret; | ||
29 | |||
30 | ret = snd_soc_dai_set_pll(codec_dai, WM8915_FLL_MCLK1, | ||
31 | 0, 0, 0); | ||
32 | if (ret < 0) { | ||
33 | pr_err("Failed to stop FLL\n"); | ||
34 | return ret; | ||
35 | } | ||
36 | |||
37 | default: | ||
38 | break; | ||
39 | } | ||
40 | |||
41 | return 0; | ||
42 | } | ||
43 | |||
17 | static int speyside_hw_params(struct snd_pcm_substream *substream, | 44 | static int speyside_hw_params(struct snd_pcm_substream *substream, |
18 | struct snd_pcm_hw_params *params) | 45 | struct snd_pcm_hw_params *params) |
19 | { | 46 | { |
@@ -51,6 +78,13 @@ static struct snd_soc_ops speyside_ops = { | |||
51 | .hw_params = speyside_hw_params, | 78 | .hw_params = speyside_hw_params, |
52 | }; | 79 | }; |
53 | 80 | ||
81 | static int speyside_wm8915_init(struct snd_soc_pcm_runtime *rtd) | ||
82 | { | ||
83 | struct snd_soc_dai *dai = rtd->codec_dai; | ||
84 | |||
85 | return snd_soc_dai_set_sysclk(dai, WM8915_SYSCLK_MCLK1, 32768, 0); | ||
86 | } | ||
87 | |||
54 | static struct snd_soc_dai_link speyside_dai[] = { | 88 | static struct snd_soc_dai_link speyside_dai[] = { |
55 | { | 89 | { |
56 | .name = "CPU", | 90 | .name = "CPU", |
@@ -59,6 +93,7 @@ static struct snd_soc_dai_link speyside_dai[] = { | |||
59 | .codec_dai_name = "wm8915-aif1", | 93 | .codec_dai_name = "wm8915-aif1", |
60 | .platform_name = "samsung-audio", | 94 | .platform_name = "samsung-audio", |
61 | .codec_name = "wm8915.1-001a", | 95 | .codec_name = "wm8915.1-001a", |
96 | .init = speyside_wm8915_init, | ||
62 | .ops = &speyside_ops, | 97 | .ops = &speyside_ops, |
63 | }, | 98 | }, |
64 | }; | 99 | }; |
@@ -91,6 +126,8 @@ static struct snd_soc_card speyside = { | |||
91 | .dai_link = speyside_dai, | 126 | .dai_link = speyside_dai, |
92 | .num_links = ARRAY_SIZE(speyside_dai), | 127 | .num_links = ARRAY_SIZE(speyside_dai), |
93 | 128 | ||
129 | .set_bias_level = speyside_set_bias_level, | ||
130 | |||
94 | .dapm_widgets = widgets, | 131 | .dapm_widgets = widgets, |
95 | .num_dapm_widgets = ARRAY_SIZE(widgets), | 132 | .num_dapm_widgets = ARRAY_SIZE(widgets), |
96 | .dapm_routes = audio_paths, | 133 | .dapm_routes = audio_paths, |