Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp238904ybt; Fri, 19 Jun 2020 00:19:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVxGMQcuWF7wze7y0cjOqWkybNpSVV5BzFDGqfzdI3KJwnaZ0VkhAqFpkRkCIFPzUTntZx X-Received: by 2002:aa7:d985:: with SMTP id u5mr2028238eds.160.1592551187357; Fri, 19 Jun 2020 00:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592551187; cv=none; d=google.com; s=arc-20160816; b=YWElPkoZ3bs38buZL14XVapikWZcRX3Mc6lU8/8bSTn/W2k3mvz6VLU3+MeeUpfSDP HogF8pgJtSPwFaWxgSRYSvkvMZM0r2GNOOz6v5COaD3gZwOS7JJuXPxpilcJlrckXSf+ SBTGwbhkG/Kq4JBV3B1lwgypMzFVv1uEwtqy4AoDBPOI6SHL5AIIsUY73HmvjZBl6Gcm ExTt1ZxZOOAXdYL3oUBbO8p8VG0xTuvaNX8ZeYEYm0XJXwkgEL1lVGEGiJ9vX5gTje/0 pPt4T3mWDP2SWxaY1uG7c+y/sQp0v0OeMDps874F4E7ChRTbM2HepQS7PVyqX1SYPXDP 5LTQ== 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=xcLqzNszUsRDe3jzmL6Kvi+SK8buR0iM6L0pJ0UQJfo=; b=G4ccNbfyPvfCbExCX8YUoX5NtqjUEMoSXp90ZB6GsGpK+pprD98a0cw52GLxa+9j9u ZDd2EzOMfJuuVyuTiY5QgplOXYR5PhHVT1gRtK7aRAnqEVs2Z9lBPTixIClS6tlNT+J5 G2zVFlN1+1e2BZZRRRfRAfoTrW8MvZuv0l710CiJGI+EWs5twt8sVN+epTCCq5pUgM6e bAq8XQ6ZjwQcet9dnzfiqdrubZ/NymFavMSZAsA8kK8BadbhHJNQiGR8zad6ZOvZVZAi Aqyjp/JYFxJXVjfqX88Huj+x7n/7JOEy0ckOIyuRFHNQ8EFaoYDc8BppBmja1kmYNOFj NS6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MThCG9Jw; 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 a7si3191348ejy.133.2020.06.19.00.19.24; Fri, 19 Jun 2020 00:19:47 -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=MThCG9Jw; 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 S1730346AbgFSHQI (ORCPT + 99 others); Fri, 19 Jun 2020 03:16:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729740AbgFSHQI (ORCPT ); Fri, 19 Jun 2020 03:16:08 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E613CC06174E for ; Fri, 19 Jun 2020 00:16:07 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id i16so6492408qtr.7 for ; Fri, 19 Jun 2020 00:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xcLqzNszUsRDe3jzmL6Kvi+SK8buR0iM6L0pJ0UQJfo=; b=MThCG9Jwd1aI1wlSrnihvC6cp3eKrh1rOv53tY8fvT3TtKvhO4+k+EFdPX6DnBxykT HIAUcdBak30KNoee1xQlVGjQw+hElyt19YBKvIplGecD/KWhj8ClCPXrtKXwLneEzPkG FX2YRtIycp9pDMfyTHJgBM5aXLXlxwmFiJy+p+G9rjP4s16pUfA8Ed7dtd9yN2DsSr65 ajQr2uZOX1cSLXZrD31ZkfHZImQMfY35RGJ5SEJylICknu5fwuDtAcUp6VtIPDTgMuIT SdzZcm84vhjqCYCVAgG9traNzYrCUBJBeoTdbYa44zPvck6LQiRZDIa5uulw8dHVCqPb HDrQ== 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=xcLqzNszUsRDe3jzmL6Kvi+SK8buR0iM6L0pJ0UQJfo=; b=XdAhl8dvIsCBkNlG4DPABF1j3SN+4LYPSdRANatnPwQmAXHrwUqo3wjyN+VXMRbyg8 /3RZtBEL6dO226v7pAWVkoehRxF1QD9Kk0olGhrMyPp28RiFBk623GliBphnkl+c4OSM PqhlO8Srx24WCp/ovqV2sx5AMRVAzLe0eCqPDiifiLznE5zdj/8B5wrYg7oAYmK+u9vt Mf1vqgkTn+k3zoORFyX7Tar1f5za/Z0JzU9xftYVep9gQ4YKgvQIFeGcRA5vtCHe1R9e 8emibLKucM3fvNqEvdiMcIWGdxHPZkh78tRdMd7GWPPrrQTb+EJw+yuiJzlNB5VZ4p1+ HghA== X-Gm-Message-State: AOAM533pb3Vlj8CGIZn1GmPCmNlfP6TC6ye2/IfQ0ySR2s+VO6SiM6dU tibckI+dynp/r2UkbXnHDB5wyuuHDC/+YHkXhU+6YQ== X-Received: by 2002:ac8:7417:: with SMTP id p23mr2043092qtq.204.1592550967172; Fri, 19 Jun 2020 00:16:07 -0700 (PDT) MIME-Version: 1.0 References: <1592481334-3680-1-git-send-email-shengjiu.wang@nxp.com> <20200619054942.GA25856@Asurada-Nvidia> In-Reply-To: <20200619054942.GA25856@Asurada-Nvidia> From: Shengjiu Wang Date: Fri, 19 Jun 2020 15:15:56 +0800 Message-ID: Subject: Re: [PATCH] ASoC: fsl_spdif: Add pm runtime function To: Nicolin Chen Cc: Shengjiu Wang , Linux-ALSA , Timur Tabi , Xiubo Li , linuxppc-dev@lists.ozlabs.org, Takashi Iwai , Mark Brown , Fabio Estevam , linux-kernel 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, Jun 19, 2020 at 1:51 PM Nicolin Chen wrote: > > 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. seems can drop one, will send an update. best regards wang shengjiu