summaryrefslogtreecommitdiff
path: root/sound/soc/fsl
AgeCommit message (Collapse)Author
2015-01-16ASoC: eukrea-tlv320: Fix of_node_put() call with uninitialized objectTakashi Iwai
commit 077661b6ed24e530dabc9db3ab3ae48fbaf19679 upstream. The of_node_put() call in eukrea_tlv320_probe() may take an uninitialized pointer, as compiler spotted out: sound/soc/fsl/eukrea-tlv320.c:221:14: warning: 'ssi_np' may be used uninitialized in this function [-Wuninitialized] This patch adds the proper NULL initializations as a fix. (codec_np is also NULL initialized just for consistency.) Fixes: 66f232908de2 ('ASoC: eukrea-tlv320: Add DT support') Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-17Merge remote-tracking branches 'asoc/fix/adsp', 'asoc/fix/cs41l51', ↵Mark Brown
'asoc/fix/dpcm', 'asoc/fix/es8328', 'asoc/fix/fsl-asrc', 'asoc/fix/max98090', 'asoc/fix/rcar', 'asoc/fix/rockchip' and 'asoc/fix/rt5645' into asoc-linus
2014-10-28ASoC: fsl_asrc: Add reg_defaults for regmap to fix kernel dumpNicolin Chen
Kernel dump (WARN_ON) ocurred during system boot-up inside regmap_write(): ------------[ cut here ]------------ WARNING: CPU: 0 PID: 47 at kernel/locking/lockdep.c:2744 lockdep_trace_alloc+0xe8/0x108() DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags)) Modules linked in: CPU: 0 PID: 47 Comm: kworker/u2:2 Not tainted 3.18.0-rc1-10245-gb75d289-dirty #56 Workqueue: deferwq deferred_probe_work_func Backtrace: [<80012294>] (dump_backtrace) from [<80012578>] (show_stack+0x18/0x1c) r6:8097c73c r5:8097c73c r4:00000000 r3:be33ba80 [<80012560>] (show_stack) from [<806aac48>] (dump_stack+0x8c/0xa4) [<806aabbc>] (dump_stack) from [<8002a694>] (warn_slowpath_common+0x70/0x94) r6:80062838 r5:00000009 r4:bd827b30 r3:be33ba80 [<8002a624>] (warn_slowpath_common) from [<8002a6f0>] (warn_slowpath_fmt+0x38/0x40) r8:00000004 r7:00000001 r6:000080d0 r5:60000193 r4:bd826010 [<8002a6bc>] (warn_slowpath_fmt) from [<80062838>] (lockdep_trace_alloc+0xe8/0x108) r3:80831590 r2:8082e160 [<80062750>] (lockdep_trace_alloc) from [<800ea5dc>] (kmem_cache_alloc+0x28/0x134) r5:000080d0 r4:be001f00 [<800ea5b4>] (kmem_cache_alloc) from [<8038d72c>] (regcache_rbtree_write+0x15c/0x648) r10:00000000 r9:0000001c r8:00000004 r7:00000001 r6:00000000 r5:bd819a00 r4:00000000 r3:811aea88 [<8038d5d0>] (regcache_rbtree_write) from [<8038c4d8>] (regcache_write+0x5c/0x64) r10:be3f9f88 r9:00000000 r8:00000004 r7:00000001 r6:00000000 r5:00000001 r4:bd819a00 [<8038c47c>] (regcache_write) from [<8038b0dc>] (_regmap_raw_write+0x134/0x5f4) r6:be3f9f84 r5:00000001 r4:bd819a00 r3:00000001 [<8038afa8>] (_regmap_raw_write) from [<8038b610>] (_regmap_bus_raw_write+0x74/0x94) r10:00000000 r9:00000001 r8:be3fb080 r7:bd819a00 r6:00000001 r5:00000000 r4:bd819a00 [<8038b59c>] (_regmap_bus_raw_write) from [<8038a8b4>] (_regmap_write+0x60/0x9c) r6:00000001 r5:00000000 r4:bd819a00 r3:8038b59c [<8038a854>] (_regmap_write) from [<8038ba24>] (regmap_write+0x48/0x68) r7:bd81ad80 r6:00000001 r5:00000000 r4:bd819a00 [<8038b9dc>] (regmap_write) from [<80528f30>] (fsl_asrc_dai_probe+0x34/0x104) r6:bd888628 r5:be3fb080 r4:be3b4410 r3:be3b442c ------------[ dump end ]------------ ============================================================================= 2741 /* 2742 * Oi! Can't be having __GFP_FS allocations with IRQs disabled. 2743 */ 2744 if (DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))) 2745 return; ============================================================================= By looking at 2744 line, we can get that it's because regcache_rbtree_write() would call kmalloc() with GFP flag if it couldn't find an existing block to insert nodes while this kmalloc() call is inside a spin_lock_irq_save pair, i.e. IRQs disabled. Even though this may be a bug that should be fixed, I still try to send this patch as a quick fix (work around) since it does no harm to assign default values of every registers when using regcache. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-22ASoC: fsl: use strncpy() to prevent copying of over-long namesDaniel Mack
Use strncpy() instead of strcpy(). That's not a security issue, as the source buffer is taken from DT nodes, but we should still enforce bound checks. Spotted by Coverity. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-08Merge remote-tracking branches 'asoc/fix/88pm860x', 'asoc/fix/fsl', ↵Mark Brown
'asoc/fix/imx', 'asoc/fix/mc13783', 'asoc/fix/rockchip' and 'asoc/fix/simple' into asoc-linus
2014-10-07ASoC: imx-es8328: Fix of_node_put() call with uninitialized objectTakashi Iwai
The of_node_put() calls in imx_es8328_probe() may take uninitialized pointers when reached though the early error path. This patch adds the proper NULL initialization for fixing these. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-07ASoC: imx-es8328: Fix missing return code in imx_es8328_probe()Takashi Iwai
An error code was forgotten to be passed in the error path of imx_es8328_probe(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-06Merge remote-tracking branches 'asoc/topic/simple', 'asoc/topic/sirf', ↵Mark Brown
'asoc/topic/spdif', 'asoc/topic/ssm2602' and 'asoc/topic/ssm4567' into asoc-next
2014-10-06Merge remote-tracking branches 'asoc/topic/fsl-easi', 'asoc/topic/fsl-sai', ↵Mark Brown
'asoc/topic/fsl-ssi' and 'asoc/topic/intel' into asoc-next
2014-10-06Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/dmic', ↵Mark Brown
'asoc/topic/drivers', 'asoc/topic/es8328' and 'asoc/topic/fsl' into asoc-next
2014-10-06Merge remote-tracking branch 'asoc/topic/fsl-esai' into asoc-nextMark Brown
2014-10-03ASoC: fsl_spdif: Remove unused includes of linux/clk-private.hTomeu Vizoso
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-01ASoC: fsl: Do not force codecs selection by SND_SOC_FSL_ASOC_CARDFabio Estevam
The wm8962 driver uses the input subsystem, but it is selected by SND_SOC_FSL_ASOC_CARD, which can be built with CONFIG_INPUT disabled, resulting in this link error: ERROR: "input_event" [sound/soc/codecs/snd-soc-wm8962.ko] undefined! ERROR: "input_register_device" [sound/soc/codecs/snd-soc-wm8962.ko] undefined! ERROR: "devm_input_allocate_device" [sound/soc/codecs/snd-soc-wm8962.ko] undefined! Do not force the selection of the codecs by SND_SOC_FSL_ASOC_CARD to avoid such problem. Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-30ASoC: fsl_ssi: Remove unneeded 'i2s-slave' propertyFabio Estevam
There is no need to use 'i2s-slave' property, since master/slave configuration are passed via machine layer. This change does not break existing users because they do check for slave mode inside sound/soc/fsl/mpc8610_hpcd.c/p1022_ds.c/p1022_rdk.c Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Timur Tabi <timur@tabi.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-28Merge remote-tracking branches 'asoc/fix/atmel', 'asoc/fix/compress', ↵Mark Brown
'asoc/fix/core', 'asoc/fix/fsl-ssi' and 'asoc/fix/rt286' into asoc-linus
2014-09-22ASoC: fsl_ssi: fix kernel panic in probe functionMichael Trimarchi
code can raise a panic when the ssi_private->pdev is null [...] /* * If codec-handle property is missing from SSI node, we assume * that the machine driver uses new binding which does not require * SSI driver to trigger machine driver's probe. */ if (!of_get_property(np, "codec-handle", NULL)) goto done; [...] ssi_private->pdev = platform_device_register_data(&pdev->dev, name, 0, NULL, 0); [...] done: if (ssi_private->dai_fmt) _fsl_ssi_set_dai_fmt(ssi_private, ssi_private->dai_fmt); Proposal was to not use ssi_private->pdev->dev here but adding a new parameter of *dev pointer to this _set_dai_fmt() -- passing pdev->dev in probe() and cpu_dai->dev in fsl_ssi_set_dai_fmt(). Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Reported-by: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-17ASoC: fsl_ssi: refine ipg clock usage in this moduleShengjiu Wang
Check if ipg clock is in clock-names property, then we can move the ipg clock enable and disable operation to startup and shutdown, that is only enable ipg clock when ssi is working and keep clock is disabled when ssi is in idle. But when the checking is failed, remain the clock control as before. Tested-by: Markus Pargmann <mpa@pengutronix.de> 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-09-01ASoC: fsl-sai: using 'lsb-first' property instead of 'big-endian-data'.Xiubo Li
The 'big-endian-data' property is originally used to indicate whether the LSB firstly or MSB firstly will be transmitted to the CODEC or received from the CODEC, and there has nothing relation to the memory data. Generally, if the audio data in big endian format, which will be using the bytes reversion, Here this can only be used to bits reversion. So using the 'lsb-first' instead of 'big-endian-data' can make the code to be readable easier and more easy to understand what this property is used to do. This property used for configuring whether the LSB or the MSB is transmitted first for the fifo data. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-01Merge branch 'topic/fsl' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-fsl-sai
2014-09-01Merge branch 'topic/fsl' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-fsl-esai
2014-08-27ASoC: fsl-sai: Convert to use regmap framework's endianness method.Xiubo Li
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-27ASoC: fsl-spdif: Convert to use regmap framework's endianness method.Xiubo Li
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-27ASoC: fsl-esai: Convert to use regmap framework's endianness method.Xiubo Li
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-27ASoC: fsl-asrc: Convert to use regmap framework's endianness method.Xiubo Li
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-19ASoC: fsl-asoc-card: move 'config SND_SOC_FSL_ASOC_CARD' to 'if SND_IMX_SOC'Shengjiu Wang
Build kernel with SND_SOC_FSL_ASOC_CARD=m && SND_SOC_FSL_{SSI,SAI,ESAI}=y leads the following error: sound/built-in.o: In function `fsl_sai_probe': >> fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init' sound/built-in.o: In function `fsl_esai_probe': >> fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init' The config SND_SOC_FSL_ASOC_CARD is for IMX SOC, So move it under condition of 'if SND_IMX_SOC'. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-19ASoC: fsl: Fix building of imx-es8328 on PPCSean Cross
The imx-es8328 driver fails to build on PPC because it explicitly depends on SND_SOC_IMX_PCM_FIQ, which itself doesn't build on PPC. Instead, rely on the SND_SOC_FSL_SSI config option to pull in the necessary libraries. While we're at it, remove SND_SOC_FSL_UTILS, which also is not needed. Signed-off-by: Sean Cross <xobs@kosagi.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-18ASoC: fsl: fsl-asoc-card: Select SND_SOC_IMX_AUDMUXShengjiu Wang
Building kernel with SND_SOC_IMX_AUDMUX=n leads to the following error: sound/built-in.o: In function `fsl_asoc_card_probe': >> fsl-asoc-card.c:(.text+0x1467b5): undefined reference to `imx_audmux_v2_configure_port' >> fsl-asoc-card.c:(.text+0x1467d0): undefined reference to `imx_audmux_v2_configure_port' >> fsl-asoc-card.c:(.text+0x1467ed): undefined reference to `imx_audmux_v2_configure_port' >> fsl-asoc-card.c:(.text+0x146807): undefined reference to `imx_audmux_v2_configure_port' Update Kconfig to select SND_SOC_IMX_AUDMUX when SND_SOC_FSL_ASOC_CARD=y. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-18ASoC: fsl-asoc-card: Fix build warning for maybe-uninitializedShengjiu Wang
When build fsl-asoc-card as module, there is following error: sound/soc/fsl/fsl-asoc-card.c: In function 'fsl_asoc_card_probe': >> sound/soc/fsl/fsl-asoc-card.c:547:13: warning: 'asrc_np' may be used uninitialized in this function [-Wmaybe-uninitialized] of_node_put(asrc_np); ^ vim +/asrc_np +547 sound/soc/fsl/fsl-asoc-card.c 531 if (width == 24) 532 priv->asrc_format = SNDRV_PCM_FORMAT_S24_LE; 533 else 534 priv->asrc_format = SNDRV_PCM_FORMAT_S16_LE; 535 } 536 537 /* Finish card registering */ 538 platform_set_drvdata(pdev, priv); 539 snd_soc_card_set_drvdata(&priv->card, priv); 540 541 ret = devm_snd_soc_register_card(&pdev->dev, &priv->card); 542 if (ret) 543 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); 544 545 fail: 546 of_node_put(codec_np); > 547 of_node_put(asrc_np); 548 of_node_put(cpu_np); 549 550 return ret; 551 } 552 553 static const struct of_device_id fsl_asoc_card_dt_ids[] = { 554 { .compatible = "fsl,imx-audio-cs42888", }, 555 { .compatible = "fsl,imx-audio-sgtl5000", }, Add 'asrc_fail' branch for error jump after asrc_np initialized. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-16ASoC: fsl_sai: Set SYNC bit of TCR2 to Asynchronous ModeNicolin Chen
There is one design rule according to SAI's reference manual: If the transmitter bit clock and frame sync are to be used by both transmitter and receiver, the transmitter must be configured for asynchronous operation and the receiver for synchronous operation. And SYNC of TCR2 is a 2-width control bit: 00 Asynchronous mode. 01 Synchronous with receiver. 10 Synchronous with another SAI transmitter. 11 Synchronous with another SAI receiver. So the driver should have set SYNC bit of TCR2 to 0x0, and meanwhile set SYNC bit of RCR2 to 0x1 (Synchronous with transmitter). Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-16Merge branch 'fix/fsl-esai' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-fsl-esai
2014-08-16ASoC: fsl: add imx-es8328 machine driverSean Cross
This adds an initial machine driver for the ES8328 audio codec on Freescale boards. The driver supports headphones and an audio regulator for an onboard speaker amp. Signed-off-by: Sean Cross <xobs@kosagi.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-16ASoC: fsl_sai: Make Synchronous and Asynchronous modes exclusiveNicolin Chen
The previous patch (ASoC: fsl_sai: Add asynchronous mode support) added new Device Tree bindings for Asynchronous and Synchronous modes support. However, these two shall not be present at the same time. So this patch just simply makes them exclusive so as to avoid incorrect Device Tree binding usage. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-16ASoC: fsl_sai: Add asynchronous mode supportNicolin Chen
SAI supports these operation modes: 1) asynchronous mode Both Tx and Rx are set to be asynchronous. 2) synchronous mode (Rx sync with Tx) Tx is set to be asynchronous, Rx is set to be synchronous. 3) synchronous mode (Tx sync with Rx) Rx is set to be asynchronous, Tx is set to be synchronous. 4) synchronous mode (Tx/Rx sync with another SAI's Tx) 5) synchronous mode (Tx/Rx sync with another SAI's Rx) * 4) and 5) are beyond this patch because they are related with another SAI. As the initial version of this SAI driver, it supported 2) as default while the others were totally missing. So this patch just adds supports for 1) and 3). Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-16ASoC: fsl_sai: Set SYNC bit of TCR2 to Asynchronous ModeNicolin Chen
There is one design rule according to SAI's reference manual: If the transmitter bit clock and frame sync are to be used by both transmitter and receiver, the transmitter must be configured for asynchronous operation and the receiver for synchronous operation. And SYNC of TCR2 is a 2-width control bit: 00 Asynchronous mode. 01 Synchronous with receiver. 10 Synchronous with another SAI transmitter. 11 Synchronous with another SAI receiver. So the driver should have set SYNC bit of TCR2 to 0x0, and meanwhile set SYNC bit of RCR2 to 0x1 (Synchronous with transmitter). Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-16ASoC: fsl_sai: Initialize with software resetNicolin Chen
This patch adds software reset code in dai_probe() so as to make a true init by clearing SAI's internal logic, including the bit clock generation, status flags, and FIFO pointers. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-16ASoC: fsl_esai: refine esai for TDM supportShengjiu Wang
Original driver didn't store the number of slots, just fix the slot number to 2, use this default number to calculate bclk and pins for TX/RX. In this patch, add one parameter for slots, and update the calculation of bclk and pins of TX/RX. Then driver will be compatible with slots > 2 in TDM mode. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-16ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC supportNicolin Chen
The Freescale Generic ASoC Sound Card is a general ASoC DAI Link driver that can be used, ideally, for all Freescale CPU DAI drivers and external CODECs. The idea of this generic sound card is a bit like ASoC Simple Card. However, for Freescale SoCs (especially those released in recent years), most of them have ASRC (Documentation/devicetree/bindings/sound/fsl,asrc.txt) inside. And this is a specific feature that might be painstakingly controlled and merged into the Simple Card driver. So having this driver will allow all Freescale SoC users to benefit from the simplification to support a new card and the capability of wide sample rates support through ASRC. The driver is initially designed for sound card using I2S or PCM DAI formats. However, it's also possible to merge those non-I2S/PCM type sound cards, such as S/PDIF audio and HDMI audio, into this card as long as the merge will not break the original function and as long as there is something redundant that can be abstracted along with I2S type sound cards. As an initial version, it only supports three cards that I can test: imx-audio-cs42888, a new card that links ESAI with CS42888 CODEC imx-audio-sgtl5000, just like the old imx-sgtl5000.c driver imx-audio-wm8962, just like the old imx-wm8962.c driver The driver is also compatible with the old Device Tree bindings of WM8962 and SGTL5000. So we may consider to remove those two drivers after this driver is totally enabled. (It needs to be added into defconfig) Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-13ASoC: fsl_esai: refine esai for TDM supportShengjiu Wang
Original driver didn't store the number of slots, just fix the slot number to 2, use this default number to calculate bclk and pins for TX/RX. In this patch, add one parameter for slots, and update the calculation of bclk and pins of TX/RX. Then driver will be compatible with slots > 2 in TDM mode. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-13ASoC: fsl-esai: Revert .xlate_tdm_slot_mask() supportShengjiu Wang
This reverts commit a603c8ee526f5ea9ad9b40710308766299ad8a69. fsl_asoc_xlate_tdm_slot_mask() is different with snd_soc_xlate_tdm_slot_mask(). fsl_asoc_xlate_tdm_slot_mask() will set the enabled bit to 0, disabled bit to 1. snd_soc_xlate_tdm_slot_mask() will set the enabled bit to 1, disabled bit to 0. For esai when the bit value is 1, the slot is enabled, when the bit value is 0, the slot is disabled. If using fsl_asoc_xlate_tdm_slot_mask(), the esai will work abnormally. So revert this patch, make the esai use default function. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-07ASoC: fsl-ssi: Support for SND_SOC_DAIFMT_CBM_CFSFabio Falzoi
Add SND_SOC_DAIFMT_CBM_CFS support for Freescale architecture. Successfully tested on i.MX 6Quad Wandboard and UDOO boards connected to the pcm1792a codec. In CBM_CFS mode, when using a sample size of 16 bits, we cannot use CCSR_SSI_SCR_I2S_MODE_MASTER since we get a frame sync every 16 bits. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com> Tested-by: Angelo Adamo <adamo.a60@gmail.com> Acked-by: Timur Tabi <timur@tabi.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-04Merge remote-tracking branches 'asoc/topic/fsl', 'asoc/topic/fsl-asrc', ↵Mark Brown
'asoc/topic/fsl-spdif' and 'asoc/topic/imx-audmux' into asoc-next
2014-08-04Merge remote-tracking branch 'asoc/fix/fsl-sai' into asoc-linusMark Brown
2014-08-04ASoC: imx-audmux: Use uintptr_t for port numbersMark Brown
Since we pass the port number through file private data for debugfs we cast it to and from a pointer so use uintptr_t in order to ensure that the types are compatible, avoiding warnings on 64 bit platforms where pointers are 64 bit and unsigned integers 32 bit. Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-04ASoC: fsl_asrc: Don't access members of config before checking itNicolin Chen
sound/soc/fsl/fsl_asrc.c:250 fsl_asrc_config_pair() warn: variable dereferenced before check 'config' (see line 243) git remote add next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git remote update next git checkout 3117bb3109dc223e186302f5dc8ce9ed04adca90 vim +/config +250 sound/soc/fsl/fsl_asrc.c 237 */ 238 static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair) 239 { 240 struct asrc_config *config = pair->config; 241 struct fsl_asrc *asrc_priv = pair->asrc_priv; 242 enum asrc_pair_index index = pair->index; @243 u32 inrate = config->input_sample_rate, indiv; 244 u32 outrate = config->output_sample_rate, outdiv; 245 bool ideal = config->inclk == INCLK_NONE; 246 u32 clk_index[2], div[2]; 247 int in, out, channels; 248 struct clk *clk; 249 @250 if (!config) { 251 pair_err("invalid pair config\n"); 252 return -EINVAL; 253 } Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-04ASoC: fsl_sarc_dma: Check pair before using itNicolin Chen
The patch 3117bb3109dc: "ASoC: fsl_asrc: Add ASRC ASoC CPU DAI and platform drivers" from Jul 29, 2014, leads to the following Smatch complaint: sound/soc/fsl/fsl_asrc_dma.c:304 fsl_asrc_dma_shutdown() warn: variable dereferenced before check 'pair' (see line 302) sound/soc/fsl/fsl_asrc_dma.c 301 struct fsl_asrc_pair *pair = runtime->private_data; 302 struct fsl_asrc *asrc_priv = pair->asrc_priv; ^^^^^^^^^^^^^^^ Dereference. 303 304 if (pair && asrc_priv->pair[pair->index] == pair) ^^^^ Check. 305 asrc_priv->pair[pair->index] = NULL; 306 So we just let the driver check pair before using it. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-31ASoC: fsl_ssi: Add stream names for DPCM usageNicolin Chen
DPCM needs extra dapm routes in the machine driver to route audio between Front-End and Back-End. In order to differ the stream names in the route map from CODECs, we here add specific stream names to SSI driver so that we can implement ASRC via DPCM to it. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Timur Tabi <timur@tabi.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-31ASoC: fsl_spdif: Add stream names for DPCM usageNicolin Chen
DPCM needs extra dapm routes in the machine driver to route audio between Front-End and Back-End. In order to differ the stream names in the route map from CODECs, we here add specific stream names to SPDIF driver so that we can implement ASRC via DPCM to it. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-31ASoC: fsl_sai: Add stream names for DPCM usageNicolin Chen
DPCM needs extra dapm routes in the machine driver to route audio between Front-End and Back-End. In order to differ the stream names in the route map from CODECs, we here add specific stream names to SAI driver so that we can implement ASRC via DPCM to it. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-31ASoC: fsl_esai: Add stream names for DPCM usageNicolin Chen
DPCM needs extra dapm routes in the machine driver to route audio between Front-End and Back-End. In order to differ the stream names in the route map from CODECs, we here add specific stream names to ESAI driver so that we can implement ASRC via DPCM to it. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-31ASoC: fsl_asrc: fix an error code in fsl_asrc_probe()Dan Carpenter
There is a cut and paste bug so it returns success instead of the error code. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@linaro.org>