summaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/oxygen_mixer.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-04-09 09:16:33 +0200
committerTakashi Iwai <tiwai@suse.de>2008-04-24 12:00:32 +0200
commit1d98c7d4be6ac521e3391025ddffcfe0400c798c (patch)
treebaa410a35f6ef8b275cdb40aa56811f5fccf74a5 /sound/pci/oxygen/oxygen_mixer.c
parent11864b4b84194b459fc20e0ec47906885bddb12e (diff)
downloadblackbird-op-linux-1d98c7d4be6ac521e3391025ddffcfe0400c798c.tar.gz
blackbird-op-linux-1d98c7d4be6ac521e3391025ddffcfe0400c798c.zip
[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.c9
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[] = {
.get = spdif_pcm_get,
.put = spdif_pcm_put,
},
+};
+
+static const struct snd_kcontrol_new spdif_input_controls[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
.device = 1,
@@ -961,6 +964,12 @@ int oxygen_mixer_init(struct oxygen *chip)
err = add_controls(chip, controls, ARRAY_SIZE(controls));
if (err < 0)
return err;
+ if (chip->model->pcm_dev_cfg & CAPTURE_1_FROM_SPDIF) {
+ err = add_controls(chip, spdif_input_controls,
+ ARRAY_SIZE(spdif_input_controls));
+ if (err < 0)
+ return err;
+ }
for (i = 0; i < ARRAY_SIZE(monitor_controls); ++i) {
if (!(chip->model->pcm_dev_cfg & monitor_controls[i].pcm_dev))
continue;
OpenPOWER on IntegriCloud