summaryrefslogtreecommitdiff
path: root/sound/soc/fsl
AgeCommit message (Collapse)AuthorFilesLines
2020-07-03ASoC: fsl: fsl_esai: fix kernel-docPierre-Louis Bossart1-14/+18
Fix W=1 warnings. Fix kernel-doc syntax and add missing parameters. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/20200702192141.168018-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03ASoC: fsl: fsl_asrc: fix kernel-docPierre-Louis Bossart1-18/+39
Fix W=1 warnings. fix kernel doc and describe arguments. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/20200702192141.168018-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03ASoC: fsl: fsl_spdif: fix kernel-docPierre-Louis Bossart1-2/+3
Fix W=1 warnings. kernel-doc syntax was not followed and missing parameter Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/20200702192141.168018-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03ASoC: fsl: fsl-asoc-card: fix kernel-docPierre-Louis Bossart1-12/+9
Fix W=1 warnings. Kernel-doc syntax was not properly used. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/20200702192141.168018-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03ASoC: fsl: fsl_ssi: fix kernel-docPierre-Louis Bossart1-26/+44
Fix W=1 warnings. The kernel-doc support is partial, add more descriptions and follow proper syntax Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/20200702192141.168018-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03ASoC: fsl: fsl_ssi_dbg: remove spurious kernel-doc comment startPierre-Louis Bossart1-2/+2
Fix W=1 warnings. There is no kernel-doc here. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/20200702192141.168018-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01ASoC: fsl_asrc: Add an option to select internal ratio modeShengjiu Wang1-2/+44
The ASRC not only supports ideal ratio mode, but also supports internal ratio mode. For internal rato mode, the rate of clock source should be divided with no remainder by sample rate, otherwise there is sound distortion. Add function fsl_asrc_select_clk() to find proper clock source for internal ratio mode, if the clock source is available then internal ratio mode will be selected. With change, the ideal ratio mode is not the only option for user. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/1593525367-23221-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01ASoC: fsl_sai: Refine regcache usage with pm runtimeShengjiu Wang1-1/+2
When there is dedicated power domain bound with device, after probing the power will be disabled, then registers are not accessible in fsl_sai_dai_probe(), so regcache only need to be enabled in end of probe() and regcache_mark_dirty should be moved to pm runtime resume callback function. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1593412953-10897-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29Merge branch 'for-5.8' of ↵Mark Brown2-13/+23
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.9
2020-06-24ASoC: fsl-asoc-card: Add WM8524 supportShengjiu Wang1-0/+10
WM8524 only supports playback mode, and only works at slave mode. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1592895167-30483-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23ASoC: fsl_easrc: Fix uninitialized scalar variable in fsl_easrc_set_ctx_formatShengjiu Wang1-1/+1
The "ret" in fsl_easrc_set_ctx_format is not initialized, then the unknown value maybe returned by this function. Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1592816611-16297-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enableShengjiu Wang1-2/+12
Fix unchecked return value for clk_prepare_enable, add error handler in fsl_mqs_runtime_resume. Fixes: 9e28f6532c61 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/5edd68d03def367d96268f1a9a00bd528ea5aaf2.1592888591.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23ASoC: fsl_mqs: Don't check clock is NULL before calling clk APIShengjiu Wang1-9/+4
Because clk_prepare_enable and clk_disable_unprepare should check input clock parameter is NULL or not internally, then we don't need to check them before calling the function. Fixes: 9e28f6532c61 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/743be216bd504c26e8d45d5ce4a84561b67a122b.1592888591.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22ASoC: soc-component: merge snd_soc_component_read() and ↵Kuninori Morimoto2-12/+3
snd_soc_component_read32() We had read/write function for Codec, Platform, etc, but these has been merged into snd_soc_component_read/write(). Internally, it is using regmap or driver function. In read case, each styles are like below regmap ret = regmap_read(..., reg, &val); driver function val = xxx->read(..., reg); Because of this kind of different style, to keep same read style, when we merged each read function into snd_soc_component_read(), we created snd_soc_component_read32(), like below. commit 738b49efe6c6 ("ASoC: add snd_soc_component_read32") (1) val = snd_soc_component_read32(component, reg); (2) ret = snd_soc_component_read(component, reg, &val); Many drivers are using snd_soc_component_read32(), and some drivers are using snd_soc_component_read() today. In generally, we don't check read function successes, because, we will have many other issues at initial timing if read function didn't work. Now we can use soc_component_err() when error case. This means, it is easy to notice if error occurred. This patch aggressively merge snd_soc_component_read() and _read32(), and makes snd_soc_component_read/write() as generally style. This patch do 1) merge snd_soc_component_read() and snd_soc_component_read32() 2) it uses soc_component_err() when error case (easy to notice) 3) keeps read32 for now by #define 4) update snd_soc_component_read() for all drivers Because _read() user drivers are not too many, this patch changes all user drivers. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/87sgev4mfl.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-19ASoC: fsl_spdif: Add pm runtime functionShengjiu Wang1-50/+67
Add pm runtime support and move clock handling there. Close the clocks at suspend to reduce the power consumption. fsl_spdif_suspend is replaced by pm_runtime_force_suspend. fsl_spdif_resume is replaced by pm_runtime_force_resume. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/579c0d71e976f34f23f40daa9f1aa06c4baca2f1.1592552389.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17ASoC: fsl_spdif: Add support for imx6sx platformShengjiu Wang1-5/+45
The one difference on imx6sx platform is that the root clock is shared with ASRC module, so we add a new flags "shared_root_clock" which means the root clock is not independent, then we will not do the clk_set_rate and clk_round_rate to avoid impact ASRC module usage. As add a new flags, we include the soc specific data struct. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/7a343edd5f8487abad248a0b862f45fd95067751.1592376770.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17ASoC: fsl-asoc-card: Add MQS supportShengjiu Wang1-21/+57
The MQS codec isn't an i2c device, so use of_find_device_by_node to get platform device pointer. Because MQS only support playback, then add a new audio map. And there maybe "model" property or no "audio-routing" property in devicetree, so add some enhancement for these two property. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/918505decb7f757f12c38059c590984f28d2f3a4.1592369271.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-16ASoC: fsl_ssi: Fix bclk calculation for mono channelShengjiu Wang1-4/+9
For mono channel, SSI will switch to Normal mode. In Normal mode and Network mode, the Word Length Control bits control the word length divider in clock generator, which is different with I2S Master mode (the word length is fixed to 32bit), it should be the value of params_width(hw_params). The condition "slots == 2" is not good for I2S Master mode, because for Network mode and Normal mode, the slots can also be 2. Then we need to use (ssi->i2s_net & SSI_SCR_I2S_MODE_MASK) to check if it is I2S Master mode. So we refine the formula for mono channel, otherwise there will be sound issue for S24_LE. Fixes: b0a7043d5c2c ("ASoC: fsl_ssi: Caculate bit clock rate using slot number and width") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/034eff1435ff6ce300b6c781130cefd9db22ab9a.1592276147.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: fsl_easrc: Fix "Function parameter not described" warningsShengjiu Wang1-4/+4
Obtained with: $ make W=1 sound/soc/fsl/fsl_easrc.c:403: warning: Function parameter or member 'easrc' not described in 'fsl_easrc_normalize_filter' sound/soc/fsl/fsl_easrc.c:403: warning: Function parameter or member 'infilter' not described in 'fsl_easrc_normalize_filter' sound/soc/fsl/fsl_easrc.c:403: warning: Function parameter or member 'outfilter' not described in 'fsl_easrc_normalize_filter' sound/soc/fsl/fsl_easrc.c:403: warning: Function parameter or member 'shift' not described in 'fsl_easrc_normalize_filter' Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/d166b868e6d294de47a89857be03758ec82a0a61.1591155860.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: fsl_easrc: Fix -Wunused-but-set-variableShengjiu Wang1-8/+3
Obtained with: $ make W=1 unsigned int int_bits; ^ struct device *dev; ^ struct device *dev; ^ Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_set_rs_ratio': sound/soc/fsl/fsl_easrc.c:182:15: warning: variable 'int_bits' set but not used [-Wunused-but-set-variable] sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_set_ctx_organziation': sound/soc/fsl/fsl_easrc.c:1204:17: warning: variable 'dev' set but not used [-Wunused-but-set-variable] sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_release_context': sound/soc/fsl/fsl_easrc.c:1294:17: warning: variable 'dev' set but not used [-Wunused-but-set-variable] Link: https://lore.kernel.org/r/91ceb59e3bce31c9e93abba06f5156692ff5c71e.1591155860.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: fsl_easrc: Fix -Wmissing-prototypes warningShengjiu Wang1-12/+11
Obtained with: $ make W=1 sound/soc/fsl/fsl_easrc.c:967:5: warning: no previous prototype for function 'fsl_easrc_config_context' [-Wmissing-prototypes] int fsl_easrc_config_context(struct fsl_asrc *easrc, unsigned int ctx_id) ^ sound/soc/fsl/fsl_easrc.c:967:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int fsl_easrc_config_context(struct fsl_asrc *easrc, unsigned int ctx_id) ^ static sound/soc/fsl/fsl_easrc.c:1128:5: warning: no previous prototype for function 'fsl_easrc_set_ctx_format' [-Wmissing-prototypes] int fsl_easrc_set_ctx_format(struct fsl_asrc_pair *ctx, ^ sound/soc/fsl/fsl_easrc.c:1128:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int fsl_easrc_set_ctx_format(struct fsl_asrc_pair *ctx, ^ static sound/soc/fsl/fsl_easrc.c:1201:5: warning: no previous prototype for function 'fsl_easrc_set_ctx_organziation' [-Wmissing-prototypes] int fsl_easrc_set_ctx_organziation(struct fsl_asrc_pair *ctx) ^ sound/soc/fsl/fsl_easrc.c:1201:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int fsl_easrc_set_ctx_organziation(struct fsl_asrc_pair *ctx) ^ static sound/soc/fsl/fsl_easrc.c:1245:5: warning: no previous prototype for function 'fsl_easrc_request_context' [-Wmissing-prototypes] int fsl_easrc_request_context(int channels, struct fsl_asrc_pair *ctx) ^ sound/soc/fsl/fsl_easrc.c:1245:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int fsl_easrc_request_context(int channels, struct fsl_asrc_pair *ctx) ^ static sound/soc/fsl/fsl_easrc.c:1290:6: warning: no previous prototype for function 'fsl_easrc_release_context' [-Wmissing-prototypes] void fsl_easrc_release_context(struct fsl_asrc_pair *ctx) ^ sound/soc/fsl/fsl_easrc.c:1290:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void fsl_easrc_release_context(struct fsl_asrc_pair *ctx) ^ static sound/soc/fsl/fsl_easrc.c:1317:5: warning: no previous prototype for function 'fsl_easrc_start_context' [-Wmissing-prototypes] int fsl_easrc_start_context(struct fsl_asrc_pair *ctx) ^ sound/soc/fsl/fsl_easrc.c:1317:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int fsl_easrc_start_context(struct fsl_asrc_pair *ctx) ^ static sound/soc/fsl/fsl_easrc.c:1335:5: warning: no previous prototype for function 'fsl_easrc_stop_context' [-Wmissing-prototypes] int fsl_easrc_stop_context(struct fsl_asrc_pair *ctx) ^ sound/soc/fsl/fsl_easrc.c:1335:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int fsl_easrc_stop_context(struct fsl_asrc_pair *ctx) ^ static sound/soc/fsl/fsl_easrc.c:1382:18: warning: no previous prototype for function 'fsl_easrc_get_dma_channel' [-Wmissing-prototypes] struct dma_chan *fsl_easrc_get_dma_channel(struct fsl_asrc_pair *ctx, ^ sound/soc/fsl/fsl_easrc.c:1382:1: note: declare 'static' if the function is not intended to be used outside of this translation unit struct dma_chan *fsl_easrc_get_dma_channel(struct fsl_asrc_pair *ctx, ^ static Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/ab1b83a56c71f4159a98e6da5602c2c36fe59f4d.1591155860.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-12ASoC: fsl_asrc_dma: Fix data copying speed issue with EDMAShengjiu Wang2-11/+17
With EDMA, there is two dma channels can be used for dev_to_dev, one is from ASRC, one is from another peripheral (ESAI or SAI). If we select the dma channel of ASRC, there is an issue for ideal ratio case, the speed of copy data is faster than sample frequency, because ASRC output data is very fast in ideal ratio mode. So it is reasonable to use the dma channel of Back-End peripheral. then copying speed of DMA is controlled by data consumption speed in the peripheral FIFO, Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/424ed6c249bafcbe30791c9de0352821c5ea67e2.1591947428.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-12ASoC: fsl_asrc_dma: Reuse the dma channel if available in Back-EndShengjiu Wang1-5/+20
The dma channel has been requested by Back-End cpu dai driver already. If fsl_asrc_dma requests dma chan with same dma:tx symlink, then there will be below warning with SDMA. [ 48.174236] fsl-esai-dai 2024000.esai: Cannot create DMA dma:tx symlink So if we can reuse the dma channel of Back-End, then the issue can be fixed. In order to get the dma channel which is already requested in Back-End. we use the exported two functions (snd_soc_lookup_component_nolocked and soc_component_to_pcm). If we can get the dma channel, then reuse it, if can't, then request a new one. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/3a79f0442cb4930c633cf72145cfe95a45b9c78e.1591947428.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-04ASoC: fsl-asoc-card: Defer probe when fail to find codec deviceShengjiu Wang1-1/+1
Defer probe when fail to find codec device, because the codec device maybe probed later than machine driver. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1591251930-4111-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-29ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failedXiyu Yang1-0/+1
fsl_asrc_dma_hw_params() invokes dma_request_channel() or fsl_asrc_get_dma_channel(), which returns a reference of the specified dma_chan object to "pair->dma_chan[dir]" with increased refcnt. The reference counting issue happens in one exception handling path of fsl_asrc_dma_hw_params(). When config DMA channel failed for Back-End, the function forgets to decrease the refcnt increased by dma_request_channel() or fsl_asrc_get_dma_channel(), causing a refcnt leak. Fix this issue by calling dma_release_channel() when config DMA channel failed. Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Link: https://lore.kernel.org/r/1590415966-52416-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25ASoC: fsl_asrc: Merge suspend/resume function to runtime_suspend/resumeShengjiu Wang1-43/+27
With dedicated power domain for asrc, power can be disabled after probe and pm runtime suspend, then the value of all registers need to be restored in pm runtime resume. So we can merge suspend/resume function to runtime_suspend/resume function and enable regcache only in end of probe. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1590141444-28668-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25ASoC: fsl: imx-audmix: Fix unused assignment to variable 'ret'Tang Bin1-2/+2
Omit unused initialized value, because 'ret' will be assigined by the function snd_soc_component_read(). Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20200513111408.11452-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25ASoC: fsl_asrc: Fix -Wmissing-prototypes warningshengjiu wang1-2/+2
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 sound/soc/fsl/fsl_asrc.c:557:18: warning: no previous prototype for function 'fsl_asrc_get_dma_channel' [-Wmissing-prototypes] struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir) ^ sound/soc/fsl/fsl_asrc.c:557:1: note: declare 'static' if the function is not intended to be used outside of this translation unit struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir) ^ static Fixes: be7bd03f0201 ("ASoC: fsl_asrc: Move common definition to fsl_asrc_common") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: shengjiu wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1590397412-12966-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-19ASoC: fsl_micfil: Do not pass irq numbers in commentsFabio Estevam1-2/+2
The IRQ numbers may change depending on the SoC, so do not pass the IRQ numbers in the comments. Signed-off-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20200518185448.6116-2-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-19ASoC: fsl_micfil: Remove unneeded ifdef'sFabio Estevam1-4/+0
There is no need to use ifdef's around the power managament related functions, as they are already using the __maybe_unused notation. Signed-off-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20200518185448.6116-1-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-19ASoC: fsl_asrc: Set ASR76K and ASR56K based on processing clockShengjiu Wang1-5/+10
The processing clock is different for platforms, so it is better to set ASR76K and ASR56K based on processing clock, rather than hard coding the value for them. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Signed-off-by: Mihai Serban <mihai.serban@nxp.com> Link: https://lore.kernel.org/r/1589278979-31008-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18Merge series "ASoC: cleanup DAI/Component activity" from Kuninori Morimoto ↵Mark Brown2-3/+3
<kuninori.morimoto.gx@renesas.com>: Hi Mark These are v3 of DAI/Component activity cleanup. This patch-set exchanges soc-dapm.c :: snd_soc_dai_link_event_xxx() behavior which updates dai->active but not cares other actives. But I think original code was wrong. So, I believe these works correctly, but maybe need some tests or deep review. v1 -> v2 - function naming "activity" -> "active" v2 -> v3 - macro -> inline function - added Reviewed-by from Ranjani, Acked-by from Peter Link: https://lore.kernel.org/r/875zd39frp.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87blmq9alx.wl-kuninori.morimoto.gx@renesas.com Kuninori Morimoto (21): ASoC: soc-pcm: replace snd_soc_runtime_activate()/deactivate() to macro ASoC: soc-dai: add snd_soc_dai_action() ASoC: soc-dapm: use snd_soc_dai_activate()/deactivate() ASoC: soc-dai: add snd_soc_dai_active() ASoC: soc-component: add snd_soc_component_active() ASoC: soc-dai: add snd_soc_dai_stream_active() ASoC: use snd_soc_xxx_active() ASoC: atomel: use snd_soc_xxx_active() ASoC: bcm: use snd_soc_xxx_active() ASoC: cirrus: use snd_soc_xxx_active() ASoC: codecs: use snd_soc_xxx_active() ASoC: fsl: use snd_soc_xxx_active() ASoC: intel: use snd_soc_xxx_active() ASoC: jz4740: use snd_soc_xxx_active() ASoC: mediatek: use snd_soc_xxx_active() ASoC: meson: use snd_soc_xxx_active() ASoC: pxa: use snd_soc_xxx_active() ASoC: ti: use snd_soc_xxx_active() ASoC: uniphier: use snd_soc_xxx_active() ASoC: dwc: use snd_soc_xxx_active() ASoC: cleanup dai / component active code include/sound/soc-component.h | 6 +- include/sound/soc-dai.h | 21 +++++- include/sound/soc.h | 15 ++++- sound/soc/atmel/atmel_ssc_dai.c | 4 +- sound/soc/bcm/bcm2835-i2s.c | 6 +- sound/soc/bcm/cygnus-ssp.c | 4 +- sound/soc/cirrus/ep93xx-i2s.c | 4 +- sound/soc/codecs/adav80x.c | 4 +- sound/soc/codecs/arizona.c | 2 +- sound/soc/codecs/cs4271.c | 4 +- sound/soc/codecs/madera.c | 2 +- sound/soc/codecs/max98090.c | 6 +- sound/soc/codecs/tlv320aic23.c | 2 +- sound/soc/codecs/tlv320dac33.c | 2 +- sound/soc/codecs/uda1380.c | 2 +- sound/soc/codecs/wl1273.c | 2 +- sound/soc/codecs/wm8711.c | 2 +- sound/soc/codecs/wm8753.c | 4 +- sound/soc/dwc/dwc-i2s.c | 2 +- sound/soc/fsl/fsl_esai.c | 2 +- sound/soc/fsl/fsl_spdif.c | 4 +- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 14 ++-- sound/soc/jz4740/jz4740-i2s.c | 8 +-- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 8 +-- sound/soc/meson/axg-tdm-interface.c | 2 +- sound/soc/pxa/pxa-ssp.c | 8 +-- sound/soc/pxa/pxa2xx-i2s.c | 2 +- sound/soc/soc-compress.c | 4 +- sound/soc/soc-core.c | 11 +-- sound/soc/soc-dai.c | 23 +++++++ sound/soc/soc-dapm.c | 8 +-- sound/soc/soc-pcm.c | 70 +++++++------------- sound/soc/ti/davinci-mcasp.c | 2 +- sound/soc/ti/omap-dmic.c | 4 +- sound/soc/ti/omap-mcbsp.c | 4 +- sound/soc/ti/omap-mcpdm.c | 8 +-- sound/soc/uniphier/aio-cpu.c | 4 +- 37 files changed, 155 insertions(+), 125 deletions(-) -- 2.17.1
2020-05-18ASoC: fsl_micfil: Fix unused assignment in fsl_set_clock_params()Tang Bin1-1/+1
Delete unused initialized value of 'ret', because it will be assigned by the function fsl_micfil_set_mclk_rate(). Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20200518110040.18036-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: fsl_micfil: Fix indentation to put on one line affected codeTang Bin1-2/+1
In the function fsl_micfil_startup(), the two lines of dev_err() can be shortened to one line. Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20200518105951.19200-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: fsl: use snd_soc_xxx_active()Kuninori Morimoto2-3/+3
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/87v9ky58iy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-15ASoC: fsl_esai: introduce SoC specific dataShengjiu Wang1-9/+37
Introduce a SoC specific data structure which contains the differences between the different SoCs. This makes it easier to support more differences without having to introduce a new if/else each time. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/c188279975bd216995904f9bf8a84c7887b759a0.1589537601.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-07soc: fsl_asrc: Make some functions staticChenTao1-2/+2
Fix the following warning: sound/soc/fsl/fsl_asrc.c:157:5: warning: symbol 'fsl_asrc_request_pair' was not declared. Should it be static? sound/soc/fsl/fsl_asrc.c:200:6: warning: symbol 'fsl_asrc_release_pair' was not declared. Should it be static? Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: ChenTao <chentao107@huawei.com> Link: https://lore.kernel.org/r/20200507022959.183739-1-chentao107@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-29ASoC: fsl_easrc: mark PM functions __maybe_unusedArnd Bergmann1-4/+2
ifdefs are hard, and in this driver the suspend/resume functions are the only callers of some other helpers that trigger a harmless warning when CONFIG_PM is disabled: sound/soc/fsl/fsl_easrc.c:1807:12: warning: 'fsl_easrc_get_firmware' defined but not used [-Wunused-function] 1807 | static int fsl_easrc_get_firmware(struct fsl_asrc *easrc) | ^~~~~~~~~~~~~~~~~~~~~~ sound/soc/fsl/fsl_easrc.c:303:12: warning: 'fsl_easrc_resampler_config' defined but not used [-Wunused-function] 303 | static int fsl_easrc_resampler_config(struct fsl_asrc *easrc) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Remove the #ifdef and just mark the callers as __maybe_unused to suppress the warnings altogether. Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/20200428212847.2926376-1-arnd@arndb.de Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-28Merge branch 'for-5.7' of ↵Mark Brown1-0/+4
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.8
2020-04-27ASoC: fsl_easrc: Check for null pointer before dereferencing "ctx" in ↵Shengjiu Wang1-2/+7
fsl_easrc_hw_free() The patch 955ac624058f: "ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers" from Apr 16, 2020, leads to the following Smatch complaint: sound/soc/fsl/fsl_easrc.c:1529 fsl_easrc_hw_free() warn: variable dereferenced before check 'ctx' (see line 1527) sound/soc/fsl/fsl_easrc.c 1526 struct fsl_asrc_pair *ctx = runtime->private_data; 1527 struct fsl_easrc_ctx_priv *ctx_priv = ctx->private; ^^^^^ Dereference 1528 1529 if (ctx && (ctx_priv->ctx_streams & BIT(substream->stream))) { ^^^ This check is too late, to prevent a NULL dereference. 1530 ctx_priv->ctx_streams &= ~BIT(substream->stream); 1531 fsl_easrc_release_context(ctx); Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/d23c939f1c9eeb3fce34b6c34d44e2d6156f663a.1587799355.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-27ASoC: fsl_esai: Disable exception interrupt before scheduling taskletShengjiu Wang1-0/+4
Disable exception interrupt before scheduling tasklet, otherwise if the tasklet isn't handled immediately, there will be endless xrun interrupt. Fixes: 7ccafa2b3879 ("ASoC: fsl_esai: recover the channel swap after xrun") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/a8f2ad955aac9e52587beedc1133b3efbe746895.1587968824.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-23ASoC: fsl_easrc: fix spelling mistake "prefitler" -> "prefilter"Colin Ian King1-1/+1
There is a spelling mistake in a deb_dbg message, fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20200423083922.8159-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-21ASoC: fsl_easrc: Add EASRC ASoC CPU DAI driversShengjiu Wang4-0/+2778
EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module found on i.MX8MN. It is different with old ASRC module. The primary features for the EASRC are as follows: - 4 Contexts - groups of channels with an independent time base - Fully independent and concurrent context control - Simultaneous processing of up to 32 audio channels - Programmable filter charachteristics for each context - 32, 24, 20, and 16-bit fixed point audio sample support - 32-bit floating point audio sample support - 8kHz to 384kHz sample rate - 1/16 to 8x sample rate conversion ratio Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/260d7a9fbddf9fa90760d30095df60a4c25fd0a1.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-21ASoC: fsl_asrc: Move common definition to fsl_asrc_commonShengjiu Wang4-109/+178
There is a new ASRC included in i.MX serial platform, there are some common definition can be shared with each other. So move the common definition to a separate header file. And add fsl_asrc_pair_priv and fsl_asrc_priv for the variable specific for the module, which can be used internally. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/7106993928ea9e9720e6b42ec601871103155b1c.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-21ASoC: fsl_asrc: Support new property fsl,asrc-formatShengjiu Wang3-20/+40
In order to align with new ESARC, we add new property fsl,asrc-format. The fsl,asrc-format can replace the fsl,asrc-width, driver can accept format from devicetree, don't need to convert it to format through width. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/2be9664768f32982ba4f71e49749f7390096ac9f.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-21ASoC: fsl-asoc-card: Support new property fsl, asrc-formatShengjiu Wang1-9/+15
In order to align with new ESARC, we add new property fsl,asrc-format. The fsl,asrc-format can replace the fsl,asrc-width, driver can accept format from devicetree, don't need to convert it to format through width. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/02f53d5512b9acd3492e2acdd5e0ba3113f18009.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-21ASoC: fsl_asrc: rename asrc_priv to asrcShengjiu Wang3-163/+163
In order to move common structure to fsl_asrc_common.h we change the name of asrc_priv to asrc, the asrc_priv will be used by new struct fsl_asrc_priv. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/722142c2e1b57a95f911db1d42d901b88fc283d6.1587038908.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-15ASoC: fsl_micfil: Omit superfluous error message in fsl_micfil_probe()Tang Bin1-3/+1
In the function fsl_micfil_probe(), when get irq failed, the function platform_get_irq() logs an error message, so remove redundant message here. Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com> Link: https://lore.kernel.org/r/20200415044513.17492-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-03-27ASoC: fsl: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointerKuninori Morimoto15-43/+43
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/87v9mvir89.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-19ASoC: fsl: fsl_asrc_dma: use for_each_pcm_streams() macroKuninori Morimoto1-2/+2
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/87wo8laa8p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>