diff options
Diffstat (limited to 'sound/pci/hda/patch_cmedia.c')
-rw-r--r-- | sound/pci/hda/patch_cmedia.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c index ab3308daa96..cd2cf5e94e8 100644 --- a/sound/pci/hda/patch_cmedia.c +++ b/sound/pci/hda/patch_cmedia.c | |||
@@ -327,7 +327,9 @@ static int cmi9880_build_controls(struct hda_codec *codec) | |||
327 | return err; | 327 | return err; |
328 | } | 328 | } |
329 | if (spec->multiout.dig_out_nid) { | 329 | if (spec->multiout.dig_out_nid) { |
330 | err = snd_hda_create_spdif_out_ctls(codec, spec->multiout.dig_out_nid); | 330 | err = snd_hda_create_spdif_out_ctls(codec, |
331 | spec->multiout.dig_out_nid, | ||
332 | spec->multiout.dig_out_nid); | ||
331 | if (err < 0) | 333 | if (err < 0) |
332 | return err; | 334 | return err; |
333 | err = snd_hda_create_spdif_share_sw(codec, | 335 | err = snd_hda_create_spdif_share_sw(codec, |
@@ -396,12 +398,11 @@ static int cmi9880_fill_multi_init(struct hda_codec *codec, const struct auto_pi | |||
396 | { | 398 | { |
397 | struct cmi_spec *spec = codec->spec; | 399 | struct cmi_spec *spec = codec->spec; |
398 | hda_nid_t nid; | 400 | hda_nid_t nid; |
399 | int i, j, k, len; | 401 | int i, j, k; |
400 | 402 | ||
401 | /* clear the table, only one c-media dac assumed here */ | 403 | /* clear the table, only one c-media dac assumed here */ |
402 | memset(spec->multi_init, 0, sizeof(spec->multi_init)); | 404 | memset(spec->multi_init, 0, sizeof(spec->multi_init)); |
403 | for (j = 0, i = 0; i < cfg->line_outs; i++) { | 405 | for (j = 0, i = 0; i < cfg->line_outs; i++) { |
404 | hda_nid_t conn[4]; | ||
405 | nid = cfg->line_out_pins[i]; | 406 | nid = cfg->line_out_pins[i]; |
406 | /* set as output */ | 407 | /* set as output */ |
407 | spec->multi_init[j].nid = nid; | 408 | spec->multi_init[j].nid = nid; |
@@ -414,12 +415,10 @@ static int cmi9880_fill_multi_init(struct hda_codec *codec, const struct auto_pi | |||
414 | spec->multi_init[j].verb = AC_VERB_SET_CONNECT_SEL; | 415 | spec->multi_init[j].verb = AC_VERB_SET_CONNECT_SEL; |
415 | spec->multi_init[j].param = 0; | 416 | spec->multi_init[j].param = 0; |
416 | /* find the index in connect list */ | 417 | /* find the index in connect list */ |
417 | len = snd_hda_get_connections(codec, nid, conn, 4); | 418 | k = snd_hda_get_conn_index(codec, nid, |
418 | for (k = 0; k < len; k++) | 419 | spec->dac_nids[i], 0); |
419 | if (conn[k] == spec->dac_nids[i]) { | 420 | if (k >= 0) |
420 | spec->multi_init[j].param = k; | 421 | spec->multi_init[j].param = k; |
421 | break; | ||
422 | } | ||
423 | j++; | 422 | j++; |
424 | } | 423 | } |
425 | } | 424 | } |