Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp197904ybt; Thu, 18 Jun 2020 23:01:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVlR7R59rF9ek8DsLUvd7SZFpgWz71gc2oNF90LuMKgN35FhE6212jlFTIMMS86ODtAQ7/ X-Received: by 2002:a17:906:7f84:: with SMTP id f4mr2063384ejr.482.1592546489903; Thu, 18 Jun 2020 23:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592546489; cv=none; d=google.com; s=arc-20160816; b=gBSjeNPh5VgHWBVsxjsAJ7ohmacs2CyR1dB6lCavtoM9h6hjX28Z8ohY40ngIjAxUl jiuJ3/n6HGWCjzZ4HpUzdJr0qDCSI262bJYYnRrLe/ISm4lV1NHpA0tdLci1ns2FtclJ juu4ZjaIrKVKL3nDiT2Eje4gRp84YPNKJUYb5hG1y9FCVC80RtdWlsRomK6Fya4e63Dw dMEyNLRv5nqitNtUQCtWAX15LCwFEt0WEPmlf8buOLp7/iqJauDt2ILxJ1s0+tDqAJIc t6a1qSDpkZy1PKrR1IWPLi59b6RZcCEbSoveVax3LKtkyLiFBFqG64V98tPwhZuCpMMD Bowg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=uJunhxgU/GhtFdUD98Pvml4aHtu/6+uQFMKPVljojZY=; b=mbpNnAfykW/eaXwnMdrOHyJLyqxc113EWL6ICaeqQDwCv6GP3fiTMr/gS0kGkoLKqD 7gk8wWhl2hkSrdT553ztq++3ToOaWgLr+/BdEkw5dga2dKj+/fV+7XbgfRo0CkxGdHQ9 j5F2Plc9UbvLeWelWB7H1VBwC/d9qJnnwJgmllc7U6nXGWRPi2DRb8Ei4wzns35MxOPu VJ6OndKH1cQx2cz7t8a6RqksASBt7ViNLcwxBkMo0MSUTtKoHl+nWn9VpxqG09lMsQFH 1A0YfcuS/xtWbu2dg80nJZJo2zxt3fga01VEvEyZDW4XGJhy1JlGN6mIq3kdofXS9OJv WJUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="VLVq/MTQ"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l30si4021720edj.499.2020.06.18.23.01.07; Thu, 18 Jun 2020 23:01:29 -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=@gmail.com header.s=20161025 header.b="VLVq/MTQ"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729009AbgFSFuE (ORCPT + 99 others); Fri, 19 Jun 2020 01:50:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbgFSFuE (ORCPT ); Fri, 19 Jun 2020 01:50:04 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AEC6C06174E for ; Thu, 18 Jun 2020 22:50:04 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id jz3so3642773pjb.0 for ; Thu, 18 Jun 2020 22:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uJunhxgU/GhtFdUD98Pvml4aHtu/6+uQFMKPVljojZY=; b=VLVq/MTQU/NNg1KDEodPCc0dIVnRN0lPQnSff9+nrJhdE1v5B72E4p0G+nx7HDdROB TwUXIT0/yD8D0OJ+3VxMmx+8x23YbT8Wxj//0vsxG6/Pag1QcQlwYCEIhI9n09u4bPaF dR7NvqkQyN/C+6IU3hD6PN/CmCZsXNgwBR9NIg8ZJ8KWDhDpnNHqyBXnwffA9CRTJ8h3 LbaWrqCCkrPlv1EKl5zAswa/WrO+a2HBU0tpoe5lafMudJGyYhwoW7Qw74dZ2u1El1yR Ab7eDkHYshROtUglv+eB0hoCm1UgWZDNEr1+xgIzG5oodweXDbRJ9G5zWb2M9ZPjnjxL 3s8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uJunhxgU/GhtFdUD98Pvml4aHtu/6+uQFMKPVljojZY=; b=JdAYgrHtjvbPZycJb7sXvJcANkr9f1rdAujhkhWejNTwJas2eZ65RJTol7g4V4dFmR s5miJqFNXOurm90O5vYf4vB7y8a8gN/ek7fNYjZLcSemxuBghkySXZ8QjyIADLq42WLs FGvNsHTxhWKBrBAiDavYfSayqY59ZDUKEEYFkacZwd027UXlqTy6+ZPPvHLQLIjWtcRJ AAOiIh7Op9PGuVmTSRtoS6Yu9SeO5V9ZMKhguf+UOPPa3arGpjyiCu3YCUyXWkVDJPZt rRp4bSgLXygnr0S2mT44P3NoF+N3TEIaurlBTKnG33bvO2jU4yUUdQFZvV+bwW0FKSuM W4ZQ== X-Gm-Message-State: AOAM531cH85E3IB2Hx+taMgRD+3M8PfCp0wlqyZBmiSVjXWxOP9tiLNb Pb5JbBCokhZdIbRuZsdtxmo= X-Received: by 2002:a17:90a:1a17:: with SMTP id 23mr1880621pjk.231.1592545803758; Thu, 18 Jun 2020 22:50:03 -0700 (PDT) Received: from Asurada-Nvidia (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id w17sm5028544pff.27.2020.06.18.22.50.02 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jun 2020 22:50:03 -0700 (PDT) Date: Thu, 18 Jun 2020 22:49:43 -0700 From: Nicolin Chen To: Shengjiu Wang Cc: timur@kernel.org, Xiubo.Lee@gmail.com, festevam@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ASoC: fsl_spdif: Add pm runtime function Message-ID: <20200619054942.GA25856@Asurada-Nvidia> References: <1592481334-3680-1-git-send-email-shengjiu.wang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1592481334-3680-1-git-send-email-shengjiu.wang@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 18, 2020 at 07:55:34PM +0800, Shengjiu Wang wrote: > Add pm runtime support and move clock handling there. > Close the clocks at suspend to reduce the power consumption. > > fsl_spdif_suspend is replaced by pm_runtime_force_suspend. > fsl_spdif_resume is replaced by pm_runtime_force_resume. > > Signed-off-by: Shengjiu Wang LGTM, yet some nits, please add my ack after fixing: Acked-by: Nicolin Chen > @@ -495,25 +496,10 @@ static int fsl_spdif_startup(struct snd_pcm_substream *substream, > > -disable_txclk: > - for (i--; i >= 0; i--) > - clk_disable_unprepare(spdif_priv->txclk[i]); > err: > - if (!IS_ERR(spdif_priv->spbaclk)) > - clk_disable_unprepare(spdif_priv->spbaclk); > -err_spbaclk: > - clk_disable_unprepare(spdif_priv->coreclk); > - > return ret; Only "return ret;" remains now. We could clean the goto away. > -static int fsl_spdif_resume(struct device *dev) > +static int fsl_spdif_runtime_resume(struct device *dev) > +disable_rx_clk: > + clk_disable_unprepare(spdif_priv->rxclk); > +disable_tx_clk: > +disable_spba_clk: Why have two duplicated ones? Could probably drop the 2nd one.