diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-08-08 11:26:54 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-08-08 11:27:50 -0400 |
commit | 8e13fc1c5f694a6ae4032c7f94103c137136733f (patch) | |
tree | 76c660280e6379649a9074e7ed91a1944f793fbb /sound/pci | |
parent | 27ebeb0b1b5bb26908e485a7e8bd2ec30366ffef (diff) |
ALSA: hda - Add missing SPDIF I/O setup for CA0132
CA0132 driver had some codes to handle the S/PDIF I/O, but the actual
setups of pins and converters were missing. Now the pins are added.
Also, fixed a few points triggering invalid codec verbs and mixer
elements since the digital I/O audio widgets on CA0132 have no amp.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_ca0132.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 31512a0f1d07..9c0ec0a55bef 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c | |||
@@ -246,7 +246,7 @@ static void init_output(struct hda_codec *codec, hda_nid_t pin, hda_nid_t dac) | |||
246 | AC_VERB_SET_AMP_GAIN_MUTE, | 246 | AC_VERB_SET_AMP_GAIN_MUTE, |
247 | AMP_OUT_UNMUTE); | 247 | AMP_OUT_UNMUTE); |
248 | } | 248 | } |
249 | if (dac) | 249 | if (dac && (get_wcaps(codec, dac) & AC_WCAP_OUT_AMP)) |
250 | snd_hda_codec_write(codec, dac, 0, | 250 | snd_hda_codec_write(codec, dac, 0, |
251 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO); | 251 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO); |
252 | } | 252 | } |
@@ -261,7 +261,7 @@ static void init_input(struct hda_codec *codec, hda_nid_t pin, hda_nid_t adc) | |||
261 | AC_VERB_SET_AMP_GAIN_MUTE, | 261 | AC_VERB_SET_AMP_GAIN_MUTE, |
262 | AMP_IN_UNMUTE(0)); | 262 | AMP_IN_UNMUTE(0)); |
263 | } | 263 | } |
264 | if (adc) | 264 | if (adc && (get_wcaps(codec, adc) & AC_WCAP_IN_AMP)) |
265 | snd_hda_codec_write(codec, adc, 0, AC_VERB_SET_AMP_GAIN_MUTE, | 265 | snd_hda_codec_write(codec, adc, 0, AC_VERB_SET_AMP_GAIN_MUTE, |
266 | AMP_IN_UNMUTE(0)); | 266 | AMP_IN_UNMUTE(0)); |
267 | } | 267 | } |
@@ -841,18 +841,16 @@ static int ca0132_build_controls(struct hda_codec *codec) | |||
841 | spec->dig_out); | 841 | spec->dig_out); |
842 | if (err < 0) | 842 | if (err < 0) |
843 | return err; | 843 | return err; |
844 | err = add_out_volume(codec, spec->dig_out, "IEC958"); | 844 | err = snd_hda_create_spdif_share_sw(codec, &spec->multiout); |
845 | if (err < 0) | 845 | if (err < 0) |
846 | return err; | 846 | return err; |
847 | /* spec->multiout.share_spdif = 1; */ | ||
847 | } | 848 | } |
848 | 849 | ||
849 | if (spec->dig_in) { | 850 | if (spec->dig_in) { |
850 | err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in); | 851 | err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in); |
851 | if (err < 0) | 852 | if (err < 0) |
852 | return err; | 853 | return err; |
853 | err = add_in_volume(codec, spec->dig_in, "IEC958"); | ||
854 | if (err < 0) | ||
855 | return err; | ||
856 | } | 854 | } |
857 | return 0; | 855 | return 0; |
858 | } | 856 | } |
@@ -912,6 +910,16 @@ static void ca0132_config(struct hda_codec *codec) | |||
912 | spec->input_labels[1] = "Line"; | 910 | spec->input_labels[1] = "Line"; |
913 | spec->adcs[1] = 0x08; | 911 | spec->adcs[1] = 0x08; |
914 | spec->num_inputs = 2; | 912 | spec->num_inputs = 2; |
913 | |||
914 | /* SPDIF I/O */ | ||
915 | spec->dig_out = 0x05; | ||
916 | spec->multiout.dig_out_nid = spec->dig_out; | ||
917 | cfg->dig_out_pins[0] = 0x0c; | ||
918 | cfg->dig_outs = 1; | ||
919 | cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF; | ||
920 | spec->dig_in = 0x09; | ||
921 | cfg->dig_in_pin = 0x0e; | ||
922 | cfg->dig_in_type = HDA_PCM_TYPE_SPDIF; | ||
915 | } | 923 | } |
916 | 924 | ||
917 | static void ca0132_init_chip(struct hda_codec *codec) | 925 | static void ca0132_init_chip(struct hda_codec *codec) |