From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
To: Chih-Chiang Chang <ccchang12@nuvoton.com>
Cc: Mark Brown <broonie@kernel.org>, "tiwai@suse.de" <tiwai@suse.de>,
AP MS30 Linux ALSA <alsa-devel@alsa-project.org>,
Lars-Peter Clausen <lars@metafoo.de>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
AP MS30 Linux Kernel community <linux-kernel@vger.kernel.org>
Subject: Re: [alsa-devel] [PATCH v3] ASoC: Add support for NAU8825 codec to ASoC
Date: Mon, 13 Jul 2015 10:23:10 +0100 [thread overview]
Message-ID: <1436779390.2533.20.camel@loki> (raw)
In-Reply-To: <55A369B2.5040500@nuvoton.com>
On Mon, 2015-07-13 at 15:33 +0800, Chih-Chiang Chang wrote:
> +static void set_sys_clk(struct snd_soc_codec *codec, int sys_clk)
> +{
> + struct nau8825_priv *nau8825 = snd_soc_codec_get_drvdata(codec);
> +
> + pr_debug("%s :: sys_clk=%x\n", __func__, sys_clk);
> + switch (sys_clk) {
> + case NAU8825_INTERNALCLOCK:
> + regmap_update_bits(nau8825->regmap, NAU8825_CLK_DIVIDER,
> + NAU8825_SYSCLK_EN_MASK, NAU8825_SYSCLK_DIS);
> + regmap_update_bits(nau8825->regmap, NAU8825_FLL_6,
> + NAU8825_DCO_EN_MASK, NAU8825_DCO_EN);
> + regmap_update_bits(nau8825->regmap, NAU8825_CLK_DIVIDER,
> + NAU8825_SYSCLK_EN_MASK, NAU8825_SYSCLK_EN);
> + break;
> + case NAU8825_MCLK:
> + default:
> + regmap_update_bits(nau8825->regmap, NAU8825_FLL_6,
> + NAU8825_DCO_EN_MASK, NAU8825_DCO_DIS);
> + regmap_update_bits(nau8825->regmap, NAU8825_I2S_PCM_CTRL_2,
> + NAU8825_I2S_MS_MASK, NAU8825_I2S_MS_SLAVE);
> + /* FLL clock source from MCLK */
> + regmap_update_bits(nau8825->regmap, NAU8825_CLK_DIVIDER,
> + NAU8825_SYSCLK_EN_MASK, NAU8825_SYSCLK_DIS);
> + mdelay(2);
Probably best to sleep here rather than block, especially if this code
will be used in init/PM sequences.
Btw, is there anyway to check whether the FLL actually achieves lock
after the 2ms ?
> + regmap_update_bits(nau8825->regmap, NAU8825_CLK_DIVIDER,
> + NAU8825_SYSCLK_EN_MASK, NAU8825_SYSCLK_EN);
> + break;
> + }
> +}
> +
Thanks
Liam
next prev parent reply other threads:[~2015-07-13 9:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 7:33 [PATCH v3] ASoC: Add support for NAU8825 codec to ASoC Chih-Chiang Chang
2015-07-13 9:23 ` Liam Girdwood [this message]
2015-07-13 11:15 ` Mark Brown
2015-07-22 17:57 ` [alsa-devel] " Anatol Pomozov
2015-07-27 6:25 ` Chih-Chiang Chang
2015-07-27 23:10 ` Anatol Pomozov
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=1436779390.2533.20.camel@loki \
--to=liam.r.girdwood@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ccchang12@nuvoton.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox