alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pascal Huerst <pascal.huerst@gmail.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com
Subject: Re: [PATCH] ASoC: adau1701: Reset codec based on sample rate changes
Date: Thu, 24 Mar 2016 17:48:26 +0100	[thread overview]
Message-ID: <56F41A5A.6030605@gmail.com> (raw)
In-Reply-To: <56F29DCB.2090208@metafoo.de>



On 23.03.2016 14:44, Lars-Peter Clausen wrote:
> On 03/23/2016 12:58 PM, pascal.huerst@gmail.com wrote:
>> From: Pascal Huerst <pascal.huerst@gmail.com>
>>
>> Instead of checking if mclk/lrclk ratio has changed, check if
>> sample rate has changed. In certain cases, the mclk might be
>> changed in the machine driver, which can lead to the same
>> mclk/lrclk ration, eventhow the sample rate has changed.
>>
>> Since the codec has to be programmed differently for every
>> sample rate, its better to check for samplerate changes instead
>> of mclk/lrclk ration changes.
> 
> Mark's comment made me give this some additional though. Do we actually
> need to reset the device if the clkdiv did not change. Stopping the DSP,
> uploading the new firmware and then restarting it should be sufficient.
> But on the other hand the time the reset takes should be negligible
> compared to programming the firmware, so it might be ok to always do it.
> Let me know what you think.

Ok, I see your point. So I did some measurements.

On our devices,

a firmware download takes about: 844ms
Resetting the pll settings takes about: 87ms

I'm not sure, if this worth the effort, but certainly it could be done.
I would probably leave it for now, be a bit more precise in the comment
above and add a note to the commit message, as Mark suggested (?)

While at it I also saw, that we should keep the reset line low, while
changing the pll settings. (Which we don't right now)

The datasheet states:

... "The state of the PLL_MODEx pins should be changed while RESET is
held low." ...

      reply	other threads:[~2016-03-24 16:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 11:58 [PATCH] ASoC: adau1701: Reset codec based on sample rate changes pascal.huerst
2016-03-23 12:48 ` Mark Brown
2016-03-23 13:37   ` Lars-Peter Clausen
2016-03-23 13:42     ` Mark Brown
2016-03-23 13:44 ` Lars-Peter Clausen
2016-03-24 16:48   ` Pascal Huerst [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=56F41A5A.6030605@gmail.com \
    --to=pascal.huerst@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.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).