From patchwork Mon Oct 9 08:49:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 115186 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2309175qgn; Mon, 9 Oct 2017 01:50:02 -0700 (PDT) X-Google-Smtp-Source: AOwi7QC568aixHoZBiRyTqNdaPMEs4ocV3rsq8qkdSb3fkdI1WG2m0eEJU4EekrFNnEsKfWzhOKX X-Received: by 10.28.191.131 with SMTP id o3mr6892687wmi.113.1507539002693; Mon, 09 Oct 2017 01:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507539002; cv=none; d=google.com; s=arc-20160816; b=laDxkXoMXuaMe3VsZZPa2YwjRW3wPndBJexdsmHX4KK8kw5yOOOXceAoYzwAkjo/jX Yo79goPiGE16TbUaAgvG7d2TAgVudUe+mp89QAalK/U4N7tPAKDZkvl2OUJzPOzWOOOf 4AO4f3m6Fs8VOxhxkqzF+hcneb6ExERhqE7T83f4dad9CyIO2PD3Ow3EkKivGL2aQ7Vq 7kH37yC++W3NpqbvKUh36C/x+GjrivJRmHMJgV6uxZRAuUvC2ugo734iirXiHbgt6h1q gV70bXYJJrsKNF1aZ2XJPS1tj6SkS7tzKXvSaonnAc70xHmZY0+fpU/xIqAs8yDH5CR0 XqZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=jT6JIhbIz97UVXdMG4tAW46vCjWyly/H31b9SSBFhtA=; b=WAGiJa+0SJmpp/8hGJQXZtYbVFm2C6mossnJAU0wZ1dGgwfZLuZv9su/TSz8C8id5o Lb5Q4xL6UesBbqsnsWjlFxYwPzusTZ+T+XH86nFoNCO4TXUJCfntOhgusi9sVaTDIvI1 og5lfw2hm2hCW/lwUhEwQNX6BeptCXatIhTBcgRwioaHvFDn9Kv/fASFiG1PsX/3fvc9 nTdZ4T9F3hiUL+zjgKf8GeOAsm0UovL+E1wRKITwTpIDfexupCFdy9zAIA8ghQKaGM8f tos8bvucncjyNtQ7SUeE/j9h/LhdctRNKffuJjmbjoPMMKGb47ceqfU5IETDVDGYCt5J ejOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=co+Cuhxg; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id i191si6342338wmd.139.2017.10.09.01.50.02; Mon, 09 Oct 2017 01:50:02 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=co+Cuhxg; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B79FA267172; Mon, 9 Oct 2017 10:49:47 +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 A802C267148; Mon, 9 Oct 2017 10:49:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_NEUTRAL autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 1A02C267141 for ; Mon, 9 Oct 2017 10:49:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=Cls4AzzFktt5leIyRyTFt9un+ORFYnfoCg/QKayGY2k=; b=co+CuhxgMp/8 96K56/1q7v1EwFgvW6vkA9p7EOrWzsIVj0N4cW3fNzwRMKJyVplyT43cGrGEUAoVqF/JcsbNPvyvC BkQyXkxIQjsVZL3pn9ZqPstVKiXNoh2gdNIZYy7zuUBLTeODS0fZ3hQWAixBK+3VvZr+qcDB/mFld k0NUM=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1e1Tkq-0000dG-Jo; Mon, 09 Oct 2017 08:49:40 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1e1Tkq-0006KY-7W; Mon, 09 Oct 2017 09:49:40 +0100 From: Mark Brown To: Ed Blake In-Reply-To: <1506938517-810-4-git-send-email-ed.blake@sondrel.com> Message-Id: Date: Mon, 09 Oct 2017 09:49:40 +0100 Cc: alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com Subject: [alsa-devel] Applied "ASoC: img-spdif-out: Add control of sys clock to runtime PM" to the asoc tree 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 The patch ASoC: img-spdif-out: Add control of sys clock to runtime PM has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From e8639d0c65ba4036b51d63e222080e56384b0573 Mon Sep 17 00:00:00 2001 From: Ed Blake Date: Fri, 6 Oct 2017 15:56:07 +0100 Subject: [PATCH] ASoC: img-spdif-out: Add control of sys clock to runtime PM Disable sys clock as well as ref clock when runtime suspended. Signed-off-by: Ed Blake Signed-off-by: Mark Brown --- sound/soc/img/img-spdif-out.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) -- 2.14.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/img/img-spdif-out.c b/sound/soc/img/img-spdif-out.c index 1808a5542fd1..934ed3df2ebf 100644 --- a/sound/soc/img/img-spdif-out.c +++ b/sound/soc/img/img-spdif-out.c @@ -57,6 +57,7 @@ static int img_spdif_out_runtime_suspend(struct device *dev) struct img_spdif_out *spdif = dev_get_drvdata(dev); clk_disable_unprepare(spdif->clk_ref); + clk_disable_unprepare(spdif->clk_sys); return 0; } @@ -66,9 +67,16 @@ static int img_spdif_out_runtime_resume(struct device *dev) struct img_spdif_out *spdif = dev_get_drvdata(dev); int ret; + ret = clk_prepare_enable(spdif->clk_sys); + if (ret) { + dev_err(dev, "clk_enable failed: %d\n", ret); + return ret; + } + ret = clk_prepare_enable(spdif->clk_ref); if (ret) { dev_err(dev, "clk_enable failed: %d\n", ret); + clk_disable_unprepare(spdif->clk_sys); return ret; } @@ -358,21 +366,21 @@ static int img_spdif_out_probe(struct platform_device *pdev) return PTR_ERR(spdif->clk_ref); } - ret = clk_prepare_enable(spdif->clk_sys); - if (ret) - return ret; - - img_spdif_out_writel(spdif, IMG_SPDIF_OUT_CTL_FS_MASK, - IMG_SPDIF_OUT_CTL); - - img_spdif_out_reset(spdif); - pm_runtime_enable(&pdev->dev); if (!pm_runtime_enabled(&pdev->dev)) { ret = img_spdif_out_runtime_resume(&pdev->dev); if (ret) goto err_pm_disable; } + ret = pm_runtime_get_sync(&pdev->dev); + if (ret < 0) + goto err_suspend; + + img_spdif_out_writel(spdif, IMG_SPDIF_OUT_CTL_FS_MASK, + IMG_SPDIF_OUT_CTL); + + img_spdif_out_reset(spdif); + pm_runtime_put(&pdev->dev); spin_lock_init(&spdif->lock); @@ -399,21 +407,16 @@ static int img_spdif_out_probe(struct platform_device *pdev) img_spdif_out_runtime_suspend(&pdev->dev); err_pm_disable: pm_runtime_disable(&pdev->dev); - clk_disable_unprepare(spdif->clk_sys); return ret; } static int img_spdif_out_dev_remove(struct platform_device *pdev) { - struct img_spdif_out *spdif = platform_get_drvdata(pdev); - pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) img_spdif_out_runtime_suspend(&pdev->dev); - clk_disable_unprepare(spdif->clk_sys); - return 0; }