Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vasily Khoruzhick <anarsoul@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	alsa-devel <alsa-devel@alsa-project.org>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Philipp Zabel <philipp.zabel@gmail.com>,
	anarsoul@gmail.com
Subject: [PATCH 4/4] ASoC: rx1950: Fix clkdiv for 16khz and 48khz
Date: Tue,  7 Sep 2010 17:04:18 +0300	[thread overview]
Message-ID: <1283868258-26493-5-git-send-email-anarsoul@gmail.com> (raw)
In-Reply-To: <1283868258-26493-1-git-send-email-anarsoul@gmail.com>

Usage of 256 as clkdiv gives better rounding error (<1%)
for 16khz and 48khz

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 sound/soc/s3c24xx/rx1950_uda1380.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/s3c24xx/rx1950_uda1380.c b/sound/soc/s3c24xx/rx1950_uda1380.c
index 9552296..ffd5cf2 100644
--- a/sound/soc/s3c24xx/rx1950_uda1380.c
+++ b/sound/soc/s3c24xx/rx1950_uda1380.c
@@ -171,9 +171,9 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream,
 	case 16000:
 	case 48000:
 		clk_source = S3C24XX_CLKSRC_PCLK;
-		fs_mode = S3C2410_IISMOD_384FS;
-		div = s3c24xx_i2s_get_clockrate() / (384 * rate);
-		if (s3c24xx_i2s_get_clockrate() % (384 * rate) > (182 * rate))
+		fs_mode = S3C2410_IISMOD_256FS;
+		div = s3c24xx_i2s_get_clockrate() / (256 * rate);
+		if (s3c24xx_i2s_get_clockrate() % (256 * rate) > (128 * rate))
 			div++;
 		break;
 	case 44100:
-- 
1.7.2.2

  parent reply	other threads:[~2010-09-07 14:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 14:04 [PATCH 0/4] ASoC: rx1950-related fixes Vasily Khoruzhick
2010-09-07 14:04 ` [PATCH 1/4] ASoC: rx1950: check that machine is rx1950 in glue driver Vasily Khoruzhick
2010-09-07 14:04 ` [PATCH 2/4] ASoC: rx1950: remove unnecessary headers Vasily Khoruzhick
2010-09-07 14:04 ` [PATCH 3/4] ASoC: UDA1380: Add delay between power on and reset Vasily Khoruzhick
2010-09-07 14:04 ` Vasily Khoruzhick [this message]
2010-09-08 10:35 ` [PATCH 0/4] ASoC: rx1950-related fixes Mark Brown
2010-09-08 10:41   ` Vasily Khoruzhick

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=1283868258-26493-5-git-send-email-anarsoul@gmail.com \
    --to=anarsoul@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=philipp.zabel@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