devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] ASoC: samsung: odroid: Fix 32000 sample rate handling
       [not found] <CGME20180314164131epcas2p426aa34f4503ff12fa041a817cdd3eed9@epcas2p4.samsung.com>
@ 2018-03-14 16:41 ` Sylwester Nawrocki
       [not found]   ` <CGME20180314164137epcas2p336d64724b044d14aa920d611b6483593@epcas2p3.samsung.com>
                     ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sylwester Nawrocki @ 2018-03-14 16:41 UTC (permalink / raw)
  To: broonie
  Cc: devicetree, alsa-devel, linux-samsung-soc, b.zolnierkie, sbkim73,
	lgirdwood, krzk, robh+dt, Sylwester Nawrocki, m.szyprowski

In case of sample rates lower than 44100 currently there is too low MCLK
frequency set for the CODEC. Playback fails with following errors:

$ speaker-test -c2 -t sine -f 1500 -l2 -r 32000

Sine wave rate is 1500.0000Hz
Rate set to 32000Hz (requested 32000Hz)
Buffer size range from 128 to 131072
Period size range from 64 to 65536
Using max buffer size 131072
Periods = 4
Unable to set hw params for playback: Invalid argument
Setting of hwparams failed: Invalid argument

[  497.883700] max98090 1-0010: Invalid master clock frequency

To fix this the I2S root clock's frequency is increased, depending
on sampling rate.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 sound/soc/samsung/odroid.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c
index 92d750806d1d..e698e67f5f84 100644
--- a/sound/soc/samsung/odroid.c
+++ b/sound/soc/samsung/odroid.c
@@ -36,23 +36,26 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct odroid_priv *priv = snd_soc_card_get_drvdata(rtd->card);
-	unsigned int pll_freq, rclk_freq;
+	unsigned int pll_freq, rclk_freq, rfs;
 	int ret;
 
 	switch (params_rate(params)) {
-	case 32000:
 	case 64000:
-		pll_freq = 131072006U;
+		pll_freq = 196608001U;
+		rfs = 384;
 		break;
 	case 44100:
 	case 88200:
 	case 176400:
 		pll_freq = 180633609U;
+		rfs = 512;
 		break;
+	case 32000:
 	case 48000:
 	case 96000:
 	case 192000:
 		pll_freq = 196608001U;
+		rfs = 512;
 		break;
 	default:
 		return -EINVAL;
@@ -67,7 +70,7 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream,
 	 *  frequency values due to the EPLL output frequency not being exact
 	 *  multiple of the audio sampling rate.
 	 */
-	rclk_freq = params_rate(params) * 256 + 1;
+	rclk_freq = params_rate(params) * rfs + 1;
 
 	ret = clk_set_rate(priv->sclk_i2s, rclk_freq);
 	if (ret < 0)
-- 
2.14.2

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

* [PATCH 2/5] ASoC: samsung: odroid: Drop sample rates that cannot be supported from hw_params()
       [not found]   ` <CGME20180314164137epcas2p336d64724b044d14aa920d611b6483593@epcas2p3.samsung.com>
@ 2018-03-14 16:41     ` Sylwester Nawrocki
  2018-03-16  7:30       ` Krzysztof Kozlowski
  2018-03-19  1:47       ` Applied "ASoC: samsung: odroid: Drop sample rates that cannot be supported from hw_params()" to the asoc tree Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Sylwester Nawrocki @ 2018-03-14 16:41 UTC (permalink / raw)
  To: broonie
  Cc: devicetree, alsa-devel, linux-samsung-soc, b.zolnierkie, sbkim73,
	lgirdwood, krzk, robh+dt, Sylwester Nawrocki, m.szyprowski

The I2S controller can handle sample rates only up to 96000 and the CPU DAI
has already related constraint set so drop the impossible 176400, 192000
switch cases.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 sound/soc/samsung/odroid.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c
index e698e67f5f84..e1b59457a327 100644
--- a/sound/soc/samsung/odroid.c
+++ b/sound/soc/samsung/odroid.c
@@ -46,14 +46,12 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream,
 		break;
 	case 44100:
 	case 88200:
-	case 176400:
 		pll_freq = 180633609U;
 		rfs = 512;
 		break;
 	case 32000:
 	case 48000:
 	case 96000:
-	case 192000:
 		pll_freq = 196608001U;
 		rfs = 512;
 		break;
-- 
2.14.2

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

* [PATCH 3/5] ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c
       [not found]   ` <CGME20180314164141epcas1p43edb2d21ad8818f744b2e11009322996@epcas1p4.samsung.com>
@ 2018-03-14 16:41     ` Sylwester Nawrocki
  2018-03-16  7:33       ` Krzysztof Kozlowski
  2018-03-19  1:47       ` Applied "ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c" to the asoc tree Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Sylwester Nawrocki @ 2018-03-14 16:41 UTC (permalink / raw)
  To: broonie
  Cc: devicetree, alsa-devel, linux-samsung-soc, b.zolnierkie, sbkim73,
	lgirdwood, krzk, robh+dt, Sylwester Nawrocki, m.szyprowski

Now when a helper for unreferencing device nodes is available
we can get rid of the local implementation.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 sound/soc/samsung/odroid.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c
index e1b59457a327..e7b371b07230 100644
--- a/sound/soc/samsung/odroid.c
+++ b/sound/soc/samsung/odroid.c
@@ -91,18 +91,6 @@ static const struct snd_soc_ops odroid_card_ops = {
 	.hw_params = odroid_card_hw_params,
 };
 
-static void odroid_put_codec_of_nodes(struct snd_soc_dai_link *link)
-{
-	struct snd_soc_dai_link_component *component = link->codecs;
-	int i;
-
-	for (i = 0; i < link->num_codecs; i++, component++) {
-		if (!component->of_node)
-			break;
-		of_node_put(component->of_node);
-	}
-}
-
 static int odroid_audio_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -197,7 +185,7 @@ static int odroid_audio_probe(struct platform_device *pdev)
 err_put_i2s_n:
 	of_node_put(link->cpu_of_node);
 err_put_codec_n:
-	odroid_put_codec_of_nodes(link);
+	snd_soc_of_put_dai_link_codecs(link);
 	return ret;
 }
 
