summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-ak4458.c
AgeCommit message (Collapse)Author
2019-12-04MLK-21106: ASoC: imx-ak4458: Fix channel not supported in tdm & daisy chainShengjiu Wang
The channel num (9 - 15) should not be supported in tdm & daisy chain mode for there is two dataline, this channel number can't be symmetrically distributed on two dataline (the first one is fixed to be 8 channel) Fixes commit 8d29874365c3 ("MLK-17817-2: ASoC: imx-ak4458: enable 16 channels in TDM mode") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> (cherry picked from commit 0bc47b31660efd3dbbeee7e51fca6f75e7ecb69f)
2019-11-25ASoC: imx-ak4458: Fix compile issue with the new dai link definitionShengjiu Wang
Fix compile issue with the new dai link definition Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25MLK-17817-2: ASoC: imx-ak4458: enable 16 channels in TDM modeViorel Suman
In TDM mode with Daisy Chain enabled (CPLD mode 0x04) DAC1 and DAC2 AK4458 codecs on audio board are able to play 16 channels, so extend the TDM mode constraint to 16 channels. Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2019-11-25MLK-20034-1: ASoC: imx-ak4458: constrain the mclk rate for DSDShengjiu Wang
When enable DSD for ak4458 with imx8mm platform, in DSD256 mode the mclk calculated from ak4458_get_mclk_rate is 256fs, but the codec require the mclk should be 512fs. so just hard code the clock to be 512fs in DSD mode. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25MLK-19573-3: ASoC: imx-ak4458: enable DSD playbackViorel Suman
Enable DSD playback. Signed-off-by: Viorel Suman <viorel.suman@nxp.com> (cherry picked from commit 351177200e66b980deae67b9d571d378f5b128a2)
2019-11-25MLK-18898-2: ASoC: imx-ak4458: refine mclk rate calculationViorel Suman
The existing implementation calculates mclk rate as function of audio sample rate multiplied to multiplier taken from Table 5. However this is not accurate for Manual Setting Mode - tables 3 & 4 from AK4458 RM defines rate (LRCK/FS) and frame width (MCLK/16fs..1152fs) ranges as parameters to calculate mclk frequency. Aside of this - adjust bclk:mclk ratio from machine driver as function of "compatible" id. Signed-off-by: Viorel Suman <viorel.suman@nxp.com> (cherry picked from commit 527b8b7032dcb75c14bb2790330ab96743d83b16)
2019-11-25MLK-18682-3: ASoC: imx-ak: enable both 8k and 11k range of ratesViorel Suman
SAI interface now is able to change at runtime the pll parent of the master clock, so enable both 8k and 11k range of rates for AK codecs. Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2019-11-25MLK-17509: ASoC: imx-ak4458: Set MCLK freq as a function of FSCosmin-Gabriel Samoila
According to AK4458 RM the MCLK freq need to be set externaly as function of LRCK frequency. Notice that multiplier is twice the value shown in RM since SAI MCLK must be at least double the BCLK. Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
2019-11-25MLK-17515-1: ASoC: imx-ak4458: add pdn gpio for machine driverShengjiu Wang
There is two ak4458 codecs which share some pdn gpio. If assign the pdn gpio to one codec, will cause the another codec error: ak4458 1-0012: Unable to sync registers 0x0-0x0. -6 The reason is that if the codec driver is trying to do regcache_sync, but another codec is resetting the pdn gpio in same time, the regcache_sync will fail. So Move the pdn gpio to machine driver, machine driver will control this gpio for two codecs. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Cosmin Samoila <cosmin.samoila@nxp.com>
2019-11-25MLK-15033-1: ASoC: fsl: Change rate constraints in TDM mode for AK4458Cosmin-Gabriel Samoila
When in TDM mode, change constraints for rate and allow only rates in [8KHz, 96KHz] due to the limitations of SAI master clock. If rate is higher than 96KHz, the TX rate cannot be obtained using only a 49MHz SAI clock. Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25MLK-15033: ASoC: fsl: Change constraints for AK4458Cosmin-Gabriel Samoila
Add 384KHz and 768KHz as supported rates and add different constraints for number of channels when in tdm mode. Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25MLK-15033: ASoC: fsl: Add TDM support in machine driver for AK4458Cosmin-Gabriel Samoila
TDM mode is enabled when "fsl,tdm" property is added in machine driver dts node. When using TDM mode, SND_SOC_DAIFMT_DSP_B format is used and the tdm slot_width is set to 32. Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25MLK-15033: ASoC: codecs: AK4458: Remove unsupported rates and channelsCosmin-Gabriel Samoila
Support only even number of channels greater than 2 and rates multiple of 8000. Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25MLK-17428-5: ASoC: imx-ak4458: support 768KHz sample rateShengjiu Wang
For 768kHz sample rate, the codec can't support 64fs mclk, only can support 32fs mclk, so we can't fix the slot_width to 32, which is for S32_LE, use params_physical_width(params) to instead of hard code. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25MLK-15033-2: ASoC: fsl: Add machine driver for AK4458Mihai Serban
Add machine driver for i.MX boards that have AK4458 DAC attached to SAI. Signed-off-by: Mihai Serban <mihai.serban@nxp.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> [ Aisheng: clean for a new base ] Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>