All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shengjiu Wang <shengjiu.wang@freescale.com>
To: Rob Herring <robh@kernel.org>
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
	alsa-devel@alsa-project.org, pawel.moll@arm.com,
	ijc+devicetree@hellion.org.uk, linuxppc-dev@lists.ozlabs.org,
	Xiubo.Lee@gmail.com, timur@tabi.org, lgirdwood@gmail.com,
	nicoleotsuka@gmail.com, broonie@kernel.org, galak@codeaurora.org,
	tiwai@suse.com, shawnguo@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 1/3] ASoC: fsl_esai: spba clock is needed by esai device
Date: Wed, 25 Nov 2015 10:02:32 +0800	[thread overview]
Message-ID: <20151125020229.GA26087@shlinux2> (raw)
In-Reply-To: <20151124232130.GA3400@rob-hp-laptop>

On Tue, Nov 24, 2015 at 05:21:30PM -0600, Rob Herring wrote:
> On Tue, Nov 24, 2015 at 03:03:28PM +0800, Shengjiu Wang wrote:
> > ESAI need to enable the spba clock, when sdma is using share peripheral
> > script. In this case, there is two spba master port is used, if don't
> > enable the clock, the spba bus will have arbitration issue, which may
> > cause read/write wrong data from/to ESAI registers.
> > 
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
> > ---
> >  Documentation/devicetree/bindings/sound/fsl,esai.txt |  5 +++++
> 
> Acked-by: Rob Herring <robh@kernel.org>

Hi Mark, Rob

   Just a reminder. There is V4 for this patch set. I think the "Acked-by:" is
for the V4. Thanks.

best regards
wang shengjiu

