diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-04-12 02:42:25 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-04-13 13:02:01 -0400 |
commit | ea3e98e75a6f38522450b66e22e34267977915ef (patch) | |
tree | af68006a93184486ce4dcb57e39c7bb491158725 /sound | |
parent | ea0a591a28b9249ea585f2cf8045e43f57f48fbb (diff) |
ASoC: Support the sub speaker driver on Speyside
Speyside includes a WM9081 configured as an external speaker driver taking
an analogue input from HPOUT2 on the WM8915 on the system. Add support for
this to the driver, using a prefix of "Sub" for the WM9081 controls to
ensure we avoid collisions with controls on the WM8915.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/samsung/Kconfig | 1 | ||||
-rw-r--r-- | sound/soc/samsung/speyside.c | 34 |
2 files changed, 35 insertions, 0 deletions
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 726af2ede795..459566bfcd35 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig | |||
@@ -176,3 +176,4 @@ config SND_SOC_SPEYSIDE | |||
176 | depends on SND_SOC_SAMSUNG && MACH_WLF_CRAGG_6410 | 176 | depends on SND_SOC_SAMSUNG && MACH_WLF_CRAGG_6410 |
177 | select SND_SAMSUNG_I2S | 177 | select SND_SAMSUNG_I2S |
178 | select SND_SOC_WM8915 | 178 | select SND_SOC_WM8915 |
179 | select SND_SOC_WM9081 | ||
diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c index 1e51750fd3a2..0adaf7fe6814 100644 --- a/sound/soc/samsung/speyside.c +++ b/sound/soc/samsung/speyside.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <sound/soc-dapm.h> | 13 | #include <sound/soc-dapm.h> |
14 | 14 | ||
15 | #include "../codecs/wm8915.h" | 15 | #include "../codecs/wm8915.h" |
16 | #include "../codecs/wm9081.h" | ||
16 | 17 | ||
17 | static int speyside_set_bias_level(struct snd_soc_card *card, | 18 | static int speyside_set_bias_level(struct snd_soc_card *card, |
18 | enum snd_soc_bias_level level) | 19 | enum snd_soc_bias_level level) |
@@ -98,6 +99,30 @@ static struct snd_soc_dai_link speyside_dai[] = { | |||
98 | }, | 99 | }, |
99 | }; | 100 | }; |
100 | 101 | ||
102 | static int speyside_wm9081_init(struct snd_soc_dapm_context *dapm) | ||
103 | { | ||
104 | snd_soc_dapm_nc_pin(dapm, "LINEOUT"); | ||
105 | |||
106 | /* At any time the WM9081 is active it will have this clock */ | ||
107 | return snd_soc_codec_set_sysclk(dapm->codec, WM9081_SYSCLK_MCLK, | ||
108 | 48000 * 256, 0); | ||
109 | } | ||
110 | |||
111 | static struct snd_soc_aux_dev speyside_aux_dev[] = { | ||
112 | { | ||
113 | .name = "wm9081", | ||
114 | .codec_name = "wm9081.1-006c", | ||
115 | .init = speyside_wm9081_init, | ||
116 | }, | ||
117 | }; | ||
118 | |||
119 | static struct snd_soc_codec_conf speyside_codec_conf[] = { | ||
120 | { | ||
121 | .dev_name = "wm9081.1-006c", | ||
122 | .name_prefix = "Sub", | ||
123 | }, | ||
124 | }; | ||
125 | |||
101 | static struct snd_soc_dapm_widget widgets[] = { | 126 | static struct snd_soc_dapm_widget widgets[] = { |
102 | SND_SOC_DAPM_HP("Headphone", NULL), | 127 | SND_SOC_DAPM_HP("Headphone", NULL), |
103 | 128 | ||
@@ -118,6 +143,11 @@ static struct snd_soc_dapm_route audio_paths[] = { | |||
118 | { "Headphone", NULL, "HPOUT1L" }, | 143 | { "Headphone", NULL, "HPOUT1L" }, |
119 | { "Headphone", NULL, "HPOUT1R" }, | 144 | { "Headphone", NULL, "HPOUT1R" }, |
120 | 145 | ||
146 | { "Sub IN1", NULL, "HPOUT2L" }, | ||
147 | { "Sub IN2", NULL, "HPOUT2R" }, | ||
148 | |||
149 | { "Main Speaker", NULL, "Sub SPKN" }, | ||
150 | { "Main Speaker", NULL, "Sub SPKP" }, | ||
121 | { "Main Speaker", NULL, "SPKDAT" }, | 151 | { "Main Speaker", NULL, "SPKDAT" }, |
122 | }; | 152 | }; |
123 | 153 | ||
@@ -125,6 +155,10 @@ static struct snd_soc_card speyside = { | |||
125 | .name = "Speyside", | 155 | .name = "Speyside", |
126 | .dai_link = speyside_dai, | 156 | .dai_link = speyside_dai, |
127 | .num_links = ARRAY_SIZE(speyside_dai), | 157 | .num_links = ARRAY_SIZE(speyside_dai), |
158 | .aux_dev = speyside_aux_dev, | ||
159 | .num_aux_devs = ARRAY_SIZE(speyside_aux_dev), | ||
160 | .codec_conf = speyside_codec_conf, | ||
161 | .num_configs = ARRAY_SIZE(speyside_codec_conf), | ||
128 | 162 | ||
129 | .set_bias_level = speyside_set_bias_level, | 163 | .set_bias_level = speyside_set_bias_level, |
130 | 164 | ||