aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/oxygen_mixer.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-04-09 03:16:14 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:32 -0400
commit11864b4b84194b459fc20e0ec47906885bddb12e (patch)
treecd50f762af2aa05c25657ee7d5486a2b67d66a52 /sound/pci/oxygen/oxygen_mixer.c
parenta9d3cc485e65a56edc9ef78c034146cc8a5b3101 (diff)
[ALSA] virtuoso: correctly switch input jack on Xonar DX
When selecting the capture source on the Xonar DX, the input jack must be routed to either the line input or the microphone input by setting a GPIO pin. This requires an additional callback so that the model driver can hook into the toggling of AC97 switches. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen/oxygen_mixer.c')
-rw-r--r--sound/pci/oxygen/oxygen_mixer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c
index 9a7c880eddbd..d0bef09a6999 100644
--- a/sound/pci/oxygen/oxygen_mixer.c
+++ b/sound/pci/oxygen/oxygen_mixer.c
@@ -518,6 +518,8 @@ static void mute_ac97_ctl(struct oxygen *chip, unsigned int control)
518 value = oxygen_read_ac97(chip, 0, priv_idx); 518 value = oxygen_read_ac97(chip, 0, priv_idx);
519 if (!(value & 0x8000)) { 519 if (!(value & 0x8000)) {
520 oxygen_write_ac97(chip, 0, priv_idx, value | 0x8000); 520 oxygen_write_ac97(chip, 0, priv_idx, value | 0x8000);
521 if (chip->model->ac97_switch)
522 chip->model->ac97_switch(chip, priv_idx, 0x8000);
521 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, 523 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
522 &chip->controls[control]->id); 524 &chip->controls[control]->id);
523 } 525 }
@@ -544,6 +546,8 @@ static int ac97_switch_put(struct snd_kcontrol *ctl,
544 change = newreg != oldreg; 546 change = newreg != oldreg;
545 if (change) { 547 if (change) {
546 oxygen_write_ac97(chip, codec, index, newreg); 548 oxygen_write_ac97(chip, codec, index, newreg);
549 if (codec == 0 && chip->model->ac97_switch)
550 chip->model->ac97_switch(chip, index, newreg & 0x8000);
547 if (index == AC97_LINE) { 551 if (index == AC97_LINE) {
548 oxygen_write_ac97_masked(chip, 0, CM9780_GPIO_STATUS, 552 oxygen_write_ac97_masked(chip, 0, CM9780_GPIO_STATUS,
549 newreg & 0x8000 ? 553 newreg & 0x8000 ?