From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Petr Kulhavy <petr@barix.com>
Cc: alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com,
lgirdwood@gmail.com, patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH] ASoC: wm8985: rework and fix the clock calculation
Date: Thu, 12 May 2016 16:15:29 +0100 [thread overview]
Message-ID: <20160512151529.GL1646@localhost.localdomain> (raw)
In-Reply-To: <1463035734-24477-1-git-send-email-petr@barix.com>
On Thu, May 12, 2016 at 08:48:54AM +0200, Petr Kulhavy wrote:
> The clock calculation has several issues:
> 1) if PLL is used in master mode the BCLK output runs at double the speed
> 2) de-facto only 44.1kHz and 48kHz sampling rates are supported, other
> rates like 8kHz, 12kHz, 24kHz fail to find the proper BCLK divider
> 3) the wm8985->sysclk variable has a misleading name and is used wrongly
> in the clock calculation in wm8985_hw_params() which is the root cause
> for (1)
> 4) wm8985->bclk is used only in wm8985_hw_params() and therefore no
> need to store it in the wm8985_priv structure
>
> Therefore the clock calculation is rewritten in more clean and proper way:
> - move wm8985_priv->bclk as a local variable into mw8985_hw_params()
> - new variable wm8985_priv->pllout holds the actual frequency that is input
> to the MCLKDIV post-divider
> - move wm8985_priv->sysclk as a local variable into mw8985_hw_params()
> - sysclk is now always calculated as 256 * fs
> - the MCLKDIV is looked up as pllout/sysclk
> - fs_ratios[] is replaced by simpler mclk_divs[] lookup table
>
> With this patch all rates: 8, 11.025, 12, 16, 22.05, 24, 32, 44.1 and 48kHz
> work properly and generate the correct BCLK.
>
> Signed-off-by: Petr Kulhavy <petr@barix.com>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
prev parent reply other threads:[~2016-05-12 15:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 6:48 [PATCH] ASoC: wm8985: rework and fix the clock calculation Petr Kulhavy
2016-05-12 12:15 ` Charles Keepax
2016-05-12 13:06 ` Petr Kulhavy
2016-05-12 15:10 ` Charles Keepax
2016-05-12 15:15 ` Charles Keepax [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=20160512151529.GL1646@localhost.localdomain \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lgirdwood@gmail.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=petr@barix.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.