From patchwork Wed Nov 7 15:42:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 12715 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 1E04623E16 for ; Wed, 7 Nov 2012 15:43:06 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 8D493A18917 for ; Wed, 7 Nov 2012 15:43:05 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so1148362iag.11 for ; Wed, 07 Nov 2012 07:43:05 -0800 (PST) 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=hi/sQulfHDGJ8y/5rVWkPA0JbwPRZ1tPNXMDyHc4X3A=; b=YnEFYhjFgGmw/AmvdmaJt9t7M1U8e75OPkTHfhH2+sG7bICw6+gNRNKjpE/U7Rda0/ 0BJSzZ12w5O0CRUS7YNuFFmP8Un3yeunVL7b5tYr7E0tdCKQHPQvVHmZudxwRXZIwRcO AScX0nHvSVySby28i4qwMnZ1ZSa2kbjD7eDg+hrgIKtYPjvj1KY4DimITJlYtNHrV9Cl 5mjbu0IYKE7xq/IC2RthcD/G59Zq66TGC5MlkNsox4iZsTKHUQPSU3nh7xg7XBViQp+U /Sn+w/BAPGx1FQd+S5Y9p4pOrqaXYGU8Y2ouhmiixoLljSIPrdzmYNjU175fUtvseXqv +Q/w== Received: by 10.42.203.146 with SMTP id fi18mr4374905icb.18.1352302984968; Wed, 07 Nov 2012 07:43:04 -0800 (PST) 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 n20csp233636igt; Wed, 7 Nov 2012 07:43:04 -0800 (PST) Received: by 10.180.100.101 with SMTP id ex5mr25608856wib.16.1352302983407; Wed, 07 Nov 2012 07:43:03 -0800 (PST) Received: from eu1sys200aog118.obsmtp.com (eu1sys200aog118.obsmtp.com [207.126.144.145]) by mx.google.com with SMTP id m6si17525933eed.69.2012.11.07.07.42.51 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Nov 2012 07:43:03 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.145 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.145; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.145 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-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob118.postini.com ([207.126.147.11]) with SMTP ID DSNKUJqBes7INPK5DTq5F2jrPot4uK3/Lz1V@postini.com; Wed, 07 Nov 2012 15:43:03 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 9B9AD4D; Wed, 7 Nov 2012 15:42:12 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 2028B5C; Wed, 7 Nov 2012 10:59:47 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id E86D0A8065; Wed, 7 Nov 2012 16:42:39 +0100 (CET) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 7 Nov 2012 16:42:45 +0100 From: Ulf Hansson To: Liam Girdwood , Mark Brown , , Cc: , Linus Walleij , Lee Jones , Ola Lilja , Ulf Hansson Subject: [RESEND PATCH 1/2] ASoC: Ux500: Fixup use of clocks Date: Wed, 7 Nov 2012 16:42:41 +0100 Message-ID: <1352302962-25201-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQk5GE/qZxTp1bzSYQ94+tPXGnLi0OFVhvrfCLI0mNDQGBf+vMubVwxIhtGw/u20iTPZpFRv From: Ulf Hansson Make sure clocks are being prepared and unprepared as well as enabled and disabled. Acked-by: Linus Walleij 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);