From 8dea55e8323f46ff3fac32a786f03b23a7952ba1 Mon Sep 17 00:00:00 2001 From: Xing Wang Date: Tue, 6 Mar 2018 10:31:05 +0800 Subject: [PATCH] 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 --- sound/soc/amlogic/auge/pdm.c | 10 ++++++---- sound/soc/amlogic/auge/pdm.h | 15 ++++++++------- sound/soc/codecs/amlogic/pdm_dummy.c | 15 ++++++++------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/sound/soc/amlogic/auge/pdm.c b/sound/soc/amlogic/auge/pdm.c index e784e6b..b85047f 100644 --- a/sound/soc/amlogic/auge/pdm.c +++ b/sound/soc/amlogic/auge/pdm.c @@ -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; diff --git a/sound/soc/amlogic/auge/pdm.h b/sound/soc/amlogic/auge/pdm.h index 115efa6..72ff145 100644 --- a/sound/soc/amlogic/auge/pdm.h +++ b/sound/soc/amlogic/auge/pdm.h @@ -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, diff --git a/sound/soc/codecs/amlogic/pdm_dummy.c b/sound/soc/codecs/amlogic/pdm_dummy.c index 79fca33..f986aae 100644 --- a/sound/soc/codecs/amlogic/pdm_dummy.c +++ b/sound/soc/codecs/amlogic/pdm_dummy.c @@ -20,15 +20,16 @@ #include #include -#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, -- 2.7.4