From patchwork Wed Aug 23 04:15:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9916523 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 DB82F602CB for ; Wed, 23 Aug 2017 04:17:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAB6A28534 for ; Wed, 23 Aug 2017 04:17:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF59728847; Wed, 23 Aug 2017 04:17:29 +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 5FFA028534 for ; Wed, 23 Aug 2017 04:17:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753202AbdHWERC (ORCPT ); Wed, 23 Aug 2017 00:17:02 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:19331 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753201AbdHWERA (ORCPT ); Wed, 23 Aug 2017 00:17:00 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id v7N4F6Rt020925; Wed, 23 Aug 2017 13:15:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v7N4F6Rt020925 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1503461712; bh=FwhS68wn/DRb/yfAKpFl76Lzh07QSjEb+YWjsEG/v54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zrpZCQ2WoFuxnlKCTqHrt0piUjh9ZCLpcwXpF6iRs50QXH5o2D0Q/k1GdQXFlbkGl Za+qpBsgsLeJHPS6wQX6zwVtOpQAn6I5UREyqIu93MiPWyHflFf39t33WnuR2Od7wV Ci13FnYcnh71+6fJLqhXMsbIZU5MIRxSPk5Yl2kHTiPe3eCfCzCaU1McP/oSJqT7w/ wO+AoJy3XGmvw0uTbvJ2uxvhymdQt5ioL4pZF8KWDbIOaBH26r3E0RbAXnxw2KqDg3 HhFwc/eQ51dGaE15YLwQtHmJGk/PPiDyjSNrxT00Ljd3nEQGRK8nL0i2acMaYatu4M Qf9aiYAiqDB2Q== X-Nifty-SrcIP: [153.142.97.92] 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 v4 4/4] mmc: sdhci-pltfm: export sdhci_pltfm_suspend/resume Date: Wed, 23 Aug 2017 13:15:03 +0900 Message-Id: <1503461703-16225-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503461703-16225-1-git-send-email-yamada.masahiro@socionext.com> References: <1503461703-16225-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 Acked-by: Adrian Hunter --- Changes in v4: None 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 3dca3b3c6436..56529c3d389a 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); @@ -438,7 +420,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 4c0135e184e9..02bea6159d79 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); @@ -243,6 +244,7 @@ static int sdhci_pltfm_resume(struct device *dev) return ret; } +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 */