aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 8b2c080c85ae..07360996caaa 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2012,7 +2012,7 @@ static int is_in_nid_list(hda_nid_t nid, hda_nid_t *list)
2012 * in the order of front, rear, CLFE, side, ... 2012 * in the order of front, rear, CLFE, side, ...
2013 * 2013 *
2014 * If more extra outputs (speaker and headphone) are found, the pins are 2014 * If more extra outputs (speaker and headphone) are found, the pins are
2015 * assisnged to hp_pin and speaker_pins[], respectively. If no line-out jack 2015 * assisnged to hp_pins[] and speaker_pins[], respectively. If no line-out jack
2016 * is detected, one of speaker of HP pins is assigned as the primary 2016 * is detected, one of speaker of HP pins is assigned as the primary
2017 * output, i.e. to line_out_pins[0]. So, line_outs is always positive 2017 * output, i.e. to line_out_pins[0]. So, line_outs is always positive
2018 * if any analog output exists. 2018 * if any analog output exists.
@@ -2074,7 +2074,10 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *c
2074 cfg->speaker_outs++; 2074 cfg->speaker_outs++;
2075 break; 2075 break;
2076 case AC_JACK_HP_OUT: 2076 case AC_JACK_HP_OUT:
2077 cfg->hp_pin = nid; 2077 if (cfg->hp_outs >= ARRAY_SIZE(cfg->hp_pins))
2078 continue;
2079 cfg->hp_pins[cfg->hp_outs] = nid;
2080 cfg->hp_outs++;
2078 break; 2081 break;
2079 case AC_JACK_MIC_IN: 2082 case AC_JACK_MIC_IN:
2080 if (loc == AC_JACK_LOC_FRONT) 2083 if (loc == AC_JACK_LOC_FRONT)
@@ -2147,8 +2150,10 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *c
2147 cfg->speaker_outs, cfg->speaker_pins[0], 2150 cfg->speaker_outs, cfg->speaker_pins[0],
2148 cfg->speaker_pins[1], cfg->speaker_pins[2], 2151 cfg->speaker_pins[1], cfg->speaker_pins[2],
2149 cfg->speaker_pins[3], cfg->speaker_pins[4]); 2152 cfg->speaker_pins[3], cfg->speaker_pins[4]);
2150 snd_printd(" hp=0x%x, dig_out=0x%x, din_in=0x%x\n", 2153 snd_printd(" hp_outs=%d (0x%x/0x%x/0x%x/0x%x/0x%x)\n",
2151 cfg->hp_pin, cfg->dig_out_pin, cfg->dig_in_pin); 2154 cfg->hp_outs, cfg->hp_pins[0],
2155 cfg->hp_pins[1], cfg->hp_pins[2],
2156 cfg->hp_pins[3], cfg->hp_pins[4]);
2152 snd_printd(" inputs: mic=0x%x, fmic=0x%x, line=0x%x, fline=0x%x," 2157 snd_printd(" inputs: mic=0x%x, fmic=0x%x, line=0x%x, fline=0x%x,"
2153 " cd=0x%x, aux=0x%x\n", 2158 " cd=0x%x, aux=0x%x\n",
2154 cfg->input_pins[AUTO_PIN_MIC], 2159 cfg->input_pins[AUTO_PIN_MIC],
@@ -2169,10 +2174,12 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *c
2169 sizeof(cfg->speaker_pins)); 2174 sizeof(cfg->speaker_pins));
2170 cfg->speaker_outs = 0; 2175 cfg->speaker_outs = 0;
2171 memset(cfg->speaker_pins, 0, sizeof(cfg->speaker_pins)); 2176 memset(cfg->speaker_pins, 0, sizeof(cfg->speaker_pins));
2172 } else if (cfg->hp_pin) { 2177 } else if (cfg->hp_outs) {
2173 cfg->line_outs = 1; 2178 cfg->line_outs = cfg->hp_outs;
2174 cfg->line_out_pins[0] = cfg->hp_pin; 2179 memcpy(cfg->line_out_pins, cfg->hp_pins,
2175 cfg->hp_pin = 0; 2180 sizeof(cfg->hp_pins));
2181 cfg->hp_outs = 0;
2182 memset(cfg->hp_pins, 0, sizeof(cfg->hp_pins));
2176 } 2183 }
2177 } 2184 }
2178 2185