summaryrefslogtreecommitdiffstats
path: root/sound/soc/xilinx
AgeCommit message (Collapse)AuthorFilesLines
2022-01-24ASoC: xilinx: xlnx_i2s: Handle sysclk settingRobert Hancock1-10/+81
This driver previously only handled the set_clkdiv divider callback when setting the SCLK Out Divider field in the I2S Timing Control register. However, when using the simple-audio-card driver, the set_sysclk function is called but not set_clkdiv. This caused the divider not to be set, leaving it at an invalid value of 0 and resulting in a very low SCLK output rate. Handle set_clkdiv and store the sysclk (MCLK) value for later use in hw_params to set the SCLK Out Divider such that: MCLK/SCLK = divider * 2 Signed-off-by: Robert Hancock <robert.hancock@calian.com> Link: https://lore.kernel.org/r/20220120195832.1742271-4-robert.hancock@calian.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24ASoC: xilinx: xlnx_i2s: create drvdata structureRobert Hancock1-31/+35
An upcoming change will require storing additional driver data other than the memory base address. Create a drvdata structure and use that rather than storing the raw base address pointer. Signed-off-by: Robert Hancock <robert.hancock@calian.com> Link: https://lore.kernel.org/r/20220120195832.1742271-3-robert.hancock@calian.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24ASoC: xilinx: xlnx_formatter_pcm: Handle sysclk settingRobert Hancock1-0/+25
This driver did not set the MM2S Fs Multiplier Register to the proper value for playback streams. This needs to be set to the sample rate to MCLK multiplier, or random stream underflows can occur on the downstream I2S transmitter. Store the sysclk value provided via the set_sysclk callback and use that in conjunction with the sample rate in the hw_params callback to calculate the proper value to set for this register. Fixes: 6f6c3c36f091 ("ASoC: xlnx: add pcm formatter platform driver") Signed-off-by: Robert Hancock <robert.hancock@calian.com> Link: https://lore.kernel.org/r/20220120195832.1742271-2-robert.hancock@calian.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-10ASoC: xilinx: xlnx_formatter_pcm: Make buffer bytes multiple of period bytesRobert Hancock1-3/+24
This patch is based on one in the Xilinx kernel tree, "ASoc: xlnx: Make buffer bytes multiple of period bytes" by Devarsh Thakkar. The same issue exists in the mainline version of the driver. The original patch description is as follows: "The Xilinx Audio Formatter IP has a constraint on period bytes to be multiple of 64. This leads to driver changing the period size to suitable frames such that period bytes are multiple of 64. Now since period bytes and period size are updated but not the buffer bytes, this may make the buffer bytes unaligned and not multiple of period bytes. When this happens we hear popping noise as while DMA is being done the buffer bytes are not enough to complete DMA access for last period of frame within the application buffer boundary. To avoid this, align buffer bytes too as multiple of 64, and set another constraint to always enforce number of periods as integer. Now since, there is already a rule in alsa core to enforce Buffer size = Number of Periods * Period Size this automatically aligns buffer bytes as multiple of period bytes." Fixes: 6f6c3c36f091 ("ASoC: xlnx: add pcm formatter platform driver") Cc: Devarsh Thakkar <devarsh.thakkar@xilinx.com> Signed-off-by: Robert Hancock <robert.hancock@calian.com> Link: https://lore.kernel.org/r/20220107214711.1100162-2-robert.hancock@calian.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-21ASoC: xlnx: Use platform_get_irq() to get the interruptLad Prabhakar1-7/+3
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Link: https://lore.kernel.org/r/20211221170100.27423-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-07-30ASoC: xilinx: Fix reference to PCM buffer addressTakashi Iwai1-2/+2
PCM buffers might be allocated dynamically when the buffer preallocation failed or a larger buffer is requested, and it's not guaranteed that substream->dma_buffer points to the actually used buffer. The driver needs to refer to substream->runtime->dma_addr instead for the buffer address. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20210728112353.6675-4-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-18sound: remove duplicate "the the" phrase in Kconfig textColin Ian King1-2/+2
There are a couple of occurrences of "the the" in the Kconfig text. Fix these. Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Link: https://lore.kernel.org/r/20200817224706.6139-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-11ASoC: xilinx: Use managed buffer allocationTakashi Iwai1-12/+1
Clean up the driver with the new managed buffer allocation API. The hw_free callback became superfluous and got dropped. Cc: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20191210142614.19405-16-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-11ASoC: xilinx: Drop superfluous ioctl PCM opsTakashi Iwai1-1/+0
ASoC PCM core deals the empty ioctl field now as default. Let's kill the redundant lines. Cc: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20191210145406.21419-21-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2019-11-07Merge tag 'asoc-v5.5' of ↵Takashi Iwai1-39/+24
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v5.5 Some big changes in the core but more about cleanps and refactorings than new features, plus a collection of new drivers and lots of small fixes and improvements to existing ones. - Lots more cleanups from Morimoto-san. Now that everything is a component this is mostly about refactorings to clarify and simplify the core, a combination of things that are no longer required due to refactorings and spotting similarities. - Many fixes to the Sound Open Firmware code. - Wake on voice support for Chromebooks. - SPI support for RT5677. - New drivers for Analog Devices ADAU7118, Intel Cannonlake systems with RT1011 and RT5682, Texas Instruments TAS2562 and TAS2770.
2019-10-08ASoC: xilinx: xlnx_formatter_pcm: remove snd_pcm_opsKuninori Morimoto1-31/+23
snd_pcm_ops is no longer needed. Let's use component driver callback. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87bluzaf0y.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-07sound: Fix Kconfig indentationKrzysztof Kozlowski1-10/+10
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20191004144931.3851-1-krzk@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-10-01ASoC: xlnx: Use devm_platform_ioremap_resource() in xlnx_formatter_pcm_probe()Markus Elfring1-8/+1
Simplify this function implementation by using a known wrapper function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Link: https://lore.kernel.org/r/8f7cf483-6ab3-d00f-5606-863e9f5b31fc@web.de Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-02ASoC: Remove dev_err() usage after platform_get_irq()Stephen Boyd1-2/+0
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20190730181557.90391-50-swboyd@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-31ASoC: xlnx: use devm_platform_ioremap_resource() to simplify codeYueHaibing2-5/+2
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190727150738.54764-32-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2-0/+2
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-08ASoC: xlnx: fix up for snd_pcm_lib_preallocate_pages_for_all() API changeStephen Rothwell1-1/+2
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-01-14ASoC: xlnx: parse AES audio parametersMaruthi Srinivas Bayyavarapu1-0/+143
AES channel status carries various audio parameters. If channel status is detected, current patch extracts sample rate and bit depth parameters of the incoming stream during capture. Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-07ASoC: xlnx: enable SPDIF driver buildMaruthi Srinivas Bayyavarapu2-0/+9
Added SPDIF driver build related changes. Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-07ASoC: xlnx: add SPDIF audio driverMaruthi Srinivas Bayyavarapu1-0/+339
Added SPDIF audio driver. This provides playback and capture of AES audio over SPDIF interface. Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probeGustavo A. R. Silva1-2/+2
Currently, if platform_get_irq_byname() fails, the returned error turns into a huge value, once it is being store into a variable of type unsigned int, hence never actually reporting any error and causing unexpected behavior when using the values stored in aud_drv_data->s2mm_irq and aud_drv_data->mm2s_irq. Fix this by changing the type of variables s2mm_irq and mm2s_irq in structure xlnx_pcm_drv_data from unsigned int to int. Addresses-Coverity-ID: 1476096 ("Unsigned compared against 0") Fixes: 796175a94a7f ("ASoC: xlnx: add pcm formatter platform driver") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: xlnx: enable audio formatter driver buildMaruthi Srinivas Bayyavarapu2-0/+9
Enable audio formatter driver build. Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: xlnx: add pcm formatter platform driverMaruthi Srinivas Bayyavarapu1-0/+565
The audio formatter PL IP supports DMA of two streams - mm2s and s2mm for playback and capture respectively. Apart from DMA, IP also does conversions like PCM to AES and viceversa. This patch adds DMA component driver for the IP. Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: xlnx: change license header format styleMaruthi Srinivas Bayyavarapu1-8/+7
Changed License header from C to C++ style comment block. Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: xlnx: Grammar s/the the/the/Geert Uytterhoeven1-1/+1
Fixes: 33f8db9a89200c18 ("ASoC: xlnx: enable i2s driver build") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-13ASoC: xlnx: enable i2s driver buildMaruthi Srinivas Bayyavarapu2-0/+10
Enabled i2s driver build option. Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-13ASoC: xlnx: Add i2s driverMaruthi Srinivas Bayyavarapu1-0/+185
I2S IP instance can work in transmitter/playback or receiver/capture mode exclusively. The patch registers corresponding instance as ASoC component with audio framework. Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com> Signed-off-by: Mark Brown <broonie@kernel.org>