1
0
Fork 0
Commit Graph

17 Commits (de2f62c6a59c21523468425bdfb66fa6734aa92f)

Author SHA1 Message Date
Shengjiu Wang d4eb8ab263 MLK-19854-1: ASoC: imx-cs42888: fix error when m4 image is not loaded
With rpmsg sound, when the m4 image is not loaded. There is error log

[ 46.257647] imx-cs42888 sound-rpmsg-cs42888: ASoC: CODEC DAI cs42888 not registered
[ 46.265413] imx-cs42888 sound-rpmsg-cs42888: snd_soc_register_card failed (-517)

The issue is that codec is not register, the sound registeration will fail

So add check in probe function for codec dai ready or not.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang 41a69a3d02 MLK-19168-5: ASoC: imx-cs42888: support codec through rpmsg
support codec through rpmsg

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(cherry picked from commit 8585d67e54c4c3607990a792718992de8be8fe58)
2018-10-29 11:10:38 +08:00
Viorel Suman 73b7d3dca2 MLK-16742-4: ASoC: imx-cs42888: fix DAPM routes
ASRC DAPM routes not needed when ASRC node is not specified.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang d920d3202f MLK-16563-2: ASoC: imx-cs42888: support 12.288MHz mclk of codec
The esai and cs42888 can use different mclk, which has different
frequency. But machine driver thought they are same frequency, which
may cause issue in some case.
Base on above conclusion, the codec can support 12.288MHz mclk.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang 18f556827f MLK-16350-3: ASoC: imx-cs42888: fix clock rate issue
The rate returned by clk_get_rate in probe function is not correct,
for the power domain in that time may be closed, kernel get 0 rate
from scfw, so move the clk_get_rate to hw_params, in that time, the
power domain should be enabled

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2018-10-29 11:10:38 +08:00
Mihai Serban f15891887b MLK-15053: ASoC: fsl: imx-cs42888: Reject unsupported sampling rates
Dynamic constraints for supported sampling rates cannot prevent aplay to
play audio files with higher rates. So we remove the constraints and hard
reject the unsupported samples.

Signed-off-by: Mihai Serban <mihai.serban@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang b21ceed8d4 MLK-15043-2: ASoC: imx-cs42888: fix noise issue with FE-BE case
The case is "aplay -Dhw:0,1 -d 5 -r 8000 -f S16_LE -c 9 audio8k16b9c.wav",
which is to playback 9 channel bitstream. But the maximum supported channel
of codec is 8, ALSA didn't return error for this case, but continue to
playback.

The reason is that in FE-BE case, ASLA only get the FE's hw parameter for
constraint list, omit the BE's parameter. This patch is to merge BE's
parameter to FE. in this situation with the 9 channel case, ASLA will
return error "aplay: set_params:1303: Channels count non available"

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit cfe36e2e7f)
2018-10-29 11:10:38 +08:00
Mihai Serban 78482d012d MLK-14778: ASoC: fsl: imx-cs42888: Improve support for odd number of channels
For samples with more than 2 and odd number of channels the I2S mode
does not work correctly. In I2S mode we are required to activate an even
number of channels (possibly on multiple datalines) and thus configure
the BCLK for even channels. In this case samples with odd (smaller) number
of channels are played faster and the sound is distorted.

To fix this behavior we can enable TDM mode for the special cases of
samples with 3, 5 or 7 channels. But even TDM has some restrictions that
prevent us from having full support for the special cases:
1. TDM is not supported by codec in master mode so 3, 5 and 7 channels
usage is denied.
2. In codec slave mode TDM works only with 8 slots and slot width of 32
bits. For an often used MCLK frequency of 24MHz and the above restrictions
the maximum sample rate is limited to 48KHz = 24576000/(2*8*32).
The 2 denominator is required by ESAI BCLK divisors.

Signed-off-by: Mihai Serban <mihai.serban@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang 5dae60d899 MLK-12745-2: ASoC: fsl_esai: remove the channel swap workaround for imx6ull
In imx6ull, the esai errata ERR008000 for imx6q/dl is fixed, so remove the
workaround from imx6ull.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang 639104178f MLK-12745-1: ASoC: imx-cs42888: add codec master mode support
Add codec master mode support, the default is slave mode.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2018-10-29 11:10:38 +08:00
Zidan Wang b08c460cfa MLK-12244 ASoC: fsl: Set the sound card owner field
When load sound card, the pulseaudio will using the sound card to
playback and record. It may be cause a kernel crash when the sound
card is unloaded while the playback/record is active

After setting the sound card owner field, when pulseaudio is running,
the sound card module ref-count will not be 0 and the sound card will
not be unloaded. So you should stop the pulseaudio when you want to
unload the sound card.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang 02b889b1ea MLK-12165: ASoC: fsl: imx-cs42888: remove 32k and 64k support
Revert "MLK-11623 ASoC: imx-cs42888: add 32k and 64k sample rate support"

This reverts commit 314a01f405.

In Async mode, record and playback use different samplerate, one is 32k,
another is 48kHz, there will be issue "unsupported sysclk ratio".

example case is
arecord -Dhw:0,1 -f S16_LE -r 32000 -c 2 | aplay -f S16_LE -r 32000 -c 2

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang d914c3d633 MLK-12043: ASoC: fsl: imx-cs42888: Add return value check
Report by coverity (CID 18428). The return value need be checked
for snd_soc_dai_set_sysclk().

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2018-10-29 11:10:38 +08:00
Zidan Wang 5d4722cd96 MLK-11915-04 ASoC: imx-cs42888: init asrc_np to avoid wild pointer and check return value of set_fmt()
init asrc_np to avoid wild pointer and check return value of
set_fmt(). Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit 4ccc87a93e180e09b6494fd6c6d81b07dc054e9b)
2018-10-29 11:10:38 +08:00
Zidan Wang 98495d6ec8 MLK-11623 ASoC: imx-cs42888: add 32k and 64k sample rate support
When codec sysclk is 24576000, the sample rate ratio can be 128, 192,
256, 384, 512, 768, 1024. So 32k, 48k, 64k, 96k, 192k can be support.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit b436254cd55dc0d2ebb6d2ca7ce5f58520ea5dbc)
2018-10-29 11:10:38 +08:00
Shengjiu Wang ad9afa8889 MLK-10055-1: ASoC: imx-cs42888: when codec probe failed, alsa return RETRY error.
If there is no codec device, the machine driver will not register the
card. then alsa will not return RETRY error. update the error handling
for machine driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 01ffd8e5e828d20214a196e64b981c9fd94c913e)
2018-10-29 11:10:38 +08:00
Shengjiu Wang 41f3420d0f MLK-11429-21: ASoC: imx-cs42888: port cs42888 machine driver from imx_3.10.y
cherry-pick below patch from imx_3.14.y
ENGR00330403-1: ASoC: imx-cs42888: port cs42888 machine driver from imx_3.10.y

Port the cs42888 machine driver from imx_3.10.y and do update according to
new esai driver and asrc driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
(cherry picked from commit 7ed3aac83630a38eb397ed92f815a28e07198748)
2018-10-29 11:10:38 +08:00