lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170929174246.12144-3-damien.riegel@savoirfairelinux.com>
Date:   Fri, 29 Sep 2017 13:42:46 -0400
From:   Damien Riegel <damien.riegel@...oirfairelinux.com>
To:     alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        kernel@...oirfairelinux.com,
        Damien Riegel <damien.riegel@...oirfairelinux.com>
Subject: [PATCH v1 2/2] ASoC: codecs: msm8916-wcd-analog: configure micbias in mbhc setup

The very first time a headset is plugged in, detection is unreliable
because bias hasn't been configured yet, it's done once a mechanical
insertion interrupt has been triggered, so following insertions (and
thus detections) are not affected.

To fix the very first detection, the bias must also be configured in the 
function that setup the MBHC.

Signed-off-by: Damien Riegel <damien.riegel@...oirfairelinux.com>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
 sound/soc/codecs/msm8916-wcd-analog.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c
index 9f08d998a79b..71494e9dbdcb 100644
--- a/sound/soc/codecs/msm8916-wcd-analog.c
+++ b/sound/soc/codecs/msm8916-wcd-analog.c
@@ -493,6 +493,7 @@ static int pm8916_mbhc_configure_bias(struct pm8916_wcd_analog_priv *priv,
 static void pm8916_wcd_setup_mbhc(struct pm8916_wcd_analog_priv *wcd)
 {
 	struct snd_soc_codec *codec = wcd->codec;
+	bool micbias_enabled = false;
 	u32 plug_type = 0;
 	u32 int_en_mask;
 
@@ -524,6 +525,11 @@ static void pm8916_wcd_setup_mbhc(struct pm8916_wcd_analog_priv *wcd)
 			    DIG_CLK_CTL_D_MBHC_CLK_EN_MASK,
 			    DIG_CLK_CTL_D_MBHC_CLK_EN);
 
+	if (snd_soc_read(codec, CDC_A_MICB_2_EN) & CDC_A_MICB_2_EN_ENABLE)
+		micbias_enabled = true;
+
+	pm8916_mbhc_configure_bias(wcd, micbias_enabled);
+
 	int_en_mask = MBHC_SWITCH_INT;
 	if (wcd->mbhc_btn_enabled)
 		int_en_mask |= MBHC_BUTTON_PRESS_DET | MBHC_BUTTON_RELEASE_DET;
-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