Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-11 Thread Shengjiu Wang
On Thu, Sep 11, 2014 at 08:36:51AM +0200, Markus Pargmann wrote: > On Wed, Sep 10, 2014 at 10:42:04AM -0700, Nicolin Chen wrote: > > On Wed, Sep 10, 2014 at 04:12:53PM +0800, Shengjiu Wang wrote: > > > > Then we can get a patch like: > > > > open() { > > > > + clk_prepare_enable(); > > > >

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-10 Thread Markus Pargmann
On Wed, Sep 10, 2014 at 10:42:04AM -0700, Nicolin Chen wrote: > On Wed, Sep 10, 2014 at 04:12:53PM +0800, Shengjiu Wang wrote: > > > Then we can get a patch like: > > > open() { > > > + clk_prepare_enable(); > > > > > > } > > > > > > close() { > > > > > > + clk_disable_unprepare() >

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-10 Thread Nicolin Chen
On Wed, Sep 10, 2014 at 04:12:53PM +0800, Shengjiu Wang wrote: > > Then we can get a patch like: > > open() { > > + clk_prepare_enable(); > > > > } > > > > close() { > > > > + clk_disable_unprepare() > > } > what is the open() and close()? do you mean the fsl_ssi_startup() >

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-10 Thread Markus Pargmann
Hi, On Wed, Sep 10, 2014 at 06:30:06PM +0800, Shengjiu Wang wrote: > On Wed, Sep 10, 2014 at 08:21:18AM +0200, Markus Pargmann wrote: > > On Tue, Sep 09, 2014 at 11:38:05AM -0700, Nicolin Chen wrote: > > > On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > > > > @@ -1321,7 +1333,11 @

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-10 Thread Shengjiu Wang
On Wed, Sep 10, 2014 at 08:21:18AM +0200, Markus Pargmann wrote: > On Tue, Sep 09, 2014 at 11:38:05AM -0700, Nicolin Chen wrote: > > On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > > > @@ -1321,7 +1333,11 @@ static int fsl_ssi_probe(struct platform_device > > > *pdev) > > >

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-10 Thread Shengjiu Wang
On Tue, Sep 09, 2014 at 12:59:29PM -0700, Nicolin Chen wrote: > On Tue, Sep 09, 2014 at 02:37:42PM -0500, Timur Tabi wrote: > > On 09/09/2014 01:38 PM, Nicolin Chen wrote: > > >make sure to have the call for imx only because it seems that > > >the other platforms do not depend on the clock. > > >

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-10 Thread Shengjiu Wang
On Tue, Sep 09, 2014 at 11:38:05AM -0700, Nicolin Chen wrote: > On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > > @@ -1321,7 +1333,11 @@ static int fsl_ssi_probe(struct platform_device > > *pdev) > > return -ENOMEM; > > } > > > > - ssi_private->regs = devm_regm

Re: [alsa-devel] [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Nicolin Chen
On Wed, Sep 10, 2014 at 08:21:18AM +0200, Markus Pargmann wrote: > On Tue, Sep 09, 2014 at 11:38:05AM -0700, Nicolin Chen wrote: > > On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > > > @@ -1321,7 +1333,11 @@ static int fsl_ssi_probe(struct platform_device > > > *pdev) > > >

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Markus Pargmann
On Tue, Sep 09, 2014 at 11:38:05AM -0700, Nicolin Chen wrote: > On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > > @@ -1321,7 +1333,11 @@ static int fsl_ssi_probe(struct platform_device > > *pdev) > > return -ENOMEM; > > } > > > > - ssi_private->regs = devm_regm

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Nicolin Chen
On Tue, Sep 09, 2014 at 03:37:26PM -0500, Timur Tabi wrote: > >However, my approach doesn't need any check. The open() or pm_resume() > >can just call clk_prepare_enable() directly. The __clk_enable() will > >then handle the 'clk == NULL' case: > > Yes, I was thinking the same thing. Because that

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Timur Tabi
On 09/09/2014 03:27 PM, Nicolin Chen wrote: I guess Mark's comment is merely against the check for clk validation because if talking about clk validation, we should check IS_ERR(clk) rather than check !=NULL directly. Ah, that makes sense now. However, my approach doesn't need any check. The

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Nicolin Chen
On Tue, Sep 09, 2014 at 03:03:53PM -0500, Timur Tabi wrote: > On 09/09/2014 02:59 PM, Nicolin Chen wrote: > >+/* > >+ * Initially mark the clock to NULL for all platforms so that later > >+ * clk_prepare_enable() will ignore and return 0 for non-clock cases. > >+ */ > >+ssi_priv

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Timur Tabi
On 09/09/2014 02:59 PM, Nicolin Chen wrote: + /* +* Initially mark the clock to NULL for all platforms so that later +* clk_prepare_enable() will ignore and return 0 for non-clock cases. +*/ + ssi_private->clk = NULL; According to Mark, NULL is a valid clock,

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Nicolin Chen
On Tue, Sep 09, 2014 at 02:37:42PM -0500, Timur Tabi wrote: > On 09/09/2014 01:38 PM, Nicolin Chen wrote: > >make sure to have the call for imx only because it seems that > >the other platforms do not depend on the clock. > > Although I doubt anyone will every add support for clocks to PowerPC "si

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Timur Tabi
On 09/09/2014 01:38 PM, Nicolin Chen wrote: make sure to have the call for imx only because it seems that the other platforms do not depend on the clock. Although I doubt anyone will every add support for clocks to PowerPC "side" of this driver, I would prefer to avoid IMX-specific changes. I

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Nicolin Chen
On Tue, Sep 09, 2014 at 07:15:16PM +0100, Mark Brown wrote: > On Tue, Sep 09, 2014 at 11:03:10AM -0700, Nicolin Chen wrote: > > On Tue, Sep 09, 2014 at 12:27:50PM +0100, Mark Brown wrote: > > > On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > > > > - ssi_private->clk = devm_cl

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Nicolin Chen
On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > @@ -1321,7 +1333,11 @@ static int fsl_ssi_probe(struct platform_device *pdev) > return -ENOMEM; > } > > - ssi_private->regs = devm_regmap_init_mmio(&pdev->dev, iomem, > + if (ssi_private->soc->imx) > +

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Mark Brown
On Tue, Sep 09, 2014 at 11:03:10AM -0700, Nicolin Chen wrote: > On Tue, Sep 09, 2014 at 12:27:50PM +0100, Mark Brown wrote: > > On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > > > - ssi_private->clk = devm_clk_get(&pdev->dev, NULL); > > > + ssi_private->clk = devm_clk_get(&pdev->de

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Nicolin Chen
On Tue, Sep 09, 2014 at 12:27:50PM +0100, Mark Brown wrote: > On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > > - ssi_private->clk = devm_clk_get(&pdev->dev, NULL); > > + ssi_private->clk = devm_clk_get(&pdev->dev, "ipg"); > > if (IS_ERR(ssi_private->clk)) { > >

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Timur Tabi
On 09/09/2014 10:21 AM, Mark Brown wrote: if (ssi_private->clk) >clk_prepare_enable(ssi_private->clk); Should be a !IS_ERR() - NULL is a valid clock. In that case, ssi_private->clk needs to be initialized to -EINVAL or something, so that the check works on systems that don't have any cl

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Mark Brown
On Tue, Sep 09, 2014 at 08:17:51AM -0500, Timur Tabi wrote: > Shengjiu Wang wrote: > >+if (ssi_private->soc->imx) > >+clk_prepare_enable(ssi_private->clk); > How about this instead? > if (ssi_private->clk) > clk_prepare_enable(ssi_private->clk); Should be a !IS_ERR() - NULL

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Timur Tabi
Shengjiu Wang wrote: + if (ssi_private->soc->imx) + clk_prepare_enable(ssi_private->clk); How about this instead? if (ssi_private->clk) clk_prepare_enable(ssi_private->clk); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Mark Brown
On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > + if (ssi_private->soc->imx) > + clk_prepare_enable(ssi_private->clk); > + We're ignoring the error code here. > - ssi_private->clk = devm_clk_get(&pdev->dev, NULL); > + ssi_private->clk = devm_clk_get(&pdev

RE: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread li.xi...@freescale.com
Hi, > Subject: [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module > > Move the ipg clock enable and disable operation to startup and shutdown, > that is only enable ipg clock when ssi is working. we don't need to enable > ipg clock in probe. > Another register

Re: [alsa-devel] [PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Markus Pargmann
Hi, On Tue, Sep 09, 2014 at 05:18:07PM +0800, Shengjiu Wang wrote: > Move the ipg clock enable and disable operation to startup and shutdown, > that is only enable ipg clock when ssi is working. we don't need to enable > ipg clock in probe. > Another register accessing need the ipg clock, so use

[PATCH V1] ASoC: fsl_ssi: refine ipg clock usage in this module

2014-09-09 Thread Shengjiu Wang
Move the ipg clock enable and disable operation to startup and shutdown, that is only enable ipg clock when ssi is working. we don't need to enable ipg clock in probe. Another register accessing need the ipg clock, so use devm_regmap_init_mmio_clk instead of devm_regmap_init_mmio. Signed-off-by: S