From patchwork Sat Jan 16 18:35:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TcOlbnMgUnVsbGfDpXJk?= X-Patchwork-Id: 8049551 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C9BE6BEEE5 for ; Sat, 16 Jan 2016 18:37:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1364020328 for ; Sat, 16 Jan 2016 18:37:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id C5C4220304 for ; Sat, 16 Jan 2016 18:36:58 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6BAB82605E8; Sat, 16 Jan 2016 19:36:57 +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, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BB3C62604D3; Sat, 16 Jan 2016 19:36:49 +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 81E252604F4; Sat, 16 Jan 2016 19:36:48 +0100 (CET) Received: from unicorn.mansr.com (unicorn.mansr.com [81.2.72.234]) by alsa0.perex.cz (Postfix) with ESMTP id A5BBA2604BE for ; Sat, 16 Jan 2016 19:36:41 +0100 (CET) Received: by unicorn.mansr.com (Postfix, from userid 51770) id CD76515393; Sat, 16 Jan 2016 18:36:40 +0000 (GMT) From: Mans Rullgard To: Hans-Christian Egtvedt Date: Sat, 16 Jan 2016 18:35:49 +0000 Message-Id: <1452969349-9810-1-git-send-email-mans@mansr.com> X-Mailer: git-send-email 2.7.0 Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Takashi Iwai Subject: [alsa-devel] [PATCH] ALSA: at73c213: manage SSC clock 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 Since commit 49af54ff0fc7 ("misc: atmel-ssc: prepare clock only when request") the SSC driver expects clients to manage the SSC clock. Update this driver accordingly. Signed-off-by: Mans Rullgard Acked-by: Hans-Christian Egtvedt --- sound/spi/at73c213.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c index 39522367897c..3b2d0b2be421 100644 --- a/sound/spi/at73c213.c +++ b/sound/spi/at73c213.c @@ -981,6 +981,8 @@ static int snd_at73c213_probe(struct spi_device *spi) goto out_card; } + clk_enable(chip->ssc->clk); + retval = snd_at73c213_dev_init(card, spi); if (retval) goto out_ssc; @@ -998,6 +1000,7 @@ static int snd_at73c213_probe(struct spi_device *spi) goto out; out_ssc: + clk_disable(chip->ssc->clk); ssc_free(chip->ssc); out_card: snd_card_free(card); @@ -1066,6 +1069,9 @@ out: /* Stop DAC master clock. */ clk_disable(chip->board->dac_clk); + /* Stop SSC clock. */ + clk_disable(chip->ssc->clk); + ssc_free(chip->ssc); snd_card_free(card); @@ -1080,6 +1086,7 @@ static int snd_at73c213_suspend(struct device *dev) struct snd_at73c213 *chip = card->private_data; ssc_writel(chip->ssc->regs, CR, SSC_BIT(CR_TXDIS)); + clk_disable(chip->ssc->clk); clk_disable(chip->board->dac_clk); return 0; @@ -1091,6 +1098,7 @@ static int snd_at73c213_resume(struct device *dev) struct snd_at73c213 *chip = card->private_data; clk_enable(chip->board->dac_clk); + clk_enable(chip->ssc->clk); ssc_writel(chip->ssc->regs, CR, SSC_BIT(CR_TXEN)); return 0;