From patchwork Tue Dec 15 21:51:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Zhang X-Patchwork-Id: 7857611 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 04D6FBEEE1 for ; Tue, 15 Dec 2015 21:51:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3AF1B203C0 for ; Tue, 15 Dec 2015 21:51:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 191562037F for ; Tue, 15 Dec 2015 21:51:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4F56A26153C; Tue, 15 Dec 2015 22:51:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D97E42608D3; Tue, 15 Dec 2015 22:51:40 +0100 (CET) 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 920212610C5; Tue, 15 Dec 2015 22:51:38 +0100 (CET) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by alsa0.perex.cz (Postfix) with ESMTP id 58FFF260786 for ; Tue, 15 Dec 2015 22:51:33 +0100 (CET) Received: by mail-pa0-f53.google.com with SMTP id hk6so11757007pad.2 for ; Tue, 15 Dec 2015 13:51:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=HpvUah70Iy/zRnMFLEntvdYlAHQhUtMvecPThTkXgQg=; b=fpB/n+1DaT68AIeHRKZQa5Z4ZIAqngNbQoXXzcOoheHhmTinExKnEo8I/Jefyqsme8 DPPeR+xBg9fizOgSzyz5bnw+8u4ORvF7ddXhII3bKZIwrN8DeEWUiUiygE5OAg7/aCNp a+TL/wTC1XH1EFLUe4Cb2bRaIwZvmHV5T+GD0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HpvUah70Iy/zRnMFLEntvdYlAHQhUtMvecPThTkXgQg=; b=iUlLLbzEbA6LCooXEdeF2yo84K45jc98qMI/IVm4EALhqLsU7fYU8pQZlxqKGVr3uH dzejCEOAm98Yge5YcKC9fxwR3Yux/FLbDtr9mTmBueEwJodE80etvMI89o8Ha7JnsRHQ dU45sCzwERiyoFA+qyAHzMsDfEfP6ZRtT46GSRCdWa9mCB0xWUj1hRagHhy9CGSfCGbU gAWBSpdiKOZIzywBLfbayC3iobxh+Wg07zi0f1pBdLuS0B+CWuJ1/mScITFTWuAtfpWF Y5cuBUatlKuY05/uQHaF5IY/LATWEtIBKvr9tjeIUpILIZoaX2Q+7BAGGTRlF+cSH1/m wBQw== X-Gm-Message-State: ALoCoQkDyREocPoJtYm/hW/mXKpQX7SggvHHtWCwJ8LRZckia3zq7jWw0VkVHFgO0I81Fz6NJY/5uAypJwbq09nD7iPn/AhvlA== X-Received: by 10.66.138.101 with SMTP id qp5mr57832299pab.113.1450216291714; Tue, 15 Dec 2015 13:51:31 -0800 (PST) Received: from benzh.mtv.corp.google.com ([172.22.65.67]) by smtp.gmail.com with ESMTPSA id qz2sm4505510pab.14.2015.12.15.13.51.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Dec 2015 13:51:31 -0800 (PST) From: Ben Zhang To: Mark Brown Date: Tue, 15 Dec 2015 13:51:25 -0800 Message-Id: <1450216285-14875-1-git-send-email-benzh@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 Cc: Oder Chiou , alsa-devel@alsa-project.org, Liam Girdwood , John Lin , Ben Zhang , Anatol Pomozov , Bard Liao , Dylan Reid Subject: [alsa-devel] [PATCH] ASoC: rt5677: Reconfigure PLL1 after resume 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 X-Virus-Scanned: ClamAV using ClamSMTP Sometimes PLL1 stops working if the codec loses power during suspend (when pow-ldo2 or reset gpio is used). MX-7Bh(RT5677_PLL1_CTRL2) is cleared and won't be restored by regcache since it's volatile. MX-7Bh has one status bit and M code for PLL1. rt5677_set_dai_pll doesn't reconfigure PLL1 after resume because it thinks the PLL params are not changed. This patch clears the cached PLL params at resume so that rt5677_set_dai_pll can reconfigure the PLL after resume. Signed-off-by: Ben Zhang --- sound/soc/codecs/rt5677.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index f73fd12..c404f51 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -4792,6 +4792,9 @@ static int rt5677_resume(struct snd_soc_codec *codec) struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec); if (!rt5677->dsp_vad_en) { + rt5677->pll_src = 0; + rt5677->pll_in = 0; + rt5677->pll_out = 0; gpiod_set_value_cansleep(rt5677->pow_ldo2, 1); gpiod_set_value_cansleep(rt5677->reset_pin, 0); if (rt5677->pow_ldo2 || rt5677->reset_pin)