From patchwork Wed Jun 29 18:00:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 929762 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5TGsZWK016986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 29 Jun 2011 16:54:56 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qby1X-0002uU-V9; Wed, 29 Jun 2011 16:54:00 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qby1X-0002K8-3T; Wed, 29 Jun 2011 16:53:59 +0000 Received: from newsmtp5.atmel.com ([204.2.163.5] helo=sjogate2.atmel.com) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qby1A-0002FV-Th for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2011 16:53:38 +0000 Received: from meyreuil.atmel.fr ([10.159.254.132]) by sjogate2.atmel.com (8.13.6/8.13.6) with ESMTP id p5TGo1hw001584; Wed, 29 Jun 2011 09:50:01 -0700 (PDT) Received: from bendor.rfo.atmel.com ([10.159.245.201]) by meyreuil.atmel.fr (8.11.7p1+Sun/8.11.7) with ESMTP id p5TGr5a10826; Wed, 29 Jun 2011 18:53:05 +0200 (MEST) From: Nicolas Ferre To: alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com, lrg@ti.com Subject: [PATCH 1/5] ASoC: wm8731: rework power management Date: Wed, 29 Jun 2011 20:00:15 +0200 Message-Id: X-Mailer: git-send-email 1.7.3 In-Reply-To: <1309370419-22810-1-git-send-email-nicolas.ferre@atmel.com> References: <1309370419-22810-1-git-send-email-nicolas.ferre@atmel.com> MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110629_125337_277164_FA3F12C6 X-CRM114-Status: GOOD ( 10.38 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 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.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 29 Jun 2011 16:54:56 +0000 (UTC) X-MIME-Autoconverted: from base64 to 8bit by demeter2.kernel.org id p5TGsZWK016986 - 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 | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 2dc964b..e65af3d 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c @@ -481,7 +481,8 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec, break; case SND_SOC_BIAS_OFF: snd_soc_write(codec, WM8731_ACTIVE, 0x0); - snd_soc_write(codec, WM8731_PWR, 0xffff); + /* standby: keep crystal oscillator enabled */ + snd_soc_write(codec, WM8731_PWR, 0x00df); regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); break; @@ -533,6 +534,8 @@ static int wm8731_suspend(struct snd_soc_codec *codec, pm_message_t state) 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; }