mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
audio: auge: pdm supports 64k sample rate
PD#156734: audio: auge: pdm supports 64k sample rate Change-Id: Ia938906fc0aef51d66b947b376b62c21fb2c8c76 Signed-off-by: Xing Wang <xing.wang@amlogic.com>
This commit is contained in:
@@ -51,7 +51,7 @@ static struct snd_pcm_hardware aml_pdm_hardware = {
|
||||
SNDRV_PCM_FMTBIT_S32,
|
||||
|
||||
.rate_min = 8000,
|
||||
.rate_max = 48000,
|
||||
.rate_max = 64000,
|
||||
|
||||
.channels_min = PDM_CHANNELS_MIN,
|
||||
.channels_max = PDM_CHANNELS_MAX,
|
||||
@@ -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",
|
||||
"PDM Dclk 3.072m, support 8k/16k/32k/48k/64k",
|
||||
"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 == 48000)
|
||||
if (runtime->rate == 64000)
|
||||
osr = 48;
|
||||
else if (runtime->rate == 48000)
|
||||
osr = 64;
|
||||
else if (runtime->rate == 32000)
|
||||
osr = 96;
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
#define PDM_CHANNELS_MIN 1
|
||||
#define PDM_CHANNELS_MAX (8 + 8) /* 8ch pdm in, 8 ch tdmin_lb */
|
||||
|
||||
#define PDM_RATES (SNDRV_PCM_RATE_48000 |\
|
||||
#define PDM_RATES (SNDRV_PCM_RATE_64000 |\
|
||||
SNDRV_PCM_RATE_48000 |\
|
||||
SNDRV_PCM_RATE_32000 |\
|
||||
SNDRV_PCM_RATE_16000 |\
|
||||
SNDRV_PCM_RATE_8000)
|
||||
|
||||
@@ -147,22 +147,22 @@ static void aml_pdm_filters_config(int osr,
|
||||
case 32:
|
||||
hcic_dn_rate = 0x4;
|
||||
hcic_gain = 0x80;
|
||||
hcic_shift = 0xa;
|
||||
hcic_shift = 0xe;
|
||||
break;
|
||||
case 40:
|
||||
hcic_dn_rate = 0x5;
|
||||
hcic_gain = 0x54;
|
||||
hcic_shift = 0xb;
|
||||
hcic_gain = 0x6b;
|
||||
hcic_shift = 0x10;
|
||||
break;
|
||||
case 48:
|
||||
hcic_dn_rate = 0x6;
|
||||
hcic_gain = 0x43;
|
||||
hcic_shift = 0xc;
|
||||
hcic_gain = 0x78;
|
||||
hcic_shift = 0x12;
|
||||
break;
|
||||
case 56:
|
||||
hcic_dn_rate = 0x7;
|
||||
hcic_gain = 0x7d;
|
||||
hcic_shift = 0xe;
|
||||
hcic_gain = 0x51;
|
||||
hcic_shift = 0x13;
|
||||
break;
|
||||
case 64:
|
||||
hcic_dn_rate = 0x0008;
|
||||
@@ -358,7 +358,8 @@ void aml_pdm_filter_ctrl(int osr, int mode)
|
||||
case 48:
|
||||
case 56:
|
||||
default:
|
||||
pr_info("default mode 1, osr 64, 48k\n");
|
||||
pr_info("osr :%d , lpf2 uses default parameters with osr64\n",
|
||||
osr);
|
||||
lpf2_coeff = lpf2_osr64;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
#include <linux/of.h>
|
||||
#include <sound/soc.h>
|
||||
|
||||
#define DUMMY_RATES (SNDRV_PCM_RATE_48000 |\
|
||||
#define DUMMY_RATES (SNDRV_PCM_RATE_64000 |\
|
||||
SNDRV_PCM_RATE_48000 |\
|
||||
SNDRV_PCM_RATE_32000 |\
|
||||
SNDRV_PCM_RATE_16000 |\
|
||||
SNDRV_PCM_RATE_8000)
|
||||
|
||||
Reference in New Issue
Block a user