From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: alsa-devel@alsa-project.org,
Kuninori Morimoto <morimoto.kuninori@renesas.com>,
Magnus Damm <damm@opensource.se>,
Liam Girdwood <lrg@slimlogic.co.uk>,
linux-sh@vger.kernel.org
Subject: Re: [PATCH 1/4 v4] ASoC: add a WM8978 codec driver
Date: Wed, 27 Jan 2010 20:17:55 +0000 [thread overview]
Message-ID: <20100127201755.GA11601@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <Pine.LNX.4.64.1001271846020.5073@axis700.grange>
On Wed, Jan 27, 2010 at 06:56:23PM +0100, Guennadi Liakhovetski wrote:
> The WM8978 codec from Wolfson Microelectronics is very similar to wm8974,
> but
> is stereo and also has some differences in pin configuration and internal
> signal routing. This driver is based on wm8974 and takes the differences
> into
> account.
I suspect something funny with word wrapping :)
There's a few more fairly small issues below but I'll apply the patch
as-is, please send incremental patches to fix these things.
> + if (f_opclk) {
...
> + if (16 * f_opclk < 3 * f_mclk || 4 * f_opclk >= 13 * f_mclk)
> + return -EINVAL;
> +
> + if (4 * f_opclk < 3 * f_mclk)
> + /* Have to use OPCLKDIV */
> + opclk_div = (3 * f_mclk / 4 + f_opclk - 1) / f_opclk;
> + else
> + opclk_div = 1;
I'm fairly sure this and the similar logic for SYSCLK can be squashed
together with some suitable local variables. Might be more legible
since this requires some staring at. I didn't actually go so far as to
work out what the relevant code is, though.
> + case WM8978_MCLKDIV:
> + if (div & ~0xe0)
> + return -EINVAL;
> + snd_soc_update_bits(codec, WM8978_CLOCKING, 0xe0, div);
> + break;
This is now configured automatically isn't it?
> + case WM8978_ADCCLK:
> + if (div & ~8)
> + return -EINVAL;
> + snd_soc_update_bits(codec, WM8978_ADC_CONTROL, 8, div);
> + break;
> + case WM8978_DACCLK:
> + if (div & ~8)
> + return -EINVAL;
> + snd_soc_update_bits(codec, WM8978_DAC_CONTROL, 8, div);
> + break;
These should be user visible controls to select the DAC and ADC
oversampling rates.
[suspend..]
> + /* Put to sleep */
> + snd_soc_write(codec, WM8978_POWER_MANAGEMENT_2, 0x40);
This control isn't going to do much over suspend since it's likely the
device will completely loose power and you've already turned off all the
biases anyway. However, it would be useful to turn it on when the
device is in BIAS_STANDBY since it should produce a small power saving
then.
next prev parent reply other threads:[~2010-01-27 20:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 17:56 [PATCH 1/4 v4] ASoC: add a WM8978 codec driver Guennadi Liakhovetski
2010-01-27 20:17 ` Mark Brown [this message]
2010-01-28 8:24 ` Guennadi Liakhovetski
2010-01-28 19:01 ` Dan Williams
2010-01-29 13:57 ` Guennadi Liakhovetski
2010-02-01 14:31 ` Mark Brown
2010-02-01 20:01 ` Guennadi Liakhovetski
2010-02-03 10:34 ` 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=20100127201755.GA11601@rakim.wolfsonmicro.main \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=damm@opensource.se \
--cc=g.liakhovetski@gmx.de \
--cc=linux-sh@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=morimoto.kuninori@renesas.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).