@@ -206,7 +194,7 @@ static int odroid_audio_remove(struct platform_device *pdev)
 	struct odroid_priv *priv = platform_get_drvdata(pdev);
 
 	of_node_put(priv->dai_link.cpu_of_node);
-	odroid_put_codec_of_nodes(&priv->dai_link);
+	snd_soc_of_put_dai_link_codecs(&priv->dai_link);
 	clk_put(priv->sclk_i2s);
 	clk_put(priv->clk_i2s_bus);
 
-- 
2.14.2

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

* Re: [PATCH 1/5] ASoC: samsung: odroid: Fix 32000 sample rate handling
  2018-03-14 16:41 ` [PATCH 1/5] ASoC: samsung: odroid: Fix 32000 sample rate handling Sylwester Nawrocki
       [not found]   ` <CGME20180314164137epcas2p336d64724b044d14aa920d611b6483593@epcas2p3.samsung.com>
       [not found]   ` <CGME20180314164141epcas1p43edb2d21ad8818f744b2e11009322996@epcas1p4.samsung.com>
@ 2018-03-16  7:29   ` Krzysztof Kozlowski
  2018-03-19  1:47   ` Applied "ASoC: samsung: odroid: Fix 32000 sample rate handling" to the asoc tree Mark Brown
  3 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2018-03-16  7:29 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: devicetree, alsa-devel, linux-samsung-soc,
	Bartłomiej Żołnierkiewicz, sbkim73, lgirdwood,
	robh+dt, broonie, Marek Szyprowski

On Wed, Mar 14, 2018 at 5:41 PM, Sylwester Nawrocki
<s.nawrocki@samsung.com> wrote:
> In case of sample rates lower than 44100 currently there is too low MCLK
> frequency set for the CODEC. Playback fails with following errors:
>
> $ speaker-test -c2 -t sine -f 1500 -l2 -r 32000
>
> Sine wave rate is 1500.0000Hz
> Rate set to 32000Hz (requested 32000Hz)
> Buffer size range from 128 to 131072
> Period size range from 64 to 65536
> Using max buffer size 131072
> Periods = 4
> Unable to set hw params for playback: Invalid argument
> Setting of hwparams failed: Invalid argument
>
> [  497.883700] max98090 1-0010: Invalid master clock frequency
>
> To fix this the I2S root clock's frequency is increased, depending
> on sampling rate.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
>  sound/soc/samsung/odroid.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

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

* Re: [PATCH 2/5] ASoC: samsung: odroid: Drop sample rates that cannot be supported from hw_params()
  2018-03-14 16:41     ` [PATCH 2/5] ASoC: samsung: odroid: Drop sample rates that cannot be supported from hw_params() Sylwester Nawrocki
