From patchwork Thu Aug 3 01:44:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 109284 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp156664qge; Wed, 2 Aug 2017 18:46:00 -0700 (PDT) X-Received: by 10.84.224.137 with SMTP id s9mr52114plj.350.1501724760022; Wed, 02 Aug 2017 18:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501724760; cv=none; d=google.com; s=arc-20160816; b=UbKsyC/Cf1AKWZZUW0l+8fofeqi5SZgXqawfFQWHtbtA6Bs1/de1xDRIsXOkp57xpd lI0D9cQJ6/uMV/R0mkQ6WwhcToXeLN24qWqmGz8uY94AJoeyYkN47HUaA9zJ7wWlI9KK kxsycfSCF7g1Aw+8Xw7p6b5if9u0TGKxORtahWr+MJkJVEXd9j3xfJW+qj0xu4z8Vtt1 CKxhv62CdJz2QIPlNR/9FlWvkSSxJ7WdQHMKX7CQBmWi93+K3VdSJNyrdUJCgQLZBvYL MZX1qqsskmurDVkSZ7qk0PfF+WIRmsV8zVaNW2enXX8rMAXXd4o4PA8ky+lQBVjRsgcm Z8+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=XJcudhS3QXrTfg0A+KM9HwDyUSRgf/dJBlfL9qzRNfc=; b=MFTHFss0T0MD8vMhhAk06/CePtthrB5M9nZ/MkwnLlRaO1fFK6s3C2k1L0K4GkPEsb ElIC/T+MBJlNrxJGlAAPh1AysNL0Ofwdx+3IsK5pjIC10vbQG7wyslZkcnIjjuDMYrDe PgCvKm8GSZBnYLSsiQ9db4jTZbh9CzP8lLIKUzPK1qJ6HAig388a62K9VCS2U2os2A1d FBEXeoCIk4R87Tal1oSvnf7cJ2jp7v7QWGYd+cJ8uWdsihfjflj8kQrIt8xUHQcG2p75 EPfqW6+iv0cHi0edgFjjPBMtxU1RKZOQC6eNuqSzcsuiUaWFXnOMA1ZR+WYnD1S7mhQE 5TXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=Wk5e9tbU; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si20703549pga.596.2017.08.02.18.45.59; Wed, 02 Aug 2017 18:46:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=Wk5e9tbU; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752099AbdHCBp6 (ORCPT + 6 others); Wed, 2 Aug 2017 21:45:58 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:29563 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751345AbdHCBp6 (ORCPT ); Wed, 2 Aug 2017 21:45:58 -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 v731iOVp012846; Thu, 3 Aug 2017 10:44:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v731iOVp012846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1501724666; bh=hiH03wiCjmU2YXaGHTIh/Udm54DTpJRxKNy3jvW+RAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wk5e9tbUvMjD3dZEjImEsMAsRwN0g+rBOlmkD17EPWGobfpLEUAXDSBQUHgy6fG+B tva3AXtcacNVcVclNw3P2b6UjNolSI1mxjlrOOhe8rcx+IND6AgD1H2Ikb0+K+jEnD G+qziTmBpF+4ZXM/0QHue8t/0rao8t89z0n3c12c8dBHXmYNIzLpQbrkTplACn7kfw z61+jcCmPJ9xCrJaJb/I0lHMKXdDomy5YZzAhh7fwjnPYsPHo7qMCU3PqMFJGkYm3p H/l69PBaVr54yxRrbrw1Pq54IqHPMorJjgeKCZtZPnxW14jBCg9TtUpNHv8CVaCpvI IynigFWGiQfzQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mmc@vger.kernel.org Cc: Piotr Sroka , Adrian Hunter , Masahiro Yamada , Al Cooper , linux-kernel@vger.kernel.org, Brian Norris , bcm-kernel-feedback-list@broadcom.com, Barry Song , Florian Fainelli , Gregory Fong , linux-arm-kernel@lists.infradead.org, Ulf Hansson Subject: [PATCH v2 1/4] mmc: sdhci: enable/disable the clock in sdhci_pltfm_suspend/resume Date: Thu, 3 Aug 2017 10:44:13 +0900 Message-Id: <1501724656-12435-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501724656-12435-1-git-send-email-yamada.masahiro@socionext.com> References: <1501724656-12435-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 This commit provides similar cleanups as commit 83eacdfa2529 ("mmc: sdhci: disable the clock in sdhci_pltfm_unregister()") did for unregister hooks. Some drivers duplicate code to handle pltfm_host->clk in their own hooks. The clock can be handled in sdhci_pltfm.c so that drivers can reuse sdhci_pltfm_pmops. Signed-off-by: Masahiro Yamada --- Changes in v2: - Fix build error reported by kbuild test robot drivers/mmc/host/sdhci-brcmstb.c | 37 +------------------------------------ drivers/mmc/host/sdhci-pltfm.c | 16 +++++++++++++++- drivers/mmc/host/sdhci-sirf.c | 39 +-------------------------------------- 3 files changed, 17 insertions(+), 75 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c index e2f638338e8f..6d461fcdd663 100644 --- a/drivers/mmc/host/sdhci-brcmstb.c +++ b/drivers/mmc/host/sdhci-brcmstb.c @@ -21,41 +21,6 @@ #include "sdhci-pltfm.h" -#ifdef CONFIG_PM_SLEEP - -static int sdhci_brcmstb_suspend(struct device *dev) -{ - struct sdhci_host *host = dev_get_drvdata(dev); - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); - int res; - - if (host->tuning_mode != SDHCI_TUNING_MODE_3) - mmc_retune_needed(host->mmc); - - res = sdhci_suspend_host(host); - if (res) - return res; - clk_disable_unprepare(pltfm_host->clk); - return res; -} - -static int sdhci_brcmstb_resume(struct device *dev) -{ - struct sdhci_host *host = dev_get_drvdata(dev); - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); - int err; - - err = clk_prepare_enable(pltfm_host->clk); - if (err) - return err; - return sdhci_resume_host(host); -} - -#endif /* CONFIG_PM_SLEEP */ - -static SIMPLE_DEV_PM_OPS(sdhci_brcmstb_pmops, sdhci_brcmstb_suspend, - sdhci_brcmstb_resume); - static const struct sdhci_ops sdhci_brcmstb_ops = { .set_clock = sdhci_set_clock, .set_bus_width = sdhci_set_bus_width, @@ -131,7 +96,7 @@ MODULE_DEVICE_TABLE(of, sdhci_brcm_of_match); static struct platform_driver sdhci_brcmstb_driver = { .driver = { .name = "sdhci-brcmstb", - .pm = &sdhci_brcmstb_pmops, + .pm = &sdhci_pltfm_pmops, .of_match_table = of_match_ptr(sdhci_brcm_of_match), }, .probe = sdhci_brcmstb_probe, diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index e090d8c42ddb..be9a79d62e22 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -212,16 +212,30 @@ EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister); static int sdhci_pltfm_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); - return sdhci_suspend_host(host); + ret = sdhci_suspend_host(host); + if (ret) + return ret; + + clk_disable_unprepare(pltfm_host->clk); + + return 0; } static int sdhci_pltfm_resume(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + int ret; + + ret = clk_prepare_enable(pltfm_host->clk); + if (ret) + return ret; return sdhci_resume_host(host); } diff --git a/drivers/mmc/host/sdhci-sirf.c b/drivers/mmc/host/sdhci-sirf.c index c251c6c0a112..0c7aa89df4e2 100644 --- a/drivers/mmc/host/sdhci-sirf.c +++ b/drivers/mmc/host/sdhci-sirf.c @@ -230,43 +230,6 @@ static int sdhci_sirf_probe(struct platform_device *pdev) return ret; } -#ifdef CONFIG_PM_SLEEP -static int sdhci_sirf_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(pltfm_host->clk); - - return 0; -} - -static int sdhci_sirf_resume(struct device *dev) -{ - struct sdhci_host *host = dev_get_drvdata(dev); - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); - int ret; - - ret = clk_enable(pltfm_host->clk); - if (ret) { - dev_dbg(dev, "Resume: Error enabling clock\n"); - return ret; - } - - return sdhci_resume_host(host); -} -#endif - -static SIMPLE_DEV_PM_OPS(sdhci_sirf_pm_ops, sdhci_sirf_suspend, sdhci_sirf_resume); - static const struct of_device_id sdhci_sirf_of_match[] = { { .compatible = "sirf,prima2-sdhc" }, { } @@ -277,7 +240,7 @@ static struct platform_driver sdhci_sirf_driver = { .driver = { .name = "sdhci-sirf", .of_match_table = sdhci_sirf_of_match, - .pm = &sdhci_sirf_pm_ops, + .pm = &sdhci_pltfm_pmops, }, .probe = sdhci_sirf_probe, .remove = sdhci_pltfm_unregister, From patchwork Thu Aug 3 01:44:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 109281 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp156020qge; Wed, 2 Aug 2017 18:45:07 -0700 (PDT) X-Received: by 10.84.217.74 with SMTP id e10mr39420plj.410.1501724707524; Wed, 02 Aug 2017 18:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501724707; cv=none; d=google.com; s=arc-20160816; b=EldO+uwjaXOvJ8uxrpU3OXk7UPgsRJQFxcCyqDFzO7+eYYRSPu4V6iF4z8zxJsvVtW iqa84fJkuS+RXCkxB4sBGscCVLPjV2YE1VINKIr1L1aJbS5UJ5p645vT5+qN5URuK76S NBO2egegaF42unIN6SUP/a9B97vdRoqfwi/UxB1yS+z/L8JJ25SfFfxB4T3S2yZVQPwc de3tO9PHrtFkFsZqDwCnYbXNvtanXSVoZid4VctBzCK2+6nGeqn4C9OMVfSy+9wh+JBW vYH2cxqg7EFtPM+vx6c9nQG1IFnwc2cLsjHjDblITNY58VMqHXuIlMyGa2Mm8l1JWkyW T4Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=AFj8R3MieDnOh35BfUNVv948N5mAHmx81vEm/RBexM4=; b=ob7hRWC/f6ztG88CGLAOHRJmyy+8O/Cyx4L9BXQedTQY2z9RHZpHeblrB0+1wHmX4V W11SDilcP0InuWDO4smJr6IHbLpdN1NVohiQkFIgCHwi+lllxCHb7H2RrDjcFZsM+9qo 8RqPJ+Xrs57OfOpfxV/7SUjqzyN8PZW27k/dUr6HrahTkODhmPZTDZ2dGrFTWPocK1Kr y5FECwwk2ypD24U+3io902GITLBfbkGsDmfC8+J64XJIJiOySiqXj1m59H5kzV9qzd5X B1eH2JCAxTT+1qmHR+3bh3gGELNNTYg/Qq0UwzpEWQhgnZmUEAHn2cfJ6kt0bFC2Zdl7 OYCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=kDH7ZJJF; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si22015286pld.582.2017.08.02.18.45.06; Wed, 02 Aug 2017 18:45:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=kDH7ZJJF; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751727AbdHCBpF (ORCPT + 6 others); Wed, 2 Aug 2017 21:45:05 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:27878 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbdHCBpE (ORCPT ); Wed, 2 Aug 2017 21:45:04 -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 v731iOVs012846; Thu, 3 Aug 2017 10:44:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v731iOVs012846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1501724668; bh=COFxZIU4H1rFk/HqJxzI7/J23i3x4/PQ1u6pwwphw7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kDH7ZJJFjtmO6KYYMJhsyJacjH58UZvj8UXJWmzM9n7XN4Zn5xvVSSUtcOywnRbCH FuKhWhT9g8Ot4kBYGE8IHDQF6bwO0lU+v9d7U6zh6t693EHnTIQVWdPyYfy1HDNnDK wODG0JE4N+QcwY4ykynWeCB042a4pLV012Frs8LONRJ7MSPafQXibyfjbickH12VQC Odl89zXo2sHheeD0+E7SNGSuZkTYtFqlfUsXnQiUqNq0D6DPtEj+hp/tJnU8IXQ9VS 902j5Q8Md/xVESc15xFZpZ32+tlFieS9o7UhK5itPH4oTHqOWZdqlHVbdvxckLJuk5 qktRcc2nZQQhQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mmc@vger.kernel.org Cc: Piotr Sroka , Adrian Hunter , Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 4/4] mmc: sdhci-cadence: add suspend / resume support Date: Thu, 3 Aug 2017 10:44:16 +0900 Message-Id: <1501724656-12435-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1501724656-12435-1-git-send-email-yamada.masahiro@socionext.com> References: <1501724656-12435-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 Currently, the probe function initializes the PHY, but PHY settings are lost during the sleep state. Restore the PHY registers when resuming. To facilitate this, split sdhci_cdns_phy_init() into the DT parse part and PHY update part so that the latter can be invoked from the resume hook. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/sdhci-cadence.c | 77 +++++++++++++++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 9 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c index 19d5698244b5..7473766801a5 100644 --- a/drivers/mmc/host/sdhci-cadence.c +++ b/drivers/mmc/host/sdhci-cadence.c @@ -67,9 +67,16 @@ */ #define SDHCI_CDNS_MAX_TUNING_LOOP 40 +struct sdhci_cdns_phy_param { + u8 addr; + u8 data; +}; + struct sdhci_cdns_priv { void __iomem *hrs_addr; bool enhanced_strobe; + unsigned int nr_phy_params; + struct sdhci_cdns_phy_param phy_params[0]; }; struct sdhci_cdns_phy_cfg { @@ -115,9 +122,22 @@ static int sdhci_cdns_write_phy_reg(struct sdhci_cdns_priv *priv, return 0; } -static int sdhci_cdns_phy_init(struct device_node *np, - struct sdhci_cdns_priv *priv) +static unsigned int sdhci_cdns_phy_param_count(struct device_node *np) { + unsigned int count = 0; + int i; + + for (i = 0; i < ARRAY_SIZE(sdhci_cdns_phy_cfgs); i++) + if (of_property_read_bool(np, sdhci_cdns_phy_cfgs[i].property)) + count++; + + return count; +} + +static void sdhci_cdns_phy_param_parse(struct device_node *np, + struct sdhci_cdns_priv *priv) +{ + struct sdhci_cdns_phy_param *p = priv->phy_params; u32 val; int ret, i; @@ -127,9 +147,19 @@ static int sdhci_cdns_phy_init(struct device_node *np, if (ret) continue; - ret = sdhci_cdns_write_phy_reg(priv, - sdhci_cdns_phy_cfgs[i].addr, - val); + p->addr = sdhci_cdns_phy_cfgs[i].addr; + p->data = val; + p++; + } +} + +static int sdhci_cdns_phy_init(struct sdhci_cdns_priv *priv) +{ + int ret, i; + + for (i = 0; i < priv->nr_phy_params; i++) { + ret = sdhci_cdns_write_phy_reg(priv, priv->phy_params[i].addr, + priv->phy_params[i].data); if (ret) return ret; } @@ -302,6 +332,8 @@ static int sdhci_cdns_probe(struct platform_device *pdev) struct sdhci_pltfm_host *pltfm_host; struct sdhci_cdns_priv *priv; struct clk *clk; + size_t priv_size; + unsigned int nr_phy_params; int ret; struct device *dev = &pdev->dev; @@ -313,7 +345,9 @@ static int sdhci_cdns_probe(struct platform_device *pdev) if (ret) return ret; - host = sdhci_pltfm_init(pdev, &sdhci_cdns_pltfm_data, sizeof(*priv)); + nr_phy_params = sdhci_cdns_phy_param_count(dev->of_node); + priv_size = sizeof(*priv) + sizeof(priv->phy_params[0]) * nr_phy_params; + host = sdhci_pltfm_init(pdev, &sdhci_cdns_pltfm_data, priv_size); if (IS_ERR(host)) { ret = PTR_ERR(host); goto disable_clk; @@ -322,7 +356,8 @@ static int sdhci_cdns_probe(struct platform_device *pdev) pltfm_host = sdhci_priv(host); pltfm_host->clk = clk; - priv = sdhci_cdns_priv(host); + priv = sdhci_pltfm_priv(pltfm_host); + priv->nr_phy_params = nr_phy_params; priv->hrs_addr = host->ioaddr; priv->enhanced_strobe = false; host->ioaddr += SDHCI_CDNS_SRS_BASE; @@ -336,7 +371,9 @@ static int sdhci_cdns_probe(struct platform_device *pdev) if (ret) goto free; - ret = sdhci_cdns_phy_init(dev->of_node, priv); + sdhci_cdns_phy_param_parse(dev->of_node, priv); + + ret = sdhci_cdns_phy_init(priv); if (ret) goto free; @@ -353,6 +390,28 @@ static int sdhci_cdns_probe(struct platform_device *pdev) return ret; } +static int __maybe_unused sdhci_cdns_resume(struct device *dev) +{ + struct sdhci_host *host = dev_get_drvdata(dev); + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_cdns_priv *priv = sdhci_pltfm_priv(pltfm_host); + int ret; + + ret = clk_prepare_enable(pltfm_host->clk); + if (ret) + return ret; + + ret = sdhci_cdns_phy_init(priv); + if (ret) + return ret; + + return sdhci_resume_host(host); +} + +static const struct dev_pm_ops sdhci_cdns_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_cdns_resume) +}; + static const struct of_device_id sdhci_cdns_match[] = { { .compatible = "socionext,uniphier-sd4hc" }, { .compatible = "cdns,sd4hc" }, @@ -363,7 +422,7 @@ MODULE_DEVICE_TABLE(of, sdhci_cdns_match); static struct platform_driver sdhci_cdns_driver = { .driver = { .name = "sdhci-cdns", - .pm = &sdhci_pltfm_pmops, + .pm = &sdhci_cdns_pm_ops, .of_match_table = sdhci_cdns_match, }, .probe = sdhci_cdns_probe,