From patchwork Mon Jan 30 12:38:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9545145 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 2CAD3604CC for ; Mon, 30 Jan 2017 12:41:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C43B26E47 for ; Mon, 30 Jan 2017 12:41:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00C2226E54; Mon, 30 Jan 2017 12:41:08 +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 9449126E48 for ; Mon, 30 Jan 2017 12:41:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752856AbdA3MlE (ORCPT ); Mon, 30 Jan 2017 07:41:04 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:43067 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbdA3MlB (ORCPT ); Mon, 30 Jan 2017 07:41:01 -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 <0OKL0062BF4I7L60@mailout4.w1.samsung.com>; Mon, 30 Jan 2017 12:38:42 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170130123841eucas1p2df5eab7b5676b8ffa41ba04d7239f4fb~ejPeDiuqa0359803598eucas1p25; Mon, 30 Jan 2017 12:38:41 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id E7.A7.09557.1D33F885; Mon, 30 Jan 2017 12:38:41 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170130123840eucas1p20025e600860b43b2da81d9063f96e442~ejPdQLgzY1821218212eucas1p2H; Mon, 30 Jan 2017 12:38:40 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-f4-588f33d1ee79 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 91.76.10233.FC33F885; Mon, 30 Jan 2017 12:38:39 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKL0038AF49F510@eusync3.samsung.com>; Mon, 30 Jan 2017 12:38:40 +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 Subject: [PATCH v3 7/7] mfd: exynos-lpass: Add runtime PM support Date: Mon, 30 Jan 2017 13:38:28 +0100 Message-id: <1485779908-32147-8-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485779908-32147-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHIsWRmVeSWpSXmKPExsWy7djPc7oXjfsjDI7Mk7fYOGM9q8X58xvY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Zl56bZKoSFuuhZK CnmJuam2ShG6viFBSgpliTmlQJ6RARpwcA5wD1bSt0twy7ixgr1gsUDF3ImvWRsYP/F2MXJy SAiYSHSe3c4KYYtJXLi3nq2LkYtDSGAJo0TDgy/sEE4Tk8TSU4sZQarYBAwlut52gVWJCLQz Sry+fY0JxGEW2MIk0bXpIjtIlbCAo8S74/tYQGwWAVWJtw9fM3cxcnDwCnhIXLtqALFOTuLk sclgqzkFPCW2PD3EDGILAZWcv/GfZQIj7wJGhlWMIqmlxbnpucVGesWJucWleel6yfm5mxiB wb/t2M8tOxi73gUfYhTgYFTi4b0h3BchxJpYVlyZe4hRgoNZSYT3pGp/hBBvSmJlVWpRfnxR aU5q8SFGU6CbJjJLiSbnAyMzryTe0MTQ3NLQyNjCwtzISEmcd+qHK+FCAumJJanZqakFqUUw fUwcnFINjAyvEq7bPjv55Wf619wLElK3b747fOrZp7THGsu7I5jdvyRVibpy79d2+v/z5Y/n jfsPSs0OO+Hl6vX5gVX0357b8+Yd/3tr5bJl/pMfzCtavXmWxAyxxDXrypqmP+PTmOR69PV7 x5COQMu8OJtLJfc1JpdcSv4S3bzUXPNj0IX18oX3p9z0UYhRYinOSDTUYi4qTgQAZy8BLZQC AAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170130123840eucas1p20025e600860b43b2da81d9063f96e442 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: 20170130123840eucas1p20025e600860b43b2da81d9063f96e442 X-RootMTR: 20170130123840eucas1p20025e600860b43b2da81d9063f96e442 References: <1485779908-32147-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 --- 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" },