From: Lars-Peter Clausen <lars@metafoo.de>
To: Mike Looijmans <mike.looijmans@topic.nl>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] sound/soc/adi/axi-spdif.c: Support programmable master clock
Date: Thu, 18 Dec 2014 16:07:53 +0100 [thread overview]
Message-ID: <5492EDC9.5000401@metafoo.de> (raw)
In-Reply-To: <1418283847-25673-1-git-send-email-mike.looijmans@topic.nl>
On 12/11/2014 08:44 AM, Mike Looijmans wrote:
> If the master clock supports programmable rates, program it to generate
> the desired frequency. Only apply constraints when the clock is fixed.
> This allows proper clock generation for both 44100 and 48000 Hz based
> sampling rates if the platform supports it.
>
> The clock frequency must be set before enabling it. Enabling the clock
> was done in "startup", but that occurs before "hw_params" where the rate
> is known. Enabling a programmable clock without first setting a valid
> frequency may harm the system. Move the clock start to the hw_params
> routine, and keep track of whether the clock has been started, because
> shutdown may be called without having called hw_params first, and
> hw_params may be called multiple times.
> Starting the clock and enabling the SPDIF output AFTER programming the
> dividers is a more logical order anyway.
>
> To detect if the source clock is fixed, the driver calls clk_round_rate
> for two frequencies. If the results are equal, or if the call returns
> an error, the driver assumes the clock is fixed.
>
> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Thanks.
prev parent reply other threads:[~2014-12-18 15:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-04 6:52 [PATCH] sound/soc/adi/axi-spdif.c: Support programmable master clock Mike Looijmans
2014-12-04 12:45 ` Lars-Peter Clausen
2014-12-04 14:18 ` Mike Looijmans
2014-12-04 16:54 ` Lars-Peter Clausen
2014-12-05 12:37 ` [PATCH v2] " Mike Looijmans
2014-12-10 9:34 ` Lars-Peter Clausen
2014-12-11 6:44 ` Mike Looijmans
2014-12-11 7:44 ` [PATCH v3] " Mike Looijmans
2014-12-18 15:07 ` Lars-Peter Clausen [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=5492EDC9.5000401@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.looijmans@topic.nl \
/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