mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
ODROID-COMMON:Support up to 384KHz sample rate.
Change-Id: Iad8a1337637b5f09d444c632935a1326123a04d8
This commit is contained in:
@@ -129,6 +129,9 @@ struct snd_pcm_ops {
|
||||
#define SNDRV_PCM_RATE_96000 (1<<10) /* 96000Hz */
|
||||
#define SNDRV_PCM_RATE_176400 (1<<11) /* 176400Hz */
|
||||
#define SNDRV_PCM_RATE_192000 (1<<12) /* 192000Hz */
|
||||
#define SNDRV_PCM_RATE_216000 (1<<13) /* 216000Hz */
|
||||
#define SNDRV_PCM_RATE_352800 (1<<14) /* 352800Hz */
|
||||
#define SNDRV_PCM_RATE_384000 (1<<15) /* 384000Hz */
|
||||
|
||||
#define SNDRV_PCM_RATE_CONTINUOUS (1<<30) /* continuous range */
|
||||
#define SNDRV_PCM_RATE_KNOT (1<<31) /* supports more non-continuos rates */
|
||||
@@ -141,6 +144,11 @@ struct snd_pcm_ops {
|
||||
SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000)
|
||||
#define SNDRV_PCM_RATE_8000_192000 (SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\
|
||||
SNDRV_PCM_RATE_192000)
|
||||
#define SNDRV_PCM_RATE_8000_384000 (SNDRV_PCM_RATE_8000_192000|\
|
||||
SNDRV_PCM_RATE_216000|\
|
||||
SNDRV_PCM_RATE_352800|\
|
||||
SNDRV_PCM_RATE_384000)
|
||||
|
||||
#define _SNDRV_PCM_FMTBIT(fmt) (1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt)
|
||||
#define SNDRV_PCM_FMTBIT_S8 _SNDRV_PCM_FMTBIT(S8)
|
||||
#define SNDRV_PCM_FMTBIT_U8 _SNDRV_PCM_FMTBIT(U8)
|
||||
|
||||
@@ -1986,7 +1986,8 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params,
|
||||
#endif
|
||||
|
||||
static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100,
|
||||
48000, 64000, 88200, 96000, 176400, 192000 };
|
||||
48000, 64000, 88200, 96000, 176400, 192000,
|
||||
216000, 352800, 384000 };
|
||||
|
||||
const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = {
|
||||
.count = ARRAY_SIZE(rates),
|
||||
|
||||
@@ -440,6 +440,9 @@ static int aml_card_hw_params(struct snd_pcm_substream *substream,
|
||||
else if (dai_props->mclk_fs)
|
||||
mclk_fs = dai_props->mclk_fs;
|
||||
|
||||
if (params_rate(params) > 192000)
|
||||
mclk_fs = 128;
|
||||
|
||||
if (mclk_fs) {
|
||||
mclk = params_rate(params) * mclk_fs;
|
||||
|
||||
|
||||
@@ -128,13 +128,13 @@ static const struct snd_pcm_hardware aml_tdm_hardware = {
|
||||
SNDRV_PCM_FMTBIT_S32_LE,
|
||||
|
||||
.period_bytes_min = 64,
|
||||
.period_bytes_max = 256 * 1024,
|
||||
.period_bytes_max = 256 * 1024 * 2,
|
||||
.periods_min = 2,
|
||||
.periods_max = 1024,
|
||||
.buffer_bytes_max = 1024 * 1024,
|
||||
.buffer_bytes_max = 512 * 1024 * 2,
|
||||
|
||||
.rate_min = 8000,
|
||||
.rate_max = 192000,
|
||||
.rate_max = 384000,
|
||||
.channels_min = 1,
|
||||
.channels_max = 32,
|
||||
};
|
||||
@@ -762,7 +762,10 @@ static int pcm_setting_init(struct pcm_setting *setting, unsigned int rate,
|
||||
/* for some TDM codec, mclk limites */
|
||||
ratio = 2;
|
||||
} else {
|
||||
ratio = 4;
|
||||
if (rate > 192000)
|
||||
ratio = 2;
|
||||
else
|
||||
ratio = 4;
|
||||
}
|
||||
setting->sysclk_bclk_ratio = ratio;
|
||||
setting->sysclk = ratio * setting->bclk;
|
||||
@@ -1400,7 +1403,7 @@ static struct snd_soc_dai_ops aml_dai_tdm_ops = {
|
||||
.mute_stream = aml_dai_tdm_mute_stream,
|
||||
};
|
||||
|
||||
#define AML_DAI_TDM_RATES (SNDRV_PCM_RATE_8000_192000)
|
||||
#define AML_DAI_TDM_RATES (SNDRV_PCM_RATE_8000_384000)
|
||||
#define AML_DAI_TDM_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
|
||||
|
||||
|
||||
@@ -498,7 +498,7 @@ static int aml_T9015_audio_resume(struct snd_soc_codec *codec)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define T9015_AUDIO_STEREO_RATES SNDRV_PCM_RATE_8000_96000
|
||||
#define T9015_AUDIO_STEREO_RATES SNDRV_PCM_RATE_8000_384000
|
||||
#define T9015_AUDIO_FORMATS (SNDRV_PCM_FMTBIT_S16_LE \
|
||||
| SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE \
|
||||
| SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S32_LE)
|
||||
|
||||
@@ -30,7 +30,7 @@ struct dummy_codec_private {
|
||||
struct snd_soc_codec codec;
|
||||
};
|
||||
|
||||
#define DUMMY_CODEC_RATES (SNDRV_PCM_RATE_8000_192000)
|
||||
#define DUMMY_CODEC_RATES (SNDRV_PCM_RATE_8000_384000)
|
||||
#define DUMMY_CODEC_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user