summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-pdm.c
diff options
context:
space:
mode:
authorAdrian Alonso <adrian.alonso@nxp.com>2020-04-01 20:05:47 -0500
committerAdrian Alonso <adrian.alonso@nxp.com>2020-05-12 13:20:34 -0500
commit7238c03e567afa780bebf1701ce9031a475ca6eb (patch)
treeff812302cb8dbf2dc9d33b266a275ac87e7554f9 /sound/soc/fsl/imx-pdm.c
parent710953489d1abc526f5e45f566cef9f0a3439bd0 (diff)
MLK-23921: sound: soc: imx-pdm: update driver constrains
Update drivers constrains, limit sample rates to [8Khz - 64Khz] and up to 8 channels. Use SND_SOC_DAIFMT_PDM format type and remove tdm slot settings to allow capture from multiple SAI_RxD pins. Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com> Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
Diffstat (limited to 'sound/soc/fsl/imx-pdm.c')
-rw-r--r--sound/soc/fsl/imx-pdm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/soc/fsl/imx-pdm.c b/sound/soc/fsl/imx-pdm.c
index 9e61689d0278..3cca30131981 100644
--- a/sound/soc/fsl/imx-pdm.c
+++ b/sound/soc/fsl/imx-pdm.c
@@ -23,12 +23,16 @@ struct imx_pdm_data {
unsigned int decimation;
};
-static u32 imx_pdm_mic_rates[] = { 8000, 16000, 32000, 48000, 64000 };
+static const unsigned int imx_pdm_mic_rates[] = {
+ 8000, 11025, 12000, 16000,
+ 22050, 24000, 32000, 44100,
+ 48000, 64000,
+};
static struct snd_pcm_hw_constraint_list imx_pdm_mic_rate_constrains = {
.count = ARRAY_SIZE(imx_pdm_mic_rates),
.list = imx_pdm_mic_rates,
};
-static u32 imx_pdm_mic_channels[] = { 1 };
+static unsigned int imx_pdm_mic_channels[] = { 1, 2, 4, 6, 8 };
static struct snd_pcm_hw_constraint_list imx_pdm_mic_channels_constrains = {
.count = ARRAY_SIZE(imx_pdm_mic_channels),
.list = imx_pdm_mic_channels,
@@ -70,14 +74,12 @@ static int imx_pdm_mic_hw_params(struct snd_pcm_substream *substream,
int ret;
/* set cpu dai format configuration */
- ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
+ ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_PDM |
SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);
if (ret) {
dev_err(card->dev, "fail to set cpu dai fmt: %d\n", ret);
return ret;
}
- /* set tdm slots only one for now */
- snd_soc_dai_set_tdm_slot(cpu_dai, 0, 0, 1, 32);
/* Set clock out */
ret = snd_soc_dai_set_bclk_ratio(cpu_dai, data->decimation);
if (ret) {