aboutsummaryrefslogtreecommitdiffstats
path: root/sound/i2c/other/ak4xxx-adda.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 11:52:06 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 11:52:06 -0400
commit7f46e6ca0183568a688e6bfe40e3ab9adb305d03 (patch)
tree32934472c0396953c910e1dd14c195c782ae9986 /sound/i2c/other/ak4xxx-adda.c
parentc8e16aa291c7d1ff14d3784e52bd376bcae17d54 (diff)
parent53555eb758388fff3982875129ca96080caed147 (diff)
Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
* 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa: (102 commits) [ALSA] version 1.0.14 [ALSA] remove duplicate Logitech Quickcam USB ID in usbquirks.h [ALSA] hda-codec - Fix input with STAC92xx [ALSA] hda-intel: support for iMac 24'' released on 09/2006 [ALSA] hda-codec - Add quirk for Asus P5LD2 [ALSA] snd-ca0106: Add support for X-Fi Extreme Audio. [ALSA] snd-emu10k1:Enable E-Mu 1616m notebook firmware loading. [ALSA] snd-emu10k1: Initial support for E-Mu 1616 and 1616m. [ALSA] cs46xx - Fix PM resume [ALSA] hda: Enable SPDIF in/out on some stac9205 boards [ALSA] timer: check for incorrect device state in non-debug compiles, too [ALSA] snd-aoa-codec-onyx: fix typo [ALSA] hda-codec - Add quirks for HP dx2200/dx2250 [ALSA] hda-codec - Rename HP model-specific quirks [ALSA] hda-codec - Add quirk for HP Samba [ALSA] hda-codec - Add LG LW20 line-in capture source [ALSA] usb-audio - Fix AC3 with M-Audio Audiophile USB [ALSA] hda: stac9202 mixer fix [ALSA] Make s3c24xx_i2s_set_clkdiv() change the correct bits [ALSA] hda-codec - Add LG LW20 si3054 modem id ...
Diffstat (limited to 'sound/i2c/other/ak4xxx-adda.c')
-rw-r--r--sound/i2c/other/ak4xxx-adda.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/sound/i2c/other/ak4xxx-adda.c b/sound/i2c/other/ak4xxx-adda.c
index 8805110017a7..fd335159f849 100644
--- a/sound/i2c/other/ak4xxx-adda.c
+++ b/sound/i2c/other/ak4xxx-adda.c
@@ -481,8 +481,8 @@ static int ak4xxx_switch_get(struct snd_kcontrol *kcontrol,
481 int addr = AK_GET_ADDR(kcontrol->private_value); 481 int addr = AK_GET_ADDR(kcontrol->private_value);
482 int shift = AK_GET_SHIFT(kcontrol->private_value); 482 int shift = AK_GET_SHIFT(kcontrol->private_value);
483 int invert = AK_GET_INVERT(kcontrol->private_value); 483 int invert = AK_GET_INVERT(kcontrol->private_value);
484 unsigned char val = snd_akm4xxx_get(ak, chip, addr); 484 /* we observe the (1<<shift) bit only */
485 485 unsigned char val = snd_akm4xxx_get(ak, chip, addr) & (1<<shift);
486 if (invert) 486 if (invert)
487 val = ! val; 487 val = ! val;
488 ucontrol->value.integer.value[0] = (val & (1<<shift)) != 0; 488 ucontrol->value.integer.value[0] = (val & (1<<shift)) != 0;
@@ -585,6 +585,26 @@ static int build_dac_controls(struct snd_akm4xxx *ak)
585 585
586 mixer_ch = 0; 586 mixer_ch = 0;
587 for (idx = 0; idx < ak->num_dacs; ) { 587 for (idx = 0; idx < ak->num_dacs; ) {
588 /* mute control for Revolution 7.1 - AK4381 */
589 if (ak->type == SND_AK4381
590 && ak->dac_info[mixer_ch].switch_name) {
591 memset(&knew, 0, sizeof(knew));
592 knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
593 knew.count = 1;
594 knew.access = SNDRV_CTL_ELEM_ACCESS_READWRITE;
595 knew.name = ak->dac_info[mixer_ch].switch_name;
596 knew.info = ak4xxx_switch_info;
597 knew.get = ak4xxx_switch_get;
598 knew.put = ak4xxx_switch_put;
599 knew.access = 0;
600 /* register 1, bit 0 (SMUTE): 0 = normal operation,
601 1 = mute */
602 knew.private_value =
603 AK_COMPOSE(idx/2, 1, 0, 0) | AK_INVERT;
604 err = snd_ctl_add(ak->card, snd_ctl_new1(&knew, ak));
605 if (err < 0)
606 return err;
607 }
588 memset(&knew, 0, sizeof(knew)); 608 memset(&knew, 0, sizeof(knew));
589 if (! ak->dac_info || ! ak->dac_info[mixer_ch].name) { 609 if (! ak->dac_info || ! ak->dac_info[mixer_ch].name) {
590 knew.name = "DAC Volume"; 610 knew.name = "DAC Volume";