summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)Author
2015-11-13MLK-11856 ASoC: fsl-sai: set xCR4/xCR5/xMR for SAI master modeZidan Wang
For SAI master mode, when Tx(Rx) sync with Rx(Tx) clock, Rx(Tx) will generate bclk and frame clock for Tx(Rx), we should set RCR4(TCR4), RCR5(TCR5) and RMR(TMR) for playback(capture), or there will be sync error sometimes. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> (cherry picked from commit 1b4f2c2b400dac1145970dde5588309f6504a50a)
2015-10-30MLK-10183 ASoC: wm8962: separate ALC Coefficients to four reigstersZidan Wang
Attempt to read volatile register when cache_only is set will return EBUSY. After playback/record, wm8962_runtime_suspend function will set cache_only flag, so the volitale register ALC2 can't be read from cache. Separate ALC Coefficients to four reigsters, the volatile register ALC2 will be read from hardware instead of cache. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> (cherry picked from commit 5ec8878be12530517b4c8ae307441a0ac16071a3)
2015-10-30MLK-10683 ASoC: wm8960: replace idle_bias_off with suspend_bias_offZidan Wang
After removing idle_bias_off, it will not set bias to off after playback, it just set bias to standby, and will not power down codec VREF, so it can decrease the obvious pop noise at the first second. Only in suspend, it will set codec bias to off. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> (cherry picked from commit ca7958ba19f5cee32215894fc7664b3451f7e9e6)
2015-10-30ASoC: Add support for automatically going to BIAS_OFF on suspendLars-Peter Clausen
There is a substantial amount of drivers that in go to SND_SOC_BIAS_OFF on suspend and go back to SND_SOC_BIAS_SUSPEND on resume (Often this is even the only thing done in the suspend and resume handlers). This patch introduces a new suspend_bias_off flag, which when set by a driver will let the ASoC core automatically put the device's DAPM context at the SND_SOC_BIAS_OFF level during suspend. Once the device is resumed the DAPM context will go back to SND_SOC_BIAS_STANDBY (if the context is idle, otherwise to SND_SOC_BIAS_ON). This will allow us to remove a fair bit of duplicated code from the drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org> (cherry picked from commit 86dbf2ac6fcb2d2932d4610f2dfe0954aa0633f7) Conflicts: sound/soc/soc-core.c
2015-10-14MLK-11570-02 ASoC: wm8994: store/restore context in codec driver suspend/resumeZidan Wang
For lpsr mode, the codec will be power down, the register value will be lost, so we should store the context at the end of codec suspend, and load the registers at the beginning of codec resume. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-25MLK-11623 ASoC: imx-cs42888: add 32k and 64k sample rate supportZidan Wang
When codec sysclk is 24576000, the sample rate ratio can be 128, 192, 256, 384, 512, 768, 1024. So 32k, 48k, 64k, 96k, 192k can be support. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-23ASoC: wm8960: correct the max register value of mic boost pgaZidan Wang
the max register value of mic boost pga should be 3. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17ASoC: wm8960: correct gain value for input PGA and add microphone PGAZidan Wang
The input PGAs have a gain range from -17.25dB to +30dB in 0.75dB steps. The boost stage can provide additional gain. For line inputs, -12dB to +6dB gain is available on the boost mixer. For micphone inputs, it can provide up to +29dB additional gain from the microphone PGA. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17ASoC: wm8960: correct the min gain value of some PGAZidan Wang
The min gain is the corresponding gain value when the register value is 0 instead of 1, just correct it. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-17ASoC: dapm: Make sure register value is in sync with DAPM kcontrol stateJarkko Nikula
Commit c9e065c27fe9 ("ASoC: dapm: Make sure to always update the DAPM graph in _put_volsw()") stopped updating register values in those cases where initial after boot state of kcontrol appears to not change but where register value still needs update because it is not in sync with the kcontrol state. Fix this by doing snd_soc_test_bits() unconditionally as it was before but by using separate flags for kcontrol and register state changes. This allow both DAPM graph to be updated when disabling auto-muted control and update register if it is out-of-sync in respect of kcontrol state. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org> (cherry picked from commit 18626c7ebc05e6486712cc129d8da83d07da9dc7)
2015-09-17ASoC: pcm_dmaengine: pause/resume interface have been supported in dma driverZidan Wang
Revert "MLK-10213-2: ASoC: dmaengine: Merge trigger RESUME to START and SUSPEND to STOP" This reverts commit a21f8a846f653fe5415961fe8006f0f9688fe908. commit 0e8928f has supported pause/resume interface in dma driver. So no need to merge trigger RESUME to START and SUSPEND to STOP any more. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-11496: ASoC: fsl_sai: fix channel swap issue after suspend/resumeShengjiu Wang
The regcache_sync in fsl_sai_resume will write one data to FSL_SAI_TDR register, which will cause one more data is pushed to FIFO, after resume, the channel swap. The reason for regcache_sync write volatile register is caused by there is no default value for registers, then regcache_rbtree will work abnormal. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-11436 ASoC: fsl_mqs: restore pin setting for mqsZidan Wang
restore pin setting for mqs in suspend/resume. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-11435 ASoC: fsl_mqs: add snd_soc_pm_ops for mqs machine driverZidan Wang
add snd_soc_pm_ops for mqs machine driver to make the trigger suspend/resume be called in suspend/resume. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-11432 ASoC: fsl_sai: ALSA core will restore pin setting for cpu_dai when ↵Zidan Wang
resume back Revert "MLK-11410-1 ASoC: fsl_sai: restore pin setting for SAI" This reverts commit 28fd246b81d9cb83c8b31edd829b53328cb46729. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-11392-2: ASoC: fsl_ssi: revert patch to fix kernel dump issueFabio Estevam
Revert "MLK-10359: ASoC: fsl_ssi: move pm runtime enable/disable to trigger function" This reverts commit 6fe69c2ff824ddb2c260b31615641d7d942bf2d6. commit 6fe69c2ff82 "MLK-10359: ASoC: fsl_ssi: move pm runtime enable/disable to trigger function " calls the pm_runtime_ functions from an unsafe context as shown when building a kernel with CONFIG_DEBUG_ATOMIC_SLEEP=y: root@freescale /$ aplay /home/clarinet.wav BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:954 in_atomic(): 1, irqs_disabled(): 128, pid: 781, name: aplay CPU: 0 PID: 781 Comm: aplay Not tainted 3.10.53-02670-g6fe69c2 #2 [<80013f98>] (unwind_backtrace+0x0/0xf8) from [<80011a2c>] (show_stack+0x10/0x14) [<80011a2c>] (show_stack+0x10/0x14) from [<80313634>] (__pm_runtime_resume+0x84/0x8c) [<80313634>] (__pm_runtime_resume+0x84/0x8c) from [<804cc4b4>] (fsl_ssi_trigger+0x54/0x200) So revert such commit. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> (cherry picked from commit 16d24d435c2ce1ae6f8139af7fdcf627d9b32b72)
2015-09-17MLK-11392-1 ASoC: fsl_sai: Move pm runtime enable/disable out trigger functionShengjiu Wang
When building kernel with CONFIG_DEBUG_ATOMIC_SLEEP=y, there will be kernel dump. BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:954 in_atomic(): 1, irqs_disabled(): 128, pid: 705, name: aplay CPU: 0 PID: 705 Comm: aplay Not tainted 3.10.53-02755-gbee6071 #1472 [<80013f4c>] (unwind_backtrace+0x0/0xf8) from [<800119c0>] (show_stack+0x10/0x14) [<800119c0>] (show_stack+0x10/0x14) from [<8031fd68>] (__pm_runtime_resume+0x88/0x90) [<8031fd68>] (__pm_runtime_resume+0x88/0x90) from [<80509ba8>] (fsl_sai_trigger+0x98/0x300) [<80509ba8>] (fsl_sai_trigger+0x98/0x300) from [<804fef9c>] (soc_pcm_trigger+0x90/0xa0) [<804fef9c>] (soc_pcm_trigger+0x90/0xa0) from [<804eae60>] (snd_pcm_do_start+0x2c/0x30) [<804eae60>] (snd_pcm_do_start+0x2c/0x30) from [<804eaad8>] (snd_pcm_action_single+0x38/0x78) [<804eaad8>] (snd_pcm_action_single+0x38/0x78) from [<804eada8>] (snd_pcm_action_lock_irq+0x84/0xa4) [<804eada8>] (snd_pcm_action_lock_irq+0x84/0xa4) from [<804eba58>] (snd_pcm_common_ioctl1+0x16c/0xd68) [<804eba58>] (snd_pcm_common_ioctl1+0x16c/0xd68) from [<804ecc8c>] (snd_pcm_playback_ioctl1+0x158/0x4d0) [<804ecc8c>] (snd_pcm_playback_ioctl1+0x158/0x4d0) from [<800d5bb8>] (do_vfs_ioctl+0x80/0x624) [<800d5bb8>] (do_vfs_ioctl+0x80/0x624) from [<800d6198>] (SyS_ioctl+0x3c/0x5c) [<800d6198>] (SyS_ioctl+0x3c/0x5c) from [<8000e200>] (ret_fast_syscall+0x0/0x30) Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> (cherry picked from commit 99095f3362bc53eb414dabbbe7da5778f3d54f25)
2015-09-17MLK-11410-1 ASoC: fsl_sai: restore pin setting for SAIZidan Wang
restore pin setting for SAI in suspend/resume. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-11301: ASoC: cs42xx8: can't set volume 255 in idle modeShengjiu Wang
Volume 255 corresponding to register value 0, the value 0 is default value. In regcache_sync(), when the cache value is equal to default value, this register will be skipped. So volume 255 isn't set to register successfully. The correct fix is to add software reset in runtime_resume, but cs42xx8 has no software reset, the hardware reset gpio pin is used by all the perpherial device in ARD base board. So need to use another method. In order to fix it, need to cherry-pick two patch from master branch. Which will sync all the registers include the register which cache value equal the default value, And remove regcache_mark_dirty(). Add update value of one register to make the cache_dirty if user press the hardware reset pin on the board, then need to regcache_sync. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-11248: dmaengine: imx-sdma: add new api for sync with dma and substreamShengjiu Wang
There is occasion that dma callback come late after the substream is released. Then there will be kernel dump. [<805866b0>] (imx_pcm_dma_complete) from [<802fad9c>] (sdma_handle_channel_loop.isra.25+0x48/0x54) [<802fad9c>] (sdma_handle_channel_loop.isra.25) from [<802fae48>] (sdma_tasklet+0xa0/0x1d4) [<802fae48>] (sdma_tasklet) from [<800356e0>] (tasklet_action+0x64/0xf8) [<800356e0>] (tasklet_action) from [<80034ea0>] (__do_softirq+0x104/0x218) [<80034ea0>] (__do_softirq) from [<80035220>] (irq_exit+0xa8/0xec) [<80035220>] (irq_exit) from [<8000ed44>] (handle_IRQ+0x3c/0x90) [<8000ed44>] (handle_IRQ) from [<80008578>] (gic_handle_irq+0x28/0x5c) [<80008578>] (gic_handle_irq) from [<80012100>] (__irq_svc+0x40/0x70) The reason is the sdma tasklet is async with audio substream release. ALSA think when terminate dma, the dma should be stopped and no callback be called. This patch is to add new api dma_sync_wait_tasklet(), which is called in snd_dmaengine_pcm_close(). It will make sure the callback not be called after this funtion. Tasklet_kill is to wait scheduled tasklet end. Tasklet_kill can't be added to terminate dma function, because terminate dma function may be called in interrupt, but tasklet_kill can't be called in interrupt context. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-11259-2: ASoC: fsl: enable ASRC p2p for ssi->wm8962Shengjiu Wang
Enable ASRC p2p for ssi->wm8962, base on the new p2p script, which support to select dualfifo for source/destination device. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-11179 ASoC: fsl: implement specify audio DMA buffer size from devicetreeZidan Wang
If the property "fsl,dma-buffer-size" is present, using the specified buffer size. Otherwise, using the default audio buffer size. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-11169 ASoC: fsl_sai: using special pcm config for IMX seriesZidan Wang
Using special pcm config for IMX series. The dafault pcm config is using 512K DMA Buffer which will cause allocating from OCRAM failed. The special pcm config will using 64K DMA buffer. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-11053: ASoC: imx_mqs: Remove 96k and 192k support for mqsShengjiu Wang
If the mclk is 24.576MHz, mqs can't support 96k and 192kHz, because the we can't get a proper clock divider for mqs. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-11030-1 ASoC: imx-wm8960: change rate constraint list and remove sample ↵Zidan Wang
bit constraint list wm8960 just support 8k 11.025k 16k 22.05k 32k 44.1k and 48k sample rate. Change rate constraint list to support 8k 16k 32k and 48k for SAI master mode. After set SAI MCLK frequency to 36864000HZ, SAI master mode can full support 16 24 and 32 bit word length and 8k 16k 32k, 48k sample rate. No need to add sample bit constraint list to restrict physical length, so remove it. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10880: ASoC: fsl_asrc: the limitation for rate is not accurate.Shengjiu Wang
The limitation is for the case that output sampling rate is between 8kHz and 30kHz. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-10899: ASoC: si476x: add startup/shutdown to powerup/down FMShengjiu Wang
The hw parameter is set failed for si476x if si476x is not powerup, the codec use the default value of this module. So add startup/shutdown to powerup/powerdown FM, then we can set parameter successfully. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-11004-3: ASoC: cs42888: enable PWR in probe for fix pop noiseShengjiu Wang
Delete PWR widget, enable it in probe to fix pop noise Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-11004-2: ASoC: CS42xx8: can't use PWR as PGA widgetShengjiu Wang
Revert "ENGR00320678 ASoC: cs42xx8: Revert the DAPM routes to the old one" When PWR is PGA widget, it is used by input route and output rate, there is a circle route "AINxL -> PWR -> AOUTxL", alsa driver will open this audio route in kernel boot up, and refcount of pm enable is set to 1 by soc-dapm, which cause the codec can't enter pm_suspend. This reverts commit 8256b071de4ce0971f00f819fae3defa44fe892d. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-11004-1: ASoC: cs42888: Add regcache mask dirty in suspendShengjiu Wang
Add regcache mask dirty in suspend, otherwise the register is not synced with cache in resume. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-10903-2: ASoC: imx_spdif: add snd_soc_pm_opsShengjiu Wang
Add snd_soc_pm_ops in machine driver to make the trigger suspend/resume be called in suspend/resume. Remove platform_set_drvdata for redundance, When register card, it has been called. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-10903-1: ASoC: fsl_spdif: remove cache only in suspend/resumeShengjiu Wang
In imx6qp, there is no mega fast. After suspend, but before resume, there will be spdif interrupt, if set cache only in suspend, then we can't clear the interrupt, because regmap_write only write to cache. So the system will hang for the interrupt can't be cleared. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17ASoC: Replace list_empty(&card->codec_dev_list) with !card->instantiatedLars-Peter Clausen
With componentization we no longer necessarily need a snd_soc_codec struct for a card. Instead of checking if the card's CODEC list is empty just use card->instantiated to check if the card has been instantiated yet. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org> (cherry picked from commit c5599b87a8317738a541d8893cb327df5d04b007)
2015-09-17MLK-10830 ASoC: imx-wm8960: audio mclk should be enabled early to avoid jack ↵Zidan Wang
detect error Audio mclk should be enabled early to avoid jack detect error. It will playback from speaker in the first 2 seconds, then switch to headphone. Steps to reproduce this issue: 1. plug out headphone and playback a wav. 2. stop playback and wait for at least 5 seconds, then plug in headphone and playback a wav. And set TOCLKSEL (bit1 R23) to get faster jack detect response. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10843-1 ASoC: imx-wm8960: set codec mclk in device tree instead of ↵Zidan Wang
machine driver set codec mclk in device tree instead of machine driver. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10788-3 driver: misc: change busfreq head file nameAnson Huang
As busfreq head file name is changed from busfreq-imx6.h to busfreq-imx.h, change the drivers which include this head file accordingly. Signed-off-by: Anson Huang <b20788@freescale.com>
2015-09-17MLK-10818-1 ASoC: imx-wm8960: support parsing audio route from device treeZidan Wang
Since different board will have different micphone, headphone and speaker hardware connection, support parsing audio route from device tree, so that we can configure audio route dynamically. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10815-1 ASoC: imx-wm8960: add ASRC p2p support in sai<->wm8960Zidan Wang
Add ASRC p2p support in sai<->wm8960. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10813-2: ASoC: imx-wm8958: fix issue that clock is not disabledShengjiu Wang
The clock disable has no chance to be called in set_bias_level_post, because the dapm->bias_level is set by the codec driver, machine driver should use the card->dapm.bias_level. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-10813-1: ASoC: imx-wm8958: Enable mclk output for codecShengjiu Wang
In imx6ul, the mclk need to be enable by gpr. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-10796 ASoC: imx-wm8960: add constraint list for codec master modeZidan Wang
add constraint list for codec master mode. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10780-6 ASoC: imx-wm8960: move some basic register config to late_probe ↵Zidan Wang
function Move some basic register config to late_probe function. Move hp detect config to late_probe function to avoid detect error. imx6ul-evk using LINPUT2 and LINTPUT3 for hp MIC, and RINPUT1 and RINPUT2 for Main MIC. When using hp MIC, we should route left channel data to right channel. When using Main MIC, we should route right channel data to left channel. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10780-4 ASoC: imx-wm8960: add headphone and micphone jack detect eventZidan Wang
add headphone and micphone jack detect event. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10780-1 ASoC: imx-wm8960: add wm8960 support for imx6ul-evk boardZidan Wang
add wm8960 support for imx6ul-evk board. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10775-2: ASoC: imx-mqs: add asrc p2p support in sai->mqsShengjiu Wang
add asrc p2p support in sai->mqs Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-10775-1: ASoC: fsl-sai: add compatible for imx6ulShengjiu Wang
support sai in imx6ul. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-10713-2 ASoC: imx-sii902x: Add 96k and 192k sample rate supportZidan Wang
Add 96k and 192k sample rate support for hdmi audio. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10713-1 ASoC: fsl-sai: Add 176.4k and 192k sample rate supportZidan Wang
Add 96k and 192k sample rate support. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
2015-09-17MLK-10661: ASoC: imx_wm8960: HDMI has noise after playback with wm8960Shengjiu Wang
The root cause is hardware issue. In imx7d-sdb hdmi, wm8960 use the same SAI interface. After playback with wm8960, the Frame clock voltage doesn't become 0v, wm8960 will introduce noise to frame clock. This patch is a workaround to set wm8960 to slave mode, remove interference to I2S signal. Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
2015-09-17MLK-10608 ASoC: imx-wm8958: playback 24 bit 44k and 48k wave will get big noiseZidan Wang
According to the wm8958 referance manual, DAC sample rate 44.1k and 48k are supported for 24 bit word length when it is 'simple' DAC-only playback modes. But after test, we found that it would get big noise which can't be eliminated by configuring codec register. It should be the codec hardward limitation, and we can't support these sample rate. Signed-off-by: Zidan Wang <zidan.wang@freescale.com>