All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viorel Suman <viorel.suman@nxp.com>
To: "nicoleotsuka@gmail.com" <nicoleotsuka@gmail.com>,
	Daniel Baluta <daniel.baluta@nxp.com>
Cc: dl-linux-imx <linux-imx@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"timur@kernel.org" <timur@kernel.org>,
	"Xiubo.Lee@gmail.com" <Xiubo.Lee@gmail.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"S.j. Wang" <shengjiu.wang@nxp.com>,
	"perex@perex.cz" <perex@perex.cz>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [PATCH 2/2] ASoC: fsl: Move clock operation to PM runtime
Date: Mon, 22 Apr 2019 11:02:22 +0000	[thread overview]
Message-ID: <1555930942.31656.4.camel@nxp.com> (raw)
In-Reply-To: <20190421055406.GC683@Asurada-Nvidia.nvidia.com>

Hi Nicolin,

On Sb, 2019-04-20 at 22:54 -0700, Nicolin Chen wrote:
> On Sat, Apr 20, 2019 at 03:59:05PM +0000, Daniel Baluta wrote:
> > 
> > Turn off/on clocks when device enters suspend/resume. This
> > helps saving power.
> > 
> > @@ -934,6 +933,25 @@ static int fsl_sai_runtime_suspend(struct device *dev)
> >  static int fsl_sai_runtime_resume(struct device *dev)
> >  {
> >  	struct fsl_sai *sai = dev_get_drvdata(dev);
> > +	int ret;
> > +
> > +	ret = clk_prepare_enable(sai->bus_clk);
> > +	if (ret) {
> > +		dev_err(dev, "failed to enable bus clock: %d\n", ret);
> > +		return ret;
> > +	}
> > +
> > +	if (sai->mclk_streams & BIT(SNDRV_PCM_STREAM_PLAYBACK)) {
> > +		ret = clk_prepare_enable(sai->mclk_clk[sai->mclk_id[1]]);
> > +		if (ret)
> > +			goto disable_bus_clk;
> > +	}
> > +
> > +	if (sai->mclk_streams & BIT(SNDRV_PCM_STREAM_CAPTURE)) {
> > +		ret = clk_prepare_enable(sai->mclk_clk[sai->mclk_id[0]]);
> > +		if (ret)
> > +			goto disable_tx_clk;
> > +	}
> The driver only enables mclk_clks for I2S master mode. But this
> change enables them for I2S slave mode also. It doesn't sound a
> right thing to me since we are supposed to save power?

This change does not enable them for I2S slave mode, please check "fsl_sai_hw_params"
and "fsl_sai_hw_free" functions: the field "sai->mclk_streams" is modified only for
the case when "if (!sai->is_slave_mode)";

Regards,
Viorel

WARNING: multiple messages have this Message-ID (diff)
From: Viorel Suman <viorel.suman@nxp.com>
To: "nicoleotsuka@gmail.com" <nicoleotsuka@gmail.com>,
	Daniel Baluta <daniel.baluta@nxp.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"timur@kernel.org" <timur@kernel.org>,
	"Xiubo.Lee@gmail.com" <Xiubo.Lee@gmail.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"S.j. Wang" <shengjiu.wang@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"perex@perex.cz" <perex@perex.cz>,
	"festevam@gmail.com" <festevam@gmail.com>
Subject: Re: [PATCH 2/2] ASoC: fsl: Move clock operation to PM runtime
Date: Mon, 22 Apr 2019 11:02:22 +0000	[thread overview]
Message-ID: <1555930942.31656.4.camel@nxp.com> (raw)
In-Reply-To: <20190421055406.GC683@Asurada-Nvidia.nvidia.com>

Hi Nicolin,

On Sb, 2019-04-20 at 22:54 -0700, Nicolin Chen wrote:
> On Sat, Apr 20, 2019 at 03:59:05PM +0000, Daniel Baluta wrote:
> > 
> > Turn off/on clocks when device enters suspend/resume. This
> > helps saving power.
> > 
> > @@ -934,6 +933,25 @@ static int fsl_sai_runtime_suspend(struct device *dev)
> >  static int fsl_sai_runtime_resume(struct device *dev)
> >  {
> >  	struct fsl_sai *sai = dev_get_drvdata(dev);
> > +	int ret;
> > +
> > +	ret = clk_prepare_enable(sai->bus_clk);
> > +	if (ret) {
> > +		dev_err(dev, "failed to enable bus clock: %d\n", ret);
> > +		return ret;
> > +	}
> > +
> > +	if (sai->mclk_streams & BIT(SNDRV_PCM_STREAM_PLAYBACK)) {
> > +		ret = clk_prepare_enable(sai->mclk_clk[sai->mclk_id[1]]);
> > +		if (ret)
> > +			goto disable_bus_clk;
> > +	}
> > +
> > +	if (sai->mclk_streams & BIT(SNDRV_PCM_STREAM_CAPTURE)) {
> > +		ret = clk_prepare_enable(sai->mclk_clk[sai->mclk_id[0]]);
> > +		if (ret)
> > +			goto disable_tx_clk;
> > +	}
> The driver only enables mclk_clks for I2S master mode. But this
> change enables them for I2S slave mode also. It doesn't sound a
> right thing to me since we are supposed to save power?

This change does not enable them for I2S slave mode, please check "fsl_sai_hw_params"
and "fsl_sai_hw_free" functions: the field "sai->mclk_streams" is modified only for
the case when "if (!sai->is_slave_mode)";

Regards,
Viorel

  reply	other threads:[~2019-04-22 11:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-20 15:59 [PATCH 0/2] Add runtime PM for SAI digital audio interface Daniel Baluta
2019-04-20 15:59 ` Daniel Baluta
2019-04-20 15:59 ` [PATCH 1/2] ASoC: fsl: sai: Add support for runtime pm Daniel Baluta
2019-04-20 15:59   ` Daniel Baluta
2019-04-21  5:43   ` Nicolin Chen
2019-04-21  5:43     ` Nicolin Chen
2019-04-20 15:59 ` [PATCH 2/2] ASoC: fsl: Move clock operation to PM runtime Daniel Baluta
2019-04-20 15:59   ` Daniel Baluta
2019-04-21  5:54   ` Nicolin Chen
2019-04-21  5:54     ` Nicolin Chen
2019-04-21  5:54     ` Nicolin Chen
2019-04-22 11:02     ` Viorel Suman [this message]
2019-04-22 11:02       ` Viorel Suman
2019-04-22 18:15       ` Nicolin Chen
2019-04-22 18:15         ` Nicolin Chen
2019-04-21  5:42 ` [PATCH 0/2] Add runtime PM for SAI digital audio interface Nicolin Chen
2019-04-21  5:42   ` Nicolin Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1555930942.31656.4.camel@nxp.com \
    --to=viorel.suman@nxp.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=festevam@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=perex@perex.cz \
    --cc=shengjiu.wang@nxp.com \
    --cc=timur@kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.