aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
Commit message (Collapse)AuthorAge
...
* ASoC: soc-pcm: move DAIs parameters cleaning into hw_free()Nicolin Chen2014-04-16
| | | | | | | | | | | | | | | | | | | | | We're now applying soc_hw_params_symmetry() to reject unmatched parameters while we clear parameters in soc_pcm_close(). So here's a use case might be broken by this mechanism: aplay -Dhw:0 44100.wav 48000.wav 32000.wav In this case, we call soc_pcm_open()->soc_pcm_hw_params()->soc_pcm_hw_free() ->soc_pcm_hw_params()->soc_pcm_hw_free()->soc_pcm_close() in order. As we only clear parameters in soc_pcm_close(). The parameters would be remained in the system even if the playback of 44100.wav is finished. Thus, this patch is trying to move parameters cleaning into hw_free() so that the system can continue to serve this kind of use case. Also, since we set them in hw_params(), it should be better to clear them in hw_free() for symmetry. Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> (cherry picked from commit d3383420c969c25deffd33270ebe321e8401191a)
* ASoC: soc-pcm: add symmetry for channels and sample bitsNicolin Chen2014-04-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some SoCs can only work in mono or stereo mode at one time. So if we let them capture a mono stream while playing a stereo stream, there might be a problem occur to one of these two streams: double paced or slowed down. In soc-pcm.c, we have soc_pcm_apply_symmetry() to apply the rate symmetry. But we don't have one for channels. Likewise, we can treat symmetric_rate as a solution for those SoCs or CODECs which can not handle asymmetrical LRCLK. But it's also impossible for them to handle asymmetrical BCLK. And accodring to BCLK = LRCLK * channel number * slot size(fixed or sample bits), sample bits might also be a problem if they are not using a fixed slot size. Thus, this patch applys symmetry for channels and sample bits. Meanwhile, there might be a race between two substreams if starting simultaneously. Previously, we only added warning to compalin but still using conservative way to let it carry on. However, this patch rejects the second stream with any unmatched parameter to make sure the first existing stream won't be broken. Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> (cherry picked from commit 3635bf09a89cf92b80ac44198c5c8f0989624ea6)
* ENGR00290229 ASoC: fsl: Drop snd_soc_dapm_sync() in imx-wm8962Nicolin Chen2014-04-16
| | | | | | | | | | | As DAPM would do the sync() for us, we don't need to handle it by ourselves. And leaving snd_soc_dapm_sync() here is dangerous because it would disable the clock from WM8962 during the short period of the output route changing since we don't leave the alternative route's enanbling to this machine driver but to DAPM core. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00289643-2 ASoC: fsl: Add missing spba clock for esai and spdifNicolin Chen2014-04-16
| | | | | | | | Both esai and spdif are using SDMA script to transmit and receive data while the essential spba clock is missed in the current two drivers. Thus add them. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00264453 asoc: when codec probe failed, alsa return RETRY error.Shengjiu Wang2014-04-16
| | | | | | | | | | 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. Add for cs42888 and si476x. update dts file for sound-fm. Signed-off-by: Shengjiu Wang <b02247@freescale.com>
* ENGR00288421-3 ASoC: fsl_ssi: Move i2s_mode from static to ssi_privateNicolin Chen2014-04-16
| | | | | | | | | It's no good to use static variable because there might be several drivers calling the function and the value would be overwritten by all of them. Thus we move it into ssi_private. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00288421-2 ASoC: fsl_spdif: Ignore system clock due to potential riskNicolin Chen2014-04-16
| | | | | | | | | | | The current clock selecting mechanism would choose a clock and set its rate later when using it. It might be feasible for other clock sources but not for sysclk -- ipg clock. Changing ipg clock rate in specific driver would be a dangerous operation, so we here ingore the sysclk and will restore it after we accomplish a better mechanism. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00288421-1 ASoC: fsl_spdif: Use correct clock for Rx clock rate calculationNicolin Chen2014-04-16
| | | | | | | | | According to the Reference Manual, we should use system clock to calculate rx clock rate instead of spdif own clock. Thus add system clock to spdif driver and replace the incorrect one in rate calculation. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00286961-5 ASoC: fsl: set tdm slot number for imx-si476xNicolin Chen2014-04-16
| | | | | | | | | When using SSI I2S master mode, we need to decide the time slot number. Because we use SSI normal mode to trick I2S signal, we here need to set time slot number to two (left/right). Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00286961-4 ASoC: fsl_ssi: add monaural audio supportNicolin Chen2014-04-16
| | | | | | | | | We use SSI's normal mode to trick I2S signal by fetching data only from one side of time slot so that we can purely get or put the monaural audio data. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00286961-2 ASoC: fsl_ssi: Move DC configuration to set_dai_tdm_slot()Nicolin Chen2014-04-16
| | | | | | | | | DC indicates Frame Rate Divider. By setting it we can get a desired time slot numbers. Thus it should be more plausible to set DC in set_dai_tdm_slot() instead of hw_params(). Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00286961-1 ASoC: fsl_ssi: add period size constraint for dual fifo modeNicolin Chen2014-04-16
| | | | | | | | | When using dual fifo mode, we need to keep period size as an even number due to behavior of SDMA script. Otherwise, it might neglect the 2nd fifo at each period when its size appears to be an odd number. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ASoC: generic-dmaengine-pcm: Use SNDRV_DMA_TYPE_DEV_IRAM as defaultNicolin Chen2014-04-16
| | | | | | | | | | | | | When allocating memory space for DMA buffer, use on-chip internal SRAM as default choice to save power. Since the core would allocate memory from traditional external memory if iram allocation failed, we don't need to worry about any side effect. Signed-off-by: Nicolin Chen <b42378@freescale.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Mark Brown <broonie@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> (cherry picked from commit ca2b029515b4a81bbedcffc69a5d9574bb5ba475)
* ENGR00283079-1 ASoC: fsl: Implement different DMA buffer sizesNicolin Chen2014-04-16
| | | | | | | | | Each CPU DAI driver has its own defined DMA buffer size, so this patch just drops the original one that uses a fixed size for all drivers and implements a different DMA buffer size to each driver. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ASoC: fsl_spdif: Remove redundant semicolonSachin Kamat2014-04-16
| | | | | | | | Redundant semicolon at the end of brace is removed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ASoC: fsl_spdif: Select regmap-mmioMark Brown2014-04-16
| | | | | | | | | | The S/PDIF driver needs regmap so select it to make sure it gets included in the build. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Acked-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00281859-3 ASoC: fsl: Prepare dmaengine before submit itNicolin Chen2014-04-16
| | | | | | | | | | | | | | | | ASRC and HDMI audio might meet unexpected stop, 'ctrl+z' for example, and then disable its sdma channel. But after 'fg' resume, because sdma channel's status has already been set into DMA_ERROR, we need to prepare dmaengine again to clear its error state, otherwise sdma driver would bypass its channel enabling and 'Input/Output error' would happen to ALSA lib. The combined prepare and submit are also being used in soc-dmaengine, the common ASoC dmaengine driver. And since we already use a proper way to handle sdma channel status, there's no need to make an exception for HDMI any more, so drop it. Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00281859-2 ASoC: fsl: Use priv instead of params for imx-hdmi-dmaNicolin Chen2014-04-16
| | | | | | 'params' might be confused with snd_pcm_hw_params, so use 'priv' instead. Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00280852 ASoC: fsl: Use generic function dmaengine_prep_dma_cyclic()Nicolin Chen2014-04-16
| | | | | | Use generic dmaengine_prep_dma_cyclic() in imx-hdmi-dma.c and fsl-asrc.c Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00279368-2 ASoC: fsl: Add missing snd_soc_pm_ops to all machine driversNicolin Chen2014-04-16
| | | | | | | | | | Alsa machine drivers need snd_soc_pm_ops to support normal suspend/resume feature, thus add this to all machine drivers. Also add missing SUSPEND and RESUME cases to trigger() in fsl_ssi.c Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00279368-1 ASoC: fsl: Drop useless resume function in WM8962 machine driverNicolin Chen2014-04-16
| | | | | | | | The resume function is useless for the driver because registered jack pin has already handled suspend/resume cases, thus drop it. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00278967 ASoC: fsl: Fix null pointer when rmmod snd-soc-imx-hdmiNicolin Chen2014-04-16
| | | | | | | | | | | When rmmod snd-soc-imx-hdmi if loadable module feature of HDMI audio is being used, there would be a kernel dump promt: Unable to handle kernel NULL pointer dereference at virtual address This was caused by inappropriate priv pointer fetching, thus fix it. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00278382 ASoC: fsl: Fix hdmi audio loadable module failureNicolin Chen2014-04-16
| | | | | | | | | | | | | | | | | Use platform_device_add() which can pass drvdata correctly: previously we register the dma_dev first and pass its drvdata, but this would fail to pass its drvdata correctly when using loadable module, because the probe() hdmi dma driver would be executed right after the register() and before set_drvdata(). Then the drvdata actually failed to be set to the hdmi dma driver. While platform_device_add() has no such issue because it would finish the set_drvdata() before its execution. This patch also move codec driver registering into CPU DAI driver. When using autoload module, the codec driver would alwasy fail to be detected due to its registering located in manchine driver. Thus move this to CPU DAI driver. Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ASoC: fsl: Drop SND_SOC_FSL_UTILS from SND_SOC_IMX_SPDIFFabio Estevam2014-04-16
| | | | | | | | | SND_SOC_FSL_UTILS is only used by PowerPC machines, so let's drop it in the i.mx case. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: fsl: Add one blank space after ':=' in MakefileNicolin Chen2014-04-16
| | | | | | | There is a blank space missing between ':=' and 'imx-spdif.o', thus add it. Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: fsl_spdif: Reduce the noise on commentsFabio Estevam2014-04-16
| | | | | | | | | | Remove the "====" pattern to let the comments cleaner and more uniform. Also, do not use multi-line style for a single line comment. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: fsl_spdif: Staticse non-exported symbolsMark Brown2014-04-16
| | | | | Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Nicolin Chen <B42378@freescale.com>
* ASoC: fsl: Add wrapping for dev_dbg() in fsl_spdif.cNicolin Chen2014-04-16
| | | | | | | Add wrapping '\n' for dev_dbg() in fsl_spdif.c Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ENGR00277715-3 ASoC: fsl: Add WM8962 jack detecting supportNicolin Chen2014-04-16
| | | | | | | | There're two GPIOs connected to the headphone jack and microphone jack, thus add the states detection. Reviewed-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00277715-2 ASoC: fsl: Drop constraint in startup() of ssi driverNicolin Chen2014-04-16
| | | | | | | | | | | The constraint would disavow two simultaineous streams, eg: arecord | aplay. Since the hw_params() have the SSIEN checking, the stccr register would not be modified during a actual procedure of one stream, we can safely drop this one in startup(). Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00277894 asoc: fsl: add pm runtime for fsl audio codec.Shengjiu Wang2014-04-16
| | | | | | Add pm runtime for fsl audio codec Signed-off-by: Shengjiu Wang <b02247@freescale.com>
* ENGR00277299-5 ASoC: fsl: Add hdmi audio machine driverNicolin Chen2014-04-16
| | | | | | Add hdmi audio machine dirver Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00277299-4 ASoC: fsl: Add hdmi audio cpu dai driverNicolin Chen2014-04-16
| | | | | | Add hdmi audio cpu dai dirver Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00277299-3 ASoC: fsl: Add dma driver for hdmi audioNicolin Chen2014-04-16
| | | | | | | i.MX HDMI audio uses its own AHB DMA while there's also an extra SDMA channel to update its buffer addresses. Thus add a new driver for HDMI audio. Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00277299-2 ASoC: codec: Generalise omap hdmi audio dummy codec driverNicolin Chen2014-04-16
| | | | | | | The omap hdmi audio dummy codec driver is a generic hdmi codec driver but have build dependency, thus drop the dependency in order to use it. Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00277471 ASoC: fsl: Fix set-mute-failed issue after WM8962 captureNicolin Chen2014-04-16
| | | | | | | | | | | | We only need to mute WM8962 after playback, so add direction check before doing mute. And a mute failure would cause hw_free() abruptly return after it, which might drop the essential procedure code for FLL controlling. Thus put mute before FLL controlling code and drop its return check. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00277458-1 ASoC: fsl: Use correct flag for imx_pcm_dma_init()Nicolin Chen2014-04-16
| | | | | | | | We are using generic dma binding from devicetree for spdif, thus use the correct flag. Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ASoC: fsl: Add S/PDIF machine driverNicolin Chen2014-04-16
| | | | | | | | | | This patch implements a device-tree-only machine driver for Freescale i.MX series Soc. It works with spdif_transmitter/spdif_receiver and fsl_spdif.c drivers. Signed-off-by: Nicolin Chen <b42378@freescale.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: fsl_spdif: Remove unnecessary dev_set_drvdata()Fabio Estevam2014-04-16
| | | | | | | | | | Driver core clears the driver data to NULL after device_release or on probe failure, so just remove it from here. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Reviewed-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00276567-7 ASoC: fsl: Add si476x machine driverNicolin Chen2014-04-16
| | | | | | Add si476x machine dirver for i.MX series SoC and binding doc. Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00276567-2 ASoC: fsl: Add I2S Master support for ssiNicolin Chen2014-04-16
| | | | | | | Add I2S master/PCM(DSP_A, DSP_B)/LEFT_J formats support for ssi, also dropped the constrain of i2s-slave in probe(). Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ENGR00276567-1 ASoC: fsl: Add missing baud clock for ssiNicolin Chen2014-04-16
| | | | | | Also treat the ipg clock as ssi core clock. Signed-off-by: Nicolin Chen <b42378@freescale.com>
* ASoC: fsl: Add S/PDIF CPU DAI driverNicolin Chen2014-04-16
| | | | | | | | | This patch implements a device-tree-only CPU DAI driver for Freescale S/PDIF controller that supports stereo playback and record feature. Signed-off-by: Nicolin Chen <b42378@freescale.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ENGR00275974-3 [iMX6x] Add busfreq support to the driversRanjani Vaidyanathan2014-04-16
| | | | | | | | Add request_bus_freq() and release_bus_freq() calls to the various drivers to ensure that the DDR and AHB are the requested frequency before the driver starts its task. Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
* ENGR00274585-9 ASoC: change error message to debug messageShengjiu Wang2014-04-16
| | | | | | | | This error message is not actual error, which is a warning. When using FE/BE, if there is widget which is used by playback and capture route, then this message will be printed. Signed-off-by: Shengjiu Wang <b02247@freescale.com>
* ENGR00274585-6 ASoC: fsl: update format and buffer size in the pcm dmaShengjiu Wang2014-04-16
| | | | | | | 1. add 24bit format support. 2. enlarge the buffer size for ESAI. Signed-off-by: Shengjiu Wang <b02247@freescale.com>
* ENGR00274585-5 ASoC: fsl: add cs42888 machine driver.Shengjiu Wang2014-04-16
| | | | | | | add cs42888 machine driver. add bindings document of cs42888 machine. Signed-off-by: Shengjiu Wang <b02247@freescale.com>
* ENGR00274585-4 ASoC: fsl: add esai driverShengjiu Wang2014-04-16
| | | | | | | add esai driver. add bindings documentation of esai Signed-off-by: Shengjiu Wang <b02247@freescale.com>
* ENGR00274585-3 ASoC: fsl: add asrc p2p driver.Shengjiu Wang2014-04-16
| | | | | | | add asrc p2p driver. add bindings document of asrc p2p. Signed-off-by: Shengjiu Wang <b02247@freescale.com>
* ENGR00274585-2 ASoC: codec: add codec driver cs42888Shengjiu Wang2014-04-16
| | | | | | | Add codec driver cs42888. Add bindings document for cs42888 audio codec. Signed-off-by: Shengjiu Wang <b02247@freescale.com>