From: Takashi Iwai Date: Tue, 25 Nov 2008 10:56:25 +0000 (+0100) Subject: Merge branch 'topic/fix/hda' into topic/hda X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=0e19e7d2bff0ec04fe4dc920c580d8a321afa07f;p=deliverable%2Flinux.git Merge branch 'topic/fix/hda' into topic/hda Conflicts: sound/pci/hda/patch_sigmatel.c --- 0e19e7d2bff0ec04fe4dc920c580d8a321afa07f diff --cc sound/pci/hda/patch_sigmatel.c index 7cd395a175ef,5a29699c6fdb..09b3f4b1db4d --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@@ -4127,33 -3994,11 +4150,38 @@@ static void stac_toggle_power_map(struc snd_hda_codec_write(codec, codec->afg, 0, 0x7ec, val); } + static void stac92xx_pin_sense(struct hda_codec *codec, hda_nid_t nid) + { + stac_toggle_power_map(codec, nid, get_hp_pin_presence(codec, nid)); + } + +static void stac92xx_report_jack(struct hda_codec *codec, hda_nid_t nid) +{ + struct sigmatel_spec *spec = codec->spec; + struct sigmatel_jack *jacks = spec->jacks.list; + + if (jacks) { + int i; + for (i = 0; i < spec->jacks.used; i++) { + if (jacks->nid == nid) { + unsigned int pin_ctl = + snd_hda_codec_read(codec, nid, + 0, AC_VERB_GET_PIN_WIDGET_CONTROL, + 0x00); + int type = jacks->type; + if (type == (SND_JACK_LINEOUT + | SND_JACK_HEADPHONE)) + type = (pin_ctl & AC_PINCTL_HP_EN) + ? SND_JACK_HEADPHONE : SND_JACK_LINEOUT; + snd_jack_report(jacks->jack, + get_hp_pin_presence(codec, nid) + ? type : 0); + } + jacks++; + } + } +} + static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) { struct sigmatel_spec *spec = codec->spec;