audio: auge: pdm supports 96k sample rate

PD#156734: audio: auge: pdm supports 96k sample rate

1) pdm supports 96k sample rate
2) set HCIC gain additional shift as default 0

Change-Id: I056f87cd43bb5c07d04b2baff461bb38c7443f6d
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
This commit is contained in:
Xing Wang
2018-03-06 10:31:05 +08:00
committed by Jianxin Pan
parent 093712257d
commit 8dea55e832
3 changed files with 22 additions and 18 deletions

View File

@@ -51,7 +51,7 @@ static struct snd_pcm_hardware aml_pdm_hardware = {
SNDRV_PCM_FMTBIT_S32,
.rate_min = 8000,
.rate_max = 64000,
.rate_max = 96000,
.channels_min = PDM_CHANNELS_MIN,
.channels_max = PDM_CHANNELS_MAX,
@@ -107,7 +107,7 @@ static int aml_pdm_filter_mode_set_enum(
return 0;
}
int pdm_hcic_shift_gain = 1;
int pdm_hcic_shift_gain;
static const char *const pdm_hcic_shift_gain_texts[] = {
"keep with coeff",
@@ -139,7 +139,7 @@ static int pdm_hcic_shift_gain_set_enum(
int pdm_dclk;
static const char *const pdm_dclk_texts[] = {
"PDM Dclk 3.072m, support 8k/16k/32k/48k/64k",
"PDM Dclk 3.072m, support 8k/16k/32k/48k/64k/96k",
"PDM Dclk 1.024m, support 8k/16k",
"PDM Dclk 768k, support 8k/16k",
};
@@ -652,7 +652,9 @@ static int aml_pdm_dai_prepare(
return -EINVAL;
}
} else {
if (runtime->rate == 64000)
if (runtime->rate == 96000)
osr = 32;
else if (runtime->rate == 64000)
osr = 48;
else if (runtime->rate == 48000)
osr = 64;

View File

@@ -29,15 +29,16 @@
#define PDM_CHANNELS_MIN 1
#define PDM_CHANNELS_MAX (8 + 8) /* 8ch pdm in, 8 ch tdmin_lb */
#define PDM_RATES (SNDRV_PCM_RATE_64000 |\
SNDRV_PCM_RATE_48000 |\
SNDRV_PCM_RATE_32000 |\
SNDRV_PCM_RATE_16000 |\
SNDRV_PCM_RATE_8000)
#define PDM_RATES (SNDRV_PCM_RATE_96000 |\
SNDRV_PCM_RATE_64000 |\
SNDRV_PCM_RATE_48000 |\
SNDRV_PCM_RATE_32000 |\
SNDRV_PCM_RATE_16000 |\
SNDRV_PCM_RATE_8000)
#define PDM_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
SNDRV_PCM_FMTBIT_S24_LE |\
SNDRV_PCM_FMTBIT_S32_LE)
SNDRV_PCM_FMTBIT_S24_LE |\
SNDRV_PCM_FMTBIT_S32_LE)
enum {
PDM_RUN_MUTE_VAL = 0,

View File

@@ -20,15 +20,16 @@
#include <linux/of.h>
#include <sound/soc.h>
#define DUMMY_RATES (SNDRV_PCM_RATE_64000 |\
SNDRV_PCM_RATE_48000 |\
SNDRV_PCM_RATE_32000 |\
SNDRV_PCM_RATE_16000 |\
SNDRV_PCM_RATE_8000)
#define DUMMY_RATES (SNDRV_PCM_RATE_96000 |\
SNDRV_PCM_RATE_64000 |\
SNDRV_PCM_RATE_48000 |\
SNDRV_PCM_RATE_32000 |\
SNDRV_PCM_RATE_16000 |\
SNDRV_PCM_RATE_8000)
#define DUMMY_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
SNDRV_PCM_FMTBIT_S24_LE |\
SNDRV_PCM_FMTBIT_S32_LE)
SNDRV_PCM_FMTBIT_S24_LE |\
SNDRV_PCM_FMTBIT_S32_LE)
static int pdm_dummy_set_fmt(
struct snd_soc_dai *codec_dai,