LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: pcm512x: Fixups for the Clock master modes series
@ 2015-01-29 11:21 Peter Rosin
  2015-01-29 11:21 ` [PATCH 1/2] ASoC: pcm512x: Fixup warning splat Peter Rosin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Rosin @ 2015-01-29 11:21 UTC (permalink / raw)
  To: alsa-devel
  Cc: Peter Rosin, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Lars-Peter Clausen, linux-kernel

From: Peter Rosin <peda@axentia.se>

These fixups can either be squashed in with 5/7 from the Clock master mode
series, or they can be added on top of the current topic/pcm512x. Sorry for
the trouble.

I can squash them, and resend the Clock master modes series if that helps.
Let me know how you'd like it.

Cheers,
Peter

Peter Rosin (2):
  ASoC: pcm512x: Fixup warning splat
  ASoC: pcm512x: Use the correct range constraints for S24_LE

 sound/soc/codecs/pcm512x.c |   41 +++++++++++++++++++++--------------------
 1 file changed, 21 insertions(+), 20 deletions(-)

-- 
1.7.10.4


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

* [PATCH 1/2] ASoC: pcm512x: Fixup warning splat
  2015-01-29 11:21 [PATCH 0/2] ASoC: pcm512x: Fixups for the Clock master modes series Peter Rosin
@ 2015-01-29 11:21 ` Peter Rosin
  2015-01-29 11:21 ` [PATCH 2/2] ASoC: pcm512x: Use the correct range constraints for S24_LE Peter Rosin
  2015-01-29 12:02 ` [PATCH 0/2] ASoC: pcm512x: Fixups for the Clock master modes series Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Rosin @ 2015-01-29 11:21 UTC (permalink / raw)
  To: alsa-devel
  Cc: Peter Rosin, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Lars-Peter Clausen, kbuild test robot,
	linux-kernel

