1. Mar 06, 2024
    • Luca Ceresoli's avatar
      ASoC: trace: add event to snd_soc_dapm trace events · 7df3eb4c
      Luca Ceresoli authored
      
      
      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: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
      Link: https://msgid.link/r/20240306-improve-asoc-trace-events-v1-2-edb252bbeb10@bootlin.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      7df3eb4c
    • Luca Ceresoli's avatar
      ASoC: trace: add component to set_bias_level trace events · 6ef46a69
      Luca Ceresoli authored
      
      
      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: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
      Link: https://msgid.link/r/20240306-improve-asoc-trace-events-v1-1-edb252bbeb10@bootlin.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      6ef46a69
    • Javier García's avatar
      ASoC: dt-bindings: rt1015: Convert to dtschema · 2ca70330
      Javier García authored
      
      
      Convert the RT1015 Mono Class D Audio Amplifier to DT schema.
      
      Signed-off-by: default avatarJavier García <javier.gar.tab@gmail.com>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Link: https://msgid.link/r/20240304142315.14522-1-javier.gar.tab@gmail.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      2ca70330
    • Andy Shevchenko's avatar
      ASoC: Intel: atom: sst_ipc: Remove unused intel-mid.h · 8fedf4f1
      Andy Shevchenko authored
      
      
      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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Link: https://msgid.link/r/20240305160723.1363534-1-andriy.shevchenko@linux.intel.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      8fedf4f1
  2. Mar 05, 2024
    • Chancel Liu's avatar
      ASoC: soc-core.c: Prefer to return dai->driver->name in snd_soc_dai_name_get() · 755bb9a4
      Chancel Liu authored
      
      
      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: default avatarChancel Liu <chancel.liu@nxp.com>
      Link: https://msgid.link/r/20240304072128.2845432-1-chancel.liu@nxp.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      755bb9a4
    • Richard Fitzgerald's avatar
      ASoC: cs-amp-lib: Add KUnit test for calibration helpers · 17786231
      Richard Fitzgerald authored
      
      
      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: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
      Link: https://msgid.link/r/20240304143705.26362-1-rf@opensource.cirrus.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      17786231
  3. Feb 28, 2024
  4. Feb 27, 2024
    • Richard Fitzgerald's avatar
      ASoC: cs35l56: Prevent bad sign extension in cs35l56_read_silicon_uid() · cb9d8a2c
      Richard Fitzgerald authored
      
      
      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: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
      Fixes: e1830f66 ("ASoC: cs35l56: Add helper functions for amp calibration")
      Link: https://msgid.link/r/20240227100042.99-1-rf@opensource.cirrus.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      cb9d8a2c
    • Mark Brown's avatar
      ASoC: meson: axg fixes and clean-up · b8614377
      Mark Brown authored
      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.
      b8614377
    • Mark Brown's avatar
      ASoC: codecs: Simplify mclk initialization · 306904db
      Mark Brown authored
      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.
      306904db
  5. Feb 26, 2024
  6. Feb 24, 2024
  7. Feb 23, 2024
  8. Feb 22, 2024
  9. Feb 21, 2024
    • Krzysztof Kozlowski's avatar
      ASoC: codecs: wsa884x: Allow sharing reset GPIO · 0dae534c
      Krzysztof Kozlowski authored
      
      
      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: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Link: https://msgid.link/r/20240129115216.96479-7-krzysztof.kozlowski@linaro.org
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      0dae534c
    • Krzysztof Kozlowski's avatar
      ASoC: dt-bindings: qcom,wsa8840: Add reset-gpios for shared line · 26c8a435
      Krzysztof Kozlowski authored
      
      
      On newer Qualcomm platforms, like X1E80100-CRD, the WSA884x speakers
      share SD_N GPIOs between two speakers, thus a coordinated assertion is
      needed.  Linux supports handling shared GPIO lines through "reset-gpios"
      property, thus allow specifying either powerdown or reset GPIOs (these
      are the same).
      
      Cc: Bartosz Golaszewski <brgl@bgdev.pl>
      Cc: Sean Anderson <sean.anderson@seco.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Link: https://msgid.link/r/20240129115216.96479-6-krzysztof.kozlowski@linaro.org
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      26c8a435
    • Mark Brown's avatar
      ASoC: Intel: avs: Fixes and new platforms support · b96ccdcf
      Mark Brown authored
      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.
      b96ccdcf
  10. Feb 20, 2024