From patchwork Tue Aug 15 15:45:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9902135 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 3A07B60244 for ; Tue, 15 Aug 2017 15:48:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C46328897 for ; Tue, 15 Aug 2017 15:48:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2143328899; Tue, 15 Aug 2017 15:48:18 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 B4F5828897 for ; Tue, 15 Aug 2017 15:48:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752450AbdHOPq4 (ORCPT ); Tue, 15 Aug 2017 11:46:56 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39984 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752542AbdHOPqy (ORCPT ); Tue, 15 Aug 2017 11:46:54 -0400 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-08.nifty.com with ESMTP id v7FFjk9b018213; Wed, 16 Aug 2017 00:45:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v7FFjk9b018213 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1502811952; bh=nAwSf4SAQ17xaXSvdQurZyISL9qAWuUJVBN8Ladcy68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jdmiAQ7Mb1fHPuF4WWKz80YCWN0axeXzHIPzmhNMHRNnc9Knvp+mIBle4vEPdb09d 4PNsBzr/1JF3vqBtc56ekpF5soRMhmvWGA6MOxvd6LJrhor9Ex2H9yRq4YMdce9mC0 oayXTRjSspvgJLst2R4P7KaJd+U++9hzm124+ObiDJIGSWrlSqKrKsSG8MJ2tbtPOF 1dx4r244DaYMfyTI4UEWDR9RDDr9ow5M79t4HvkUw6931wnReky6eiMXyFYI/h77kF 4Ue3xQexg2upW/TK0jKXWLnqRFwUNQLmjLvVGRBXRv8TJ1SXXdJXZwe8xBHiel3b+S Cn5ciZQ5FUpsw== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: linux-mmc@vger.kernel.org Cc: Piotr Sroka , Hu Ziji , Adrian Hunter , Christian Daudt , Scott Branden , Zhangfei Gao , Kevin Hao , Olof Johansson , Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v3 4/4] mmc: sdhci-pltfm: export sdhci_pltfm_suspend/resume Date: Wed, 16 Aug 2017 00:45:22 +0900 Message-Id: <1502811922-9346-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502811922-9346-1-git-send-email-yamada.masahiro@socionext.com> References: <1502811922-9346-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This will be useful when drivers want to reuse either suspend or resume callback instead of whole of sdhci_pltfm_pmops. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None drivers/mmc/host/sdhci-cadence.c | 20 +------------------- drivers/mmc/host/sdhci-pltfm.c | 6 ++++-- drivers/mmc/host/sdhci-pltfm.h | 2 ++ 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c index 751ba706bf03..79ce9053df07 100644 --- a/drivers/mmc/host/sdhci-cadence.c +++ b/drivers/mmc/host/sdhci-cadence.c @@ -391,24 +391,6 @@ static int sdhci_cdns_probe(struct platform_device *pdev) } #ifdef CONFIG_PM_SLEEP -static int sdhci_cdns_suspend(struct device *dev) -{ - struct sdhci_host *host = dev_get_drvdata(dev); - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); - int ret; - - if (host->tuning_mode != SDHCI_TUNING_MODE_3) - mmc_retune_needed(host->mmc); - - ret = sdhci_suspend_host(host); - if (ret) - return ret; - - clk_disable_unprepare(pltfm_host->clk); - - return 0; -} - static int sdhci_cdns_resume(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); @@ -429,7 +411,7 @@ static int sdhci_cdns_resume(struct device *dev) #endif static const struct dev_pm_ops sdhci_cdns_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(sdhci_cdns_suspend, sdhci_cdns_resume) + SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_cdns_resume) }; static const struct of_device_id sdhci_cdns_match[] = { diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index be9a79d62e22..a34eacac612f 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -209,7 +209,7 @@ int sdhci_pltfm_unregister(struct platform_device *pdev) EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister); #ifdef CONFIG_PM_SLEEP -static int sdhci_pltfm_suspend(struct device *dev) +int sdhci_pltfm_suspend(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@ -226,8 +226,9 @@ static int sdhci_pltfm_suspend(struct device *dev) return 0; } +EXPORT_SYMBOL_GPL(sdhci_pltfm_suspend); -static int sdhci_pltfm_resume(struct device *dev) +int sdhci_pltfm_resume(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@ -239,6 +240,7 @@ static int sdhci_pltfm_resume(struct device *dev) return sdhci_resume_host(host); } +EXPORT_SYMBOL_GPL(sdhci_pltfm_resume); #endif const struct dev_pm_ops sdhci_pltfm_pmops = { diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h index 957839d0fe37..1e91fb1c020e 100644 --- a/drivers/mmc/host/sdhci-pltfm.h +++ b/drivers/mmc/host/sdhci-pltfm.h @@ -109,6 +109,8 @@ static inline void *sdhci_pltfm_priv(struct sdhci_pltfm_host *host) return host->private; } +int sdhci_pltfm_suspend(struct device *dev); +int sdhci_pltfm_resume(struct device *dev); extern const struct dev_pm_ops sdhci_pltfm_pmops; #endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */