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
bovenliggende 44f00dc545
commit 15a3ce41fe
2 gewijzigde bestanden met toevoegingen van 14 en 5 verwijderingen

Bestand weergeven

@@ -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",

Bestand weergeven

@@ -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 {