Skip to content

Commit

Permalink
ASoC: AD1980 codec: add multi-channel function support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cliff Cai authored and Mark Brown committed Nov 18, 2008
1 parent a11311d commit 9905ed3
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions sound/soc/codecs/ad1980.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ SOC_DOUBLE("Line HP Swap Switch", AC97_AD_MISC, 10, 5, 1, 0),
SOC_DOUBLE("Surround Playback Volume", AC97_SURROUND_MASTER, 8, 0, 31, 1),
SOC_DOUBLE("Surround Playback Switch", AC97_SURROUND_MASTER, 15, 7, 1, 1),

SOC_DOUBLE("Center/LFE Playback Volume", AC97_CENTER_LFE_MASTER, 8, 0, 31, 1),
SOC_DOUBLE("Center/LFE Playback Switch", AC97_CENTER_LFE_MASTER, 15, 7, 1, 1),

SOC_ENUM("Capture Source", ad1980_cap_src),

SOC_SINGLE("Mic Boost Switch", AC97_MIC, 6, 1, 0),
Expand Down Expand Up @@ -145,7 +148,7 @@ struct snd_soc_dai ad1980_dai = {
.playback = {
.stream_name = "Playback",
.channels_min = 2,
.channels_max = 2,
.channels_max = 6,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE, },
.capture = {
Expand Down Expand Up @@ -192,6 +195,7 @@ static int ad1980_soc_probe(struct platform_device *pdev)
struct snd_soc_codec *codec;
int ret = 0;
u16 vendor_id2;
u16 ext_status;

printk(KERN_INFO "AD1980 SoC Audio Codec\n");

Expand Down Expand Up @@ -253,9 +257,16 @@ static int ad1980_soc_probe(struct platform_device *pdev)
"supported\n");
}

ac97_write(codec, AC97_MASTER, 0x0000); /* unmute line out volume */
ac97_write(codec, AC97_PCM, 0x0000); /* unmute PCM out volume */
ac97_write(codec, AC97_REC_GAIN, 0x0000);/* unmute record volume */
/* unmute captures and playbacks volume */
ac97_write(codec, AC97_MASTER, 0x0000);
ac97_write(codec, AC97_PCM, 0x0000);
ac97_write(codec, AC97_REC_GAIN, 0x0000);
ac97_write(codec, AC97_CENTER_LFE_MASTER, 0x0000);
ac97_write(codec, AC97_SURROUND_MASTER, 0x0000);

/*power on LFE/CENTER/Surround DACs*/
ext_status = ac97_read(codec, AC97_EXTENDED_STATUS);
ac97_write(codec, AC97_EXTENDED_STATUS, ext_status&~0x3800);

ad1980_add_controls(codec);
ret = snd_soc_register_card(socdev);
Expand Down

0 comments on commit 9905ed3

Please sign in to comment.