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: 9640527 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 EC645601E9 for ; Thu, 23 Mar 2017 08:05:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCDA4284F1 for ; Thu, 23 Mar 2017 08:05:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D13F3284F6; Thu, 23 Mar 2017 08:05:31 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 68F51284F1 for ; Thu, 23 Mar 2017 08:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-reply-to:Message-id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Rq6lXbHwSc345Q3h6f8NoF0Tq27Rf75/SWM39eMn7dU=; b=Nyfa78ti/W8vqiBP5upY8WZnzL gKinVE1FFV2CTxjIhhV0OezqgYV/a1to6YdxywpIKgc5xNNttXfC6tf+2i4VRrFxkJ6MmsQLGdHXC O2b+17KqKSDWn1IdoXNhybWPYJyB+6rop1NF+nxRiIZx2QBfQNnjLaLnCpohBDPDFUVpNnk/QPxNS iYTNfO54HUr7ZJLW5fhinF1uy73CTcvRFutZDJW4M4woIx8lb8olE6zTtKaUoO94GQQiHSgaTC9S5 xuoqxTFP1uMb0g0cvxzTS2+Q0Md7P+ozP0TaZzjy43hDyq9W63RhRuDwTtP+Q+8iKiHUE5wG+UCzT HtJqn0lg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqxkP-0001AT-KC; Thu, 23 Mar 2017 08:05:29 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqxjI-0006mR-Dv for linux-arm-kernel@lists.infradead.org; Thu, 23 Mar 2017 08:04:26 +0000 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> for linux-arm-kernel@lists.infradead.org; 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 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/uxvOLtPqh9rQgQ8uMoWFl7Ro4cN6kSCyUQ818k6lTW1T S8H8U6ktmpaVIppKZjAU5zRRUdPNbdkfly2dZsvAzHLuQaaEaZrz1tvncD58D+ccEhV8w0LJ jMwcRpOpUIkIHtZjWx8/pCxxymMbVsR0Z20HTrtWF3Ha4TBy6Lk1K6Afbj5HaNP8FE53NW4C 2tlfT9C1jiGEbh91c2jLcjlOG/o3wYlAWV+dmyMzGe4Qss9TA4Ssq6VIpu82AJnPJDxNnOcl pjKqjDxGc/j4JV66zyzJdlHX182DoBg0B+kASUJKAofvJesAdwf3wfdfOggd4JEC6hmAv3Ve 4G8IKB+A2/OFrCSBxmonykqtAM6OVKKsVIzAGYPKzwQVB3Ve3W5SCFUOoFtfgfgLlJpG4K25 R4TfCqaksN1n2WWMioIu6wDiZz4lg/3bHg47TgjHbNW4n7nUK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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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170323_010421_232524_D51E9FBC X-CRM114-Status: GOOD ( 14.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartlomiej Zolnierkiewicz , Linus Walleij , Tomasz Figa , Krzysztof Kozlowski , Chanwoo Choi , Sylwester Nawrocki , Lee Jones , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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" },