From patchwork Wed Oct 4 11:28:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 114773 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2999727qgn; Wed, 4 Oct 2017 04:31:01 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDMngRLFkS15pVFaBMq7kKC+mz8uLFk65hCTn9GWF7hCryk9chI9GuTlc8LNi5hl6zOVIAr X-Received: by 10.28.97.194 with SMTP id v185mr11519557wmb.117.1507116661246; Wed, 04 Oct 2017 04:31:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507116661; cv=none; d=google.com; s=arc-20160816; b=KxU+Tayrn7M4GrStPLzNhMIVvDAKct9MbPsxgS8pDhTcYrimI34lXjgNia3tflF+q+ fQrYK+AuJDn4MnvLwI9S/Hn4xb4X2SgPSQ/LFi5+Dy9i53iszZF+R3p8Upl+wq03nGPt s0pBsD8UCXRmhHOuAd3ti5wEig+M+7E6uuFUick9WhmO94VzN0JIJ+UTb9AZH9C20DXn exMEekx0cLkHqguzzFlU47uewIH5ku8+Mk41cDlYCzFnDrcwETE+efTwa42vGZ47qFZh YUpCXglql+CwtlxiJgXnuMvYv9rOdTpmo2GUFYeh+GVs4/wIUyG2RoX1oV8g8uAf8wR2 7O9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:dkim-signature:delivered-to :arc-authentication-results; bh=DskWbcJvC9/KSzApKGkOO80ZcQk2inEsE2NinGWfIlE=; b=TZAjsdeeyL0A/dESVZUxAXHVIXZiT7RnEOMfBd0BXBs/bQRVJdkkWMP+E/9ZbnfTCj TvwkDV/C88doH/sTnoIr/egrfLnhIkCu53a4LDnzzn7F9yfVbSizHwOVoui9n4uywE03 HDTpV1EX+Mahd9j6rKhh3JZWdOTXxkMrNZ/UDKgAYRVSbvS7HBDq2nb2MUyOz0+x235s juWmdaYFq+3wT/zsHuZNykezgoz17r3wqlqJYdxR4Ia57LbIIci99Skk+sSN3IYSpe/j bdSrGIs+d6N2iFcwTEi8zEOfG5hX7RMull2s2Q0Zc0so6k5QD4jH5O2Xs9M4DG+TJPuc WiDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=wrLKgaDO; 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 s2si13137281wrs.428.2017.10.04.04.31.00; Wed, 04 Oct 2017 04:31:01 -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; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=wrLKgaDO; 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 D754B267448; Wed, 4 Oct 2017 13:29:14 +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 0A9C5267428; Wed, 4 Oct 2017 13:29:12 +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=1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MIME_8BIT_HEADER, SPF_NEUTRAL autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id D89732673E8 for ; Wed, 4 Oct 2017 13:28:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=xHvGICJNOdV+tJtW4I4oGhMBhpEbsDw0GIwoAd7t5uU=; b=wrLKgaDOjMpN v+BmRdBW8OrUCHrhSIsS/oQ1BrJaOqdlhS5SpFMH4CYPdrHsf3Pu5HHMbFGIu+79AfCPDLp6prXbr TRWs/AZ49TNejrWIfJMphtNV5j2gM2D6C0apZVuLTBMZ7GOVpvzjFcAOefkFaaYvy0yKMC5Y/G0dg wWfzc=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dzhqr-0006YZ-GU; Wed, 04 Oct 2017 11:28:33 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dzhqr-0004Mu-2x; Wed, 04 Oct 2017 12:28:33 +0100 From: Mark Brown To: Jean-Fran??ois T??tu In-Reply-To: <1506716384-4700-1-git-send-email-jean-francois.tetu@savoirfairelinux.com> Message-Id: Date: Wed, 04 Oct 2017 12:28:33 +0100 Cc: alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , linux-kernel@vger.kernel.org, Mark Brown , Srinivas Kandagatla , =?UTF-8?q?Jean-Fran=C3=A7ois=20T=C3=AAtu?= Subject: [alsa-devel] Applied "ASoC: codecs: msm8916-wcd-analog: fix micbias level" 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: codecs: msm8916-wcd-analog: fix micbias level 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 664611e7e02f76fbc5470ef545b2657ed25c292b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20T=C3=AAtu?= Date: Fri, 29 Sep 2017 16:19:44 -0400 Subject: [PATCH] ASoC: codecs: msm8916-wcd-analog: fix micbias level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The macro used to set the microphone bias level causes the snd_soc_write() call to overwrite other fields in the CDC_A_MICB_1_VAL register. The macro also does not return the proper level value to use. This fixes this by preserving all bits from the register that are not the level while setting the level. Signed-off-by: Jean-François TĂȘtu Acked-by: Srinivas Kandagatla Signed-off-by: Mark Brown --- sound/soc/codecs/msm8916-wcd-analog.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.14.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/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c index 549c269acc7d..a42f8ebb9670 100644 --- a/sound/soc/codecs/msm8916-wcd-analog.c +++ b/sound/soc/codecs/msm8916-wcd-analog.c @@ -104,7 +104,7 @@ #define CDC_A_MICB_1_VAL (0xf141) #define MICB_MIN_VAL 1600 #define MICB_STEP_SIZE 50 -#define MICB_VOLTAGE_REGVAL(v) ((v - MICB_MIN_VAL)/MICB_STEP_SIZE) +#define MICB_VOLTAGE_REGVAL(v) (((v - MICB_MIN_VAL)/MICB_STEP_SIZE) << 3) #define MICB_1_VAL_MICB_OUT_VAL_MASK GENMASK(7, 3) #define MICB_1_VAL_MICB_OUT_VAL_V2P70V ((0x16) << 3) #define MICB_1_VAL_MICB_OUT_VAL_V1P80V ((0x4) << 3) @@ -349,8 +349,9 @@ static void pm8916_wcd_analog_micbias_enable(struct snd_soc_codec *codec) | MICB_1_CTL_EXT_PRECHARG_EN_ENABLE); if (wcd->micbias_mv) { - snd_soc_write(codec, CDC_A_MICB_1_VAL, - MICB_VOLTAGE_REGVAL(wcd->micbias_mv)); + snd_soc_update_bits(codec, CDC_A_MICB_1_VAL, + MICB_1_VAL_MICB_OUT_VAL_MASK, + MICB_VOLTAGE_REGVAL(wcd->micbias_mv)); /* * Special headset needs MICBIAS as 2.7V so wait for * 50 msec for the MICBIAS to reach 2.7 volts.