@ 2018-03-16  7:30       ` Krzysztof Kozlowski
  2018-03-19  1:47       ` Applied "ASoC: samsung: odroid: Drop sample rates that cannot be supported from hw_params()" to the asoc tree Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2018-03-16  7:30 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: devicetree, alsa-devel, linux-samsung-soc,
	Bartłomiej Żołnierkiewicz, sbkim73, lgirdwood,
	robh+dt, broonie, Marek Szyprowski

On Wed, Mar 14, 2018 at 5:41 PM, Sylwester Nawrocki
<s.nawrocki@samsung.com> wrote:
> The I2S controller can handle sample rates only up to 96000 and the CPU DAI
> has already related constraint set so drop the impossible 176400, 192000
> switch cases.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
>  sound/soc/samsung/odroid.c | 2 --
>  1 file changed, 2 deletions(-)

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

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

* Re: [PATCH 3/5] ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c
  2018-03-14 16:41     ` [PATCH 3/5] ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c Sylwester Nawrocki
@ 2018-03-16  7:33       ` Krzysztof Kozlowski
  2018-03-19  1:47       ` Applied "ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c" to the asoc tree Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2018-03-16  7:33 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: devicetree, alsa-devel, linux-samsung-soc,
	Bartłomiej Żołnierkiewicz, sbkim73, lgirdwood,
	robh+dt, broonie, Marek Szyprowski

On Wed, Mar 14, 2018 at 5:41 PM, Sylwester Nawrocki
<s.nawrocki@samsung.com> wrote:
> Now when a helper for unreferencing device nodes is available
> we can get rid of the local implementation.
>
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
>  sound/soc/samsung/odroid.c | 16 ++--------------
>  1 file changed, 2 insertions(+), 14 deletions(-)

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

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

* Applied "ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c" to the asoc tree
  2018-03-14 16:41     ` [PATCH 3/5] ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c Sylwester Nawrocki
  2018-03-16  7:33       ` Krzysztof Kozlowski
@ 2018-03-19  1:47       ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-03-19  1:47 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: devicetree, alsa-devel, linux-samsung-soc, b.zolnierkie, sbkim73,
	lgirdwood, krzk, robh+dt, broonie, m.szyprowski

The patch

   ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 4718840e76f74e5868d2001f0ca3a0e5c4292ea0 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Wed, 14 Mar 2018 17:41:15 +0100
Subject: [PATCH] ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in
 odroid.c

Now when a helper for unreferencing device nodes is available
we can get rid of the local implementation.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/samsung/odroid.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c
index e1b59457a327..e7b371b07230 100644
--- a/sound/soc/samsung/odroid.c
+++ b/sound/soc/samsung/odroid.c
@@ -91,18 +91,6 @@ static const struct snd_soc_ops odroid_card_ops = {
 	.hw_params = odroid_card_hw_params,
 };
 
-static void odroid_put_codec_of_nodes(struct snd_soc_dai_link *link)
-{
-	struct snd_soc_dai_link_component *component = link->codecs;
-	int i;
-
-	for (i = 0; i < link->num_codecs; i++, component++) {
-		if (!component->of_node)
-			break;
-		of_node_put(component->of_node);
-	}
-}
-
 static int odroid_audio_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -197,7 +185,7 @@ static int odroid_audio_probe(struct platform_device *pdev)
 err_put_i2s_n:
 	of_node_put(link->cpu_of_node);
 err_put_codec_n:
-	odroid_put_codec_of_nodes(link);
+	snd_soc_of_put_dai_link_codecs(link);
 	return ret;
 }
 
@@ -206,7 +194,7 @@ static int odroid_audio_remove(struct platform_device *pdev)
 	struct odroid_priv *priv = platform_get_drvdata(pdev);
 
 	of_node_put(priv->dai_link.cpu_of_node);
-	odroid_put_codec_of_nodes(&priv->dai_link);
+	snd_soc_of_put_dai_link_codecs(&priv->dai_link);
 	clk_put(priv->sclk_i2s);
 	clk_put(priv->clk_i2s_bus);
 
-- 
2.16.2

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

* Applied "ASoC: samsung: odroid: Drop sample rates that cannot be supported from hw_params()" to the asoc tree
  2018-03-14 16:41     ` [PATCH 2/5] ASoC: samsung: odroid: Drop sample rates that cannot be supported from hw_params() Sylwester Nawrocki
  2018-03-16  7:30       ` Krzysztof Kozlowski
@ 2018-03-19  1:47       ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-03-19  1:47 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: devicetree, alsa-devel, linux-samsung-soc, b.zolnierkie, sbkim73,
	lgirdwood, krzk, robh+dt, broonie, m.szyprowski

The patch

   ASoC: samsung: odroid: Drop sample rates that cannot be supported from hw_params()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 23952006ace5a54caddcda3de6f7676dfe520e86 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Wed, 14 Mar 2018 17:41:14 +0100
Subject: [PATCH] ASoC: samsung: odroid: Drop sample rates that cannot be
 supported from hw_params()

The I2S controller can handle sample rates only up to 96000 and the CPU DAI
has already related constraint set so drop the impossible 176400, 192000
switch cases.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/samsung/odroid.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c
index e698e67f5f84..e1b59457a327 100644
--- a/sound/soc/samsung/odroid.c
+++ b/sound/soc/samsung/odroid.c
@@ -46,14 +46,12 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream,
 		break;
 	case 44100:
 	case 88200:
-	case 176400:
 		pll_freq = 180633609U;
 		rfs = 512;
 		break;
 	case 32000:
 	case 48000:
 	case 96000:
-	case 192000:
 		pll_freq = 196608001U;
 		rfs = 512;
 		break;
-- 
2.16.2

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

* Applied "ASoC: samsung: odroid: Fix 32000 sample rate handling" to the asoc tree
  2018-03-14 16:41 ` [PATCH 1/5] ASoC: samsung: odroid: Fix 32000 sample rate handling Sylwester Nawrocki
                     ` (2 preceding siblings ...)
  2018-03-16  7:29   ` [PATCH 1/5] ASoC: samsung: odroid: Fix 32000 sample rate handling Krzysztof Kozlowski
