From patchwork Fri Jun 23 12:04:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 106258 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp170792qgd; Fri, 23 Jun 2017 05:06:04 -0700 (PDT) X-Received: by 10.28.64.67 with SMTP id n64mr5281860wma.93.1498219564264; Fri, 23 Jun 2017 05:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498219564; cv=none; d=google.com; s=arc-20160816; b=TQrP2nPHeQdTu2S0VI6z+nv+bcfRiodLM+Nqp9WU3yOrJzJONxwiRAX+4J2iCyyfC+ JqoTsTcg6MXmfUPvSTccPoVeiOHsfoRISV9lvfg9/kT+y9GXzc6RaNg2a2NpTHErXvUC m+Pdb2lxf/3PLH2BxOKUCg2s9O/TgzmCHqfx1GDL+idai5HjnY87mczGb9WC0t0p1BIe 59fmfTJyi/ezN2b8BDx6any18YFsvcJudDNbBKiZMvQaKbita2jh91JRvmQVLomHdswg ur+9OXo1zgKDnG8noFNPY8XwFO6sWqJj6D50w7OspP/GD5A4jzP8WgyFMvPNPdMNWSO6 MKNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :delivered-to:arc-authentication-results; bh=AaPGlSrgwO/Cg3YBFV2pIvDNtsyOWlZN9b1NUUtdhdU=; b=THVT3OVKMc+dDh0d9++BWCR3Nj2RgATKr7/cB8BCxbjQIsngEsjrjnCoUzLcHxNzEr qEape2i1el1HuG0Bgrk7ayJH8bE6Ktv/n8FibziLfkxu9Za8FndTHjzaDp15omMAWKMm E4lbdKoARB0N+KADfBgqUmuymTpT6QQF5eCriwlDJcrrtWaZbGzfSDbZhdfrifa5Gkbc leR6JFpDdqHvNIQd7xQdLFmnrG5gS5GkURC8NYtLOaksIywJFfHUSbZCnmIuii2Ejw8G 0cVKFhOM7gHcq/jzJyJDTcmDQsCbqflGEYJ0tti0O+JCsv/Ahjq+wfuX1C6Pktuk992v A4Fw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id y35si3993773wmh.132.2017.06.23.05.06.04; Fri, 23 Jun 2017 05:06:04 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DDF3E26749A; Fri, 23 Jun 2017 14:04:52 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id EDC862674DB; Fri, 23 Jun 2017 14:04:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id AFC1D26748E for ; Fri, 23 Jun 2017 14:04:17 +0200 (CEST) Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dONJi-0003Wy-SC; Fri, 23 Jun 2017 12:04:05 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dONJg-0006Or-Bi; Fri, 23 Jun 2017 13:04:00 +0100 From: Mark Brown To: John Hsu In-Reply-To: <1498028390-10952-1-git-send-email-KCHSU0@nuvoton.com> Message-Id: Date: Fri, 23 Jun 2017 13:04:00 +0100 X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Cc: alsa-devel@alsa-project.org, anatol.pomozov@gmail.com, benzh@chromium.org, John Hsu , lgirdwood@gmail.com, YHCHuang@nuvoton.com, mac.chiang@intel.com, broonie@kernel.org, CTLIN0@nuvoton.com, yong.zhi@intel.com, mhkuo@nuvoton.com Subject: [alsa-devel] Applied "ASoC: nau8825: fix jack type detection issue after resume" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: nau8825: fix jack type detection issue after resume has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 8fe19795da1b9dea2353f016622842a2f163039e Mon Sep 17 00:00:00 2001 From: John Hsu Date: Thu, 22 Jun 2017 11:21:01 +0800 Subject: [PATCH] ASoC: nau8825: fix jack type detection issue after resume Fix the issue that mic type detection error after resume. The microphone type detection procedure will recognize testing signal on JKSLV pin, but before the procedure, JKSLV already had supply voltage, that results in the failure. Therefore, the patch turns off the power and reset the jack type configuration before suspend. Then redo the jack detection procedure after resume. The patch help to fix the issue as follows: Google issue 37973093: CTIA/OMTP jack type detection failure after resume Reported Issue Chrome OS Version : ChromeOS R59-9460.13.0 Type of hardware : DVT sample What steps will reproduce the problem? (1 Play a music (2 Insert a headphones (3 Close laptop lid 3 sec then open it What is the expected output? The music is normal in the headphones. What do you see instead? Singer voice in the music is not clear. How frequently does this problem reproduce? Always What is the impact to the user, and is there a workaround? If so, what is it? Re-insert the headset or close the laptop lid and then open it again can be repaired. Signed-off-by: John Hsu Signed-off-by: John Hsu Signed-off-by: Mark Brown --- sound/soc/codecs/nau8825.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) -- 2.13.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c index c00b86dd80dc..503a6d8130b7 100644 --- a/sound/soc/codecs/nau8825.c +++ b/sound/soc/codecs/nau8825.c @@ -1612,7 +1612,6 @@ static int nau8825_jack_insert(struct nau8825 *nau8825) snd_soc_dapm_sync(dapm); break; case 2: - case 3: dev_dbg(nau8825->dev, "CTIA (micgnd2) mic connected\n"); type = SND_JACK_HEADSET; @@ -1632,6 +1631,11 @@ static int nau8825_jack_insert(struct nau8825 *nau8825) snd_soc_dapm_force_enable_pin(dapm, "SAR"); snd_soc_dapm_sync(dapm); break; + case 3: + /* detect error case */ + dev_err(nau8825->dev, "detection error; disable mic function\n"); + type = SND_JACK_HEADPHONE; + break; } /* Leaving HPOL/R grounded after jack insert by default. They will be @@ -2328,6 +2332,13 @@ static int nau8825_set_bias_level(struct snd_soc_codec *codec, break; case SND_SOC_BIAS_OFF: + /* Reset the configuration of jack type for detection */ + /* Detach 2kOhm Resistors from MICBIAS to MICGND1/2 */ + regmap_update_bits(nau8825->regmap, NAU8825_REG_MIC_BIAS, + NAU8825_MICBIAS_JKSLV | NAU8825_MICBIAS_JKR2, 0); + /* ground HPL/HPR, MICGRND1/2 */ + regmap_update_bits(nau8825->regmap, + NAU8825_REG_HSD_CTRL, 0xf, 0xf); /* Cancel and reset cross talk detection funciton */ nau8825_xtalk_cancel(nau8825); /* Turn off all interruptions before system shutdown. Keep the @@ -2351,6 +2362,10 @@ static int __maybe_unused nau8825_suspend(struct snd_soc_codec *codec) disable_irq(nau8825->irq); snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); + /* Power down codec power; don't suppoet button wakeup */ + snd_soc_dapm_disable_pin(nau8825->dapm, "SAR"); + snd_soc_dapm_disable_pin(nau8825->dapm, "MICBIAS"); + snd_soc_dapm_sync(nau8825->dapm); regcache_cache_only(nau8825->regmap, true); regcache_mark_dirty(nau8825->regmap);