From patchwork Tue Sep 18 17:45:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 146935 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp164165ljw; Tue, 18 Sep 2018 10:45:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYkgENuhxyezpZBHVOxZXhjLRNVAMAYf7gSvNxwldk1fyeQ/aghq7EJWAbFvbWFiaMUguzB X-Received: by 2002:adf:9244:: with SMTP id 62-v6mr23046824wrj.62.1537292731556; Tue, 18 Sep 2018 10:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537292731; cv=none; d=google.com; s=arc-20160816; b=BUCGMnLO1peye9rEvWdpw0o2uwzSBFmEpGFNykQJqDy6JrxHfYZP+k3eb8RD9WaeR0 OtnKyqONPbR1T/DsrWotFAovIg/nK7yya4W8MBWu+H4i1wZ+p3Hk1swhN6JXQ1kUd+40 U477iWCTKO1Nqj23qFEHKRTsoprn+eOLBFjt8wlUvEJGL6OFgbU6pEmD7+Ke/zNvBPJb zAdw3N8loEkhhpH+tsTIvuHTQ6/jeA3h1VlJxGnZhaq4RGYUh/WKC5UVNdHNLGbUqdF2 19umxBliNFoqKfabfoG77FdFkjCXrMydHtN0m/Ti/K6ZcXJ+F4L5xnERxCDO85PydGmQ 3/GA== 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 :dkim-signature:delivered-to; bh=QrA0sv2lVPPrpTDL2TIl+a93c87Vnh3q3QznDkEuny0=; b=AJc6r5R0VWDlNbQElT0IfIPYF5XU+cOFEaXkxxmveS7XoeNWW3sOhb463slZKOFIqf 0+Db1bDm6eXxDzkhhKzwtkxjtTqIhXfO7p+LgaodnS8sKaIPDDRl+b2m4SdkzPKABUF5 X+RZlAVKJYXGjlC58lD8dBMbK212SEQLCVccbMuilzL9LMj0HbtmZhAsIvpv6DsIT5SC jeaHslO6iVtxsc0hTGYdvXEF2MsYMQbiqhoiPq3Vos/mTPjKSGwam9PVYl/dqknxyN2v /H+SWsJNaXJMH8qrYSXDPMuMd1Nm031bQN3re+UUmqvThPba5O9CjInbP8UUo93Jv1HC ZF9A== 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=CeNUZOFn; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id h199-v6si11877829wmd.12.2018.09.18.10.45.31; Tue, 18 Sep 2018 10:45:31 -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=CeNUZOFn; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EDE2D26789F; Tue, 18 Sep 2018 19:45:28 +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 277502678A9; Tue, 18 Sep 2018 19:45:24 +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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS 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 1A6EC2678AC for ; Tue, 18 Sep 2018 19:45:21 +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=n4kspv8fvotNjiTibILtDWoYh5E40aqExeJ3hoBiTk0=; b=CeNUZOFnz5RJ VskX/Yf2LpnUd+xqwCf8BuSaneFGY4B9TsrlLJnTJxyNUUQ2tCzge79RGXPRbtM4eWXTeHR/GFHWd U9Zpk+0BS6HkQHEWn4vuGut+cAEPPC8O7ZcNfUpWmpIRbJYHnW+80MMSRnygwsAYXxTxVncPXEEzS pH+M8=; Received: from [209.121.128.187] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1g2K3s-0003Wu-BD; Tue, 18 Sep 2018 17:45:20 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 80EA4440078; Tue, 18 Sep 2018 18:45:18 +0100 (BST) From: Mark Brown To: Shuming Fan In-Reply-To: <1537271438-5540-1-git-send-email-shumingf@realtek.com> Message-Id: <20180918174518.80EA4440078@finisterre.ee.mobilebroadband> Date: Tue, 18 Sep 2018 18:45:18 +0100 (BST) Cc: oder_chiou@realtek.com, jack.yu@realtek.com, alsa-devel@alsa-project.org, lars@metafoo.de, lgirdwood@gmail.com, albertchen@realtek.com, broonie@kernel.org, flove@realtek.com Subject: [alsa-devel] Applied "ASoC: rt5682: Update calibration function" 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: rt5682: Update calibration function has been applied to the asoc tree at https://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 afd603e4ded0fad9e3102d514020af8494da1604 Mon Sep 17 00:00:00 2001 From: Shuming Fan Date: Tue, 18 Sep 2018 19:50:38 +0800 Subject: [PATCH] ASoC: rt5682: Update calibration function The ADC/DAC path should open while calibration process. Signed-off-by: Shuming Fan Signed-off-by: Mark Brown --- sound/soc/codecs/rt5682.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) -- 2.19.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c index 7213b1cfb18a..2725eb72fb1b 100644 --- a/sound/soc/codecs/rt5682.c +++ b/sound/soc/codecs/rt5682.c @@ -2468,17 +2468,22 @@ static void rt5682_calibrate(struct rt5682_priv *rt5682) mutex_lock(&rt5682->calibrate_mutex); rt5682_reset(rt5682->regmap); - regmap_write(rt5682->regmap, RT5682_PWR_ANLG_1, 0xa2bf); + regmap_write(rt5682->regmap, RT5682_PWR_ANLG_1, 0xa2af); usleep_range(15000, 20000); - regmap_write(rt5682->regmap, RT5682_PWR_ANLG_1, 0xf2bf); + regmap_write(rt5682->regmap, RT5682_PWR_ANLG_1, 0xf2af); regmap_write(rt5682->regmap, RT5682_MICBIAS_2, 0x0300); regmap_write(rt5682->regmap, RT5682_GLB_CLK, 0x8000); regmap_write(rt5682->regmap, RT5682_PWR_DIG_1, 0x0100); + regmap_write(rt5682->regmap, RT5682_HP_IMP_SENS_CTRL_19, 0x3800); regmap_write(rt5682->regmap, RT5682_CHOP_DAC, 0x3000); + regmap_write(rt5682->regmap, RT5682_CALIB_ADC_CTRL, 0x7005); + regmap_write(rt5682->regmap, RT5682_STO1_ADC_MIXER, 0x686c); + regmap_write(rt5682->regmap, RT5682_CAL_REC, 0x0d0d); regmap_write(rt5682->regmap, RT5682_HP_CALIB_CTRL_2, 0x0321); regmap_write(rt5682->regmap, RT5682_HP_LOGIC_CTRL_2, 0x0004); regmap_write(rt5682->regmap, RT5682_HP_CALIB_CTRL_1, 0x7c00); regmap_write(rt5682->regmap, RT5682_HP_CALIB_CTRL_3, 0x06a1); + regmap_write(rt5682->regmap, RT5682_A_DAC1_MUX, 0x0311); regmap_write(rt5682->regmap, RT5682_HP_CALIB_CTRL_1, 0x7c00); regmap_write(rt5682->regmap, RT5682_HP_CALIB_CTRL_1, 0xfc00); @@ -2495,8 +2500,12 @@ static void rt5682_calibrate(struct rt5682_priv *rt5682) pr_err("HP Calibration Failure\n"); /* restore settings */ + regmap_write(rt5682->regmap, RT5682_PWR_ANLG_1, 0x02af); + regmap_write(rt5682->regmap, RT5682_MICBIAS_2, 0x0080); regmap_write(rt5682->regmap, RT5682_GLB_CLK, 0x0000); regmap_write(rt5682->regmap, RT5682_PWR_DIG_1, 0x0000); + regmap_write(rt5682->regmap, RT5682_CHOP_DAC, 0x2000); + regmap_write(rt5682->regmap, RT5682_CALIB_ADC_CTRL, 0x2005); mutex_unlock(&rt5682->calibrate_mutex);