From patchwork Fri Dec 5 19:10:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 5445441 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5A4129F1D4 for ; Fri, 5 Dec 2014 19:10:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8782F201F4 for ; Fri, 5 Dec 2014 19:10:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C2C2A201EC for ; Fri, 5 Dec 2014 19:10:38 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B70332650E1; Fri, 5 Dec 2014 20:10:36 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 97491264FEB; Fri, 5 Dec 2014 20:10:29 +0100 (CET) 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 DA84B265099; Fri, 5 Dec 2014 20:10:27 +0100 (CET) Received: from mout.web.de (mout.web.de [212.227.15.3]) by alsa0.perex.cz (Postfix) with ESMTP id E174D264F37 for ; Fri, 5 Dec 2014 20:10:19 +0100 (CET) Received: from kongar.lan.local ([77.64.221.251]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0Lz2zw-1XspWT2b5s-014Dh8; Fri, 05 Dec 2014 20:10:17 +0100 From: Alexander Stein To: Jaroslav Kysela , Takashi Iwai Date: Fri, 5 Dec 2014 20:10:07 +0100 Message-Id: <1417806607-8433-2-git-send-email-alexanders83@web.de> X-Mailer: git-send-email 2.2.0 In-Reply-To: <1417806607-8433-1-git-send-email-alexanders83@web.de> References: <1417806607-8433-1-git-send-email-alexanders83@web.de> X-Provags-ID: V03:K0:CZwwvCR4HmKKE5O3qBuo1v0Ck17aaPpP+dE0oVRB550Uid0oQ+D ioO0Bs46vJvs0r6wwxmD9WaD9rRTTmCYRL4T59vd0BYbxk3I7CEWSee59JBVf6UBqnUf66T nbWIcg6ri9ix5HOrm0jKP7DYSdtC0IXBK/ei0rmI5QV5FpuT18bskWiJcqGQdtbPHyDCaET fJwv18a46Y0p8tlO/6Oew== X-UI-Out-Filterresults: notjunk:1; Cc: Alexander Stein , Alexandre Belloni , alsa-devel@alsa-project.org, Nicolas Ferre , Arnd Bergmann Subject: [alsa-devel] [PATCH v2 2/2] ALSA: atmel_abdac: Add missing clock prepare X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Clocks must be prepared before enabling them. Do this in one step. Replace clk_enable with clk_prepare_enable and clk_disable with clk_disable_unprepare. Signed-off-by: Alexander Stein --- Note: This is compile-tested only! sound/atmel/abdac.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c index 31061e3..0231405 100644 --- a/sound/atmel/abdac.c +++ b/sound/atmel/abdac.c @@ -242,7 +242,7 @@ static int atmel_abdac_trigger(struct snd_pcm_substream *substream, int cmd) case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* fall through */ case SNDRV_PCM_TRIGGER_RESUME: /* fall through */ case SNDRV_PCM_TRIGGER_START: - clk_enable(dac->sample_clk); + clk_prepare_enable(dac->sample_clk); retval = dw_dma_cyclic_start(dac->dma.chan); if (retval) goto out; @@ -254,7 +254,7 @@ static int atmel_abdac_trigger(struct snd_pcm_substream *substream, int cmd) dw_dma_cyclic_stop(dac->dma.chan); dac_writel(dac, DATA, 0); dac_writel(dac, CTRL, 0); - clk_disable(dac->sample_clk); + clk_disable_unprepare(dac->sample_clk); break; default: retval = -EINVAL; @@ -429,7 +429,7 @@ static int atmel_abdac_probe(struct platform_device *pdev) retval = PTR_ERR(sample_clk); goto out_put_pclk; } - clk_enable(pclk); + clk_prepare_enable(pclk); retval = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, THIS_MODULE, @@ -528,7 +528,7 @@ out_free_card: snd_card_free(card); out_put_sample_clk: clk_put(sample_clk); - clk_disable(pclk); + clk_disable_unprepare(pclk); out_put_pclk: clk_put(pclk); return retval; @@ -541,8 +541,8 @@ static int atmel_abdac_suspend(struct device *pdev) struct atmel_abdac *dac = card->private_data; dw_dma_cyclic_stop(dac->dma.chan); - clk_disable(dac->sample_clk); - clk_disable(dac->pclk); + clk_disable_unprepare(dac->sample_clk); + clk_disable_unprepare(dac->pclk); return 0; } @@ -552,8 +552,8 @@ static int atmel_abdac_resume(struct device *pdev) struct snd_card *card = dev_get_drvdata(pdev); struct atmel_abdac *dac = card->private_data; - clk_enable(dac->pclk); - clk_enable(dac->sample_clk); + clk_prepare_enable(dac->pclk); + clk_prepare_enable(dac->sample_clk); if (test_bit(DMA_READY, &dac->flags)) dw_dma_cyclic_start(dac->dma.chan); @@ -572,7 +572,7 @@ static int atmel_abdac_remove(struct platform_device *pdev) struct atmel_abdac *dac = get_dac(card); clk_put(dac->sample_clk); - clk_disable(dac->pclk); + clk_disable_unprepare(dac->pclk); clk_put(dac->pclk); dma_release_channel(dac->dma.chan);