From patchwork Thu Mar 23 08:03:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9640533 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 277FC601E9 for ; Thu, 23 Mar 2017 08:05:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 179C1284F1 for ; Thu, 23 Mar 2017 08:05:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C1E5284F6; Thu, 23 Mar 2017 08:05:49 +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=unavailable 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 84A18284F1 for ; Thu, 23 Mar 2017 08:05:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932240AbdCWIF3 (ORCPT ); Thu, 23 Mar 2017 04:05:29 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:42004 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753698AbdCWIDz (ORCPT ); Thu, 23 Mar 2017 04:03:55 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON9008IAD2F2950@mailout1.w1.samsung.com>; Thu, 23 Mar 2017 08:03:51 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170323080350eucas1p115e755c3de804a146de13ce775dfccee~udCV3WWy42316123161eucas1p1O; Thu, 23 Mar 2017 08:03:50 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id EE.DB.28517.66183D85; Thu, 23 Mar 2017 08:03:50 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170323080350eucas1p273814a2f183f04f180f8f2a2a362b86e~udCVK-3j60530105301eucas1p2L; Thu, 23 Mar 2017 08:03:50 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-4a-58d381668013 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 01.B7.10233.57183D85; Thu, 23 Mar 2017 08:04:05 +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 <0ON90067HD26AT60@eusync2.samsung.com>; Thu, 23 Mar 2017 08:03:49 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Lee Jones , Bartlomiej Zolnierkiewicz , Chanwoo Choi Subject: [PATCH v4 6/6] mfd: exynos-lpass: Add runtime PM support Date: Thu, 23 Mar 2017 09:03:27 +0100 Message-id: <1490256207-10061-7-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490256207-10061-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWRX0hTcRTH/d1/uxvOLtPqh9rQgQ8uMoWFl7Ro4cN6kSCyUQ818k6lT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PT5vkgtgi3KzyUhNTEktUkjNS85PycxLt1UK DXHTtVBSyEvMTbVVitD1DQlSUihLzCkF8owM0ICDc4B7sJK+XYJbxudDJgXXBSp+HtrL2MC4 kK+LkZNDQsBEYsPky8wQtpjEhXvr2UBsIYEljBIr/rp2MXIB2U1MEguunmcBSbAJGEp0ve1i A0mICLQzSry+fY0JJMEscIdJYsPLFBBbWMBRYu3nw2CTWARUJa4f3QNWwyvgIbHr/2t2iG1y EiePTWYFsTkFPCWurjnIArHZQ2LDnU/sExh5FzAyrGIUSS0tzk3PLTbSK07MLS7NS9dLzs/d xAiMgm3Hfm7Zwdj1LvgQowAHoxIP74a6SxFCrIllxZW5hxglOJiVRHhtCy9HCPGmJFZWpRbl xxeV5qQWH2I0BTpqIrOUaHI+MELzSuINTQzNLQ2NjC0szI2MlMR5p364Ei4kkJ5YkpqdmlqQ WgTTx8TBKdXAqMp0dCrLOVF/s9Zc/Yg39R4h2teDNuQe3Pr72ERNrZ2b3jSmC2/ibO7ka4hr ydwWyhv62On+tFf+NSG5j1tcH/2uEq5o0rucM9WYY8/azaJbJpWonmNqCLpT2VGn2BGVqPd3 3i3vm8+ObX269WvgD4OKxMsMk3f9UW98y3/U0/bG41lm2twVSizFGYmGWsxFxYkAkZF1Z5gC AAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170323080350eucas1p273814a2f183f04f180f8f2a2a362b86e 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: 20170323080350eucas1p273814a2f183f04f180f8f2a2a362b86e X-RootMTR: 20170323080350eucas1p273814a2f183f04f180f8f2a2a362b86e References: <1490256207-10061-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 Acked-by: Sylwester Nawrocki Acked-for-MFD-by: Lee Jones --- 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" },