All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: RX1950: Fix hw_params function
@ 2010-11-13 12:53 Vasily Khoruzhick
  2010-11-15 11:07 ` Liam Girdwood
  2010-11-15 12:27 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Vasily Khoruzhick @ 2010-11-13 12:53 UTC (permalink / raw)
  To: Mark Brown, alsa-devel, Liam Girdwood; +Cc: Vasily Khoruzhick

Unfortunatelly, I misunderstood datasheet, and on s3c244x-iis
when MPLLin source for master clock is selected, prescaler has
no effect. Remove dividor calculation for 44100 rate; remove 88200
rate at all, rx1950 can't do it.

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

diff --git a/sound/soc/s3c24xx/rx1950_uda1380.c b/sound/soc/s3c24xx/rx1950_uda1380.c
index ffd5cf2..468cc11 100644
--- a/sound/soc/s3c24xx/rx1950_uda1380.c
+++ b/sound/soc/s3c24xx/rx1950_uda1380.c
@@ -50,7 +50,6 @@ static unsigned int rates[] = {
 	16000,
 	44100,
 	48000,
-	88200,
 };
 
 static struct snd_pcm_hw_constraint_list hw_rates = {
@@ -130,7 +129,6 @@ static const struct snd_soc_dapm_route audio_map[] = {
 };
 
 static struct platform_device *s3c24xx_snd_device;
-static struct clk *xtal;
 
 static int rx1950_startup(struct snd_pcm_substream *substream)
 {
@@ -179,10 +177,8 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream,
 	case 44100:
 	case 88200:
 		clk_source = S3C24XX_CLKSRC_MPLL;
-		fs_mode = S3C2410_IISMOD_256FS;
-		div = clk_get_rate(xtal) / (256 * rate);
-		if (clk_get_rate(xtal) % (256 * rate) > (128 * rate))
-			div++;
+		fs_mode = S3C2410_IISMOD_384FS;
+		div = 1;
 		break;
 	default:
 		printk(KERN_ERR "%s: rate %d is not supported\n",
@@ -210,7 +206,7 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream,
 
 	/* set MCLK division for sample rate */
 	ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_MCLK,
-		S3C2410_IISMOD_384FS);
+		fs_mode);
 	if (ret < 0)
 		return ret;
 
@@ -295,17 +291,8 @@ static int __init rx1950_init(void)
 		goto err_plat_add;
 	}
 
-	xtal = clk_get(&s3c24xx_snd_device->dev, "xtal");
-
-	if (IS_ERR(xtal)) {
-		ret = PTR_ERR(xtal);
-		platform_device_unregister(s3c24xx_snd_device);
-		goto err_clk;
-	}
-
 	return 0;
 
-err_clk:
 err_plat_add:
 err_plat_alloc:
 err_gpio_conf:
@@ -320,7 +307,6 @@ static void __exit rx1950_exit(void)
 	platform_device_unregister(s3c24xx_snd_device);
 	snd_soc_jack_free_gpios(&hp_jack, ARRAY_SIZE(hp_jack_gpios),
 		hp_jack_gpios);
-	clk_put(xtal);
 	gpio_free(S3C2410_GPA(1));
 }
 
-- 
1.7.3.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: RX1950: Fix hw_params function
  2010-11-13 12:53 [PATCH] ASoC: RX1950: Fix hw_params function Vasily Khoruzhick
@ 2010-11-15 11:07 ` Liam Girdwood
  2010-11-15 12:27 ` Mark Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Liam Girdwood @ 2010-11-15 11:07 UTC (permalink / raw)
  To: Vasily Khoruzhick; +Cc: alsa-devel, Mark Brown

On Sat, 2010-11-13 at 14:53 +0200, Vasily Khoruzhick wrote:
> Unfortunatelly, I misunderstood datasheet, and on s3c244x-iis
> when MPLLin source for master clock is selected, prescaler has
> no effect. Remove dividor calculation for 44100 rate; remove 88200
> rate at all, rx1950 can't do it.
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---

Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: RX1950: Fix hw_params function
  2010-11-13 12:53 [PATCH] ASoC: RX1950: Fix hw_params function Vasily Khoruzhick
  2010-11-15 11:07 ` Liam Girdwood
@ 2010-11-15 12:27 ` Mark Brown
  2010-11-22 13:15   ` Vasily Khoruzhick
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Brown @ 2010-11-15 12:27 UTC (permalink / raw)
  To: Vasily Khoruzhick; +Cc: alsa-devel, Liam Girdwood

On Sat, Nov 13, 2010 at 02:53:41PM +0200, Vasily Khoruzhick wrote:
> Unfortunatelly, I misunderstood datasheet, and on s3c244x-iis
> when MPLLin source for master clock is selected, prescaler has
> no effect. Remove dividor calculation for 44100 rate; remove 88200
> rate at all, rx1950 can't do it.
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: RX1950: Fix hw_params function
  2010-11-15 12:27 ` Mark Brown
@ 2010-11-22 13:15   ` Vasily Khoruzhick
  2010-11-22 13:16     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Vasily Khoruzhick @ 2010-11-22 13:15 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

On Monday 15 November 2010 14:27:36 Mark Brown wrote:
> On Sat, Nov 13, 2010 at 02:53:41PM +0200, Vasily Khoruzhick wrote:
> > Unfortunatelly, I misunderstood datasheet, and on s3c244x-iis
> > when MPLLin source for master clock is selected, prescaler has
> > no effect. Remove dividor calculation for 44100 rate; remove 88200
> > rate at all, rx1950 can't do it.
> > 
> > Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> 
> Applied, thanks.

Mark, is it possible to merge this patch into for-2.6.37?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: RX1950: Fix hw_params function
  2010-11-22 13:15   ` Vasily Khoruzhick
@ 2010-11-22 13:16     ` Mark Brown
  2010-11-22 13:19       ` Vasily Khoruzhick
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2010-11-22 13:16 UTC (permalink / raw)
  To: Vasily Khoruzhick; +Cc: alsa-devel, Liam Girdwood

On Mon, Nov 22, 2010 at 03:15:46PM +0200, Vasily Khoruzhick wrote:
> On Monday 15 November 2010 14:27:36 Mark Brown wrote:

> > Applied, thanks.

> Mark, is it possible to merge this patch into for-2.6.37?

That's where I already applied it.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ASoC: RX1950: Fix hw_params function
  2010-11-22 13:16     ` Mark Brown
@ 2010-11-22 13:19       ` Vasily Khoruzhick
  0 siblings, 0 replies; 6+ messages in thread
From: Vasily Khoruzhick @ 2010-11-22 13:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

On Monday 22 November 2010 15:16:50 Mark Brown wrote:
> On Mon, Nov 22, 2010 at 03:15:46PM +0200, Vasily Khoruzhick wrote:
> > On Monday 15 November 2010 14:27:36 Mark Brown wrote:
> > > Applied, thanks.
> > 
> > Mark, is it possible to merge this patch into for-2.6.37?
> 
> That's where I already applied it.

Oh, sorry for noice, I didn't notice

Regards
Vasily

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-11-22 13:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-13 12:53 [PATCH] ASoC: RX1950: Fix hw_params function Vasily Khoruzhick
2010-11-15 11:07 ` Liam Girdwood
2010-11-15 12:27 ` Mark Brown
2010-11-22 13:15   ` Vasily Khoruzhick
2010-11-22 13:16     ` Mark Brown
2010-11-22 13:19       ` Vasily Khoruzhick

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.