diff --git a/asoc/pineapple.c b/asoc/pineapple.c index e0ea5c34d7..848df12a9d 100644 --- a/asoc/pineapple.c +++ b/asoc/pineapple.c @@ -136,10 +136,12 @@ static bool msm_usbc_swap_gnd_mic(struct snd_soc_component *component, bool acti return false; #if IS_ENABLED(CONFIG_QCOM_WCD_USBSS_I2C) - ret = wcd_usbss_switch_update(WCD_USBSS_GND_MIC_SWAP_AATC, - WCD_USBSS_CABLE_CONNECT); - if (ret == 0) - return true; + if (wcd_mbhc_cfg.usbss_hsj_connect_enable) + ret = wcd_usbss_switch_update(WCD_USBSS_GND_MIC_SWAP_HSJ, + WCD_USBSS_CABLE_CONNECT); + else if (wcd_mbhc_cfg.enable_usbc_analog) + ret = wcd_usbss_switch_update(WCD_USBSS_GND_MIC_SWAP_AATC, + WCD_USBSS_CABLE_CONNECT); #endif return ret; } @@ -1418,6 +1420,12 @@ static int msm_snd_card_late_probe(struct snd_soc_card *card) return -ENOMEM; wcd_mbhc_cfg.calibration = mbhc_calibration; +#if IS_ENABLED(CONFIG_QCOM_WCD_USBSS_I2C) + if (of_find_property(card->dev->of_node, + "qcom,usbss-hsj-connect-enabled", NULL)) + wcd_mbhc_cfg.usbss_hsj_connect_enable = true; +#endif + ret = wcd939x_mbhc_hs_detect(component, &wcd_mbhc_cfg); if (ret) { dev_err(component->dev, "%s: mbhc hs detect failed, err:%d\n", diff --git a/include/asoc/wcd-mbhc-v2.h b/include/asoc/wcd-mbhc-v2.h index 49259fe469..7c39fc8e56 100644 --- a/include/asoc/wcd-mbhc-v2.h +++ b/include/asoc/wcd-mbhc-v2.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef __WCD_MBHC_V2_H__ #define __WCD_MBHC_V2_H__ @@ -440,6 +440,7 @@ struct wcd_mbhc_config { bool enable_anc_mic_detect; u32 enable_usbc_analog; bool moisture_duty_cycle_en; + bool usbss_hsj_connect_enable; }; struct wcd_mbhc_intr {