From ebcfca4e9a46b0f43e8d31030c82116b920da2f4 Mon Sep 17 00:00:00 2001 From: Ramprasad Katkam Date: Wed, 12 Dec 2018 09:29:15 +0530 Subject: [PATCH] asoc: codecs: mbhc: Detect cross connection for mono headsets Mono headsets have only one channel connected. Hence make cross connection decision based on the voltage result of alteast one channel showing cross connection. Change-Id: I22a4ea7e25d09e785e7141f4a74c2830fdff555e Signed-off-by: Ramprasad Katkam --- asoc/codecs/wcd-mbhc-adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asoc/codecs/wcd-mbhc-adc.c b/asoc/codecs/wcd-mbhc-adc.c index d63c67ced291..4ab510c7e0ab 100644 --- a/asoc/codecs/wcd-mbhc-adc.c +++ b/asoc/codecs/wcd-mbhc-adc.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #include #include @@ -313,7 +313,7 @@ static int wcd_check_cross_conn(struct wcd_mbhc *mbhc) goto done; } - if (hphl_adc_res > 100 && hphr_adc_res > 100) { + if (hphl_adc_res > 100 || hphr_adc_res > 100) { plug_type = MBHC_PLUG_TYPE_GND_MIC_SWAP; pr_debug("%s: Cross connection identified\n", __func__); } else {