From patchwork Mon Jul 1 08:39:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 2806541 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 555A2BF4A1 for ; Mon, 1 Jul 2013 09:14:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E5BB200F7 for ; Mon, 1 Jul 2013 09:14:41 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BDB3F200E8 for ; Mon, 1 Jul 2013 09:14:39 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtZiU-0004Ak-6T; Mon, 01 Jul 2013 08:44:16 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtZfz-0003Qb-1j; Mon, 01 Jul 2013 08:41:35 +0000 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtZf7-0003G4-RY for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2013 08:40:42 +0000 Received: by mail-wi0-f182.google.com with SMTP id m6so2786070wiv.15 for ; Mon, 01 Jul 2013 01:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=yfxFX+kKGRdN7O7EYdY+aY6DXXeLiFy1vMBNvkm97nw=; b=CDd6scXnaouKDe6SqP7jjzGgqphM0PSYCJEFURsRocr4KN41dEIaGPeEx0viFp1s+X QSbFpcXE707sGGMrXnjdpb2z/pbZnQcBsoVRahPI2GoIhatX69tv85jRzC1AgTLhkAGT EdLYEnIgjEoyxMX92LE6HDZnpyk72yBl0HbuUWYjwIhGVnUTmQUvXGNqNdAh9qYtAnEd mbKtrg6jBe4PvSDLNww6DlX++n0Tc+hmC/22TaeR+hFiLf/6Kl4AsSKglfkw4WU9FctI 8cKfSMwwPaFIJ+VSpPT1+WM5x63oNnh/TxUyvhndMBcUiYzFvgCWoHq5KxYBh65r8cGh F60g== X-Received: by 10.194.21.138 with SMTP id v10mr19141841wje.16.1372668020178; Mon, 01 Jul 2013 01:40:20 -0700 (PDT) Received: from lnx-rg.pr (lyon.paratronic.fr. [213.41.177.106]) by mx.google.com with ESMTPSA id h8sm14786574wie.1.2013.07.01.01.40.18 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Jul 2013 01:40:19 -0700 (PDT) From: Richard Genoud To: devicetree-discuss@lists.ozlabs.org Subject: [RFC PATCH 12/13] sound: wm8731: rework power management Date: Mon, 1 Jul 2013 10:39:37 +0200 Message-Id: <1372667978-4718-13-git-send-email-richard.genoud@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1372667978-4718-1-git-send-email-richard.genoud@gmail.com> References: <1372667978-4718-1-git-send-email-richard.genoud@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130701_044042_037251_E800D5DF X-CRM114-Status: GOOD ( 10.73 ) X-Spam-Score: -2.0 (--) Cc: Nicolas Ferre , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicolas Ferre - preserve crystal oscillator across suspend/resume sequence: enabled by default,it should be kept enabled on resume. - if codec is in active state: set the active bit at resume time. Signed-off-by: Nicolas Ferre Signed-off-by: Uwe Kleine-König --- sound/soc/codecs/wm8731.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 5276062..3cf6b20 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -465,7 +465,9 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, snd_soc_write(codec, WM8731_PWR, reg | 0x0040); break; case SND_SOC_BIAS_OFF: - snd_soc_write(codec, WM8731_PWR, 0xffff); + snd_soc_write(codec, WM8731_ACTIVE, 0x0); + /* standby: keep crystal oscillator enabled */ + snd_soc_write(codec, WM8731_PWR, 0x00df); regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); regcache_mark_dirty(wm8731->regmap); @@ -516,6 +518,8 @@ static int wm8731_suspend(struct snd_soc_codec *codec) static int wm8731_resume(struct snd_soc_codec *codec) { wm8731_set_bias_level(codec, SND_SOC_BIAS_STANDBY); + if (codec->active) + snd_soc_write(codec, WM8731_ACTIVE, 0x0001); return 0; }