diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2015-01-16 16:14:18 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-16 16:43:50 -0500 |
commit | 20eb26a2ec8d28f6106d210ea6a12f360e57a72b (patch) | |
tree | d1d52abded3ac3621fa347f0772a400283eb14b9 /sound/pci/oxygen | |
parent | 70462457ff80c214d87135380d2dffe646867e71 (diff) |
ALSA: oxygen: do not create useless S/PDIF controls
Cards without S/PDIF output do not need those controls.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen')
-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 5988e044c519..2f698a9a5044 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c | |||
@@ -786,6 +786,9 @@ static const struct snd_kcontrol_new controls[] = { | |||
786 | .get = upmix_get, | 786 | .get = upmix_get, |
787 | .put = upmix_put, | 787 | .put = upmix_put, |
788 | }, | 788 | }, |
789 | }; | ||
790 | |||
791 | static const struct snd_kcontrol_new spdif_output_controls[] = { | ||
789 | { | 792 | { |
790 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 793 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
791 | .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, SWITCH), | 794 | .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, SWITCH), |
@@ -1073,6 +1076,12 @@ int oxygen_mixer_init(struct oxygen *chip) | |||
1073 | err = add_controls(chip, controls, ARRAY_SIZE(controls)); | 1076 | err = add_controls(chip, controls, ARRAY_SIZE(controls)); |
1074 | if (err < 0) | 1077 | if (err < 0) |
1075 | return err; | 1078 | return err; |
1079 | if (chip->model.device_config & PLAYBACK_1_TO_SPDIF) { | ||
1080 | err = add_controls(chip, spdif_output_controls, | ||
1081 | ARRAY_SIZE(spdif_output_controls)); | ||
1082 | if (err < 0) | ||
1083 | return err; | ||
1084 | } | ||
1076 | if (chip->model.device_config & CAPTURE_1_FROM_SPDIF) { | 1085 | if (chip->model.device_config & CAPTURE_1_FROM_SPDIF) { |
1077 | err = add_controls(chip, spdif_input_controls, | 1086 | err = add_controls(chip, spdif_input_controls, |
1078 | ARRAY_SIZE(spdif_input_controls)); | 1087 | ARRAY_SIZE(spdif_input_controls)); |