Merge branch 'fix/hda' into for-linus

* fix/hda:
ALSA: hda - Set function_id only on FG nodes
ALSA: hda - Add upper-limit of mixer amp for AD1884A-laptop model, too
ALSA: hda - Fix headphone-detection on some machines with STAC/IDT codecs
ALSA: hda_intel.c - Consolidate bitfields

+19 -9
+5 -3
sound/pci/hda/hda_codec.c
··· 642 */ 643 static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec) 644 { 645 - int i, total_nodes; 646 hda_nid_t nid; 647 648 total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid); 649 for (i = 0; i < total_nodes; i++, nid++) { 650 - codec->function_id = snd_hda_param_read(codec, nid, 651 AC_PAR_FUNCTION_TYPE) & 0xff; 652 - switch (codec->function_id) { 653 case AC_GRP_AUDIO_FUNCTION: 654 codec->afg = nid; 655 break; 656 case AC_GRP_MODEM_FUNCTION: 657 codec->mfg = nid; 658 break; 659 default: 660 break;
··· 642 */ 643 static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec) 644 { 645 + int i, total_nodes, function_id; 646 hda_nid_t nid; 647 648 total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid); 649 for (i = 0; i < total_nodes; i++, nid++) { 650 + function_id = snd_hda_param_read(codec, nid, 651 AC_PAR_FUNCTION_TYPE) & 0xff; 652 + switch (function_id) { 653 case AC_GRP_AUDIO_FUNCTION: 654 codec->afg = nid; 655 + codec->function_id = function_id; 656 break; 657 case AC_GRP_MODEM_FUNCTION: 658 codec->mfg = nid; 659 + codec->function_id = function_id; 660 break; 661 default: 662 break;
+1 -1
sound/pci/hda/hda_intel.c
··· 312 unsigned int period_bytes; /* size of the period in bytes */ 313 unsigned int frags; /* number for period in the play buffer */ 314 unsigned int fifo_size; /* FIFO size */ 315 - unsigned int start_flag: 1; /* stream full start flag */ 316 unsigned long start_jiffies; /* start + minimum jiffies */ 317 unsigned long min_jiffies; /* minimum jiffies before position is valid */ 318 ··· 332 unsigned int opened :1; 333 unsigned int running :1; 334 unsigned int irq_pending :1; 335 /* 336 * For VIA: 337 * A flag to ensure DMA position is 0
··· 312 unsigned int period_bytes; /* size of the period in bytes */ 313 unsigned int frags; /* number for period in the play buffer */ 314 unsigned int fifo_size; /* FIFO size */ 315 unsigned long start_jiffies; /* start + minimum jiffies */ 316 unsigned long min_jiffies; /* minimum jiffies before position is valid */ 317 ··· 333 unsigned int opened :1; 334 unsigned int running :1; 335 unsigned int irq_pending :1; 336 + unsigned int start_flag: 1; /* stream full start flag */ 337 /* 338 * For VIA: 339 * A flag to ensure DMA position is 0
+8
sound/pci/hda/patch_analog.c
··· 3977 spec->input_mux = &ad1884a_laptop_capture_source; 3978 codec->patch_ops.unsol_event = ad1884a_hp_unsol_event; 3979 codec->patch_ops.init = ad1884a_hp_init; 3980 break; 3981 case AD1884A_MOBILE: 3982 spec->mixers[0] = ad1884a_mobile_mixers;
··· 3977 spec->input_mux = &ad1884a_laptop_capture_source; 3978 codec->patch_ops.unsol_event = ad1884a_hp_unsol_event; 3979 codec->patch_ops.init = ad1884a_hp_init; 3980 + /* set the upper-limit for mixer amp to 0dB for avoiding the 3981 + * possible damage by overloading 3982 + */ 3983 + snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT, 3984 + (0x17 << AC_AMPCAP_OFFSET_SHIFT) | 3985 + (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) | 3986 + (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) | 3987 + (1 << AC_AMPCAP_MUTE_SHIFT)); 3988 break; 3989 case AD1884A_MOBILE: 3990 spec->mixers[0] = ad1884a_mobile_mixers;
+5 -5
sound/pci/hda/patch_sigmatel.c
··· 3076 unsigned int wid_caps; 3077 3078 for (i = 0; i < num_outs && i < ARRAY_SIZE(chname); i++) { 3079 nid = dac_nids[i]; 3080 if (!nid) 3081 continue; ··· 3124 err = create_controls_idx(codec, name, idx, nid, 3); 3125 if (err < 0) 3126 return err; 3127 - if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) { 3128 - wid_caps = get_wcaps(codec, pins[i]); 3129 - if (wid_caps & AC_WCAP_UNSOL_CAP) 3130 - spec->hp_detect = 1; 3131 - } 3132 } 3133 } 3134 return 0;
··· 3076 unsigned int wid_caps; 3077 3078 for (i = 0; i < num_outs && i < ARRAY_SIZE(chname); i++) { 3079 + if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) { 3080 + wid_caps = get_wcaps(codec, pins[i]); 3081 + if (wid_caps & AC_WCAP_UNSOL_CAP) 3082 + spec->hp_detect = 1; 3083 + } 3084 nid = dac_nids[i]; 3085 if (!nid) 3086 continue; ··· 3119 err = create_controls_idx(codec, name, idx, nid, 3); 3120 if (err < 0) 3121 return err; 3122 } 3123 } 3124 return 0;