diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2008-04-09 03:16:33 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 06:00:32 -0400 |
commit | 1d98c7d4be6ac521e3391025ddffcfe0400c798c (patch) | |
tree | baa410a35f6ef8b275cdb40aa56811f5fccf74a5 /sound/pci/oxygen/oxygen_mixer.c | |
parent | 11864b4b84194b459fc20e0ec47906885bddb12e (diff) |
[ALSA] oxygen: use SPDIF input only if present
If the card model does not have a digital input or an AC97 codec,
disable the respective interrupt and mixer controls.
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.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index d0bef09a6999..2cb914498a19 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c | |||
@@ -742,6 +742,9 @@ static const struct snd_kcontrol_new controls[] = { | |||
742 | .get = spdif_pcm_get, | 742 | .get = spdif_pcm_get, |
743 | .put = spdif_pcm_put, | 743 | .put = spdif_pcm_put, |
744 | }, | 744 | }, |
745 | }; | ||
746 | |||
747 | static const struct snd_kcontrol_new spdif_input_controls[] = { | ||
745 | { | 748 | { |
746 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, | 749 | .iface = SNDRV_CTL_ELEM_IFACE_PCM, |
747 | .device = 1, | 750 | .device = 1, |
@@ -961,6 +964,12 @@ int oxygen_mixer_init(struct oxygen *chip) | |||
961 | err = add_controls(chip, controls, ARRAY_SIZE(controls)); | 964 | err = add_controls(chip, controls, ARRAY_SIZE(controls)); |
962 | if (err < 0) | 965 | if (err < 0) |
963 | return err; | 966 | return err; |
967 | if (chip->model->pcm_dev_cfg & CAPTURE_1_FROM_SPDIF) { | ||
968 | err = add_controls(chip, spdif_input_controls, | ||
969 | ARRAY_SIZE(spdif_input_controls)); | ||
970 | if (err < 0) | ||
971 | return err; | ||
972 | } | ||
964 | for (i = 0; i < ARRAY_SIZE(monitor_controls); ++i) { | 973 | for (i = 0; i < ARRAY_SIZE(monitor_controls); ++i) { |
965 | if (!(chip->model->pcm_dev_cfg & monitor_controls[i].pcm_dev)) | 974 | if (!(chip->model->pcm_dev_cfg & monitor_controls[i].pcm_dev)) |
966 | continue; | 975 | continue; |