ASoC: wcd: Avoid multiple insertion/removals for aux cable

High impedance aux cable when inserted causes jack to change to
lineout. This causes removal event to be called which results
in pause during music playback because jack value is not updated.
Do not change current plug while plug is marked as lineout.

CRs-Fixed: 2151012
Change-Id: I99797b58c48be00185a352094e32e8623faee491
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
diff --git a/asoc/codecs/wcd-mbhc-legacy.c b/asoc/codecs/wcd-mbhc-legacy.c
index 9f6a625..d03d834 100644
--- a/asoc/codecs/wcd-mbhc-legacy.c
+++ b/asoc/codecs/wcd-mbhc-legacy.c
@@ -688,7 +688,11 @@
 	if (!wrk_complete && mbhc->btn_press_intr) {
 		pr_debug("%s: Can be slow insertion of headphone\n", __func__);
 		wcd_cancel_btn_work(mbhc);
-		plug_type = MBHC_PLUG_TYPE_HEADPHONE;
+		/* Report as headphone only if previously
+		 * not reported as lineout
+		 */
+		if (!mbhc->force_linein)
+			plug_type = MBHC_PLUG_TYPE_HEADPHONE;
 	}
 	/*
 	 * If plug_tye is headset, we might have already reported either in