From: Mark Brown <broonie@sirena.org.uk>
To: Troy Kisky <troy.kisky@boundarydevices.com>
Cc: alsa-devel@alsa-project.org, arunks@mistralsolutions.com
Subject: Re: [PATCH 1/1] [ALSA]TLV320AIC23B: Support more sample rates
Date: Fri, 31 Oct 2008 22:11:56 +0000 [thread overview]
Message-ID: <20081031221155.GA6786@sirena.org.uk> (raw)
In-Reply-To: <1225488034-28557-1-git-send-email-troy.kisky@boundarydevices.com>
On Fri, Oct 31, 2008 at 02:20:34PM -0700, Troy Kisky wrote:
> Add support for more sample rates, different crystals
> and split playback/capture rates.
>
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> Acked-by: Arun KS <arunks@mistralsolutions.com>
This looks good, thanks - it's great to see more drivers moving away
from fixed tables for clock sources.
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
but a few minor coding standard things:
> + for (i = 0; i < 4; i++) {
> + int base = mclk / bosr_usb_divisor_table[i];
> + int mask = sr_valid_mask[i];
...
> + for (j = 0; j < 16; j++, mask >>= 1) {
...
> + adc = base * sr_adc_mult_table[j];
> + dac = base * sr_dac_mult_table[j];
It'd be better if these loops used ARRAY_SIZE() for the limits rather
than having magic numbers.
> +static int set_sample_rate_control(struct snd_soc_codec *codec, int mclk,
> + u32 sample_rate_adc, u32 sample_rate_dac)
> +{
> + /* Search for the right sample rate */
> + int data = find_rate(mclk, sample_rate_adc, sample_rate_dac);
> + if (data < 0) {
> + printk(KERN_ERR "%s:Invalid rate %u,%u requested\n",
> + __func__, sample_rate_adc, sample_rate_dac);
> + return -EINVAL;
> + }
> + tlv320aic23_write(codec, TLV320AIC23_SRATE, data);
> + if (1) {
> + int adc, dac;
> + get_current_sample_rates(codec, mclk, &adc, &dac);
> + printk(KERN_DEBUG "actual samplerate = %u,%u reg=%x\n",
> + adc, dac, data);
> + }
There's no need for the if () statement here - you can just open a new
block. I guess this is supposed to be for debug purposes only? If so
then it'd be better to surround it in #ifdef DEBUG.
next prev parent reply other threads:[~2008-10-31 22:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-31 21:20 [PATCH 1/1] [ALSA]TLV320AIC23B: Support more sample rates Troy Kisky
2008-10-31 22:11 ` Mark Brown [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-10-31 23:01 Troy Kisky
2008-11-02 11:07 ` 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=20081031221155.GA6786@sirena.org.uk \
--to=broonie@sirena.org.uk \
--cc=alsa-devel@alsa-project.org \
--cc=arunks@mistralsolutions.com \
--cc=troy.kisky@boundarydevices.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