Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c480f79bdca58923e605ff5e4698cfe1779bae70
Commit:     c480f79bdca58923e605ff5e4698cfe1779bae70
Parent:     dc81bed127a93e20d2100624273a27369738ffc7
Author:     Takashi Iwai <[EMAIL PROTECTED]>
AuthorDate: Mon Sep 3 09:43:38 2007 +0200
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 15:59:41 2007 +0200

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 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 3918782..b4a1d73 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
        case 3:
                /* add line-in as side */
                if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 3) {
-                       cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_LINE];
+                       cfg->line_out_pins[cfg->line_outs] =
+                               cfg->input_pins[AUTO_PIN_LINE];
                        spec->line_switch = 1;
                        cfg->line_outs++;
                }
@@ -1487,12 +1488,14 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec 
*codec, struct auto_pin_cf
        case 2:
                /* add line-in as clfe and mic as side */
                if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 2) {
-                       cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_LINE];
+                       cfg->line_out_pins[cfg->line_outs] =
+                               cfg->input_pins[AUTO_PIN_LINE];
                        spec->line_switch = 1;
                        cfg->line_outs++;
                }
                if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 3) {
-                       cfg->line_out_pins[3] = cfg->input_pins[AUTO_PIN_MIC];
+                       cfg->line_out_pins[cfg->line_outs] =
+                               cfg->input_pins[AUTO_PIN_MIC];
                        spec->mic_switch = 1;
                        cfg->line_outs++;
                }
@@ -1500,12 +1503,14 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec 
*codec, struct auto_pin_cf
        case 1:
                /* add line-in as surr and mic as clfe */
                if (cfg->input_pins[AUTO_PIN_LINE] && num_dacs > 1) {
-                       cfg->line_out_pins[1] = cfg->input_pins[AUTO_PIN_LINE];
+                       cfg->line_out_pins[cfg->line_outs] =
+                               cfg->input_pins[AUTO_PIN_LINE];
                        spec->line_switch = 1;
                        cfg->line_outs++;
                }
                if (cfg->input_pins[AUTO_PIN_MIC] && num_dacs > 2) {
-                       cfg->line_out_pins[2] = cfg->input_pins[AUTO_PIN_MIC];
+                       cfg->line_out_pins[cfg->line_outs] =
+                               cfg->input_pins[AUTO_PIN_MIC];
                        spec->mic_switch = 1;
                        cfg->line_outs++;
                }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to