@ 2018-03-19  1:47   ` Mark Brown
  3 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-03-19  1:47 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: devicetree, alsa-devel, linux-samsung-soc, b.zolnierkie, sbkim73,
	lgirdwood, krzk, robh+dt, broonie, m.szyprowski

The patch

   ASoC: samsung: odroid: Fix 32000 sample rate handling

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 1d22c337dc8f3a25638f7262e7bcb5729a34d140 Mon Sep 17 00:00:00 2001
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
Date: Wed, 14 Mar 2018 17:41:13 +0100
Subject: [PATCH] ASoC: samsung: odroid: Fix 32000 sample rate handling

In case of sample rates lower than 44100 currently there is too low MCLK
frequency set for the CODEC. Playback fails with following errors:

$ speaker-test -c2 -t sine -f 1500 -l2 -r 32000

Sine wave rate is 1500.0000Hz
Rate set to 32000Hz (requested 32000Hz)
Buffer size range from 128 to 131072
Period size range from 64 to 65536
Using max buffer size 131072
Periods = 4
Unable to set hw params for playback: Invalid argument
Setting of hwparams failed: Invalid argument

[  497.883700] max98090 1-0010: Invalid master clock frequency

To fix this the I2S root clock's frequency is increased, depending
on sampling rate.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/samsung/odroid.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c
index 92d750806d1d..e698e67f5f84 100644
--- a/sound/soc/samsung/odroid.c
+++ b/sound/soc/samsung/odroid.c
@@ -36,23 +36,26 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct odroid_priv *priv = snd_soc_card_get_drvdata(rtd->card);
-	unsigned int pll_freq, rclk_freq;
+	unsigned int pll_freq, rclk_freq, rfs;
 	int ret;
 
 	switch (params_rate(params)) {
-	case 32000:
 	case 64000:
-		pll_freq = 131072006U;
+		pll_freq = 196608001U;
+		rfs = 384;
 		break;
 	case 44100:
 	case 88200:
 	case 176400:
 		pll_freq = 180633609U;
+		rfs = 512;
 		break;
+	case 32000:
 	case 48000:
 	case 96000:
 	case 192000:
 		pll_freq = 196608001U;
+		rfs = 512;
 		break;
 	default:
 		return -EINVAL;
@@ -67,7 +70,7 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream,
 	 *  frequency values due to the EPLL output frequency not being exact
 	 *  multiple of the audio sampling rate.
 	 */
-	rclk_freq = params_rate(params) * 256 + 1;
+	rclk_freq = params_rate(params) * rfs + 1;
 
 	ret = clk_set_rate(priv->sclk_i2s, rclk_freq);
 	if (ret < 0)
-- 
2.16.2

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

end of thread, other threads:[~2018-03-19  1:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20180314164131epcas2p426aa34f4503ff12fa041a817cdd3eed9@epcas2p4.samsung.com>
2018-03-14 16:41 ` [PATCH 1/5] ASoC: samsung: odroid: Fix 32000 sample rate handling Sylwester Nawrocki
     [not found]   ` <CGME20180314164137epcas2p336d64724b044d14aa920d611b6483593@epcas2p3.samsung.com>
2018-03-14 16:41     ` [PATCH 2/5] ASoC: samsung: odroid: Drop sample rates that cannot be supported from hw_params() Sylwester Nawrocki
2018-03-16  7:30       ` Krzysztof Kozlowski
2018-03-19  1:47       ` Applied "ASoC: samsung: odroid: Drop sample rates that cannot be supported from hw_params()" to the asoc tree Mark Brown
     [not found]   ` <CGME20180314164141epcas1p43edb2d21ad8818f744b2e11009322996@epcas1p4.samsung.com>
2018-03-14 16:41     ` [PATCH 3/5] ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c Sylwester Nawrocki
2018-03-16  7:33       ` Krzysztof Kozlowski
2018-03-19  1:47       ` Applied "ASoC: samsung: Use snd_soc_of_put_dai_link_codecs() in odroid.c" to the asoc tree Mark Brown
2018-03-16  7:29   ` [PATCH 1/5] ASoC: samsung: odroid: Fix 32000 sample rate handling Krzysztof Kozlowski
2018-03-19  1:47   ` Applied "ASoC: samsung: odroid: Fix 32000 sample rate handling" to the asoc tree Mark Brown

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).