From patchwork Thu Dec 29 11:34:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9491159 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 42BE562AB8 for ; Thu, 29 Dec 2016 11:34:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3700F1FF15 for ; Thu, 29 Dec 2016 11:34:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BA341FFB9; Thu, 29 Dec 2016 11:34:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D16DE1FF15 for ; Thu, 29 Dec 2016 11:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751315AbcL2Lef (ORCPT ); Thu, 29 Dec 2016 06:34:35 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:53688 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120AbcL2Lec (ORCPT ); Thu, 29 Dec 2016 06:34:32 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OIY00CKE2THJE00@mailout4.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 29 Dec 2016 11:34:29 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20161229113428eucas1p2663b02bce2cde7a62b4bbbc89dfa0c0c~UtuQpTmJj0697806978eucas1p2Q; Thu, 29 Dec 2016 11:34:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 8A.5C.10572.4C4F4685; Thu, 29 Dec 2016 11:34:28 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20161229113427eucas1p20e91adee0da640e2a5847d53f3c6e443~UtuP_nHsT0697806978eucas1p2P; Thu, 29 Dec 2016 11:34:27 +0000 (GMT) X-AuditID: cbfec7f5-f79676d00000294c-9a-5864f4c43fcf Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 79.0F.06573.6B4F4685; Thu, 29 Dec 2016 11:34:14 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OIY00CMD2T7BA50@eusync2.samsung.com>; Thu, 29 Dec 2016 11:34:27 +0000 (GMT) From: Marek Szyprowski To: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Mark Brown , Sylwester Nawrocki , Sangbeom Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Inki Dae , Javier Martinez Canillas Subject: [PATCH 4/5] ASoC: samsung: i2s: Let runtime PM operations to control op_clk too Date: Thu, 29 Dec 2016 12:34:06 +0100 Message-id: <1483011247-21613-5-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1483011247-21613-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOIsWRmVeSWpSXmKPExsWy7djPc7pHvqREGNx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al2yqFhrjpWigp5CXmptoqRej6 hgQpKZQl5pQCeUYGaMDBOcA9WEnfLsEtY+nVbuaCfVwV9979YWxgvMjRxcjJISFgIvFv+Q9m CFtM4sK99WxdjFwcQgJLGCVe/5rADuE0MUk0PZ4GVsUmYCjR9baLDcQWEXCSmDnnPVgHs8Ad JonvjxaxgCSEBaIkXv44zQRiswioSmxcfQpoEgcHr4CHxLsLVhDb5CROHpvMCmJzCnhKtHxs AisXAir58+of0wRG3gWMDKsYRVJLi3PTc4uN9IoTc4tL89L1kvNzNzECQ33bsZ9bdjB2vQs+ xCjAwajEw1sglxIhxJpYVlyZe4hRgoNZSYT3yyegEG9KYmVValF+fFFpTmrxIUZToJsmMkuJ JucD4zCvJN7QxNDc0tDI2MLC3MhISZx36ocr4UIC6YklqdmpqQWpRTB9TBycUg2M62vz79yS ZtX0Vb12NoWfe3Lb9T3PTObFcez5Edh2q+ADc1bf9iN7F6l4ZR/u5Zy533dG4UKhZXKTOH22 Wk98Ib/mb/iimO+zE+cat296IKxi9sn8rvdn7395a8rWHeA97LvROKyT7ceugkmxAQtVT3yW LXCe1uOSyOL3skBapnaX5bUMzc0KSizFGYmGWsxFxYkAfl43a4sCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161229113427eucas1p20e91adee0da640e2a5847d53f3c6e443 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161229113427eucas1p20e91adee0da640e2a5847d53f3c6e443 X-RootMTR: 20161229113427eucas1p20e91adee0da640e2a5847d53f3c6e443 References: <1483011247-21613-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds handling of parent operational clock to runtime PM callbacks. This way it is ensured that when I2S module is in runtime suspended state, all its parent clocks are disabled and unprepared. Signed-off-by: Marek Szyprowski --- sound/soc/samsung/i2s.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 47a5650aaa66..07728b93f56e 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -546,6 +546,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, if (WARN_ON(IS_ERR(i2s->op_clk))) { ret = PTR_ERR(i2s->op_clk); + i2s->op_clk = NULL; goto err; } @@ -1121,6 +1122,8 @@ static int i2s_runtime_suspend(struct device *dev) i2s->suspend_i2scon = readl(i2s->addr + I2SCON); i2s->suspend_i2spsr = readl(i2s->addr + I2SPSR); + if (i2s->op_clk) + clk_disable_unprepare(i2s->op_clk); clk_disable_unprepare(i2s->clk); return 0; @@ -1131,6 +1134,8 @@ static int i2s_runtime_resume(struct device *dev) struct i2s_dai *i2s = dev_get_drvdata(dev); clk_prepare_enable(i2s->clk); + if (i2s->op_clk) + clk_prepare_enable(i2s->op_clk); writel(i2s->suspend_i2scon, i2s->addr + I2SCON); writel(i2s->suspend_i2smod, i2s->addr + I2SMOD);