summaryrefslogtreecommitdiffstats
path: root/sound/soc
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'asoc-v6.9' of ↵Takashi Iwai2024-03-11167-1813/+11884
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.9 This has been quite a small release, there's a lot of driver specific cleanups and minor enhancements but hardly anything on the core and only one new driver. Highlights include: - SoundWire support for AMD ACP 6.3 systems. - Support for reporting version information for AVS firmware. - Support DSPless mode for Intel Soundwire systems. - Support for configuring CS35L56 amplifiers using EFI calibration data. - Log which component is being operated on as part of power management trace events. - Support for Microchip SAM9x7, NXP i.MX95 and Qualcomm WCD939x
| * ASoC: Intel: catpt: Carefully use PCI bitwise constantsAndy Shevchenko2024-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PM constants for PCI devices are defined with bitwise annotation. When used as is, sparse complains about that: .../catpt/dsp.c:390:9: warning: restricted pci_power_t degrades to integer .../catpt/dsp.c:414:9: warning: restricted pci_power_t degrades to integer Force them to be u32 in the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240307163734.3852754-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: codecs: ES8326: Changing members of private structureZhang Yi2024-03-071-17/+1
| | | | | | | | | | | | | | | | | | We don't use mic1_src and mic2_src.so we delete these two members. We changed the default value of interrupt-clk for headphone detection Signed-off-by: Zhang Yi <zhangyi@everest-semi.com> Link: https://msgid.link/r/20240307051222.24010-2-zhangyi@everest-semi.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: trace: add event to snd_soc_dapm trace eventsLuca Ceresoli2024-03-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the event value to the snd_soc_dapm_start and snd_soc_dapm_done trace events to make them more informative. Trace before: aplay-229 [000] 250.140309: snd_soc_dapm_start: card=vscn-2046 aplay-229 [000] 250.167531: snd_soc_dapm_done: card=vscn-2046 aplay-229 [000] 251.169588: snd_soc_dapm_start: card=vscn-2046 aplay-229 [000] 251.195245: snd_soc_dapm_done: card=vscn-2046 Trace after: aplay-214 [000] 693.290612: snd_soc_dapm_start: card=vscn-2046 event=1 aplay-214 [000] 693.315508: snd_soc_dapm_done: card=vscn-2046 event=1 aplay-214 [000] 694.537349: snd_soc_dapm_start: card=vscn-2046 event=2 aplay-214 [000] 694.563241: snd_soc_dapm_done: card=vscn-2046 event=2 Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://msgid.link/r/20240306-improve-asoc-trace-events-v1-2-edb252bbeb10@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: trace: add component to set_bias_level trace eventsLuca Ceresoli2024-03-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The snd_soc_bias_level_start and snd_soc_bias_level_done trace events currently look like: aplay-229 [000] 1250.140778: snd_soc_bias_level_start: card=vscn-2046 val=1 aplay-229 [000] 1250.140784: snd_soc_bias_level_done: card=vscn-2046 val=1 aplay-229 [000] 1250.140786: snd_soc_bias_level_start: card=vscn-2046 val=2 aplay-229 [000] 1250.140788: snd_soc_bias_level_done: card=vscn-2046 val=2 kworker/u8:1-21 [000] 1250.140871: snd_soc_bias_level_start: card=vscn-2046 val=1 kworker/u8:0-11 [000] 1250.140951: snd_soc_bias_level_start: card=vscn-2046 val=1 kworker/u8:0-11 [000] 1250.140956: snd_soc_bias_level_done: card=vscn-2046 val=1 kworker/u8:0-11 [000] 1250.140959: snd_soc_bias_level_start: card=vscn-2046 val=2 kworker/u8:0-11 [000] 1250.140961: snd_soc_bias_level_done: card=vscn-2046 val=2 kworker/u8:1-21 [000] 1250.167219: snd_soc_bias_level_done: card=vscn-2046 val=1 kworker/u8:1-21 [000] 1250.167222: snd_soc_bias_level_start: card=vscn-2046 val=2 kworker/u8:1-21 [000] 1250.167232: snd_soc_bias_level_done: card=vscn-2046 val=2 kworker/u8:0-11 [000] 1250.167440: snd_soc_bias_level_start: card=vscn-2046 val=3 kworker/u8:0-11 [000] 1250.167444: snd_soc_bias_level_done: card=vscn-2046 val=3 kworker/u8:1-21 [000] 1250.167497: snd_soc_bias_level_start: card=vscn-2046 val=3 kworker/u8:1-21 [000] 1250.167506: snd_soc_bias_level_done: card=vscn-2046 val=3 There are clearly multiple calls, one per component, but they cannot be discriminated from each other. Change the ftrace events to also print the component name, to make it clear which part of the code is involved. This requires changing the passed value from a struct snd_soc_card, where the DAPM context is not kwown, to a struct snd_soc_dapm_context where it is obviously known but the a card pointer is also available. With this change, the resulting trace becomes: aplay-247 [000] 1436.357332: snd_soc_bias_level_start: card=vscn-2046 component=(none) val=1 aplay-247 [000] 1436.357338: snd_soc_bias_level_done: card=vscn-2046 component=(none) val=1 aplay-247 [000] 1436.357340: snd_soc_bias_level_start: card=vscn-2046 component=(none) val=2 aplay-247 [000] 1436.357343: snd_soc_bias_level_done: card=vscn-2046 component=(none) val=2 kworker/u8:4-215 [000] 1436.357437: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=1 kworker/u8:5-231 [000] 1436.357518: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=1 kworker/u8:5-231 [000] 1436.357523: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=1 kworker/u8:5-231 [000] 1436.357526: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=2 kworker/u8:5-231 [000] 1436.357528: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=2 kworker/u8:4-215 [000] 1436.383217: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=1 kworker/u8:4-215 [000] 1436.383221: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=2 kworker/u8:4-215 [000] 1436.383231: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=2 kworker/u8:5-231 [000] 1436.383468: snd_soc_bias_level_start: card=vscn-2046 component=ff320000.i2s val=3 kworker/u8:5-231 [000] 1436.383472: snd_soc_bias_level_done: card=vscn-2046 component=ff320000.i2s val=3 kworker/u8:4-215 [000] 1436.383503: snd_soc_bias_level_start: card=vscn-2046 component=ff560000.codec val=3 kworker/u8:4-215 [000] 1436.383513: snd_soc_bias_level_done: card=vscn-2046 component=ff560000.codec val=3 Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://msgid.link/r/20240306-improve-asoc-trace-events-v1-1-edb252bbeb10@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: Intel: atom: sst_ipc: Remove unused intel-mid.hAndy Shevchenko2024-03-051-1/+2
| | | | | | | | | | | | | | | | | | | | intel-mid.h is providing some core parts of the South Complex PM, which are usually are not used by individual drivers. In particular, this driver doesn't use it, so simply remove the unused header. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240305160723.1363534-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: soc-core.c: Prefer to return dai->driver->name in snd_soc_dai_name_get()Chancel Liu2024-03-041-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASoC machine driver can use snd_soc_{of_}get_dlc() (A) to get DAI name for dlc (snd_soc_dai_link_component). In this function call dlc->dai_name is parsed via snd_soc_dai_name_get() (B). (A) int snd_soc_get_dlc(...) { ... (B) dlc->dai_name = snd_soc_dai_name_get(dai); ... } (B) has a priority to return dai->name as dlc->dai_name. In most cases card can probe successfully. However it has an issue that ASoC tries to rebind card. Here is a simplified flow for example: | a) Card probes successfully at first | b) One of the component bound to this card is removed for some | reason the component->dev is released | c) That component is re-registered v d) ASoC calls snd_soc_try_rebind_card() a) points dlc->dai_name to dai->name. b) releases all resource of the old DAI. c) creates new DAI structure. In result d) can not use dlc->dai_name to add new created DAI. So it's reasonable that prefer to return dai->driver->name in snd_soc_dai_name_get() because dai->driver is a pre-defined global variable. Also update snd_soc_is_matching_dai() for alignment. Signed-off-by: Chancel Liu <chancel.liu@nxp.com> Link: https://msgid.link/r/20240304072128.2845432-1-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: cs-amp-lib: Add KUnit test for calibration helpersRichard Fitzgerald2024-03-044-2/+740
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a KUnit test for the cs-amp-lib library. This has test cases for cs_amp_get_efi_calibration_data() and cs_amp_write_cal_coeffs(). A KUNIT_STATIC_STUB_REDIRECT() has been added to cs_amp_get_efi_variable() and cs_amp_write_cal_coeff() so that the KUnit test can redirect these to test harness functions. Much of the testing involves invoking the same function with different parameters, i.e. the number of amps and the amp index within the array. This uses parameterization rather than looping. The idea is to avoid looping over configurations within one test case as that has a higher chance of having a bug that doesn't actually test all the expected cases. Having the test run exactly one configuration, and then tear-down, is less prone to accidentally skipped configurations. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://msgid.link/r/20240304143705.26362-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: meson: axg-fifo: use FIELD helpersJerome Brunet2024-02-274-33/+31
| | | | | | | | | | | | | | | | Use FIELD_GET() and FIELD_PREP() helpers instead of doing it manually. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://msgid.link/r/20240227150826.573581-1-jbrunet@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: cs35l56: Prevent bad sign extension in cs35l56_read_silicon_uid()Richard Fitzgerald2024-02-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cast u8 values to u32 when using them to build a 32-bit unsigned value that is then stored in a u64. This avoids the possibility of a bad sign extension where the u8 is implicitly extended to an int, thus changing it from an unsigned to a signed value. Whether this is a real problem is debatable, but it does no harm to ensure that the u8 are cast to a suitable type for shifting. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: e1830f66f6c6 ("ASoC: cs35l56: Add helper functions for amp calibration") Link: https://msgid.link/r/20240227100042.99-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: meson: axg fixes and clean-upMark Brown2024-02-265-19/+36
| |\ | | | | | | | | | | | | | | | | | | | | | Merge series from Jerome Brunet <jbrunet@baylibre.com>: This are various fixes and clean up gathered while working on Amlogic audio support. These help better handle higher and unusual clock configuration for TDM, SPDIF or PDM.
| | * ASoC: meson: axg-fifo: take continuous ratesJerome Brunet2024-02-263-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rate of the stream does not matter for the fifos of the axg family. Fifos will just push or pull data to/from the DDR according to consumption or production of the downstream element, which is the DPCM backend. Drop the rate list and allow continuous rates. The lower and upper rate are set according what is known to work with the different backends This allows the PDM input backend to also use continuous rates. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://msgid.link/r/20240223175116.2005407-6-jbrunet@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: meson: axg-spdifin: use max width for rate detectionJerome Brunet2024-02-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use maximum width between 2 edges to setup spdifin thresholds and detect the input sample rate. This comes from Amlogic SDK and seems to be marginally more reliable than minimum width. This is done to align with a future eARC support. No issue was reported with minimum width so far, this is considered to be an update so no Fixes tag is set. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://msgid.link/r/20240223175116.2005407-5-jbrunet@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: meson: axg-tdm-interface: update error format error tracesJerome Brunet2024-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASoC stopped using CBS_CFS and CBM_CFM a few years ago but the traces in the amlogic tdm interface driver did not follow. Update this to match the new format names Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://msgid.link/r/20240223175116.2005407-4-jbrunet@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: meson: axg-tdm-interface: add frame rate constraintJerome Brunet2024-02-261-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to Amlogic datasheets for the SoCs supported by this driver, the maximum bit clock rate is 100MHz. The tdm interface allows the rates listed by the DAI driver, regardless of the number slots or their width. However, these will impact the bit clock rate. Hitting the 100MHz limit is very unlikely for most use cases but it is possible. For example with 32 slots / 32 bits wide, the maximum rate is no longer 384kHz but ~96kHz. Add the constraint accordingly if the component is not already active. If it is active, the rate is already constrained by the first stream rate. Fixes: d60e4f1e4be5 ("ASoC: meson: add tdm interface driver") Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://msgid.link/r/20240223175116.2005407-3-jbrunet@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: meson: axg-tdm-interface: fix mclk setup without mclk-fsJerome Brunet2024-02-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, when mclk-fs is not provided, the tdm-interface driver requests an MCLK that is 4x the bit clock, SCLK. However there is no justification for this: * If the codec needs MCLK for its operation, mclk-fs is expected to be set according to the codec requirements. * If the codec does not need MCLK the minimum is 2 * SCLK, because this is minimum the divider between SCLK and MCLK can do. Multiplying by 4 may cause problems because the PLL limit may be reached sooner than it should, so use 2x instead. Fixes: d60e4f1e4be5 ("ASoC: meson: add tdm interface driver") Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://msgid.link/r/20240223175116.2005407-2-jbrunet@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: codecs: Simplify mclk initializationMark Brown2024-02-266-40/+20
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Cezary Rojewski <cezary.rojewski@intel.com>: The patchset may not cover all codecs found in the codecs/ directory - noticed a possible improvement and grepped for similar pattern across C files found in the directory. Those addressed here seem pretty straightforward. Most of clk_xxx() functions do check if provided clk-pointer is non-NULL. These do not check if the pointer is an error-pointer. Providing such to a clk_xxx() results in a panic. By utilizing _optional() variant of devm_clk_get() the driver code is both simplified and more robust. There is no need to remember about IS_ERR(clk) checks each time mclk is accessed.
| | * | ASoC: codecs: rt5660: Simplify mclk initializationCezary Rojewski2024-02-211-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of clk_xxx() functions do check if provided clk-pointer is non-NULL. These do not check if the pointer is an error-pointer. Providing such to a clk_xxx() results in a panic. By utilizing _optional() variant of devm_clk_get() the driver code is both simplified and more robust. There is no need to remember about IS_ERR(clk) checks each time mclk is accessed. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240221152516.852353-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: codecs: rt5640: Simplify mclk initializationCezary Rojewski2024-02-211-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of clk_xxx() functions do check if provided clk-pointer is non-NULL. These do not check if the pointer is an error-pointer. Providing such to a clk_xxx() results in a panic. rt5640_set_dai_sysclk() is an example of that - clk_set_rate() is not guarded by IS_ERR(). By utilizing _optional() variant of devm_clk_get() the driver code is both simplified and more robust. There is no need to remember about IS_ERR(clk) checks each time mclk is accessed. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240221152516.852353-6-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: codecs: rt5616: Simplify mclk initializationCezary Rojewski2024-02-211-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of clk_xxx() functions do check if provided clk-pointer is non-NULL. These do not check if the pointer is an error-pointer. Providing such to a clk_xxx() results in a panic. By utilizing _optional() variant of devm_clk_get() the driver code is both simplified and more robust. There is no need to remember about IS_ERR(clk) checks each time mclk is accessed. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240221152516.852353-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: codecs: rt5514: Simplify mclk initializationCezary Rojewski2024-02-211-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of clk_xxx() functions do check if provided clk-pointer is non-NULL. These do not check if the pointer is an error-pointer. Providing such to a clk_xxx() results in a panic. By utilizing _optional() variant of devm_clk_get() the driver code is both simplified and more robust. There is no need to remember about IS_ERR(clk) checks each time mclk is accessed. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240221152516.852353-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: codecs: nau8825: Simplify mclk initializationCezary Rojewski2024-02-211-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of clk_xxx() functions do check if provided clk-pointer is non-NULL. These do not check if the pointer is an error-pointer. Providing such to a clk_xxx() results in a panic. By utilizing _optional() variant of devm_clk_get() the driver code is both simplified and more robust. There is no need to remember about IS_ERR(clk) checks each time mclk is accessed. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240221152516.852353-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: codecs: da7213: Simplify mclk initializationCezary Rojewski2024-02-211-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of clk_xxx() functions do check if provided clk-pointer is non-NULL. These do not check if the pointer is an error-pointer. Providing such to a clk_xxx() results in a panic. By utilizing _optional() variant of devm_clk_get() the driver code is both simplified and more robust. There is no need to remember about IS_ERR(clk) checks each time mclk is accessed. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240221152516.852353-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: codecs: tx-macro: correct TX SMIC MUXn widgets on SM8350+Krzysztof Kozlowski2024-02-262-31/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with Qualcomm SM8350 SoC, so Low Power Audio SubSystem (LPASS) block version v9.2, the register responsible for TX SMIC MUXn muxes is different. In earlier LPASS versions this mux had bit fields for analogue (ADCn) and digital (SWR_DMICn) MICs. Choice of ADCn was selecting the analogue path in CDC_TX_TOP_CSR_SWR_DMICn_CTL register. With LPASS v9.2 and newer, the bit fields are integrated into just SWR_MICn and there is no distinction for analogue or digital MIC in the register. Fix support for LPASS v9.2+: 1. Add new set of widgets and audio routes for LPASS v9.2. 2. Do not choose analogue or digital in CDC_TX_TOP_CSR_SWR_DMICn_CTL based on value of the mux. 3. Replace all the input widgets (TX SWR_ADCn, TX SWR_DMICn) with TX SWR_INPUTn ones. The change is not backwards compatible with older DTBs and existing mixer settings, therefore it does not change handling of older platforms with working micrphones (SC8280xp) but only the ones with issues (SM8450, SM8550) which need the fix. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240226115925.53953-3-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: codecs: tx-macro: split widgets per different LPASS versionsKrzysztof Kozlowski2024-02-262-151/+232
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TX macro codec differs slightly between different Qualcomm Low Power Audio SubSystem (LPASS) block versions. In LPASS version 9.2 the register responsible for TX SMIC MUXn muxes is different, thus to properly support it, the driver needs to register different widgets per different LPASS version. Prepare for supporting this register difference by refactoring existing code: 1. Move few widgets (TX SMIC MUXn, TX SWR_ADCn, TX SWR_DMICn) out of common 'tx_macro_dapm_widgets[]' array to a new per-variant specific array 'tx_macro_dapm_widgets_v9[]'. 2. Move also related audio routes into new array. 3. Store pointers to these variant-specific arrays in new variant-data structure 'tx_macro_data'. 4. Add variant-specific widgets and routes in component probe, instead of driver probe. The change should have no real impact, except re-shuffling code and registering some widgets and audio routes in component probe, instead of driver probe. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240226115925.53953-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ALSA: cs35l56: Apply calibration from EFIMark Brown2024-02-248-12/+433
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: Factory calibration of the speakers stores the calibration information into an EFI variable. This set of patches adds support for applying speaker calibration data from that EFI variable. The HDA patch (#5) depends on the ASoC patches #2 and #3
| | * | ASoC: cs35l56: Apply amp calibration from EFI dataRichard Fitzgerald2024-02-232-3/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there are factory calibration settings in EFI, extract the settings and write them to the firmware calibration controls. This must be done after any firmware or coefficients have been downloaded to the amp. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20240223153910.2063698-5-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: cs35l56: Add helper functions for amp calibrationRichard Fitzgerald2024-02-232-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds some helper functions and data for applying amp calibration. 1. cs35l56_read_silicon_uid() to get the silicon ID that is used to search for the correct calibration data entry. 2. Add the registers for the silicon ID to the readable registers. 3. cs35l56_get_calibration() wrapper around cs_amp_get_efi_calibration_data() 4. cs35l56_calibration_controls() table of the firmware controls for calibration data. 5. Added members to struct cs35l56_base to store the calibration data. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20240223153910.2063698-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: cs-amp-lib: Add helpers for factory calibration dataRichard Fitzgerald2024-02-233-0/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a new library for code that is used by multiple Cirrus Logic amps. This initially implements extracting amp calibration data from EFI and writing it to firmware controls. During factory calibration of built-in speakers the firmware calibration constants are stored in an EFI file. The file contains an array of calibration constants for each of the speakers. cs_amp_get_calibration_data() searches for an entry matching the requested UID stamp, otherwise by array index. If the data is found in EFI the constants for that speaker are copied back to the caller. If EFI is not enabled, the cs_amp_get_calibration_data() implementation will compile to simply return -ENOENT and the linker can drop the code. The code to write calibration controls uses cs_dsp. Building of cs_dsp is not forced. Instead, the code will compile away the calls to cs_dsp if cs_dsp is not reachable. This strategy of conditional code allows cs-amp-lib to be shared by multiple drivers without forcing inclusion of other modules that might be unnecessary. The calls to efi.get_variable() and cs_dsp are in small wrapper functions. This is so that a KUNIT_STATIC_STUB_REDIRECT can be added in a future patch to redirect these calls to replacement functions for KUnit testing. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20240223153910.2063698-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: wm_adsp: Add wm_adsp_start() and wm_adsp_stop()Richard Fitzgerald2024-02-232-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Separate the functionality of wm_adsp_event() into two exported functions wm_adsp_start() and wm_adsp_stop(). This allows the codec driver to start and stop the DSP outside of a DAPM widget. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20240223153910.2063698-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: soc-core: tidyup strcmp() param on snd_soc_is_matching_dai()Kuninori Morimoto2024-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_soc_is_matching_dai() checks DAI name, which is paired function with snd_soc_dai_name_get(). It checks dlc->dai_name and dai->name (A) or dai->driver_name (B) or dai->component->name (C) static int snd_soc_is_matching_dai(...) { ... if (strcmp(dlc->dai_name, dai->name) == 0) ~~~~~~~~~~~~~ ^^^^^^^^^(A) if (... strcmp(dai->driver->name, dlc->dai_name) == 0) (B)^^^^^^^^^^^^^^^^ ~~~~~~~~~~~~~ if (... strcmp(dlc->dai_name, dai->component->name) == 0) ~~~~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^(C) ... } But (B) part order is different with (A) and (C) (= ^^^^ and ~~~~). This is not a big deal, but confusable to read. Fixup it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/87wmqxjbcg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: amd: ps: modify ACP register end address macroVijendar Mukunda2024-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify ACP63_REG_END macro to access all ACP registers. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://msgid.link/r/20240222102656.631144-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: amd: ps: update licenseVijendar Mukunda2024-02-225-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To align with AMD SoundWire manager driver license, update license as GPL-2.0-only for Pink Sardine ACP PCI driver and corresponding child drivers. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://msgid.link/r/20240222102656.631144-1-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: codecs: wsa884x: Allow sharing reset GPIOKrzysztof Kozlowski2024-02-211-10/+43
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some boards with multiple WSA8840/WSA8845 speakers, the reset (shutdown) GPIO is shared between two speakers. Use the reset controller framework and its "reset-gpio" driver to handle this case. This allows bring-up and proper handling of all WSA884x speakers on X1E80100-CRD board. Cc: Bartosz Golaszewski <brgl@bgdev.pl> Cc: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://msgid.link/r/20240129115216.96479-7-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: Intel: avs: Fixes and new platforms supportMark Brown2024-02-2143-326/+1529
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Cezary Rojewski <cezary.rojewski@intel.com>: The avs-driver continues to be utilized on more recent Intel machines. As TGL-based (cAVS 2.5) e.g.: RPL, inherit most of the functionality from previous platforms: SKL <- APL <- CNL <- ICL <- TGL rather than putting everything into a single file, the platform-specific bits are split into cnl/icl/tgl.c files instead. Makes the division clear and code easier to maintain. Layout of the patchset: First are two changes combined together address the sound-clipping problem, present when only one stream is running - specifically one CAPTURE stream. Follow up is naming-scheme adjustment for some of the existing functions what improves code incohesiveness. As existing IPC/IRQ code operates solely on cAVS 1.5 architecture, it needs no abstraction. The situation changes when newer platforms come into the picture. Thus the next two patches abstract the existing IPC/IRQ handlers so that majority of the common code can be re-used. The ICCMAX change stands out a bit - the AudioDSP firmware loading procedure differs on ICL-based platforms (and onwards) and having a separate commit makes the situation clear to the developers who are going to support the solution from LTS perspective. For that reason I decided not to merge it into the commit introducing the icl.c file.
| | * | ASoC: Intel: avs: Populate board selection with new I2S entriesCezary Rojewski2024-02-201-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update board selection with tables specifying supported I2S configurations. DMIC/HDAudio board selection require no update as dmic/hdaudio machine boards are generic and not tied to any specific codec. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-11-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: Intel: avs: ICCMAX recommendations for ICL+ platformsCezary Rojewski2024-02-203-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For ICL+ platforms to avoid DMI/OPIO L1 entry during the base firmware load procedure, HW recommends to set LTRP_GB to 95us and start an additional CAPTURE stream in the background. Once the load completes, original LTRP_GB value is restored and the additional stream is released. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-10-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: Intel: avs: TGL-based platforms supportCezary Rojewski2024-02-204-1/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define handlers specific to cAVS 2.5 platforms, that is TGL, ADL, RPL and all other variants based on this very version of AudioDSP architecture. Most operations are inherited from their predecessors with the major difference being AudioDSP cores management - firmware handlers that on its own so there is no need to interfere. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-9-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: Intel: avs: ICL-based platforms supportCezary Rojewski2024-02-206-1/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define handlers specific to cAVS 2.0 platforms, that is ICL, JSL and all other variants based on this very version of AudioDSP architecture. Most operations are inherited from their predecessors with the major difference being firmware-logging functionality - IPC request as well as debug memory windows layout have changed. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: Intel: avs: CNL-based platforms supportCezary Rojewski2024-02-206-8/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define handlers specific to cAVS 1.8 platforms, that is CNL, CFL, CML and all other variants based on this very version of AudioDSP architecture. Most operations are inherited from their predecessors. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: Intel: avs: Abstract IRQ handlingCezary Rojewski2024-02-205-37/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servicing IPCs on CNL platforms and onward differs from the existing one. To make room for these, relocate SKL-based platforms specific code into the skl.c file leaving only the genering irq_handler in the common code. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-6-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: Intel: avs: Abstract IPC handlingCezary Rojewski2024-02-205-41/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servicing IPCs on CNL platforms and onward differs from the existing one. To make room for these, enrich platform descriptor with fields representing crucial IPC registers and utilize them throughout the code. While cleaning up device descriptors, reduce the number of code lines by assigning 'min_fw_version' within a single line. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: Intel: avs: Prefix SKL/APL-specific membersCezary Rojewski2024-02-205-57/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefix members that are platform-specific with 'avs_' to improve code cohesiveness and reduce the chance for naming-conflics with other drivers. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: Intel: avs: Fix sound clipping in single capture scenarioCezary Rojewski2024-02-201-2/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid sound clipping when there just one, single CAPTURE stream ongoing, disable L1SEN before it is started. Any PLAYBACK stream or additional CAPTURE allows L1SEN to be re-enabled. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | ASoC: Intel: avs: L1SEN reference countedCezary Rojewski2024-02-202-3/+9
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code loading is not the only procedure that manipulates L1SEN. Update existing mechanism so the stream starting procedure can interfere with L1SEN without causing any trouble to its other users. Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240220115035.770402-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: cs42l42: Remove redundant delays in suspend().Vitaly Rodionov2024-02-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch will remove redundant delay and minimise total suspend() function call time. Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com> Link: https://msgid.link/r/20240216101157.23176-1-vitalyr@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: tas2781: Remove redundant initialization of pointer 'data'Colin Ian King2024-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pointer 'data' being initialized with a value that is never read, it is being re-assigned inside a while-loop. The initialization is redundant and can be removed. Cleans up clang scan build warning sound/soc/codecs/tas2781-fmwlib.c:1534:17: warning: Value stored to 'data' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://msgid.link/r/20240216142219.2109050-1-colin.i.king@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: SOF: amd: fix soundwire dependenciesArnd Bergmann2024-02-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The soundwire-amd driver has a bit of a layering violation requiring the SOF driver to directly call into its exported symbols rather than through an abstraction. The SND_SOC_SOF_AMD_SOUNDWIRE Kconfig symbol tries to deal with the dependency by selecting SOUNDWIRE_AMD in a complicated set of conditions, but gets it wrong for a configuration involving SND_SOC_SOF_AMD_COMMON=y, SND_SOC_SOF_AMD_ACP63=m, and SND_SOC_SOF_AMD_SOUNDWIRE_LINK_BASELINE=m SOUNDWIRE_AMD=m, which results in a link failure: ld.lld: error: undefined symbol: sdw_amd_get_slave_info >>> referenced by acp-common.c ld.lld: error: undefined symbol: amd_sdw_scan_controller ld.lld: error: undefined symbol: sdw_amd_probe ld.lld: error: undefined symbol: sdw_amd_exit >>> referenced by acp.c >>> sound/soc/sof/amd/acp.o:(amd_sof_acp_remove) in archive vmlinux.a In essence, the SND_SOC_SOF_AMD_COMMON option cannot be built-in when trying to link against a modular SOUNDWIRE_AMD driver. Since CONFIG_SOUNDWIRE_AMD is a user-visible option, it really should never be selected by another driver in the first place, so replace the extra complexity with a normal Kconfig dependency in SND_SOC_SOF_AMD_SOUNDWIRE, plus a top-level check that forbids any of the AMD SOF drivers from being built-in with CONFIG_SOUNDWIRE_AMD=m. In normal configs, they should all either be built-in or all loadable modules anyway, so this simplification does not limit any real usecases. Fixes: d948218424bf ("ASoC: SOF: amd: add code for invoking soundwire manager helper functions") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://msgid.link/r/20240219093900.644574-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: amd: ps: add machine select and register codeVijendar Mukunda2024-02-192-1/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add machine select logic for SoundWire interface and create a machine device node based on ACP PDM/SoundWire configuration. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://msgid.link/r/20240214104014.1144668-5-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: amd: ps: fix for acp pme wake for soundwire configurationVijendar Mukunda2024-02-191-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider the below scenario, When ACP and SoundWire managers are in D3 state and SoundWire manager power off mode is selected and acp and SoundWire manager instances are in runtime suspended state. In this case, for the ACP PME wake event, the ACP PCI driver should resume SoundWire manager devices based on wake enable status set. Add code for handling ACP PME wake event for runtime suspend scenario when SoundWire power off mode is selected. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://msgid.link/r/20240214104014.1144668-4-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>