Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp285722ybk; Fri, 15 May 2020 00:14:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6CwRaShUc+MxIY8+WeqSXtYrp0t3cDfS0FNhJOxM+ueAkOPndQTty9+ec2NG8k1uJtKxD X-Received: by 2002:a05:6402:507:: with SMTP id m7mr1559530edv.7.1589526866753; Fri, 15 May 2020 00:14:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589526866; cv=none; d=google.com; s=arc-20160816; b=Hj4z2DomED5QLEyJxtB1h2P2WRoPvn1lShmltMqtE7BnojpRcrnlCmE3Cv9MZHOk7b CR5GuRO7L4j/lxJCBKnEVWjhs52AX773dT7nG0kecDRDAZQf3eQZVVOypsTRET9txCSb h9kIM5qTgEdnPti7v3+mL6RQd1TC+MGPUPip3C2drgqg26q75f4tK7px5KHlp8rN72Ri pQtCBhyAmbWqMkHdydDQfQJourfjlL17zfH7NCcrWWCOFC2ZvlTP0bKNC5gjurpBf0+4 KefpFEh9vJ0YTy9rbumMlVTZ19DXmtJUzrTzf5o70Bgt4N4RLWF95r6ar/z6uw8Jw0nz qKJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Mjd+prrjNqDXqBM9/JBw7x6PcberMvd4v5JGZhudn1M=; b=F/VXqXtCYGQ8/F6FPFVhWL0Ro3fpoITtKWwunfOqBN9WVOjLo/LRt+J/j+nCTA2CXg 9kR2HA7N4nXOhAhaXS/WhFRqsGuGUWf4ED2iJfizyUDNfqy6O5h0Mr8OcGbAVPg666rO B0oAldd4sPUMtDkzTYmfuF27o0MzIjthmatcxy896szS85k1ylpRCTGgWmRTAyy8mGtY aePrgFJPCDjjWjsrXpvV6wQrSSZr/G4knG1ijATfbAXzxnoG1WRJDAclBTiefw9iULHf f0dj/c/0oa1eoxjEiNYjS2brSvbUR5YAV2dBM888quGY/cr2dFfdtnIOLohINTfIARbY SSpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xIGvyUUH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p1si680564ejw.313.2020.05.15.00.14.03; Fri, 15 May 2020 00:14:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xIGvyUUH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726908AbgEOHKJ (ORCPT + 99 others); Fri, 15 May 2020 03:10:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726863AbgEOHKG (ORCPT ); Fri, 15 May 2020 03:10:06 -0400 Received: from mail-vk1-xa44.google.com (mail-vk1-xa44.google.com [IPv6:2607:f8b0:4864:20::a44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81B1EC061A0C for ; Fri, 15 May 2020 00:10:05 -0700 (PDT) Received: by mail-vk1-xa44.google.com with SMTP id p7so328600vkf.5 for ; Fri, 15 May 2020 00:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mjd+prrjNqDXqBM9/JBw7x6PcberMvd4v5JGZhudn1M=; b=xIGvyUUHtSqMRzFRXRnD4nfC2if8wa39ovV9GvseHD7I+pK+Gw9uLPMl82g51Trnpr s4GcWcpuS6KMNpb+Dn0pHR4t/X562i0PfW1GttkjayRQUz1ZMPrun3msXt5FLjOEqTc1 bJyPfm/TErT0RZpuMAfhfxmSiVVnMhaWLgLVaVwMH3yAb/zDtGjLyrGPAc0DuZgiHZH3 ZqyAtZuxpydnmVosRFn5gNQcyF1j2ezdm/wiDPpQ28z52Qu284jLsUpZU2RcwLCZsi5X fDAx2E0RqlZbQMjD5XPdklOD17tGn9YBeQWIn9+ukQ1eDivxTrTabIiV4Ja6AAKK/Qvx 22NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mjd+prrjNqDXqBM9/JBw7x6PcberMvd4v5JGZhudn1M=; b=GxF8vcRFXxpH50rytf0aySagnChesSj1fi8Tp+9n+RXcs07NU4vuM7DRoo1BRAFDay WxvgzQmIeYS3gtWHltZ9YcCyemx+SLBa0H33rlquWO7HLSACD3qO5OI+k62hHGyMjSCG c7zUXCTA9vaCLtlpiTEoGFDfD7SKh1yW1WhrzK02MMpx9DJoa5FyntHzYYgI0BRcLDHj YrP4oOZgIiKdAI2ULCq6How0c7KF6t346YooXJMp/+C/0gRwcFLFD3BwZmCiK0GoQxnX zEA9w+rtm600agf1PQFuQNasXFvxyO9L3GSoXo85fzo/EtPM8K0PpWeawQcCug2SbHm+ Qk5w== X-Gm-Message-State: AOAM532FZ2rKQ7pwpyXHsD8OX4JHBpzroG1rzIR6Diud5zPOlXYYl2zW pBsyX3AcCyTy06t64cFeUFB0L9KstWhf+fgxPQgCDA== X-Received: by 2002:ac5:cded:: with SMTP id v13mr1701498vkn.59.1589526604780; Fri, 15 May 2020 00:10:04 -0700 (PDT) MIME-Version: 1.0 References: <20200515141926.52e088fe@xhacker.debian> In-Reply-To: <20200515141926.52e088fe@xhacker.debian> From: Ulf Hansson Date: Fri, 15 May 2020 09:09:28 +0200 Message-ID: Subject: Re: [PATCH] mmc: sdhci-of-dwcmshc: add suspend/resume support To: Jisheng Zhang Cc: Adrian Hunter , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 May 2020 at 08:19, Jisheng Zhang wrote: > > Add dwcmshc specific system-level suspend and resume support. > > Signed-off-by: Jisheng Zhang Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/host/sdhci-of-dwcmshc.c | 43 +++++++++++++++++++++++++++++ > 1 file changed, 43 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c > index a9ed0e006e06..64ac0dbee95c 100644 > --- a/drivers/mmc/host/sdhci-of-dwcmshc.c > +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c > @@ -163,6 +163,48 @@ static int dwcmshc_remove(struct platform_device *pdev) > return 0; > } > > +#ifdef CONFIG_PM_SLEEP > +static int dwcmshc_suspend(struct device *dev) > +{ > + struct sdhci_host *host = dev_get_drvdata(dev); > + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > + struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host); > + int ret; > + > + ret = sdhci_suspend_host(host); > + if (ret) > + return ret; > + > + clk_disable_unprepare(pltfm_host->clk); > + if (!IS_ERR(priv->bus_clk)) > + clk_disable_unprepare(priv->bus_clk); > + > + return ret; > +} > + > +static int dwcmshc_resume(struct device *dev) > +{ > + struct sdhci_host *host = dev_get_drvdata(dev); > + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > + struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host); > + int ret; > + > + ret = clk_prepare_enable(pltfm_host->clk); > + if (ret) > + return ret; > + > + if (!IS_ERR(priv->bus_clk)) { > + ret = clk_prepare_enable(priv->bus_clk); > + if (ret) > + return ret; > + } > + > + return sdhci_resume_host(host); > +} > +#endif > + > +static SIMPLE_DEV_PM_OPS(dwcmshc_pmops, dwcmshc_suspend, dwcmshc_resume); > + > static const struct of_device_id sdhci_dwcmshc_dt_ids[] = { > { .compatible = "snps,dwcmshc-sdhci" }, > {} > @@ -173,6 +215,7 @@ static struct platform_driver sdhci_dwcmshc_driver = { > .driver = { > .name = "sdhci-dwcmshc", > .of_match_table = sdhci_dwcmshc_dt_ids, > + .pm = &dwcmshc_pmops, > }, > .probe = dwcmshc_probe, > .remove = dwcmshc_remove, > -- > 2.26.2 >