summaryrefslogtreecommitdiff
path: root/sound/soc
AgeCommit message (Collapse)Author
2012-11-02ENGR00231778 MX6 ESAI: Adjust channel support capability of cpu/codec daiLionel Xu
To adjust the channel support capability, codec dai does not support mono playback and record, while esai dai does, thus making the whole audio codec only support stereo and above channel playback/record. Signed-off-by: Lionel Xu <R63889@freescale.com>
2012-10-30ENGR00231595 spdif: improve spdif driverGary Zhang
add clk operation in mxc_pb_spdif_put function Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-10-29ENGR00231321-2 wm8962: enhance audio driverGary Zhang
1. correct indent issue 2. when driver is unloaded, remove disable clock operateion and free irq Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-10-24ENGR00230920-2 HDMI AUDIO: export gloable variable in platform driverChen Liangjun
Export gloable variable in HDMI AUDIO platform driver to support HDMI AUDIO codec driver's loadable build. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-10-24ENGR00230920-1 HDMI AUDIO: add support for HDMI audio module buildChen Liangjun
HDMI driver can be divided into 3 parts: machine driver, platform driver, codec driver.To support HDMI AUDIO loadable module build, HDMI machine driver should be built as loadable. In this patch, adjust HDMI audio driver's struct: move HDMI audio platform driver to snd-soc-imx-objs(snd-soc-imx-objs would always be build-in).In this case, user need only build HDMI AUDIO machine driver as loadable. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-09-27ENGR00226095-2 SPDIF: add HDMI AUDIO in device name in mx6_sl evkGary Zhang
because HDMI AUDIO in mx6sl evk comes from SPDIF TX, change to HDMI AUDIO in device name. Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-09-19ENGR00219882 wm8962: avoid the digital volume changed by userGary Zhang
Wolfson suggests that digital volume should not be changed by user to avoid affecting SNR and dynamic range, and user should adjust analog volume. Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-09-19ENGR00224938 HDMI audio: clear HDMI dma done bit before startChen Liangjun
HDMI hardware fix: signal of HDMI DMA DONE is hard connected to SDMA event line. SDMA event is triggered by edge. If the HDMI DMA done is already 1 before start, there would be no SDMA event being trigged after HDMI generates another HDMI DONE signal. In this patch, clear HDMI DONE bit before start HDMI audio DMA. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-09-14ENGR00224245 HDMI AUDIO: stop/start PCM while unplug,blank/plug, unblankChen Liangjun
When unplug, blank happens, HDMI audio can't play properly. So in driver, audio pcm would be disconnected when event above happens. However, pulse audio can't process disconnect event properly and if an blank or unplug event happens, HDMI sink would lost and can't be back again. In this patch, instead of disconnecting audio PCM stream, triggering stop audio pcm while unplug and blank, triggering start again while plug and unblank if the audio pcm is triggerd stop in the unplug/blank event. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-09-13ENGR00223816 HDMI AUDIO: fix kernel panic cause by accessing unavailable memoryChen Liangjun
HDMI audio driver is responsible for add IEC header into audio sample. In HDMI audio driver, a variable named rtd->appl_bytes is maintained to stand for how many audio sample have already processed. appl_bytes stands for how many audio sample the user space have already feed into kernel driver. So we use the connt = appl_bytes - rtd->appl_bytes to decide how many data need to be processed. And the processed data would be write into an preallocated buffer called hw_buf in driver. When doing seek operation, the appl_bytes changes in an wide range. So it is possible that the count value is far larger than the size of hw_buf and the memory access un-existed address error would happens. In this patch, Add check operation for count to avoid kernel panic. Kernel panic log: seeking: 0:00:18.000000000/0:03:0Unable to handle kernel paging request at virtual address ffdf0000 pgd = 80004000 [ffdf0000] *pgd=71e35811, *pte=00000000, *ppte=00000000 Internal error: Oops: 7 [#1] PREEMPT SMP Modules linked in: vivante drm galcore CPU: 0 Not tainted (3.0.35-2014-g7a9337b #1) PC is at hdmi_dma_mmap_copy+0x134/0x190 LR is at hdmi_dma_mmap_copy+0x5c/0x190 pc : [<803e1e4c>] lr : [<803e1d74>] psr: 800f0193 sp : 80a61e98 ip : ffdf0000 fp : ffdeffc0 r10: 00000055 r9 : ffdeff80 r8 : 0029b450 r7 : 00000060 r6 : ffdf0200 r5 : 00000240 r4 : 00000120 r3 : 00000000 r2 : ffdf0000 r1 : 00000000 r0 : 00000090 Flags: Nzcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c53c7d Table: 6d28804a DAC: 00000015 Process swapper (pid: 0, stack limit = 0x80a602f0) Stack: (0x80a61e98 to 0x80a62000) 1e80: 00000002 000037f1 1ea0: 00006000 e1d3a7e4 a00f0193 e1d3a780 e1dcab00 00a83100 00a83100 00006000 1ec0: 00006000 803e24f4 413187b9 00000000 0073001a e1dd1e00 00000001 00000001 1ee0: 00000080 00000093 80ac7070 80a66a80 00000001 800a5ca8 8c80e568 efb3e7b9 1f00: 00000055 80a66a80 80a66acc e1ea9bc0 00000093 00000000 80a60000 00000000 1f20: 00000000 800a5e14 80a66a80 80a66acc 0000107f 800a8198 80a71cc0 80038c00 1f40: 80a60000 800a5610 000001f0 80040830 ffffffff f2a00100 00000093 00000002 1f60: 00000001 8003f9cc 80ac5f60 800f0093 00000001 00000000 80a60000 80abeb64 1f80: 804e1a54 80a74e7c 1000406a 412fc09a 00000000 00000000 00000000 80a61fb0 1fa0: 8004d52c 80040ac4 400f0013 ffffffff 80040aa0 80040cbc 00000001 80a71b3c 1fc0: 80abeac0 8002e3c4 8c80b140 80008868 800082f8 00000000 00000000 8002e3c4 1fe0: 00000000 10c53c7d 80a71a6c 8002e3c0 80a74e74 10008040 00000000 00000000 [<803e1e4c>] (hdmi_dma_mmap_copy+0x134/0x190) from [<803e24f4>] (hdmi_dma_isr+0x17c/0x1a0) [<803e24f4>] (hdmi_dma_isr+0x17c/0x1a0) from [<800a5ca8>] (handle_irq_event_percpu+0x50/0x180) [<800a5ca8>] (handle_irq_event_percpu+0x50/0x180) from [<800a5e14>] (handle_irq_event+0x3c/0x5c) [<800a5e14>] (handle_irq_event+0x3c/0x5c) from [<800a8198>] (handle_fasteoi_irq+0xbc/0x154) [<800a8198>] (handle_fasteoi_irq+0xbc/0x154) from [<800a5610>] (generic_handle_irq+0x28/0x3c) [<800a5610>] (generic_handle_irq+0x28/0x3c) from [<80040830>] (handle_IRQ+0x4c/0xac) [<80040830>] (handle_IRQ+0x4c/0xac) from [<8003f9cc>] (__irq_svc+0x4c/0xe8) [<8003f9cc>] (__irq_svc+0x4c/0xe8) from [<80040ac4>] (default_idle+0x24/0x28) [<80040ac4>] (default_idle+0x24/0x28) from [<80040cbc>] (cpu_idle+0xbc/0xfc) [<80040cbc>] (cpu_idle+0xbc/0xfc) from [<80008868>] (start_kernel+0x248/0x288) [<80008868>] (start_kernel+0x248/0x288) from [<10008040>] (0x10008040) Code: c1a0c009 c08b6005 c1a0200b da00000a (e0d230b2) Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-09-13ENGR00224112 wm8962: correct lrclk mismatchGary Zhang
lrclk trigger settings between ssi and wm8962 are different, which causes L/R channel swap. Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-09-12ENGR00223911 wm8962: correct typoGary Zhang
correct typo for wm8962 description in Kconfig Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-09-05ENGR00222900 HDMI AUDIO: fix kernel panic when doing suspend-resume testChen Liangjun
In MX6 series, HDMI audio driver is responsible for add IEC header to audio samples. Driver would maintain variables to cover this work. The old driver would cause memory access exceeding issue: 1. Resume from an playback. In this case, variable maintained by ALSA is updated while variable maintained by HDMI driver is not updated. The mmap copy operation would run into error state due to misalignment. 2. underrun!!! The same error would happens as the items above. In this patch, add variable check while adding IED header. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-09-03ENGR00222836 Fix Kern BUG during Susp/Resu caused by SPDIF debug codeNicolin Chen
dump_reg() in msc_spdif.c will cause kernel BUG during Suspend/Resume, because of calling clk_enable() in an interrupt for playback. There's also a simular issue in capture case. Capture'd be stopped after resume for suspending. Signed-off-by: Nicolin Chen <b42378@freescale.com>
2012-08-29ENGR00182456-2 HDMI AUDIO: register/unregister when audio pcm open/closeChen Liangjun
In this patch: 1. Register substream into HDMI core driver when HDMI audio PCM is open. 2. Unregister substream out of HDMI core driver when HDMI audio PCM is close. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-08-28ENGR00221298 Fix tuner clock frequency on SSIAlejandro Sierra
Fix clock frequency configuration on SSI interface for the Tuner driver. Signed-off-by: Alejandro Sierra <b18039@freescale.com>
2012-08-28ENGR00221689 wm8962: add wait time after enable power supplyGary Zhang
add 100ms wait time after enable power supply for power stability Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-08-24ENGR00219933 CS42888: abort delay powerdown if codec is onChen Liangjun
CS42888 driver own 2 codec_dai for ESAI and ASRC P2P use. Due to the delay power down mechanism, if a ASRC P2P stream is played right after a finish of ESAI stream playback, ASRC P2P stream would be stop. In this patch, do nothing in the delay powerdown flow if CS42888 codec is on. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-08-24ENGR00221177 ESAI ASRC: add mutex protection between ESAI and ASRC P2PChen Liangjun
ESAI playback and ASRC P2P playback use difference codec_dai while using the same codec. Thus they can't work together. In this patch, add mutual protection between ESAI playback and ASRC P2P playback. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-08-20ENGR00220446 ESAI: channel swapped occasionally when playing stereo wavLionel Xu
There is channel swap happened when playing stereo wav. According to the spec, the initial words should be written to the ETDR register, at least one word per enabled transmitter slot, to avoid any potential problem. Signed-off-by: Lionel Xu <Lionel.Xu@freescale.com>
2012-08-17ENGR00220633 WM8962: add support for wm8962 in mx6sl evkGary Zhang
add support for audio codec wm8962 in mx6sololite evk board Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-08-17ENGR00219926-1 ESAI ASRC: use ideal ratio for ASRC P2P playbackChen Liangjun
When use no ideal-ratio mode for ESAI playback, CPU should provide accurate clock for input clock, which means input clock should be divided by input sample rate. However, all our clock is from 24M crystal and if the input sample rate equal to 44.1k or so, CPU can't provide these clock. In this patch, use ideal ratio mode thus CPU need not provide accurate clock which can be divided by 44.1k. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-08-17ENGR00220595 ESAI ASRC: add support for 'aplay *'Chen Liangjun
When play audio in the way of aplay *, shutdown function would not be called and ASRC configuration would not be reconfigured. In this case, playback would sound noise. In this patch, put ASRC release operation into hw_free(). Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-08-16ENGR00219931 ESAI ASRC: fix channel swap bug while playback 6 channelChen Liangjun
Channel swap caused by 2 reason: 1. To avoid ASRC underflow error, ASRC driver would prefill ASRC input FIFO with 160 samples. However, 160 can't be divided by 6. In this case, channel data miss alignment. In this patch, prefill ASRC input FIFO with 120, which can be divided by 2,4,6,8. 2. While start P2P playback, ESAI driver would first start SDMA, then ASRC, and last ESAI. While start ESAI, the data is not ready, thus ESAI underrun would happens and channel data miss alignment. In this patch, delay 1 ms between ASRC's start and ESAI's start. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-08-13ENGR00220172 ESAI ASRC: put all asrc pair release operation to shutdown()Chen Liangjun
When use ASRC for ESAI P2P playback, ESAI driver would release ASRC pair resource immediately after ASRC function's error return.It may introduce risk that in ESAI machine driver's shutdown(), ASRC resource release operation may be double called. In this case, system hang happens due to ASRC register's operation with no clock. In this patch, let all ASRC resource release operation in ESAI machine driver's shutdown(). Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-08-13ENGR00220181-2 HDMI SDMA: workround for HDMI SDMA audio no sound issueChen Liangjun
Issue: When playback HDMI audio in SDMA stress test, HDMI audio may stop caused by SDMA channel's failing to work. While checking the SDMA register and HDMI module stauts, we found that SDMA fall to an unknown error state. The issue is detected both in RIGEL TO1.1 and ARIK TO1.2. This patch introduces a workround for this issue: For the memory passed to SDMA core, HDMI driver would allocate it with the attribute of C=0, B=0 instead of C=0, B=1. This patch have be tested in RIGEL TO1.1 for about 60 hours, no issue happens. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-08-09ENGR00219837-1 HDMI: Add HDMI_SDMA support for RIGEL TO1.1Chen Liangjun
In RIGEL TO1.1, the same HDMI_SDMA fix is introduced as ARIK TO1.2. Add support for RIGEL TO1.1 for HDMI_SDMA functionality. In this patch: 1.Add hdmi_SDMA_check() interface to judge whether MX6 chip support HDMI_SDMA. 2.Replace mx6q_version() check with hdmi_SDMA_check() to support both ARIK To1.2 and RIGEL TO1.1. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-08-02ENGR00219184 HDMI AUDIO: set HDMI audio's SDMA priority to highChen Liangjun
HDMI use SDMA for buffer switch. Set HDMI audio's SDMA priority to the same level as other audio device. This adjust can avoid noise due to SDMA cpu race failing. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-08-01ENGR00218958 ESAI ASRC: fix system hang cause by accessing ASRC with no clockChen Liangjun
In ESAI_ASRC, to use ASRC for p2p playback, ESAI driver would maintain an variable to keep track of ASRC pair number allocated. So every time ESAI driver want to use ASRC, he would first init the variable to a value (0 in ESAI driver)stand for unvalid pair number and then request an valid pair number. At last, open the ASRC clock for ASRC register access. However, ASRC driver treat 0 as an valid pair number. Thus, if an ESAI ASRC playback is failed, ESAI driver would check whether the pair number is valid. If the pair number is valid, ESAI driver would access ASRC register to do some clean work. Thus, the init 0 value would be treat as an valid pair number and ASRC register would be access without ASRC clock. In the case, an system hang happens. In this patch, init pair number variable to -1 after its allocation. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-07-31ENGR00217401 wm8962: fix build warningXinyu Chen
Fix two build warnings on wm8962 Signed-off-by: Xinyu Chen <Xinyu.chen@freescale.com>
2012-07-30ENGR00218807 ESAI: fix bootup issue cause by accessing unexist addressChen Liangjun
To support p2p playback, ESAI driver would copy platform data to esai_asrc struct. The platform data only exist on boards that supports ESAI. However, for ARM2 board, it supports ESAI but not necessary get the codec CS42888. Thus the probe() in ESAI driver would also try to copy the platform data from board init file. The p2p playback now only support ARD board, so the ESAI probe() for ARM2 would access unexisted address and cause an kernel dump. In the patch, check the platform data address before copy. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-07-30ENGR00218421-2 ESAI_ASRC:Add support for p2p virtual device playbackChen Liangjun
In the origin code, ESAI driver supoprt audio p2p playback by setting input PCM data's sample rate thought amixer interface.It is ugly and request user application call amixer control interface everytime before and playback. In this patch, user can call the audio p2p playback by writing data to an special virtual device. Driver would automatically get the params of input PCM. At the same time, driver would get the output sample rate and word data. With the data abover, driver can set ASRC properly and audio p2p palyback is support. This patch mainly focus on: 1 clean old p2p playback way for ESAI. 2 Setup the output sample rate and word width to virtual device's substream_runtime's private data. Everytime the virtual device is called, the data abover is used for config ASRC, ESAI, and codec. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-07-30ENGR00218421-1 ESAI: Setup virtual device under ESAI sound cardChen Liangjun
For ESAI sound card, ESAI driver setup device 0 for raw ESAI playback and capture. In this patch, add ESAI virtual device 1 under ESAI sound card. Device 1 is for ESAI audio p2p playback. Every time user use device 1 for playback, ASRC would be called defaultly. Thus for device 1, it can support all sample rate between 8k ~ 192k. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-07-30ENGR00218013-5 HDMI: Add SDMA to help HDMI audio support multi bufferChen Liangjun
For chip version easily than TO1.1, HDMI use internel DMA enginue for audio tranfer. Due to capability of HDMI module, FIFO underrun is unavoidable. For chip TO 1.2, introducing SDMA to help HDMI audio DMA. With the help of SDMA, HDMI audio can use ping-pong buffer mechanism and FIFO underrun can be avoid. In this path: Add SDMA support for i.MX6Q later than TO1.2. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-07-27ENGR00218466 WM8962: remove unused variableGary Zhang
remove unused variable Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-07-25ENGR00217598 SSI: improvement for ssi driverGary Zhang
SSI driver improvement: 1. add parameter check in imx_ssi_set_dai_clkdiv(), 2. add TX/RX FIFO1 watermark settings, 3. remove the hardcode for watermark setting. Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-07-25ENGR00215621 HDMI: Pass HCT TestID 7-32: Audio Sample Packet LayoutSandor Yu
CA index table should followed CEA-861-D table 20. Signed-off-by: Sandor Yu <R01008@freescale.com>
2012-07-25ENGR00216976 ESAI: add support for 4,6channel p2pChen Liangjun
Add support for 4, 6 channels p2p playback in ESAI. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-07-25ENGR00209905 WM8962: support for continuously playback diff sample bit streamsGary Zhang
support for continuously playback different sample bit audio streams with -Dplughw:0,0 option such as the command: 'aplay -Dplughw:0,0 16bit.wav 24bit.wav' before prohibit reenter hw_params, now remove this limitation to support this feature. Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-07-25ENGR00215851 ASRC:fix datawidth type mismatchChen Liangjun
When ESAI call ASRC for p2p playback. The datawidth may be changed. The cpu dai would configure the ESAI data width according to the modified datawidth(output_bits). The type mismatch between output_bits and cpu dai's switch branch cause cpu dai's hardware parameter set fail. Match the type of output_bits to the switch branch in cpu dai's hardware parameter configuration function. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-07-20ENGR00176555 ESAI: Increase DMA buffer size to reslove occasional aplay underrunLionel Xu
The underrun warning appears when playback high bit-rate and multi-channel( greater than 6) wav, increase DMA buffer size can resolve this issue. Signed-off-by: Lionel Xu <Lionel.Xu@freescale.com>
2012-07-20ENGR00212318 ASRC:update to in/out width configChen Liangjun
The origin ASRC driver did not support input and output wordwidth config but an total wordwidth config instead. And the input wordwith and output wordwidth are all fixed to 24 bit. In this path, we do things below: 1 Update to use input wordwidth and output wordwidth config seperately instead of an total wordwidth config. 2 Set corresponding DMA(input/output) buswidth according ASRC's input and output wordwidth config. 3 Support 16/24 bit input wordwidth and 24 bit output wordwidth. Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-07-20ENGR00213616 wm8962: set default volume for playback and recordGary Zhang
set default volume for playback and record Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-07-20ENGR00163374 ESAI: ESAI driver does not support mono playbackLionel Xu
To remove mono playback support for ESAI. Signed-off-by: Lionel Xu <Lionel.Xu@freescale.com>
2012-07-20ENGR00213179 Mx6x,Fix HDMI build wariningSandor Yu
Fix HDMI build warining Signed-off-by: Sandor Yu <R01008@freescale.com>
2012-07-20ENGR00180390 ESAI: add amixer ASRC p2p API(ALSALIB)Chen Liangjun
If we want to use ESAI call ASRC, we need to know the input sample rate as well as the output sample rate. however, cause of ALSA-LIB, the input sample rate pass down to ALSA-DRIVER is not accurate. For example, if the ALSA-DRIVER only support 48KHz playback and we want to play an 16KHz audio file, the sample rate params the ALSA DRIVER see is 48KHz but not 16KHz. So, the ALSA-DRIVER do not know the original sample rate, and thus unable to config ASRC properly. In this patch, we add an amixer control interface for alsa lib plugin to config the input sample rate before playback. If no plugin, user can call the amixer control interface to manually use ASRC for rate convert. For example, if we need to playback an 24bit_24K audio wav file without call the plug. The sound card is 0. 1 Get the ASRC capability: amixer sget "ASRC" 1 Set the input samplerate: amixer sset "ASRC" "24KHz" 2 Play; aplay -Dhw:0 audio_24k24S-S24_LE.wav Signed-off-by: Chen Liangjun <b36089@freescale.com>
2012-07-20ENGR00212542 SPDIF: move clock operationGary Zhang
Now clock operation occurs in mxc_spdif_trigger(), and because clock operation is forbidden to exist in interrupt context, move disabling clock operation to mxc_spdif_shutdown() Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-07-20ENGR00178461-02 HDMI1080p: hotplug cause kernel panic. 10%Sandor Yu
It is a warning cause by HDMI driver irq enable count mismatch. The purpose of maintain HDMI irq count is to disable hdmi_iahb_clk when HDMI cable plugout. But hdmi_iahb_clk parent ahb clock is always enabled when system run, so hdmi_iabh_clk power consumption is very low. The function clk_get_usecount introduce by irq count maintain is not safety in SMP. Remove HDMI irq count in HDMI driver, keep hdmi_iahb_clk always run. and disable hdmi_iahb_clk and hdmi_isfr_clk when FB Blank. Signed-off-by: Sandor Yu <R01008@freescale.com>
2012-07-20ENGR00211132 ESAI: fix build warningGary Zhang
imx-pcm.h should not include imx-ssi.h, or else DRV_NAME is redefined Signed-off-by: Gary Zhang <b13634@freescale.com>
2012-07-20ENGR00209739-5 WM8962: check DMIC statusGary Zhang
if there are no amic_detect pin, by checking DMIC pin status to get to know which mic is used Signed-off-by: Gary Zhang <b13634@freescale.com>