* [PATCH v4 1/5] ASoC: Apply msbits constraint for sample size bigger than the msbits
2012-01-18 11:18 [PATCH v4 0/5] ASoC: updates for core support for msbits constraints Peter Ujfalusi
@ 2012-01-18 11:18 ` Peter Ujfalusi
2012-01-18 11:34 ` Mark Brown
2012-01-18 11:18 ` [PATCH v4 2/5] ASoC: omap-dmic: Use core to set the msbits constraint Peter Ujfalusi
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Peter Ujfalusi @ 2012-01-18 11:18 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel
In order to avoid confusing the applications with msbits bigger
than the selected sample size apply the msbits constraint only
to sample seze bigger than the requested msbits.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
sound/soc/soc-pcm.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8bb1793..e5e804d 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -68,7 +68,7 @@ static int soc_pcm_apply_symmetry(struct snd_pcm_substream *substream,
* like the DAC/ADC resolution to use but there isn't right now.
*/
static int sample_sizes[] = {
- 8, 16, 24, 32,
+ 32, 24, 16, 8,
};
static void soc_pcm_apply_msb(struct snd_pcm_substream *substream,
@@ -85,6 +85,8 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream,
return;
for (i = 0; i < ARRAY_SIZE(sample_sizes); i++) {
+ if (sample_sizes[i] <= bits)
+ break;
ret = snd_pcm_hw_constraint_msbits(substream->runtime,
0, sample_sizes[i],
bits);
--
1.7.8.3
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v4 2/5] ASoC: omap-dmic: Use core to set the msbits constraint
2012-01-18 11:18 [PATCH v4 0/5] ASoC: updates for core support for msbits constraints Peter Ujfalusi
2012-01-18 11:18 ` [PATCH v4 1/5] ASoC: Apply msbits constraint for sample size bigger than the msbits Peter Ujfalusi
@ 2012-01-18 11:18 ` Peter Ujfalusi
2012-01-18 11:44 ` Mark Brown
2012-01-18 11:18 ` [PATCH v4 3/5] ASoC: omap-mcpdm: Set 24msbits constraint Peter Ujfalusi
` (2 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Peter Ujfalusi @ 2012-01-18 11:18 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel
Core can set the msbits constraint in behalf of the dai.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
sound/soc/omap/omap-dmic.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c
index 0855c1c..4dcb5a7 100644
--- a/sound/soc/omap/omap-dmic.c
+++ b/sound/soc/omap/omap-dmic.c
@@ -113,12 +113,10 @@ static int omap_dmic_dai_startup(struct snd_pcm_substream *substream,
mutex_lock(&dmic->mutex);
- if (!dai->active) {
- snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24);
+ if (!dai->active)
dmic->active = 1;
- } else {
+ else
ret = -EBUSY;
- }
mutex_unlock(&dmic->mutex);
@@ -445,6 +443,7 @@ static struct snd_soc_dai_driver omap_dmic_dai = {
.channels_max = 6,
.rates = SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_192000,
.formats = SNDRV_PCM_FMTBIT_S32_LE,
+ .sig_bits = 24,
},
.ops = &omap_dmic_dai_ops,
};
--
1.7.8.3
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v4 3/5] ASoC: omap-mcpdm: Set 24msbits constraint
2012-01-18 11:18 [PATCH v4 0/5] ASoC: updates for core support for msbits constraints Peter Ujfalusi
2012-01-18 11:18 ` [PATCH v4 1/5] ASoC: Apply msbits constraint for sample size bigger than the msbits Peter Ujfalusi
2012-01-18 11:18 ` [PATCH v4 2/5] ASoC: omap-dmic: Use core to set the msbits constraint Peter Ujfalusi
@ 2012-01-18 11:18 ` Peter Ujfalusi
2012-01-18 11:45 ` Mark Brown
2012-01-18 11:18 ` [PATCH v4 4/5] ASoC: tlv320dac33: Use core to set the msbits constraint Peter Ujfalusi
2012-01-18 11:18 ` [PATCH v4 5/5] ASoC: twl4030: " Peter Ujfalusi
4 siblings, 1 reply; 11+ messages in thread
From: Peter Ujfalusi @ 2012-01-18 11:18 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel
McPDM internal FIFO is 24 bit wide. From the 32 bit sample
8 bit is discarded. Let application know about this
via msbits constraint.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
sound/soc/omap/omap-mcpdm.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index 0e25df4..3970556 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -419,12 +419,14 @@ static struct snd_soc_dai_driver omap_mcpdm_dai = {
.channels_max = 5,
.rates = OMAP_MCPDM_RATES,
.formats = OMAP_MCPDM_FORMATS,
+ .sig_bits = 24,
},
.capture = {
.channels_min = 1,
.channels_max = 3,
.rates = OMAP_MCPDM_RATES,
.formats = OMAP_MCPDM_FORMATS,
+ .sig_bits = 24,
},
.ops = &omap_mcpdm_dai_ops,
};
--
1.7.8.3
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v4 4/5] ASoC: tlv320dac33: Use core to set the msbits constraint
2012-01-18 11:18 [PATCH v4 0/5] ASoC: updates for core support for msbits constraints Peter Ujfalusi
` (2 preceding siblings ...)
2012-01-18 11:18 ` [PATCH v4 3/5] ASoC: omap-mcpdm: Set 24msbits constraint Peter Ujfalusi
@ 2012-01-18 11:18 ` Peter Ujfalusi
2012-01-18 11:45 ` Mark Brown
2012-01-18 11:18 ` [PATCH v4 5/5] ASoC: twl4030: " Peter Ujfalusi
4 siblings, 1 reply; 11+ messages in thread
From: Peter Ujfalusi @ 2012-01-18 11:18 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel
Core can set the msbits constraint in behalf of the dai.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
sound/soc/codecs/tlv320dac33.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index f0aad26..21ccf0a 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -806,8 +806,6 @@ static int dac33_startup(struct snd_pcm_substream *substream,
/* Stream started, save the substream pointer */
dac33->substream = substream;
- snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24);
-
return 0;
}
@@ -1516,6 +1514,7 @@ static struct snd_soc_dai_driver dac33_dai = {
.channels_max = 2,
.rates = DAC33_RATES,
.formats = DAC33_FORMATS,},
+ .sig_bits = 24,
.ops = &dac33_dai_ops,
};
--
1.7.8.3
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v4 5/5] ASoC: twl4030: Use core to set the msbits constraint
2012-01-18 11:18 [PATCH v4 0/5] ASoC: updates for core support for msbits constraints Peter Ujfalusi
` (3 preceding siblings ...)
2012-01-18 11:18 ` [PATCH v4 4/5] ASoC: tlv320dac33: Use core to set the msbits constraint Peter Ujfalusi
@ 2012-01-18 11:18 ` Peter Ujfalusi
2012-01-18 11:45 ` Mark Brown
4 siblings, 1 reply; 11+ messages in thread
From: Peter Ujfalusi @ 2012-01-18 11:18 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel
Core can set the msbits constraint in behalf of the dai.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
sound/soc/codecs/twl4030.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 18e7101..a193f5f 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -1689,7 +1689,6 @@ static int twl4030_startup(struct snd_pcm_substream *substream,
struct snd_soc_codec *codec = rtd->codec;
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
- snd_pcm_hw_constraint_msbits(substream->runtime, 0, 32, 24);
if (twl4030->master_substream) {
twl4030->slave_substream = substream;
/* The DAI has one configuration for playback and capture, so
@@ -2175,13 +2174,15 @@ static struct snd_soc_dai_driver twl4030_dai[] = {
.channels_min = 2,
.channels_max = 4,
.rates = TWL4030_RATES | SNDRV_PCM_RATE_96000,
- .formats = TWL4030_FORMATS,},
+ .formats = TWL4030_FORMATS,
+ .sig_bits = 24,},
.capture = {
.stream_name = "Capture",
.channels_min = 2,
.channels_max = 4,
.rates = TWL4030_RATES,
- .formats = TWL4030_FORMATS,},
+ .formats = TWL4030_FORMATS,
+ .sig_bits = 24,},
.ops = &twl4030_dai_hifi_ops,
},
{
--
1.7.8.3
^ permalink raw reply related [flat|nested] 11+ messages in thread