···12301230 return; /* invalid entry */12311231 }12321232 }12331233+ if (!ext || !fixed)12341234+ return;12331235 if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP))12341236 return; /* no unsol support */12351237 snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n",···48144812 spec->auto_mic = 0; /* disable auto-mic to be sure */48154813}4816481448154815+/* choose the ADC/MUX containing the input pin and initialize the setup */48164816+static void fixup_single_adc(struct hda_codec *codec)48174817+{48184818+ struct alc_spec *spec = codec->spec;48194819+ hda_nid_t pin;48204820+ int i;48214821+48224822+ /* search for the input pin; there must be only one */48234823+ for (i = 0; i < AUTO_PIN_LAST; i++) {48244824+ if (spec->autocfg.input_pins[i]) {48254825+ pin = spec->autocfg.input_pins[i];48264826+ break;48274827+ }48284828+ }48294829+ if (!pin)48304830+ return;48314831+48324832+ /* set the default connection to that pin */48334833+ for (i = 0; i < spec->num_adc_nids; i++) {48344834+ hda_nid_t cap = spec->capsrc_nids ?48354835+ spec->capsrc_nids[i] : spec->adc_nids[i];48364836+ int idx;48374837+48384838+ idx = get_connection_index(codec, cap, pin);48394839+ if (idx < 0)48404840+ continue;48414841+ /* use only this ADC */48424842+ if (spec->capsrc_nids)48434843+ spec->capsrc_nids += i;48444844+ spec->adc_nids += i;48454845+ spec->num_adc_nids = 1;48464846+ /* select or unmute this route */48474847+ if (get_wcaps_type(get_wcaps(codec, cap)) == AC_WID_AUD_MIX) {48484848+ snd_hda_codec_amp_stereo(codec, cap, HDA_INPUT, idx,48494849+ HDA_AMP_MUTE, 0);48504850+ } else {48514851+ snd_hda_codec_write_cache(codec, cap, 0,48524852+ AC_VERB_SET_CONNECT_SEL, idx);48534853+ }48544854+ return;48554855+ }48564856+}48574857+48174858static void set_capture_mixer(struct hda_codec *codec)48184859{48194860 struct alc_spec *spec = codec->spec;···48694824 alc_capture_mixer3 },48704825 };48714826 if (spec->num_adc_nids > 0 && spec->num_adc_nids <= 3) {48724872- int mux;48734873- if (spec->auto_mic) {48744874- mux = 0;48274827+ int mux = 0;48284828+ if (spec->auto_mic)48754829 fixup_automic_adc(codec);48764876- } else if (spec->input_mux && spec->input_mux->num_items > 1)48774877- mux = 1;48784878- else48794879- mux = 0;48304830+ else if (spec->input_mux) {48314831+ if (spec->input_mux->num_items > 1)48324832+ mux = 1;48334833+ else if (spec->input_mux->num_items == 1)48344834+ fixup_single_adc(codec);48354835+ }48804836 spec->cap_mixer = caps[mux][spec->num_adc_nids - 1];48814837 }48824838}···71407094 HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT),71417095 HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT),71427096 HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT),71437143- HDA_CODEC_VOLUME("HP Playback Volume", 0x0f, 0x00, HDA_OUTPUT),71447144- HDA_BIND_MUTE ("HP Playback Switch", 0x0f, 0x02, HDA_INPUT),70977097+ HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT),70987098+ HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT),71457099 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),71467100 HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),71477101 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),···75427496 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},75437497 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},75447498 {0x14, AC_VERB_SET_CONNECT_SEL, 0x03},74997499+ {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},75457500 /* Front Mic pin: input vref at 80% */75467501 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},75477502 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},···7725767877267679 spec->autocfg.hp_pins[0] = 0x15;77277680 spec->autocfg.speaker_pins[0] = 0x14;76817681+}76827682+76837683+static void alc885_mb5_automute(struct hda_codec *codec)76847684+{76857685+ unsigned int present;76867686+76877687+ present = snd_hda_codec_read(codec, 0x14, 0,76887688+ AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;76897689+ snd_hda_codec_amp_stereo(codec, 0x18, HDA_OUTPUT, 0,76907690+ HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);76917691+ snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0,76927692+ HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);76937693+76947694+}76957695+76967696+static void alc885_mb5_unsol_event(struct hda_codec *codec,76977697+ unsigned int res)76987698+{76997699+ /* Headphone insertion or removal. */77007700+ if ((res >> 26) == ALC880_HP_EVENT)77017701+ alc885_mb5_automute(codec);77287702}7729770377307704static void alc885_imac91_automute(struct hda_codec *codec)···91949126 .input_mux = &mb5_capture_source,91959127 .dig_out_nid = ALC882_DIGOUT_NID,91969128 .dig_in_nid = ALC882_DIGIN_NID,91299129+ .unsol_event = alc885_mb5_unsol_event,91309130+ .init_hook = alc885_mb5_automute,91979131 },91989132 [ALC885_MACPRO] = {91999133 .mixers = { alc882_macpro_mixer },···1124911179}11250111801125111181#define alc262_auto_create_input_ctls \1125211252- alc880_auto_create_input_ctls1118211182+ alc882_auto_create_input_ctls11253111831125411184/*1125511185 * generic initialization of ADC, input mixers and output mixers···1492514855 spec->stream_digital_playback = &alc861_pcm_digital_playback;1492614856 spec->stream_digital_capture = &alc861_pcm_digital_capture;14927148571485814858+ if (!spec->cap_mixer)1485914859+ set_capture_mixer(codec);1492814860 set_beep_amp(spec, 0x23, 0, HDA_OUTPUT);14929148611493014862 spec->vmaster_nid = 0x03;···1732317251 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS),1732417252 SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K",1732517253 ALC662_3ST_6ch_DIG),1732617326- SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB200", ALC663_ASUS_MODE4),1725417254+ SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB20x", ALC662_AUTO),1732717255 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10),1732817256 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L",1732917257 ALC662_3ST_6ch_DIG),
+45-16
sound/pci/hda/patch_sigmatel.c
···47304730 }47314731}4732473247334733+static int hp_blike_system(u32 subsystem_id);47344734+47354735+static void set_hp_led_gpio(struct hda_codec *codec)47364736+{47374737+ struct sigmatel_spec *spec = codec->spec;47384738+ switch (codec->vendor_id) {47394739+ case 0x111d7608:47404740+ /* GPIO 0 */47414741+ spec->gpio_led = 0x01;47424742+ break;47434743+ case 0x111d7600:47444744+ case 0x111d7601:47454745+ case 0x111d7602:47464746+ case 0x111d7603:47474747+ /* GPIO 3 */47484748+ spec->gpio_led = 0x08;47494749+ break;47504750+ }47514751+}47524752+47334753/*47344754 * This method searches for the mute LED GPIO configuration47354755 * provided as OEM string in SMBIOS. The format of that string···47614741 *47624742 * So, HP B-series like systems may have HP_Mute_LED_0 (current models)47634743 * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings47444744+ *47454745+ *47464746+ * The dv-series laptops don't seem to have the HP_Mute_LED* strings in47474747+ * SMBIOS - at least the ones I have seen do not have them - which include47484748+ * my own system (HP Pavilion dv6-1110ax) and my cousin's47494749+ * HP Pavilion dv9500t CTO.47504750+ * Need more information on whether it is true across the entire series.47514751+ * -- kunal47644752 */47654753static int find_mute_led_gpio(struct hda_codec *codec)47664754{···47794751 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,47804752 NULL, dev))) {47814753 if (sscanf(dev->name, "HP_Mute_LED_%d_%d",47824782- &spec->gpio_led_polarity,47834783- &spec->gpio_led) == 2) {47544754+ &spec->gpio_led_polarity,47554755+ &spec->gpio_led) == 2) {47844756 spec->gpio_led = 1 << spec->gpio_led;47854757 return 1;47864758 }47874759 if (sscanf(dev->name, "HP_Mute_LED_%d",47884788- &spec->gpio_led_polarity) == 1) {47894789- switch (codec->vendor_id) {47904790- case 0x111d7608:47914791- /* GPIO 0 */47924792- spec->gpio_led = 0x01;47934793- return 1;47944794- case 0x111d7600:47954795- case 0x111d7601:47964796- case 0x111d7602:47974797- case 0x111d7603:47984798- /* GPIO 3 */47994799- spec->gpio_led = 0x08;48004800- return 1;48014801- }47604760+ &spec->gpio_led_polarity) == 1) {47614761+ set_hp_led_gpio(codec);47624762+ return 1;48024763 }47644764+ }47654765+47664766+ /*47674767+ * Fallback case - if we don't find the DMI strings,47684768+ * we statically set the GPIO - if not a B-series system.47694769+ */47704770+ if (!hp_blike_system(codec->subsystem_id)) {47714771+ set_hp_led_gpio(codec);47724772+ spec->gpio_led_polarity = 1;47734773+ return 1;48034774 }48044775 }48054776 return 0;···55745547 spec->num_adcs = ARRAY_SIZE(stac92hd71bxx_adc_nids);55755548 spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids);55765549 spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e);55505550+55515551+ snd_printdd("Found board config: %d\n", spec->board_config);5577555255785553 switch (spec->board_config) {55795554 case STAC_HP_M4: