From patchwork Fri Jul 18 17:31:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 33885 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ED32E208CF for ; Fri, 18 Jul 2014 17:31:58 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf16766275oag.8 for ; Fri, 18 Jul 2014 10:31:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=qfdBQMcY7raMdR8RDKN4eT4CtxdianJrVk+l1/MhBf8=; b=HfVjitlDoygp7HR9UlgAEpJ9kKBEASQQjdUvizqLgKNeLcR5HhqHo+eo67fw0PxGs2 ZsV1G8MDvcNASAcaC9jqzUsJ54tiHHWJjpe8ixeyO1cqqK//NSobh8JwkuI27Kkl+953 iSAtl6EuoXGtNeVzzWTRSohkSaNxzLGwYLq1L2fjmtME/gyopbvfhJoKLVoWW0BPwM9T o1mMJOBkmXHhzKQUDqqqbTTYdcs9wS8yTHvexAidBvNPdxmre2X/QCnikoAIC57VP7u7 rgK10+vEBoWfjd5jMkO35cRqWqSITr4qnuE5sc/HnTvEgDSbKEr4AYtXAkEsILN3477Y PTBw== X-Gm-Message-State: ALoCoQmGcgpe2am/2ln2cPFjKeasAnfIpDRbs2+Uky802UesCQvfyz+YMYnGwq8r34aqySfqs2Ll X-Received: by 10.50.170.162 with SMTP id an2mr3560677igc.4.1405704718496; Fri, 18 Jul 2014 10:31:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.54 with SMTP id b51ls1084353qgf.48.gmail; Fri, 18 Jul 2014 10:31:58 -0700 (PDT) X-Received: by 10.52.13.98 with SMTP id g2mr6816390vdc.46.1405704718303; Fri, 18 Jul 2014 10:31:58 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id o14si6510664vdi.42.2014.07.18.10.31.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jul 2014 10:31:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so6485881vcb.10 for ; Fri, 18 Jul 2014 10:31:58 -0700 (PDT) X-Received: by 10.52.129.200 with SMTP id ny8mr6668061vdb.27.1405704718071; Fri, 18 Jul 2014 10:31:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp29155vcb; Fri, 18 Jul 2014 10:31:57 -0700 (PDT) X-Received: by 10.180.91.6 with SMTP id ca6mr9324209wib.77.1405704717273; Fri, 18 Jul 2014 10:31:57 -0700 (PDT) Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id y20si5138028wie.93.2014.07.18.10.31.55 for ; Fri, 18 Jul 2014 10:31:57 -0700 (PDT) Received-SPF: none (google.com: alsa-devel-bounces@alsa-project.org does not designate permitted sender hosts) client-ip=77.48.224.243; Received: by alsa0.perex.cz (Postfix, from userid 1000) id C5E5F265665; Fri, 18 Jul 2014 19:31:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.2.4 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6AF91265639; Fri, 18 Jul 2014 19:31:25 +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 7B65226563D; Fri, 18 Jul 2014 19:31:23 +0200 (CEST) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by alsa0.perex.cz (Postfix) with ESMTP id 63EBE2608E8 for ; Fri, 18 Jul 2014 19:31:15 +0200 (CEST) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s6IHVADW016690; Fri, 18 Jul 2014 12:31:10 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6IHV9f1004043; Fri, 18 Jul 2014 12:31:10 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 18 Jul 2014 12:31:10 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s6IHV9HO014002; Fri, 18 Jul 2014 12:31:09 -0500 Received: from localhost (j-172-22-79-180.vpn.ti.com [172.22.79.180]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id s6IHV9t12591; Fri, 18 Jul 2014 12:31:09 -0500 (CDT) From: Dan Murphy To: Date: Fri, 18 Jul 2014 12:31:07 -0500 Message-ID: <1405704668-8038-1-git-send-email-dmurphy@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, broonie@kernel.org, linux-kernel@vger.kernel.org, Dan Murphy Subject: [alsa-devel] [PATCH 1/2] ASoC: tas2552: Fix PM sequencing X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dmurphy@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 In the pm suspend/resume it is better to disable the GPIO after the regmap_cache setting calls so that if the call is interrupted the new reg values will be cached and set on resume. Also add pm_runtime_put in the remove call. Signed-off-by: Dan Murphy --- sound/soc/codecs/tas2552.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index f0760af..a3ae394 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c @@ -239,12 +239,12 @@ static int tas2552_runtime_suspend(struct device *dev) tas2552_sw_shutdown(tas2552, 0); - if (tas2552->enable_gpio) - gpiod_set_value(tas2552->enable_gpio, 0); - regcache_cache_only(tas2552->regmap, true); regcache_mark_dirty(tas2552->regmap); + if (tas2552->enable_gpio) + gpiod_set_value(tas2552->enable_gpio, 0); + return 0; } @@ -382,6 +382,8 @@ static int tas2552_codec_remove(struct snd_soc_codec *codec) { struct tas2552_data *tas2552 = snd_soc_codec_get_drvdata(codec); + pm_runtime_put(codec->dev); + if (tas2552->enable_gpio) gpiod_set_value(tas2552->enable_gpio, 0);