diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-09-03 03:43:38 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 09:59:41 -0400 |
commit | c480f79bdca58923e605ff5e4698cfe1779bae70 (patch) | |
tree | 775e8cfd0d087c1ee7c5f11c016f2e89167c70c1 /sound/pci | |
parent | dc81bed127a93e20d2100624273a27369738ffc7 (diff) |
[ALSA] hda-codec - Avoid zero NID in line_out_pins[] of STAC codecs
The STAC codes adds line_out_pins[] for shared mic/line-inputs accordingly.
But, the current code may give a hole with NID=0 in some setting, which
results in an error at probe. This patch fixes the problem.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 39187828503d..b4a1d73b5721 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -1479,7 +1479,8 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf | |||
1479 | case 3: | 1479 | case 3: |
1480 | /* add line-in as side */ | 1480 | /* add line-in as side */ |
1481 | if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 3) { | 1481 | if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 3) { |
1482 | cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_LINE]; | 1482 | cfg->line_out_pins[cfg->line_outs] = |
1483 | cfg->input_pins[AUTO_PIN_LINE]; | ||
1483 | spec->line_switch = 1; | 1484 | spec->line_switch = 1; |
1484 | cfg->line_outs++; | 1485 | cfg->line_outs++; |
1485 | } | 1486 | } |
@@ -1487,12 +1488,14 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf | |||
1487 | case 2: | 1488 | case 2: |
1488 | /* add line-in as clfe and mic as side */ | 1489 | /* add line-in as clfe and mic as side */ |
1489 | if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 2) { | 1490 | if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 2) { |
1490 | cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_LINE]; | 1491 | cfg->line_out_pins[cfg->line_outs] = |
1492 | cfg->input_pins[AUTO_PIN_LINE]; | ||
1491 | spec->line_switch = 1; | 1493 | spec->line_switch = 1; |
1492 | cfg->line_outs++; | 1494 | cfg->line_outs++; |
1493 | } | 1495 | } |
1494 | if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 3) { | 1496 | if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 3) { |
1495 | cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_MIC]; | 1497 | cfg->line_out_pins[cfg->line_outs] = |
1498 | cfg->input_pins[AUTO_PIN_MIC]; | ||
1496 | spec->mic_switch = 1; | 1499 | spec->mic_switch = 1; |
1497 | cfg->line_outs++; | 1500 | cfg->line_outs++; |
1498 | } | 1501 | } |
@@ -1500,12 +1503,14 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf | |||
1500 | case 1: | 1503 | case 1: |
1501 | /* add line-in as surr and mic as clfe */ | 1504 | /* add line-in as surr and mic as clfe */ |
1502 | if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 1) { | 1505 | if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 1) { |
1503 | cfg->line_out_pins[1] = cfg->input_pins[AUTO_PIN_LINE]; | 1506 | cfg->line_out_pins[cfg->line_outs] = |
1507 | cfg->input_pins[AUTO_PIN_LINE]; | ||
1504 | spec->line_switch = 1; | 1508 | spec->line_switch = 1; |
1505 | cfg->line_outs++; | 1509 | cfg->line_outs++; |
1506 | } | 1510 | } |
1507 | if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 2) { | 1511 | if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 2) { |
1508 | cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_MIC]; | 1512 | cfg->line_out_pins[cfg->line_outs] = |
1513 | cfg->input_pins[AUTO_PIN_MIC]; | ||
1509 | spec->mic_switch = 1; | 1514 | spec->mic_switch = 1; |
1510 | cfg->line_outs++; | 1515 | cfg->line_outs++; |
1511 | } | 1516 | } |