Asoc: wcd: mbhc: Force lineout event report only for headphone

Correct plug type to lineout only if headphone is detected and
impedance of left and right is above 5000 ohm. This avoids reporting
lineout for valid headset devices like tty.

CRs-Fixed: 899726
Change-Id: I048c5e63e8cdd526fecf20211f061ed61db39522
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
This commit is contained in:
Yandong Yang 2015-09-01 11:17:41 +08:00 committed by Gerrit - the friendly Code Review server
parent 973e5f2eb0
commit bfa547f815

View file

@ -631,7 +631,8 @@ static void wcd_mbhc_report_plug(struct wcd_mbhc *mbhc, int insertion,
mbhc->mbhc_cb->compute_impedance(mbhc,
&mbhc->zl, &mbhc->zr);
if ((mbhc->zl > mbhc->mbhc_cfg->linein_th) &&
(mbhc->zr > mbhc->mbhc_cfg->linein_th)) {
(mbhc->zr > mbhc->mbhc_cfg->linein_th) &&
(jack_type == SND_JACK_HEADPHONE)) {
jack_type = SND_JACK_LINEOUT;
mbhc->current_plug = MBHC_PLUG_TYPE_HIGH_HPH;
if (mbhc->hph_status) {