diff options
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index cfe064a75ca6..b2c53809603e 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -370,7 +370,7 @@ static int ad198x_eapd_put(struct snd_kcontrol *kcontrol, | |||
370 | int invert = (kcontrol->private_value >> 8) & 1; | 370 | int invert = (kcontrol->private_value >> 8) & 1; |
371 | hda_nid_t nid = kcontrol->private_value & 0xff; | 371 | hda_nid_t nid = kcontrol->private_value & 0xff; |
372 | unsigned int eapd; | 372 | unsigned int eapd; |
373 | eapd = ucontrol->value.integer.value[0]; | 373 | eapd = !!ucontrol->value.integer.value[0]; |
374 | if (invert) | 374 | if (invert) |
375 | eapd = !eapd; | 375 | eapd = !eapd; |
376 | if (eapd == spec->cur_eapd) | 376 | if (eapd == spec->cur_eapd) |
@@ -1021,6 +1021,8 @@ static int ad1983_spdif_route_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ | |||
1021 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); | 1021 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
1022 | struct ad198x_spec *spec = codec->spec; | 1022 | struct ad198x_spec *spec = codec->spec; |
1023 | 1023 | ||
1024 | if (ucontrol->value.enumerated.item[0] > 1) | ||
1025 | return -EINVAL; | ||
1024 | if (spec->spdif_route != ucontrol->value.enumerated.item[0]) { | 1026 | if (spec->spdif_route != ucontrol->value.enumerated.item[0]) { |
1025 | spec->spdif_route = ucontrol->value.enumerated.item[0]; | 1027 | spec->spdif_route = ucontrol->value.enumerated.item[0]; |
1026 | snd_hda_codec_write_cache(codec, spec->multiout.dig_out_nid, 0, | 1028 | snd_hda_codec_write_cache(codec, spec->multiout.dig_out_nid, 0, |
@@ -1966,6 +1968,8 @@ static int ad1988_spdif_playback_source_put(struct snd_kcontrol *kcontrol, | |||
1966 | int change; | 1968 | int change; |
1967 | 1969 | ||
1968 | val = ucontrol->value.enumerated.item[0]; | 1970 | val = ucontrol->value.enumerated.item[0]; |
1971 | if (val > 3) | ||
1972 | return -EINVAL; | ||
1969 | if (!val) { | 1973 | if (!val) { |
1970 | sel = snd_hda_codec_read(codec, 0x1d, 0, | 1974 | sel = snd_hda_codec_read(codec, 0x1d, 0, |
1971 | AC_VERB_GET_AMP_GAIN_MUTE, | 1975 | AC_VERB_GET_AMP_GAIN_MUTE, |