From: Peter Rosin <peda@axentia.se>

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Peter Rosin <peda@axentia.se>
---
 sound/soc/codecs/pcm512x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index 51b279e3f465..067d11743c31 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -1266,7 +1266,6 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
 {
 	struct pcm512x_priv *pcm512x;
 	int i, ret;
-	u32 val;
 
 	pcm512x = devm_kzalloc(dev, sizeof(struct pcm512x_priv), GFP_KERNEL);
 	if (!pcm512x)
@@ -1347,6 +1346,7 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
 #ifdef CONFIG_OF
 	if (dev->of_node) {
 		const struct device_node *np = dev->of_node;
+		u32 val;
 
 		if (of_property_read_u32(np, "pll-in", &val) >= 0) {
 			if (val > 6) {
-- 
1.7.10.4


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

* [PATCH 2/2] ASoC: pcm512x: Use the correct range constraints for S24_LE
  2015-01-29 11:21 [PATCH 0/2] ASoC: pcm512x: Fixups for the Clock master modes series Peter Rosin
  2015-01-29 11:21 ` [PATCH 1/2] ASoC: pcm512x: Fixup warning splat Peter Rosin
@ 2015-01-29 11:21 ` Peter Rosin
  2015-01-29 12:02 ` [PATCH 0/2] ASoC: pcm512x: Fixups for the Clock master modes series Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Rosin @ 2015-01-29 11:21 UTC (permalink / raw)
  To: alsa-devel
  Cc: Peter Rosin, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Lars-Peter Clausen, linux-kernel

From: Peter Rosin <peda@axentia.se>

This was overlooked in the late change to remove the I2S padding bits
from S24_LE mode. The patch also limits S32_LE mode to 384kHz, the
maximum according to the datasheets.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 sound/soc/codecs/pcm512x.c |   39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index 067d11743c31..884784fb1566 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -356,36 +356,37 @@ static const struct snd_pcm_hw_constraint_list constraints_slave = {
 	.list  = pcm512x_dai_rates,
 };
 
-static const struct snd_interval pcm512x_dai_ranges_64bpf[] = {
-	{
-		.min = 8000,
-		.max = 195312,
-	}, {
-		.min = 250000,
-		.max = 390625,
-	},
-};
-
-static struct snd_pcm_hw_constraint_ranges constraints_64bpf = {
-	.count  = ARRAY_SIZE(pcm512x_dai_ranges_64bpf),
-	.ranges = pcm512x_dai_ranges_64bpf,
-};
-
 static int pcm512x_hw_rule_rate(struct snd_pcm_hw_params *params,
 				struct snd_pcm_hw_rule *rule)
 {
-	struct snd_pcm_hw_constraint_ranges *r = rule->private;
+	struct snd_interval ranges[2];
 	int frame_size;
 
 	frame_size = snd_soc_params_to_frame_size(params);
 	if (frame_size < 0)
 		return frame_size;
 
-	if (frame_size != 64)
+	switch (frame_size) {
+	case 32:
+		/* No hole when the frame size is 32. */
 		return 0;
+	case 48:
+	case 64:
+		/* There is only one hole in the range of supported
+		 * rates, but it moves with the frame size.
+		 */
+		memset(ranges, 0, sizeof(ranges));
+		ranges[0].min = 8000;
+		ranges[0].max = 25000000 / frame_size / 2;
+		ranges[1].min = DIV_ROUND_UP(16000000, frame_size);
+		ranges[1].max = 384000;
+		break;
+	default:
+		return -EINVAL;
+	}
 
 	return snd_interval_ranges(hw_param_interval(params, rule->var),
-				   r->count, r->ranges, r->mask);
+				   ARRAY_SIZE(ranges), ranges, 0);
 }
 
 static int pcm512x_dai_startup_master(struct snd_pcm_substream *substream,
@@ -407,7 +408,7 @@ static int pcm512x_dai_startup_master(struct snd_pcm_substream *substream,
 		return snd_pcm_hw_rule_add(substream->runtime, 0,
 					   SNDRV_PCM_HW_PARAM_RATE,
 					   pcm512x_hw_rule_rate,
-					   (void *)&constraints_64bpf,
+					   NULL,
 					   SNDRV_PCM_HW_PARAM_FRAME_BITS,
 					   SNDRV_PCM_HW_PARAM_CHANNELS, -1);
 
-- 
1.7.10.4


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

* Re: [PATCH 0/2] ASoC: pcm512x: Fixups for the Clock master modes series
  2015-01-29 11:21 [PATCH 0/2] ASoC: pcm512x: Fixups for the Clock master modes series Peter Rosin
  2015-01-29 11:21 ` [PATCH 1/2] ASoC: pcm512x: Fixup warning splat Peter Rosin
  2015-01-29 11:21 ` [PATCH 2/2] ASoC: pcm512x: Use the correct range constraints for S24_LE Peter Rosin
@ 2015-01-29 12:02 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-01-29 12:02 UTC (permalink / raw)
  To: Peter Rosin
  Cc: alsa-devel, Peter Rosin, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai, Lars-Peter Clausen, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

On Thu, Jan 29, 2015 at 12:21:54PM +0100, Peter Rosin wrote:
> From: Peter Rosin <peda@axentia.se>
> 
> These fixups can either be squashed in with 5/7 from the Clock master mode
> series, or they can be added on top of the current topic/pcm512x. Sorry for
> the trouble.

applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

end of thread, other threads:[~2015-01-29 12:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29 11:21 [PATCH 0/2] ASoC: pcm512x: Fixups for the Clock master modes series Peter Rosin
2015-01-29 11:21 ` [PATCH 1/2] ASoC: pcm512x: Fixup warning splat Peter Rosin
2015-01-29 11:21 ` [PATCH 2/2] ASoC: pcm512x: Use the correct range constraints for S24_LE Peter Rosin
2015-01-29 12:02 ` [PATCH 0/2] ASoC: pcm512x: Fixups for the Clock master modes series 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).