From: Bryan Wu <cooloney@kernel.org>
To: broonie@sirena.org.uk, tiwai@suse.de
Cc: Cliff Cai <cliff.cai@analog.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
Bryan Wu <cooloney@kernel.org>
Subject: [PATCH 2/8] ASoC: AD1980 codec: add multi-channel function support
Date: Tue, 18 Nov 2008 16:18:16 +0800 [thread overview]
Message-ID: <1226996302-10234-3-git-send-email-cooloney@kernel.org> (raw)
In-Reply-To: <1226996302-10234-1-git-send-email-cooloney@kernel.org>
From: Cliff Cai <cliff.cai@analog.com>
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>
---
sound/soc/codecs/ad1980.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index 1397b8e..410fed9 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),
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),
@@ -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 = {
@@ -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");
@@ -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);
--
1.5.6.3
WARNING: multiple messages have this Message-ID (diff)
From: Bryan Wu <cooloney@kernel.org>
To: broonie@sirena.org.uk, tiwai@suse.de
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
Cliff Cai <cliff.cai@analog.com>, Bryan Wu <cooloney@kernel.org>
Subject: [PATCH 2/8] ASoC: AD1980 codec: add multi-channel function support
Date: Tue, 18 Nov 2008 16:18:16 +0800 [thread overview]
Message-ID: <1226996302-10234-3-git-send-email-cooloney@kernel.org> (raw)
In-Reply-To: <1226996302-10234-1-git-send-email-cooloney@kernel.org>
From: Cliff Cai <cliff.cai@analog.com>
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>
---
sound/soc/codecs/ad1980.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index 1397b8e..410fed9 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),
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),
@@ -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 = {
@@ -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");
@@ -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);
--
1.5.6.3
next prev parent reply other threads:[~2008-11-18 8:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-18 8:18 Bryan Wu
2008-11-18 8:18 ` [PATCH 1/8] ASoC: Blackfin: updates Kconfig for SPORT Bryan Wu
2008-11-18 8:18 ` Bryan Wu [this message]
2008-11-18 8:18 ` [PATCH 2/8] ASoC: AD1980 codec: add multi-channel function support Bryan Wu
2008-11-18 8:18 ` [PATCH 3/8] ASoC: Blackfin: " Bryan Wu
2008-11-18 8:18 ` Bryan Wu
2008-11-18 8:18 ` [PATCH 4/8] ASoC: Blackfin: fix bug - AD1980/1 SOC Audio driver fails to build in case MMAP support is turned off Bryan Wu
2008-11-18 8:18 ` Bryan Wu
2008-11-18 11:53 ` Mark Brown
2008-11-18 11:53 ` [alsa-devel] " Mark Brown
2008-11-18 8:18 ` [PATCH 5/8] ASoC: Fix BUGS in Blackfin AC97 DAI Bryan Wu
2008-11-18 8:18 ` Bryan Wu
2008-11-18 11:54 ` Mark Brown
2008-11-18 11:54 ` [alsa-devel] " Mark Brown
2008-11-18 11:58 ` Hennerich, Michael
2008-11-18 11:58 ` Hennerich, Michael
2008-11-18 8:18 ` [PATCH 6/8] ASoC: Blackfin: do not force TWI bus for ssm2602 codec Bryan Wu
2008-11-18 8:18 ` Bryan Wu
2008-11-18 8:18 ` [PATCH 7/8] ASoC: Blackfin: Simplify the MMAP_SUPPORT macros protected code Bryan Wu
2008-11-18 8:18 ` Bryan Wu
2008-11-18 8:18 ` [PATCH 8/8] ASoC: Blackfin: always set a default value for that GPIO range Bryan Wu
2008-11-18 8:18 ` Bryan Wu
2008-11-18 11:45 ` (no subject) Mark Brown
2008-11-18 11:45 ` [alsa-devel] " Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1226996302-10234-3-git-send-email-cooloney@kernel.org \
--to=cooloney@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@sirena.org.uk \
--cc=cliff.cai@analog.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.