asoc: pineapple: add support for GND MIC SWAP config

add support for GND MIC SWAP config for pineapple CDP.

Change-Id: Ia6ecbe2818ac12c7fad5738a78bbdcd4d1611e15
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
This commit is contained in:
Prasad Kumpatla
2023-02-07 00:35:02 +05:30
parent 44f00dc545
commit 15a3ce41fe
2 changed files with 14 additions and 5 deletions

View File

@@ -136,10 +136,12 @@ static bool msm_usbc_swap_gnd_mic(struct snd_soc_component *component, bool acti
return false; return false;
#if IS_ENABLED(CONFIG_QCOM_WCD_USBSS_I2C) #if IS_ENABLED(CONFIG_QCOM_WCD_USBSS_I2C)
ret = wcd_usbss_switch_update(WCD_USBSS_GND_MIC_SWAP_AATC, if (wcd_mbhc_cfg.usbss_hsj_connect_enable)
WCD_USBSS_CABLE_CONNECT); ret = wcd_usbss_switch_update(WCD_USBSS_GND_MIC_SWAP_HSJ,
if (ret == 0) WCD_USBSS_CABLE_CONNECT);
return true; else if (wcd_mbhc_cfg.enable_usbc_analog)
ret = wcd_usbss_switch_update(WCD_USBSS_GND_MIC_SWAP_AATC,
WCD_USBSS_CABLE_CONNECT);
#endif #endif
return ret; return ret;
} }
@@ -1418,6 +1420,12 @@ static int msm_snd_card_late_probe(struct snd_soc_card *card)
return -ENOMEM; return -ENOMEM;
wcd_mbhc_cfg.calibration = mbhc_calibration; 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); ret = wcd939x_mbhc_hs_detect(component, &wcd_mbhc_cfg);
if (ret) { if (ret) {
dev_err(component->dev, "%s: mbhc hs detect failed, err:%d\n", dev_err(component->dev, "%s: mbhc hs detect failed, err:%d\n",

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved. /* 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__ #ifndef __WCD_MBHC_V2_H__
#define __WCD_MBHC_V2_H__ #define __WCD_MBHC_V2_H__
@@ -440,6 +440,7 @@ struct wcd_mbhc_config {
bool enable_anc_mic_detect; bool enable_anc_mic_detect;
u32 enable_usbc_analog; u32 enable_usbc_analog;
bool moisture_duty_cycle_en; bool moisture_duty_cycle_en;
bool usbss_hsj_connect_enable;
}; };
struct wcd_mbhc_intr { struct wcd_mbhc_intr {