summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_asrc.h
AgeCommit message (Collapse)Author
2019-11-25MLK-21940-1: ASoC: fsl_asrc: Update mxc_asrc uapiShengjiu Wang
In order to support the new ASRC in i.MX815, we update the user api file mxc_asrc.h. The reason is that the new ASRC support more sample width, and support endianness, sign, float format, iec958 format setting, All these type can be expressed by snd_pcm_format_t type. So we use the in(out)put_format to instead the in(out)put_word_width. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Viorel Suman <viorel.suman@nxp.com> (cherry picked from commit b95c32c4d4b51e3e55e1e28269a0e8bce0a04f98)
2019-11-25MLK-19151: ASoC: fsl_asrc: fix dma timeout issue for imx8qxpShengjiu Wang
In the imx8qxp, the DMA is EDMA, which require the buffer size should be divided by burst size with no remainder, otherwise the remainder is not transferred by EDMA, so the input buffer is not consumed by ASRC, then there will be dma output timeout issue. This behavior is different with SDMA. This patch is to change the input burst size to be 1 to avoid the issue, and refine the last_period_size for output buffer. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25MLK-18875: ASoC: fsl_asrc_m2m: refine the last period sizeShengjiu Wang
The output size of asrc for a dedicate input is uncertain. For example, if the input size is 1k, the output ratio is 2, so the output size should be 2k. but the actual output size is not 2k, is less than 2k. if we set the dma size to be 2k, the dma can't get enough data that can't finish the transmission, then there will be "output DMA task timeout" So we need to set the dma size a proper value but we don't know how many data less than expected. so we defined the last period size for assumption of reduced size. The last period size should not be too large, if it is large there will be "input DMA task timeout" The reason is the output FIFO is full, which will block the input data comsumption. In this patch, the last period size is set to the difference of configured buffer size and the expected output size, plus a fix size. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
2019-11-25MLK-18737: move 'pair_streams' to 'struct fsl_asrc_pair'Viorel Suman
For multi p2p instance an ASRC device cannot be closed successfully when two threads plays streams simultaneously on same ASRC device. 'pair_streams' variable shall be moved to 'struct fsl_asrc_pair' for multi p2p instance in order to handle pair release properly. Signed-off-by: Viorel Suman <viorel.suman@nxp.com> Suggested-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25MLK-16956: ASoC: fsl_asrc: fix error with S24_3LE format bitstreamShengjiu Wang
The error is "aplay: pcm_write:2023: write error: Input/output error" query the caps of dma, then update the hw parameters according the caps. for EDMA can't support 24bit sample, but we didn't add any constraint, that cause issues. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25MLK-16839-1: ASoC: fsl_asrc: selec a proper clock source from the clock listShengjiu Wang
In internal ratio mode, when the clock rate can't be divided with no remainder, The final convert ratio is not as expected, there is distortion in output data. So need to select a proper clock source for this mode, if can't find a good clock source, then swith to ideal ratio mode. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-11-25MLK-13945-3: ASoC: fsl_asrc: support two asrc devicesShengjiu Wang
In imx8qm, there is two asrc devices, so using global structure "miscdevice" will cause error. Each instance should have their own structure. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
2019-11-25ASoC: fsl: refine the asrc driver for imx8qmViorel Suman
The clock source of ASRC in imx8qm is changed. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2019-11-25MLK-12771: ASoC: fsl_asrc: fix dma task timeout issueShengjiu Wang
The test case is one p2p playback + two m2m converter running simultaneously. There are three root cause for this issue: 1. hw_free() of p2p may be called twice in the end, which cause release twice of one pair, if another pair request is called between this two release, there will be issue. 2. In m2m close(), the asrc_priv->pair[i] will be set NULL twice, which is same issue as 1. 3. when output rate is more than eight multiple of input rate for m2m, the last_period_size should be larger. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2019-11-25MLK-12794: ASoC: fsl_asrc: fix underrun issue when convert 192k to 96kHz.Shengjiu Wang
The maximum divider of asrc clock is 1024, but there is no judgement for this limitaion in driver, which may cause the divider setting not correct. When IDEAL_RATIO_RATE 200kHZ, the cost time of conversion from 192kHz to 96kHz is 24ms every 1024 sample, but these sample's playback time is 1024/96=11ms, so there will be underrun. So need to enlarge this RATE. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2019-11-25MLK-10048-5: ASoC: fsl_asrc: underrun for playback 192k, 6ch p2p case.Shengjiu Wang
For p2p output, the output divider should align with the output sample rate, if use the Ideal sample rate, there will be a lot of overload, which will cause underrun. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> (cherry picked from commit 5ab043f1a020ae8c3aeb3d91f6894bbd6a6ec147)
2019-11-25MLK-10048-4: ASoC: fsl_asrc: fix dma task timeout issue when use 3 instanceShengjiu Wang
Merged from 49108fcf7b79ed77d34be33b53a3964b2ac27204 1. Watermark level in sdma use byte as its unit. but asrc driver use word, there is mismatch between them. Here fix this issue and sdma can work more efficiency. 2. Enlarge the larst_period_size, when use small size, for some case, the dma task will timeout, because sdma has no much data for output. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> (cherry picked from commit 8a96e09e265294f396bd3af29b429e4b7bdff461)
2019-11-25MLK-11398: ASoC: fsl_asrc: Add Memory to Memory supportShengjiu Wang
cherry-pick below patch from v3.14.y: ENGR00330403-4: ASoC: fsl_asrc: Add Memory to Memory support ASRC M2M function is not able to put upstream due to its self-designed ioctl protocol. So I just make a single patch for it and make it merge into P2P driver as simply as possible. The patch can only be maintained internally unless some one designs a new protocol or implement the originally protocol by using some common approach provided by Linux Kernel. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Fixed missing includes in 4.14 rebase Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
2018-07-24ASoC: fsl_asrc: Switch to SPDX identifierFabio Estevam
Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-02-12ASoC: fsl: asrc: replace platform to componentKuninori Morimoto
Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-05Merge remote-tracking branches 'asoc/topic/fsl', 'asoc/topic/fsl-ssi', ↵Mark Brown
'asoc/topic/fsl_asrc' and 'asoc/topic/hdac_hdmi' into asoc-next
2017-12-06ASoC: fsl_asrc: protect macro argumentStefan Agner
Protect macro argument with parentheses to avoid ambiguity. This fixes a warning seen with clang: warning: logical not is only applied to the left hand side of this comparison Signed-off-by: Stefan Agner <stefan@agner.ch> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-11-29ASoC: fsl_asrc: Fix typo in a field defineNicolin Chen
ASRFSTi_IAEi has an 11-bit offset as its _SHIFT macro defines. So this patch just fixes that. Reported-by: Laurent Charpentier <laurent.charpentier@nxp.com> Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-05ASoC: fsl_asrc: sound is wrong after suspend/resumeZidan Wang
The register ASRCFG is volatile, but some bits need to be recovered after suspend/resume. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-25ASoC: fsl_asrc: spba clock is needed by asrc deviceShengjiu Wang
ASRC need to enable the spba clock, when sdma is using share peripheral script. In this case, there is two spba master port is used, if don't enable the clock, the spba bus will have arbitration issue, which may cause read/write wrong data from/to ASRC registers Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-12-30ASoC: fsl_asrc: Use dev_name() for registering the irqFabio Estevam
The 'name' array is currently stored inside the fsl_asrc private structure only for registering the interrupt name. This can be simplified by registering it with dev_name() instead. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-07-29ASoC: fsl_asrc: Add ASRC ASoC CPU DAI and platform driversNicolin Chen
The Asynchronous Sample Rate Converter (ASRC) converts the sampling rate of a signal associated with an input clock into a signal associated with a different output clock. The driver currently works as a Front End of DPCM with other Back Ends DAI links such as ESAI<->CS42888 and SSI<->WM8962 and SAI. It converts the original sample rate to a common rate supported by Back Ends for playback while converts the common rate of Back Ends to a desired rate for capture. It has 3 pairs to support three different substreams within totally 10 channels. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Reviewed-by: Varka Bhadram <varkabhadram@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>