aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/au88x0/au88x0_core.c
diff options
context:
space:
mode:
authorRaymond Yau <superquad.vortex2@gmail.com>2012-01-17 11:32:17 +0800
committerTakashi Iwai <tiwai@suse.de>2012-01-24 15:25:08 +0100
commitbb92b7c4ed4f7d5102bb1623cc8a1a9960ddfc08 (patch)
treed92a7641af16f2b7952a4c091756e067650c11b2 /sound/pci/au88x0/au88x0_core.c
parentLinux 3.3-rc1 (diff)
downloadlinux-dev-bb92b7c4ed4f7d5102bb1623cc8a1a9960ddfc08.tar.xz
linux-dev-bb92b7c4ed4f7d5102bb1623cc8a1a9960ddfc08.zip
ALSA: Au88x0 - Implement subdevice volume controls
- add "PCM Playback Volume" controls for 16 playback subdevices This allow application to change the volume of each subdevice by using hardware mixer of au88x0 and default is zero gain/attenunation. Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/au88x0/au88x0_core.c')
-rw-r--r--sound/pci/au88x0/au88x0_core.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index 6933a27a5d76..1181c5ec2d4f 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -2050,8 +2050,6 @@ vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
}
/* Default Connections */
-static int
-vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type);
static void vortex_connect_default(vortex_t * vortex, int en)
{
@@ -2111,15 +2109,13 @@ static void vortex_connect_default(vortex_t * vortex, int en)
Return: Return allocated DMA or same DMA passed as "dma" when dma >= 0.
*/
static int
-vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
+vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir,
+ int type, int subdev)
{
stream_t *stream;
int i, en;
+ struct pcm_vol *p;
- if ((nr_ch == 3)
- || ((dir == SNDRV_PCM_STREAM_CAPTURE) && (nr_ch > 2)))
- return -EBUSY;
-
if (dma >= 0) {
en = 0;
vortex_adb_checkinout(vortex,
@@ -2250,6 +2246,14 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
MIX_DEFIGAIN);
#endif
}
+ if (stream->type == VORTEX_PCM_ADB && en) {
+ p = &vortex->pcm_vol[subdev];
+ p->dma = dma;
+ for (i = 0; i < nr_ch; i++)
+ p->mixin[i] = mix[i];
+ for (i = 0; i < ch_top; i++)
+ p->vol[i] = 0;
+ }
}
#ifndef CHIP_AU8820
else {