> 
> >  sound/soc/fsl/fsl_esai.c                             | 13 +++++++++++++
> >  2 files changed, 18 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/sound/fsl,esai.txt b/Documentation/devicetree/bindings/sound/fsl,esai.txt
> > index d3b6b5f..cd3ee5d 100644
> > --- a/Documentation/devicetree/bindings/sound/fsl,esai.txt
> > +++ b/Documentation/devicetree/bindings/sound/fsl,esai.txt
> > @@ -27,6 +27,11 @@ Required properties:
> >  			  derive HCK, SCK and FS.
> >  	"fsys"		  The system clock derived from ahb clock used to
> >  			  derive HCK, SCK and FS.
> > +	"spba"		  The spba clock is required when ESAI is placed as a
> > +			  bus slave of the Shared Peripheral Bus and when two
> > +			  or more bus masters (CPU, DMA or DSP) try to access
> > +			  it. This property is optional depending on the SoC
> > +			  design.
> >  
> >    - fsl,fifo-depth	: The number of elements in the transmit and receive
> >  			  FIFOs. This number is the maximum allowed value for
> > diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
> > index 504e731..4d7589c 100644
> > --- a/sound/soc/fsl/fsl_esai.c
> > +++ b/sound/soc/fsl/fsl_esai.c
> > @@ -35,6 +35,7 @@
> >   * @coreclk: clock source to access register
> >   * @extalclk: esai clock source to derive HCK, SCK and FS
> >   * @fsysclk: system clock source to derive HCK, SCK and FS
> > + * @spbaclk: SPBA clock (optional, depending on SoC design)
> >   * @fifo_depth: depth of tx/rx FIFO
> >   * @slot_width: width of each DAI slot
> >   * @slots: number of slots
> > @@ -54,6 +55,7 @@ struct fsl_esai {
> >  	struct clk *coreclk;
> >  	struct clk *extalclk;
> >  	struct clk *fsysclk;
> > +	struct clk *spbaclk;
> >  	u32 fifo_depth;
> >  	u32 slot_width;
> >  	u32 slots;
> > @@ -469,6 +471,9 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream,
> >  	ret = clk_prepare_enable(esai_priv->coreclk);
> >  	if (ret)
> >  		return ret;
> > +	ret = clk_prepare_enable(esai_priv->spbaclk);
> > +	if (ret)
> > +		goto err_spbaclk;
> >  	if (!IS_ERR(esai_priv->extalclk)) {
> >  		ret = clk_prepare_enable(esai_priv->extalclk);
> >  		if (ret)
> > @@ -499,6 +504,8 @@ err_fsysclk:
> >  	if (!IS_ERR(esai_priv->extalclk))
> >  		clk_disable_unprepare(esai_priv->extalclk);
> >  err_extalck:
> > +	clk_disable_unprepare(esai_priv->spbaclk);
> > +err_spbaclk:
> >  	clk_disable_unprepare(esai_priv->coreclk);
> >  
> >  	return ret;
> > @@ -564,6 +571,7 @@ static void fsl_esai_shutdown(struct snd_pcm_substream *substream,
> >  		clk_disable_unprepare(esai_priv->fsysclk);
> >  	if (!IS_ERR(esai_priv->extalclk))
> >  		clk_disable_unprepare(esai_priv->extalclk);
> > +	clk_disable_unprepare(esai_priv->spbaclk);
> >  	clk_disable_unprepare(esai_priv->coreclk);
> >  }
> >  
> > @@ -819,6 +827,11 @@ static int fsl_esai_probe(struct platform_device *pdev)
> >  		dev_warn(&pdev->dev, "failed to get fsys clock: %ld\n",
> >  				PTR_ERR(esai_priv->fsysclk));
> >  
> > +	esai_priv->spbaclk = devm_clk_get(&pdev->dev, "spba");
> > +	if (IS_ERR(esai_priv->spbaclk))
> > +		dev_warn(&pdev->dev, "failed to get spba clock: %ld\n",
> > +				PTR_ERR(esai_priv->spbaclk));
> > +
> >  	irq = platform_get_irq(pdev, 0);
> >  	if (irq < 0) {
> >  		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
> > -- 
> > 1.9.1
> > 

WARNING: multiple messages have this Message-ID (diff)
From: Shengjiu Wang <shengjiu.wang@freescale.com>
To: Rob Herring <robh@kernel.org>, <broonie@kernel.org>
Cc: <pawel.moll@arm.com>, <mark.rutland@arm.com>,
	<ijc+devicetree@hellion.org.uk>, <galak@codeaurora.org>,
	<timur@tabi.org>, <nicoleotsuka@gmail.com>, <Xiubo.Lee@gmail.com>,
	<lgirdwood@gmail.com>, <broonie@kernel.org>, <perex@perex.cz>,
	<tiwai@suse.com>, <shawnguo@kernel.org>,
	<alsa-devel@alsa-project.org>, <linuxppc-dev@lists.ozlabs.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH V3 1/3] ASoC: fsl_esai: spba clock is needed by esai device
Date: Wed, 25 Nov 2015 10:02:32 +0800	[thread overview]
Message-ID: <20151125020229.GA26087@shlinux2> (raw)
In-Reply-To: <20151124232130.GA3400@rob-hp-laptop>

On Tue, Nov 24, 2015 at 05:21:30PM -0600, Rob Herring wrote:
> On Tue, Nov 24, 2015 at 03:03:28PM +0800, Shengjiu Wang wrote:
> > ESAI need to enable the spba clock, when sdma is using share peripheral
> > script. In this case, there is two spba master port is used, if don't
> > enable the clock, the spba bus will have arbitration issue, which may
> > cause read/write wrong data from/to ESAI registers.
> > 
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
> > ---
> >  Documentation/devicetree/bindings/sound/fsl,esai.txt |  5 +++++
> 
> Acked-by: Rob Herring <robh@kernel.org>

Hi Mark, Rob

   Just a reminder. There is V4 for this patch set. I think the "Acked-by:" is
for the V4. Thanks.

best regards
wang shengjiu

> 
> >  sound/soc/fsl/fsl_esai.c                             | 13 +++++++++++++
> >  2 files changed, 18 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/sound/fsl,esai.txt b/Documentation/devicetree/bindings/sound/fsl,esai.txt
> > index d3b6b5f..cd3ee5d 100644
> > --- a/Documentation/devicetree/bindings/sound/fsl,esai.txt
> > +++ b/Documentation/devicetree/bindings/sound/fsl,esai.txt
> > @@ -27,6 +27,11 @@ Required properties:
> >  			  derive HCK, SCK and FS.
> >  	"fsys"		  The system clock derived from ahb clock used to
> >  			  derive HCK, SCK and FS.
> > +	"spba"		  The spba clock is required when ESAI is placed as a
> > +			  bus slave of the Shared Peripheral Bus and when two
> > +			  or more bus masters (CPU, DMA or DSP) try to access
> > +			  it. This property is optional depending on the SoC
> > +			  design.
> >  
> >    - fsl,fifo-depth	: The number of elements in the transmit and receive
> >  			  FIFOs. This number is the maximum allowed value for
> > diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
> > index 504e731..4d7589c 100644
> > --- a/sound/soc/fsl/fsl_esai.c
> > +++ b/sound/soc/fsl/fsl_esai.c
> > @@ -35,6 +35,7 @@
> >   * @coreclk: clock source to access register
> >   * @extalclk: esai clock source to derive HCK, SCK and FS
> >   * @fsysclk: system clock source to derive HCK, SCK and FS
> > + * @spbaclk: SPBA clock (optional, depending on SoC design)
> >   * @fifo_depth: depth of tx/rx FIFO
> >   * @slot_width: width of each DAI slot
> >   * @slots: number of slots
> > @@ -54,6 +55,7 @@ struct fsl_esai {
> >  	struct clk *coreclk;
> >  	struct clk *extalclk;
> >  	struct clk *fsysclk;
> > +	struct clk *spbaclk;
> >  	u32 fifo_depth;
> >  	u32 slot_width;
> >  	u32 slots;
> > @@ -469,6 +471,9 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream,
> >  	ret = clk_prepare_enable(esai_priv->coreclk);
> >  	if (ret)
> >  		return ret;
> > +	ret = clk_prepare_enable(esai_priv->spbaclk);
> > +	if (ret)
> > +		goto err_spbaclk;
> >  	if (!IS_ERR(esai_priv->extalclk)) {
> >  		ret = clk_prepare_enable(esai_priv->extalclk);
> >  		if (ret)
> > @@ -499,6 +504,8 @@ err_fsysclk:
> >  	if (!IS_ERR(esai_priv->extalclk))
> >  		clk_disable_unprepare(esai_priv->extalclk);
> >  err_extalck:
> > +	clk_disable_unprepare(esai_priv->spbaclk);
> > +err_spbaclk:
> >  	clk_disable_unprepare(esai_priv->coreclk);
> >  
> >  	return ret;
> > @@ -564,6 +571,7 @@ static void fsl_esai_shutdown(struct snd_pcm_substream *substream,
> >  		clk_disable_unprepare(esai_priv->fsysclk);
> >  	if (!IS_ERR(esai_priv->extalclk))
> >  		clk_disable_unprepare(esai_priv->extalclk);
> > +	clk_disable_unprepare(esai_priv->spbaclk);
> >  	clk_disable_unprepare(esai_priv->coreclk);
> >  }
> >  
> > @@ -819,6 +827,11 @@ static int fsl_esai_probe(struct platform_device *pdev)
> >  		dev_warn(&pdev->dev, "failed to get fsys clock: %ld\n",
> >  				PTR_ERR(esai_priv->fsysclk));
> >  
> > +	esai_priv->spbaclk = devm_clk_get(&pdev->dev, "spba");
> > +	if (IS_ERR(esai_priv->spbaclk))
> > +		dev_warn(&pdev->dev, "failed to get spba clock: %ld\n",
> > +				PTR_ERR(esai_priv->spbaclk));
> > +
> >  	irq = platform_get_irq(pdev, 0);
> >  	if (irq < 0) {
> >  		dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);
> > -- 
> > 1.9.1
> > 

  reply	other threads:[~2015-11-25  2:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24  7:03 [PATCH V3 0/3] add spba clock for fsl audio IP Shengjiu Wang
2015-11-24  7:03 ` Shengjiu Wang
2015-11-24  7:03 ` [PATCH V3 1/3] ASoC: fsl_esai: spba clock is needed by esai device Shengjiu Wang
2015-11-24  7:03   ` Shengjiu Wang
     [not found]   ` <37808c01df126622c41c2d413fddf838dc2aa71d.1448348336.git.shengjiu.wang-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-11-24  8:33     ` Nicolin Chen
2015-11-24  8:33       ` Nicolin Chen
2015-11-24  9:02       ` Shengjiu Wang
2015-11-24  9:02         ` Shengjiu Wang
2015-11-24 23:21     ` Rob Herring
2015-11-24 23:21       ` Rob Herring
2015-11-25  2:02       ` Shengjiu Wang [this message]
2015-11-25  2:02         ` Shengjiu Wang
     [not found] ` <cover.1448348336.git.shengjiu.wang-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-11-24  7:03   ` [PATCH V3 2/3] ASoC: fsl_spdif: spba clk is needed by spdif device Shengjiu Wang
2015-11-24  7:03     ` Shengjiu Wang
     [not found]     ` <6f03afc87c7958b975df66b163c1186be979afb6.1448348336.git.shengjiu.wang-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-11-24 23:23       ` Rob Herring
2015-11-24 23:23         ` Rob Herring
2015-11-24  7:03 ` [PATCH V3 3/3] ASoC: fsl_asrc: spba clock is needed by asrc device Shengjiu Wang
2015-11-24  7:03   ` Shengjiu Wang
     [not found]   ` <40629d5e0c3509afe27877874d225d5cd3cde261.1448348336.git.shengjiu.wang-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-11-24 23:24     ` Rob Herring
2015-11-24 23:24       ` Rob Herring

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=20151125020229.GA26087@shlinux2 \
    --to=shengjiu.wang@freescale.com \
    --cc=Xiubo.Lee@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=nicoleotsuka@gmail.com \
    --cc=pawel.moll@arm.com \
    --cc=robh@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=timur@tabi.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.