aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/oxygen_mixer.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-01-28 02:33:44 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:30:17 -0500
commit911b499af45e879ccf4b8db234278a7136d056c9 (patch)
tree8708445a77b89d5bd170044b7faf4c1514c8561f /sound/pci/oxygen/oxygen_mixer.c
parent236c4920ea825acbffa7bbba24c182ec6a9a8245 (diff)
[ALSA] oxygen: make line-in exclusive only on Xonar
Move the line input switching code to the Virtuoso driver because only the Xonar cards bypass the analog mixer for line input. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/oxygen/oxygen_mixer.c')
-rw-r--r--sound/pci/oxygen/oxygen_mixer.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c
index fe53318e94e0..cf34b1229b0b 100644
--- a/sound/pci/oxygen/oxygen_mixer.c
+++ b/sound/pci/oxygen/oxygen_mixer.c
@@ -465,19 +465,6 @@ static int ac97_switch_get(struct snd_kcontrol *ctl,
465 return 0; 465 return 0;
466} 466}
467 467
468static void ac97_mute_ctl(struct oxygen *chip, unsigned int control)
469{
470 unsigned int index = chip->controls[control]->private_value & 0xff;
471 u16 value;
472
473 value = oxygen_read_ac97(chip, 0, index);
474 if (!(value & 0x8000)) {
475 oxygen_write_ac97(chip, 0, index, value | 0x8000);
476 snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
477 &chip->controls[control]->id);
478 }
479}
480
481static int ac97_switch_put(struct snd_kcontrol *ctl, 468static int ac97_switch_put(struct snd_kcontrol *ctl,
482 struct snd_ctl_elem_value *value) 469 struct snd_ctl_elem_value *value)
483{ 470{
@@ -498,22 +485,9 @@ static int ac97_switch_put(struct snd_kcontrol *ctl,
498 change = newreg != oldreg; 485 change = newreg != oldreg;
499 if (change) { 486 if (change) {
500 oxygen_write_ac97(chip, 0, index, newreg); 487 oxygen_write_ac97(chip, 0, index, newreg);
501 if (index == AC97_LINE) { 488 if (bitnr == 15 && chip->model->ac97_switch_hook)
502 oxygen_write_ac97_masked(chip, 0, CM9780_GPIO_STATUS, 489 chip->model->ac97_switch_hook(chip, index,
503 newreg & 0x8000 ? 490 newreg & 0x8000);
504 CM9780_GPO0 : 0, CM9780_GPO0);
505 if (!(newreg & 0x8000)) {
506 ac97_mute_ctl(chip, CONTROL_MIC_CAPTURE_SWITCH);
507 ac97_mute_ctl(chip, CONTROL_CD_CAPTURE_SWITCH);
508 ac97_mute_ctl(chip, CONTROL_AUX_CAPTURE_SWITCH);
509 }
510 } else if ((index == AC97_MIC || index == AC97_CD ||
511 index == AC97_VIDEO || index == AC97_AUX) &&
512 bitnr == 15 && !(newreg & 0x8000)) {
513 ac97_mute_ctl(chip, CONTROL_LINE_CAPTURE_SWITCH);
514 oxygen_write_ac97_masked(chip, 0, CM9780_GPIO_STATUS,
515 CM9780_GPO0, CM9780_GPO0);
516 }
517 } 491 }
518 mutex_unlock(&chip->mutex); 492 mutex_unlock(&chip->mutex);
519 return change; 493 return change;
@@ -671,6 +645,7 @@ static const struct snd_kcontrol_new ac97_controls[] = {
671 AC97_VOLUME("Mic Capture Volume", AC97_MIC), 645 AC97_VOLUME("Mic Capture Volume", AC97_MIC),
672 AC97_SWITCH("Mic Capture Switch", AC97_MIC, 15, 1), 646 AC97_SWITCH("Mic Capture Switch", AC97_MIC, 15, 1),
673 AC97_SWITCH("Mic Boost (+20dB)", AC97_MIC, 6, 0), 647 AC97_SWITCH("Mic Boost (+20dB)", AC97_MIC, 6, 0),
648 AC97_VOLUME("Line Capture Volume", AC97_LINE),
674 AC97_SWITCH("Line Capture Switch", AC97_LINE, 15, 1), 649 AC97_SWITCH("Line Capture Switch", AC97_LINE, 15, 1),
675 AC97_VOLUME("CD Capture Volume", AC97_CD), 650 AC97_VOLUME("CD Capture Volume", AC97_CD),
676 AC97_SWITCH("CD Capture Switch", AC97_CD, 15, 1), 651 AC97_SWITCH("CD Capture Switch", AC97_CD, 15, 1),