summaryrefslogtreecommitdiffstats
path: root/sound/soc/sunxi/sun4i-i2s.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: sun4i-i2s: Incorrect SR and WSS computationMarcus Cooper2019-07-311-2/+2
| | | | | | | | | | The A64 audio codec uses the original I2S block but the SR and WSS computation currently assigned is for the newer block. Fixes: 619c15f7fac9 (ASoC: sun4i-i2s: Change SR and WSS computation) Signed-off-by: Marcus Cooper <codekipper@gmail.com> Link: https://lore.kernel.org/r/20190729152130.27955-1-codekipper@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'v5.2-rc6' into asoc-5.3Mark Brown2019-06-261-5/+1
|\ | | | | | | Linux 5.2-rc6
| * Merge tag 'sound-5.2-rc5' of ↵Linus Torvalds2019-06-141-1/+5
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "It might feel like deja vu to receive a bulk of changes at rc5, and it happens again; we've got a collection of fixes for ASoC. Most of fixes are targeted for the newly merged SOF (Sound Open Firmware) stuff and the relevant fixes for Intel platforms. Other than that, there are a few regression fixes for the recent ASoC core changes and HD-audio quirk, as well as a couple of FireWire fixes and for other ASoC codecs" * tag 'sound-5.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (54 commits) Revert "ALSA: hda/realtek - Improve the headset mic for Acer Aspire laptops" ALSA: ice1712: Check correct return value to snd_i2c_sendbytes (EWS/DMX 6Fire) ALSA: oxfw: allow PCM capture for Stanton SCS.1m ALSA: firewire-motu: fix destruction of data for isochronous resources ASoC: Intel: sst: fix kmalloc call with wrong flags ASoC: core: Fix deadlock in snd_soc_instantiate_card() SoC: rt274: Fix internal jack assignment in set_jack callback ALSA: hdac: fix memory release for SST and SOF drivers ASoC: SOF: Intel: hda: use the defined ppcap functions ASoC: core: move DAI pre-links initiation to snd_soc_instantiate_card ASoC: Intel: cht_bsw_rt5672: fix kernel oops with platform_name override ASoC: Intel: cht_bsw_nau8824: fix kernel oops with platform_name override ASoC: Intel: bytcht_es8316: fix kernel oops with platform_name override ASoC: Intel: cht_bsw_max98090: fix kernel oops with platform_name override ASoC: sun4i-i2s: Add offset to RX channel select ASoC: sun4i-i2s: Fix sun8i tx channel offset mask ASoC: max98090: remove 24-bit format support if RJ is 0 ASoC: da7219: Fix build error without CONFIG_I2C ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error ASoC: SOF: fix DSP oops definitions in FW ABI ...
| * | treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner2019-05-301-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | Merge branch 'asoc-5.2' into asoc-5.3Mark Brown2019-06-061-1/+5
|\ \ \ | | |/ | |/|
| * | ASoC: sun4i-i2s: Add offset to RX channel selectMarcus Cooper2019-06-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whilst testing the capture functionality of the i2s on the newer SoCs it was noticed that the recording was somewhat distorted. This was due to the offset not being set correctly on the receiver side. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: sun4i-i2s: Fix sun8i tx channel offset maskMarcus Cooper2019-06-041-1/+1
| |/ | | | | | | | | | | | | | | | | | | Although not causing any noticeable issues, the mask for the channel offset is covering too many bits. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sun4i-i2s: Change SR and WSS computationMaxime Ripard2019-06-061-16/+55
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current computation for the SR (sample resolution) and the WSS (word slot size) register parameters is based on a switch returning the matching parameters for a given params width. Later SoCs (A83t, H3, A64) changed that calculation, which was loosely the same with an offset. Therefore, an offset was added to adjust those parameters. However, the calculation is a bit less trivial than initially thought. Indeed, while we assumed that SR and WSS were always the same, on older SoCs, SR will max at 24 (since those SoCs do not support 32 bits formats), but the word size can be 32. Newer SoCs can also support a much larger range (8 bits to 32 bits, by increments of 4) of size than the older SoCs could. Finally, the A64 and A83t were never adjusted to have that offset in the first place, and were therefore broken from that point of view. In order to fix all those issues, let's introduce two functions, get_wss and get_sr, with their respective implementations for all the SoCs supported so far. Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T") Fixes: 66ecce332538 ("ASoC: sun4i-i2s: Add compatibility with A64 codec I2S") Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: move code from startup/shutdown hooks into pm_runtime hooksVasily Khoruzhick2018-10-211-36/+25
| | | | | | | | | | | | | | | startup() and shutdown() hooks are called for both substreams, so stopping either substream when another is running breaks the latter. E.g. playback breaks if capture is stopped when playback is running. Move code from startup() and shutdown() to resume() and suspend() hooks respectively to fix this issue Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Add compatibility with A64 codec I2SMarcus Cooper2018-10-171-0/+21
| | | | | | | | | | | | The I2S block used for the audio codec in the A64 differs from other 3 I2S modules in A64 and isn't compatible with H3. But it is very similar to what is found in A10(sun4i). However, its TX FIFO is located at a different address. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Fix RX slot number of SUN8IYong Deng2018-02-261-1/+1
| | | | | | | | | | I2S's RX slot number of SUN8I should be shifted 4 bit to left. Fixes: 7d2993811a1e ("ASoC: sun4i-i2s: Add support for H3") Signed-off-by: Yong Deng <yong.deng@magewell.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
*-. Merge remote-tracking branches 'asoc/topic/sun4i-i2s', 'asoc/topic/sunxi', ↵Mark Brown2018-01-051-6/+51
|\ \ | | | | | | | | | 'asoc/topic/symmetry', 'asoc/topic/tas5720' and 'asoc/topic/tas6424' into asoc-next
| | * ASoC: sun4i-i2s: Add support for A83TChen-Yu Tsai2017-12-121-0/+21
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The I2S controller in the A83T is mostly compatible with the one found in earlier SoCs such as the A20 and A31. While the documents publicly available for the A83T do not cover this hardware, the officially released BSP kernel does have register definitions for it. These were matched against the A20 user manual. The only difference is the TX FIFO and interrupt status registers have been swapped around, like what we have seen with the SPDIF controller. This patch adds support for this hardware. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: sun4i-i2s: Show detailed error when DAI configuration callbacks failChen-Yu Tsai2017-12-141-6/+30
|/ | | | | | | | | | | | | | | | | | | When any of the DAI hardware configuration callbacks (.hw_param, .set_fmt, .set_sysclk) fails, there is no explanation about why it failed. This is particularly confusing for .hw_param, which covers many parameters of the DAI. Telling the users what parameter isn't supported, and what the requested value was goes a long way for developers trying to combine sun4i-i2s with external codecs. This patch adds dev_err calls explaining what isn't supported or failed, and what the value was. sun4i_i2s_set_clk_rate()'s first parameter was changed to a struct snd_soc_dai *dai, so we can get the underlying device. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Marcus Cooper <codekipper@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Add support for H3Marcus Cooper2017-08-211-2/+174
| | | | | | | | | | | | | | The sun8i-h3 introduces a lot of changes to the i2s block such as different register locations, extended clock division and more operational modes. As we have to consider the earlier implementation then these changes need to be isolated. None of the new functionality has been implemented yet, the driver has just been expanded to allow it work on the H3 SoC. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Update global enable with bitmaskMarcus Cooper2017-08-211-3/+4
| | | | | | | | | | | The default value of the config register is different on newer SoCs and therefore enabling/disabling with a register write will clear bits used to set the direction of the clock and frame pins. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Check for slave select bitMarcus Cooper2017-08-211-16/+21
| | | | | | | | | | The newer SoCs do not have this setting. Instead they set the pin direction. Add a check to see if the bit is valid and if so set it accordingly. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Add regmap field to set DAI formatMarcus Cooper2017-08-211-3/+12
| | | | | | | | | | On the newer SoCs the bits to configure the operational mode are located in a different register. Add a regmap field so that this location can be configured. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Add mclk enable regmap fieldMarcus Cooper2017-08-211-2/+14
| | | | | | | | | The location of the mclk output enable bit is different on newer SoCs. Use a regmap field to enable it. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: bclk and lrclk polarity tidyupMarcus Cooper2017-08-211-13/+32
| | | | | | | | | | On newer SoCs the bit fields for the blck and lrclk polarity are in a different locations. Use regmap fields to set the polarity bits as intended. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Add regfields for word size select and sample resolutionMarcus Cooper2017-08-211-3/+28
| | | | | | | | | | | | On newer SoCs the location of the slot width select and sample resolution are different and also there is a bigger range of support. For the current supported rates then an offset is required. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Add regmap fields for channelsMarcus Cooper2017-08-211-8/+69
| | | | | | | | | | | | | | On the original i2s block the channel mapping and selection were configured for stereo audio by default: This is not the case with the newer SoCs and they are also located at different offsets. To support the newer SoC then regmap fields have been added to the quirks and these are initialised to their correct settings during probing. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Add TX FIFO offset to quirksMarcus Cooper2017-08-141-1/+6
| | | | | | | | | It has been seen that the newer SoCs have a different TX FIFO address. Add this to the quirks structure. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Add regmap config to quirksMarcus Cooper2017-08-141-3/+7
| | | | | | | | | | The newer SoCs have a larger range than the original SoC that this driver was developed for. By adding the regmap config to the quirks then the driver can initialise the managed register map correctly. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Add clkdiv offsets to quirksMarcus Cooper2017-08-141-0/+8
| | | | | | | | | | The BCLKDIV and MCLKDIV found on newer SoCs start from an offset of 1. Add the functionality to adjust the division values according to the needs to the device being used. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Extend quirks scopeMarcus Cooper2017-08-011-8/+14
| | | | | | | | | In preparation for the changes required to support newer SoCs then quirks has been moved and also added to the device structure. Signed-off-by: Marcus Cooper <codekipper@gmail.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i: explicitly request exclusive reset controlPhilipp Zabel2017-07-191-1/+1
| | | | | | | | | | | | | | | | | | Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting reset lines") started to transition the reset control request API calls to explicitly state whether the driver needs exclusive or shared reset control behavior. Convert all drivers requesting exclusive resets to the explicit API call so the temporary transition helpers can be removed. No functional changes. Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Chen-Yu Tsai <wens@csie.org> Cc: alsa-devel@alsa-project.org Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5677', ↵Mark Brown2017-02-191-2/+55
|\ \ | | | | | | | | | 'asoc/topic/samsung', 'asoc/topic/simple' and 'asoc/topic/sunxi' into asoc-next
| | * ASoC: sun4i-i2s: Add quirks to handle a31 compatibleMylène Josserand2017-02-031-2/+55
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Some SoCs have a reset line that must be asserted/deasserted. This patch adds a quirk to handle the new compatible "allwinner,sun6i-a31-i2s" which will deassert the reset line on probe function and assert it on remove's one. This new compatible is useful in case of A33 codec driver, for example. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: sun4i-i2s: Increase DMA max burst to 8Mylène Josserand2017-01-171-2/+2
|/ | | | | | | | | | | | | | | | As done previously for sun4i-codec, the DMA maxburst of 4 is not supported by every SoCs so the DMA controller engine returns "unsupported value". As a maxburst of 8 is supported by all variants, this patch increases it to 8. For more details, see commit from Chen-Yu Tsai: commit 730e2dd0cbc7 ("ASoC: sun4i-codec: Increase DMA max burst to 8") Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sunxi: i2s: Implement set_sysclkMaxime Ripard2016-11-091-15/+38
| | | | | | | | | | | | | | | In our i2s driver, we were previously trying to guess which oversample the user wanted to use by looking at the rate and trying to max it. However, the cards, and especially simple-card with its mclk-fs property will already provide the expected oversample ratio by using the set_sysclk callback. We can thus implement it and remove the logic to deal with the runtime guess. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sun4i-i2s: Implement capture supportMaxime Ripard2016-11-031-3/+49
| | | | | | | | The i2s driver was only implementing playback for now. Implement capture to make sure that's not a limitation anymore. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sunxi: remove redundant dev_err call in sun4i_i2s_probe()Wei Yongjun2016-07-041-3/+1
| | | | | | | | | There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sunxi: fix semicolon.cocci warningskbuild test robot2016-07-011-1/+1
| | | | | | | | | | | | sound/soc/sunxi/sun4i-i2s.c:624:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: sunxi: Add Allwinner A10 Digital Audio driverMaxime Ripard2016-06-291-0/+703
The Allwinner A10 and later come with a hardware block that used for the PCM and I2S interfaces. Add a driver for it in ASoC. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Tested-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
OpenPOWER on IntegriCloud