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: 92852 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1413103qgi; Mon, 30 Jan 2017 04:41:09 -0800 (PST) X-Received: by 10.98.73.130 with SMTP id r2mr22653777pfi.182.1485780068936; Mon, 30 Jan 2017 04:41:08 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si12507861pfc.290.2017.01.30.04.41.08; Mon, 30 Jan 2017 04:41:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbdA3MlC (ORCPT + 4 others); Mon, 30 Jan 2017 07:41:02 -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 Le5/PcpoMeXPciaLTY+vsVpsnv+H0eLyrjlsFjPO72OyWHvkLrvF4TftrBardv1hdOD22Dnr LrvHplWdbB53ru1h89i8pN6jb8sqRo/Pm+QC2KK4bFJSczLLUov07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o0TDgy/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?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= 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-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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" },