From patchwork Mon Oct 22 12:32:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 12402 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 73DB023FB7 for ; Mon, 22 Oct 2012 12:32:45 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 24A08A181E1 for ; Mon, 22 Oct 2012 12:32:45 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3320800iej.11 for ; Mon, 22 Oct 2012 05:32:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=6FHOdW+fF1+rTIdGHHa7GSoZMaEVmUAEi7KbBWVYOBA=; b=Cc/HqjWftqMtuc+G8iXsG7s85dUUDVUpIm9D9J1tBsADkNTrDnMvA743j0kn7Rcp3U u8vxr22hBq8pUmkP0D/5dSNIQQyYrqM9BVHSgIqaTMWLkOeMeCRrXT7Cum5NaSIuDDu7 ZH4EKJRty9aKeN2a8uIE8W+ESg1Rd0W21T+g7gfIhA4u9jHPLGYqNkeOITI5nkE/mUer Nh9kmxNwcjZhRmBHCcxhB0MFirNHF+qbWVAvgpdJSd9itAnlnxYS0tnzBbFxbB+S/ldw QvCNeQo9MAK8Kg7wf63r61Miv4Wv2miZucihy/eBxXthp+X4cFN1vIZCUErpatFiSnPo QgrQ== Received: by 10.50.88.233 with SMTP id bj9mr8808043igb.70.1350909164836; Mon, 22 Oct 2012 05:32:44 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp223911igt; Mon, 22 Oct 2012 05:32:44 -0700 (PDT) Received: by 10.14.220.134 with SMTP id o6mr11855373eep.35.1350909163792; Mon, 22 Oct 2012 05:32:43 -0700 (PDT) Received: from eu1sys200aog119.obsmtp.com (eu1sys200aog119.obsmtp.com [207.126.144.147]) by mx.google.com with SMTP id a9si1149195eeo.66.2012.10.22.05.32.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 22 Oct 2012 05:32:43 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.147; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) smtp.mail=ulf.hansson@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob119.postini.com ([207.126.147.11]) with SMTP ID DSNKUIU81D92f6HEJUx3OmjLKVaIwYRyXiEv@postini.com; Mon, 22 Oct 2012 12:32:43 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 7E934B1; Mon, 22 Oct 2012 12:23:58 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 84C3DBEE; Mon, 22 Oct 2012 12:32:10 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 112F824C07D; Mon, 22 Oct 2012 14:32:03 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Mon, 22 Oct 2012 14:32:09 +0200 From: Ulf Hansson To: Liam Girdwood , Mark Brown , , Cc: , Linus Walleij , Lee Jones , Ola Lilja , Ulf Hansson Subject: [PATCH 1/2] ASoC: Ux500: Fixup use of clocks Date: Mon, 22 Oct 2012 14:32:04 +0200 Message-ID: <1350909125-20189-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkqm25580JVVmgxkd5sY/I/SThS9f7nVZML7P1/x3Fm8R1Y/8jtbrTd2Cba7p33p95N3cTN From: Ulf Hansson Make sure clocks are being prepared and unprepared as well as enabled and disabled. Signed-off-by: Ulf Hansson --- sound/soc/ux500/ux500_msp_dai.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index be94bf9..e11187f 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -398,11 +398,13 @@ static int ux500_msp_dai_startup(struct snd_pcm_substream *substream, return ret; } - /* Enable clock */ + /* Prepare and enable clock */ dev_dbg(dai->dev, "%s: Enabling MSP-clock.\n", __func__); - clk_enable(drvdata->clk); + ret = clk_prepare_enable(drvdata->clk); + if (ret) + regulator_disable(drvdata->reg_vape); - return 0; + return ret; } static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, @@ -428,8 +430,8 @@ static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, __func__, dai->id, snd_pcm_stream_str(substream)); } - /* Disable clock */ - clk_disable(drvdata->clk); + /* Disable and unprepare clock */ + clk_disable_unprepare(drvdata->clk); /* Disable regulator */ ret = regulator_disable(drvdata->reg_vape);