]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: sun4i-codec: enable 12Khz and 24Khz audio sample rates
authorAndrea Bondavalli <andrea.bondavalli74@gmail.com>
Tue, 12 Dec 2017 09:14:50 +0000 (10:14 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 12 Dec 2017 10:38:03 +0000 (10:38 +0000)
commit0839bcf4f47aa70f9b6c53c1b8b559e034068380
treefbb0c3808480db4713231684bf1f492cd3cf0683
parent71d68f05473591ccdba83a13ded853e0733bca9c
ASoC: sun4i-codec: enable 12Khz and 24Khz audio sample rates

H3 ASoC supports 12Khz and 24Khz audio sample rates but the current
drivers doesn't advertise these rates properly and they cannot be used.

For example attempt to capture at 12Khz uses 11Khz (same applies to
audio playback):

Recording raw data '/tmp/testS16_LE.raw' : Signed 16 bit Little Endian, Rate 12000 Hz, Stereo
Warning: rate is not accurate (requested = 12000Hz, got = 11025Hz)

This patch fixes the audio sample rates declared and supported by the
driver according to the H3 data sheet.  Specifically for audio playback:

8000, 11050, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 96000, 192000

and for audio capture:

8000, 11050, 12000, 16000, 22050, 24000, 32000, 44100, 48000

Signed-off-by: Andrea Bondavalli <andrea.bondavalli74@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sunxi/sun4i-codec.c