From patchwork Thu Jan 26 08:33:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9538445 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 200F1604A9 for ; Thu, 26 Jan 2017 08:35:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 146C42818E for ; Thu, 26 Jan 2017 08:35:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 092D3281C3; Thu, 26 Jan 2017 08:35:00 +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 62435281B7 for ; Thu, 26 Jan 2017 08:34:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753135AbdAZIe4 (ORCPT ); Thu, 26 Jan 2017 03:34:56 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:43161 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752975AbdAZIeL (ORCPT ); Thu, 26 Jan 2017 03:34:11 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD008ASP4VHZ50@mailout4.w1.samsung.com>; Thu, 26 Jan 2017 08:34:07 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126083407eucas1p261b668bd807d9ee384de904c37525982~dRUyNVbH03039030390eucas1p2l; Thu, 26 Jan 2017 08:34:07 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id EE.BC.17477.E74B9885; Thu, 26 Jan 2017 08:34:06 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126083406eucas1p20148fa4f3ca70d333400c806dd490aef~dRUxj0B8D0139901399eucas1p2K; Thu, 26 Jan 2017 08:34:06 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-f4-5889b47ec932 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 6C.34.06687.EB4B9885; Thu, 26 Jan 2017 08:35:10 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD000KKP4KMO50@eusync1.samsung.com>; Thu, 26 Jan 2017 08:34:06 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Lee Jones , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 8/8] mfd: exynos-lpass: Add runtime PM support Date: Thu, 26 Jan 2017 09:33:54 +0100 Message-id: <1485419634-28331-9-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485419634-28331-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWRXUhTcRjG++9sZ3O5PMxRL2pebEhkSzMKTiqS4cWpmzKCRjc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NTEktUkjNS85PycxLt1UK DXHTtVBSyEvMTbVVitD1DQlSUihLzCkF8owM0ICDc4B7sJK+XYJbxv43U9gK3vBXTH9+ga2B 8QBvFyMnh4SAicTBfe2sELaYxIV769m6GLk4hASWMEoc3b6KCcJpYpK4+HU5C0gVm4ChRNfb LrAqEYGljBL/V35mB3GYBbYwSXRtusgOUiUs4CixevZURhCbRUBV4umJxWBxXgEPiWdnDkLt k5M4eWwymM0p4Clx+ukrsBohoJpNFxeyT2DkXcDIsIpRJLW0ODc9t9hQrzgxt7g0L10vOT93 EyMwFrYd+7l5B+OljcGHGAU4GJV4eA/s6IgQYk0sK67MPcQowcGsJMJ7fnVnhBBvSmJlVWpR fnxRaU5q8SFGU6CjJjJLiSbnA+M0ryTe0MTQ3NLQyNjCwtzISEmct+TDlXAhgfTEktTs1NSC 1CKYPiYOTqkGRvfG1UlFd/tmT+pfuWjf2X/dktecXKds2pCnE+GtyTflTdeHjc0HnANKJ9au upCS3G3zcCKHRd9P7wKL2qd2j9VZTHK3M65Z3fPi+Laj+14qG+e5r39W9u95ww/ToBmSJfOL 0r6L6DzPeFhv7hh5SthXS/Ek45o9D5clX45p/pVseP5t3c+WaUosxRmJhlrMRcWJAPwgV0Gb AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126083406eucas1p20148fa4f3ca70d333400c806dd490aef X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 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: 20170126083406eucas1p20148fa4f3ca70d333400c806dd490aef X-RootMTR: 20170126083406eucas1p20148fa4f3ca70d333400c806dd490aef References: <1485419634-28331-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 Convert exisitng lpass-suspend/resume callbacks into runtime PM callbacks. This way Exynos LPASS driver will be ready for use with power domains enabled. LPASS will be runtime resumed/suspended as a result of its child devices runtime PM transitions. Signed-off-by: Marek Szyprowski Acked-by: Krzysztof Kozlowski --- drivers/mfd/exynos-lpass.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/exynos-lpass.c b/drivers/mfd/exynos-lpass.c index 9dbbedad916f..6d735e22acda 100644 --- a/drivers/mfd/exynos-lpass.c +++ b/drivers/mfd/exynos-lpass.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -132,6 +133,8 @@ static int exynos_lpass_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, lpass); + pm_runtime_set_active(dev); + pm_runtime_enable(dev); exynos_lpass_enable(lpass); return of_platform_populate(dev->of_node, NULL, NULL, dev); @@ -141,7 +144,9 @@ static int exynos_lpass_remove(struct platform_device *pdev) { struct exynos_lpass *lpass = platform_get_drvdata(pdev); - exynos_lpass_disable(lpass); + pm_runtime_disable(&pdev->dev); + if (!pm_runtime_status_suspended(&pdev->dev)) + exynos_lpass_disable(lpass); regmap_exit(lpass->top); return 0; @@ -165,8 +170,11 @@ static int __maybe_unused exynos_lpass_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(lpass_pm_ops, exynos_lpass_suspend, - exynos_lpass_resume); +static const struct dev_pm_ops lpass_pm_ops = { + SET_RUNTIME_PM_OPS(exynos_lpass_suspend, exynos_lpass_resume, NULL) + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) +}; static const struct of_device_id exynos_lpass_of_match[] = { { .compatible = "samsung,exynos5433-lpass" },