All of lore.kernel.org
 help / color / mirror / Atom feed
From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 09/10] S3C64XX I2S: Set parent links for clock audio-bus.
Date: Wed, 16 Sep 2009 01:17:09 +0100	[thread overview]
Message-ID: <20090916001709.GE24720@trinity.fluff.org> (raw)
In-Reply-To: <1253008961-10698-1-git-send-email-jassi.brar@samsung.com>

On Tue, Sep 15, 2009 at 07:02:41PM +0900, Jassi wrote:
> Explicitly route audio-bus from FOUTepll via MOUTepll.
> 
> Signed-Off-by: Jassi <jassi.brar@samsung.com>
> ---
>  sound/soc/s3c24xx/s3c64xx-i2s.c |   22 ++++++++++++++++++++++
>  1 files changed, 22 insertions(+), 0 deletions(-)
> 
> diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c
> index 66f4ded..71aeb33 100644
> --- a/sound/soc/s3c24xx/s3c64xx-i2s.c
> +++ b/sound/soc/s3c24xx/s3c64xx-i2s.c
> @@ -254,6 +254,7 @@ static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev)
>  {
>  	struct s3c_i2sv2_info *i2s;
>  	struct snd_soc_dai *dai;
> +	struct clk *cm, *cf;
>  	int ret;
>  
>  	if (pdev->id >= ARRAY_SIZE(s3c64xx_i2s)) {
> @@ -275,6 +276,21 @@ static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev)
>  		goto err;
>  	}
>  
> +	cm = clk_get(NULL, "mout_epll");
> +	if (IS_ERR(cm)) {
> +		dev_err(&pdev->dev, "failed to get mout_epll\n");
> +		ret = PTR_ERR(cm);
> +		goto mout_err;
> +	}
> +	clk_set_parent(i2s->iis_cclk, cm);
> +	cf = clk_get(NULL, "fout_epll");
> +	if (IS_ERR(cf)) {
> +		dev_err(&pdev->dev, "failed to get fout_epll\n");
> +		ret = PTR_ERR(cf);
> +		goto fout_err;
> +	}
> +	clk_set_parent(cm, cf);
> +
>  	ret = s3c_i2sv2_probe(pdev, dai, i2s, 0);
>  	if (ret)
>  		goto err_clk;
> @@ -283,11 +299,17 @@ static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev)
>  	if (ret != 0)
>  		goto err_i2sv2;
>  
> +	clk_put(cf);
> +	clk_put(cm);
>  	return 0;
>  
>  err_i2sv2:
>  	/* Not implemented for I2Sv2 core yet */
>  err_clk:
> +	clk_put(cf);
> +fout_err:
> +	clk_put(cm);
> +mout_err:
>  	clk_put(i2s->iis_cclk);
>  err:
>  	return ret;

This is the wrong place to be changing the clocks, it is making a policy
for _all_ boards that may use this code. It either belongs in the board
setup code, possibly in the board specific ASoC glue driver (maybe with
a common library if enough do it).

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

      parent reply	other threads:[~2009-09-16  0:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-15 10:02 [PATCH 09/10] S3C64XX I2S: Set parent links for clock audio-bus Jassi
2009-09-15 11:12 ` Mark Brown
2009-09-15 11:42   ` jassi brar
2009-09-15 12:15     ` Mark Brown
2009-09-15 12:57       ` jassi brar
2009-09-15 13:33         ` Mark Brown
2009-09-16  0:17 ` Ben Dooks [this message]

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=20090916001709.GE24720@trinity.fluff.org \
    --to=ben-linux@fluff.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.