aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorCliff Cai <cliff.cai@analog.com>2008-11-18 03:18:16 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-11-18 06:40:18 -0500
commit9905ed35fdec0ebb3be8a724021ff3b104571667 (patch)
tree3dbd12ae20966881319d3e4576483b26d4c53e4a /sound/soc
parenta11311d71d59145d920c19c0a4eed3fa7e26d222 (diff)
ASoC: AD1980 codec: add multi-channel function support
We added multi-channel function to this codec driver and Blackfin ASoC driver as well. It was tested on Blackfin hardware. Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/ad1980.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index 1397b8e06c0b..410fed953c54 100644
--- a/sound/soc/codecs/ad1980.c
+++ b/sound/soc/codecs/ad1980.c
@@ -85,6 +85,9 @@ SOC_DOUBLE("Line HP Swap Switch", AC97_AD_MISC, 10, 5, 1, 0),
85SOC_DOUBLE("Surround Playback Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1), 85SOC_DOUBLE("Surround Playback Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1),
86SOC_DOUBLE("Surround Playback Switch", AC97_SURROUND_MASTER, 15, 7, 1, 1), 86SOC_DOUBLE("Surround Playback Switch", AC97_SURROUND_MASTER, 15, 7, 1, 1),
87 87
88SOC_DOUBLE("Center/LFE Playback Volume", AC97_CENTER_LFE_MASTER, 8, 0, 31, 1),
89SOC_DOUBLE("Center/LFE Playback Switch", AC97_CENTER_LFE_MASTER, 15, 7, 1, 1),
90
88SOC_ENUM("Capture Source", ad1980_cap_src), 91SOC_ENUM("Capture Source", ad1980_cap_src),
89 92
90SOC_SINGLE("Mic Boost Switch", AC97_MIC, 6, 1, 0), 93SOC_SINGLE("Mic Boost Switch", AC97_MIC, 6, 1, 0),
@@ -145,7 +148,7 @@ struct snd_soc_dai ad1980_dai = {
145 .playback = { 148 .playback = {
146 .stream_name = "Playback", 149 .stream_name = "Playback",
147 .channels_min = 2, 150 .channels_min = 2,
148 .channels_max = 2, 151 .channels_max = 6,
149 .rates = SNDRV_PCM_RATE_48000, 152 .rates = SNDRV_PCM_RATE_48000,
150 .formats = SNDRV_PCM_FMTBIT_S16_LE, }, 153 .formats = SNDRV_PCM_FMTBIT_S16_LE, },
151 .capture = { 154 .capture = {
@@ -192,6 +195,7 @@ static int ad1980_soc_probe(struct platform_device *pdev)
192 struct snd_soc_codec *codec; 195 struct snd_soc_codec *codec;
193 int ret = 0; 196 int ret = 0;
194 u16 vendor_id2; 197 u16 vendor_id2;
198 u16 ext_status;
195 199
196 printk(KERN_INFO "AD1980 SoC Audio Codec\n"); 200 printk(KERN_INFO "AD1980 SoC Audio Codec\n");
197 201
@@ -253,9 +257,16 @@ static int ad1980_soc_probe(struct platform_device *pdev)
253 "supported\n"); 257 "supported\n");
254 } 258 }
255 259
256 ac97_write(codec, AC97_MASTER, 0x0000); /* unmute line out volume */ 260 /* unmute captures and playbacks volume */
257 ac97_write(codec, AC97_PCM, 0x0000); /* unmute PCM out volume */ 261 ac97_write(codec, AC97_MASTER, 0x0000);
258 ac97_write(codec, AC97_REC_GAIN, 0x0000);/* unmute record volume */ 262 ac97_write(codec, AC97_PCM, 0x0000);
263 ac97_write(codec, AC97_REC_GAIN, 0x0000);
264 ac97_write(codec, AC97_CENTER_LFE_MASTER, 0x0000);
265 ac97_write(codec, AC97_SURROUND_MASTER, 0x0000);
266
267 /*power on LFE/CENTER/Surround DACs*/
268 ext_status = ac97_read(codec, AC97_EXTENDED_STATUS);
269 ac97_write(codec, AC97_EXTENDED_STATUS, ext_status&~0x3800);
259 270
260 ad1980_add_controls(codec); 271 ad1980_add_controls(codec);
261 ret = snd_soc_register_card(socdev); 272 ret = snd_soc_register_card(socdev);