All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <b42378@freescale.com>
To: Mark Brown <broonie@kernel.org>
Cc: grant.likely@linaro.org, alsa-devel@alsa-project.org,
	devicetree-discuss@lists.ozlabs.org, rob.herring@calxeda.com,
	lgirdwood@gmail.com
Subject: Re: [PATCH V2] ASoC: fsl: add imx-wm8962 machine driver
Date: Thu, 6 Jun 2013 20:49:53 +0800	[thread overview]
Message-ID: <20130606124952.GA19153@MrMyself> (raw)
In-Reply-To: <20130605115544.GX31367@sirena.org.uk>

On Wed, Jun 05, 2013 at 12:55:44PM +0100, Mark Brown wrote:
> > +		/* assuming clock enabled by default */
> > +		data->codec_clk = NULL;
> > +		ret = of_property_read_u32(codec_np, "clock-frequency",
> > +					&data->clk_frequency);
> > +		if (ret) {
> > +			dev_err(&codec_dev->dev,
> > +				"clock-frequency missing or invalid\n");
> > +			goto fail;
> > +		}
> 
> Since it's easy to define a fixed rate clock (there's a generic driver
> for that) I'd just require the user to provide a clock API clock and fix
> the rate using that.  This is going to be less error prone and makes the
> code simpler.

I tried to use fixed rate clock as below:

	data->codec_clk = devm_clk_get(&codec_dev->dev, NULL);
	if (IS_ERR(data->codec_clk)) {
		of_fixed_clk_setup(codec_np);
		data->codec_clk = clk_get(NULL, codec_np->name);
		if (IS_ERR(data->codec_clk)) {
			dev_err(&pdev->dev, "failed to create fixed clk\n");
			ret = IS_ERR(data->codec_clk);
			goto fail;
		}
	}

	data->clk_frequency = clk_get_rate(data->codec_clk);
	clk_prepare_enable(data->codec_clk);

But I always got "failed to create fixed clk" error during system booting.
So I think it's pretty different to get a fixed clock with normal since
it's on the root_list of clock tree.
How can I get the clock here, or more specifically, any way to get the 
rate of the fixed-rate-clk?

Thanks.

  parent reply	other threads:[~2013-06-06 13:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05  8:21 [PATCH V2] ASoC: fsl: add imx-wm8962 machine driver Nicolin Chen
     [not found] ` <1370420501-8410-1-git-send-email-b42378-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-06-05 11:55   ` Mark Brown
2013-06-06  4:39     ` Nicolin Chen
2013-06-06  8:56       ` Mark Brown
2013-06-06 12:49     ` Nicolin Chen [this message]
2013-06-06 13:33       ` Mark Brown
2013-06-06 14:02       ` [alsa-devel] " Fabio Estevam
     [not found]         ` <CAOMZO5B=OrXUMcD9wYHn=T171usvG_P5dpQ-7iM77-RnS8iSGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-06 14:13           ` Mark Brown
2013-06-07  2:06         ` 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=20130606124952.GA19153@MrMyself \
    --to=b42378@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=rob.herring@calxeda.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.