From: John Hsu <KCHSU0@nuvoton.com>
To: Anatol Pomozov <anatol.pomozov@gmail.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
YHCHuang@nuvoton.com, Liam Girdwood <lgirdwood@gmail.com>,
Ben Zhang <benzh@chromium.org>, Mark Brown <broonie@kernel.org>,
CTLIN0@nuvoton.com, mhkuo@nuvoton.com,
Yong Zhi <yong.zhi@intel.com>
Subject: Re: [PATCH] ASoC: nau8825: support different clock source for FLL function
Date: Thu, 17 Mar 2016 11:04:20 +0800 [thread overview]
Message-ID: <56EA1EB4.9000409@nuvoton.com> (raw)
In-Reply-To: <CAOMFOmXH-0cZ-VON3Ozttpaouuu+QWMTpdmB_fbELd+BhOUEaw@mail.gmail.com>
Hi,
On 3/17/2016 7:06 AM, Anatol Pomozov wrote:
> Hi
>
> On Mon, Mar 14, 2016 at 9:08 PM, John Hsu <KCHSU0@nuvoton.com> wrote:
>
>> Extend FLL clock source selection. The source can be from MCLK, BCLK or FS.
>>
>> Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
>> ---
>> sound/soc/codecs/nau8825.c | 82 +++++++++++++++++++++++++++++++++-------------
>> sound/soc/codecs/nau8825.h | 8 +++++
>> 2 files changed, 67 insertions(+), 23 deletions(-)
>>
>> diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
>> index 1c87299..ac264ec 100644
>> --- a/sound/soc/codecs/nau8825.c
>> +++ b/sound/soc/codecs/nau8825.c
>> @@ -1053,6 +1053,37 @@ static int nau8825_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
>> return 0;
>> }
>>
>> +static int nau8825_mclk_prepare(struct nau8825 *nau8825, unsigned int freq)
>> +{
>> + int ret = 0;
>> +
>> + nau8825->mclk = devm_clk_get(nau8825->dev, "mclk");
>> + if (IS_ERR(nau8825->mclk)) {
>>
>
> Is it possible that clock system is not ready at this point and the
> method returns -EPROBE_DEFER? If so it matches IS_ERR() but not a real
> error and the nua8825 driver should backoff and wait a little before
> clocks are ready.
>
>
The function is used when playback startup not in the driver initiation.
At this moment, we just skip mclk operation and let thing go on.
Should driver return the errorno to machine driver to handle it?
>> + dev_info(nau8825->dev, "No 'mclk' clock found, assume MCLK is managed externally");
>> + return 0;
>> + }
>> +
>> + if (!nau8825->mclk_freq) {
>> + ret = clk_prepare_enable(nau8825->mclk);
>> + if (ret) {
>> + dev_err(nau8825->dev, "Unable to prepare codec mclk\n");
>> + return ret;
>> + }
>> + }
>> +
>>
> .
>
>
next prev parent reply other threads:[~2016-03-17 3:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-15 4:08 [PATCH] ASoC: nau8825: support different clock source for FLL function John Hsu
2016-03-15 9:29 ` Applied "ASoC: nau8825: support different clock source for FLL function" to the asoc tree Mark Brown
2016-03-16 23:06 ` [PATCH] ASoC: nau8825: support different clock source for FLL function Anatol Pomozov
2016-03-17 3:04 ` John Hsu [this message]
2016-03-17 9:18 ` Mark Brown
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=56EA1EB4.9000409@nuvoton.com \
--to=kchsu0@nuvoton.com \
--cc=CTLIN0@nuvoton.com \
--cc=YHCHuang@nuvoton.com \
--cc=alsa-devel@alsa-project.org \
--cc=anatol.pomozov@gmail.com \
--cc=benzh@chromium.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=mhkuo@nuvoton.com \
--cc=yong.zhi@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).