1. 21 Jan, 2021 7 commits
    • Mark Brown's avatar
      Merge series "Add KUNIT tests for ASoC topology" from Amadeusz... · 1e924131
      Mark Brown authored
      Merge series "Add KUNIT tests for ASoC topology" from Amadeusz Sławiński<amadeuszx.slawinski@linux.intel.com>:
      
      This series adds unit tests for ASoC topology.
      
      First fix problems found when developing and running test cases and
      then add tests implementation.
      
      Tests themselves are quite simple and just call
      snd_soc_tplg_component_load() with various parameters and check the
      result. Tests themselves are described in more detail in commits
      adding them.
      
      Goal is to expand the amount of test cases in following patches.
      
      Prerequisity for this patchset are 2 patches which have already been
      sent:
      https://lore.kernel.org/alsa-devel/20210114163602.911205-1-amadeuszx.slawinski@linux.intel.com/T/#t
      
      Description on how typical test case itself works:
      
      In order to load topology we need to have 3 things:
      card, codec component & platform component.
      
      In typical test case we register card and platform component and bind
      to dummy codec. There are of course execeptions, when we want to
      test behaviour of topology API when component or card is missing.
      Note that this is bit different from typical scenario (in SOF and skylake
      drivers) where card is registered by machine driver and component by
      platform driver, as we register both when setting up test.
      
      If you check the test case most of them have similar architecture of:
      1.
      	/* run test */
      	ret = snd_soc_register_card(&kunit_comp->card);
      	if (ret != 0 && ret != -EPROBE_DEFER)
      		KUNIT_FAIL(test, "Failed to register card");
      
      2.
      	ret = snd_soc_component_initialize(&kunit_comp->comp, &test_component, test_dev);
      	KUNIT_EXPECT_EQ(test, 0, ret);
      
      3.
      	ret = snd_soc_add_component(&kunit_comp->comp, NULL, 0);
      	KUNIT_EXPECT_EQ(test, 0, ret);
      
      Ad. 1.
      First we register card, which in most tests returns -EPROBE_DEFER
      (from snd_soc_bind_card()), as platform component is not yet created.
      I test for both 0 and -EPROBE_DEFER, as it makes it easier to reshuffle
      this code around if needed and there is one test case which does it in
      different order.
      
      Ad. 2.
      Then we initialize platform component with structure pointing at proper
      probe function, which calls snd_soc_tplg_component_load() with test
      parameters and checks expected result.
      
      Ad. 3.
      And then in follow up we call snd_soc_add_component() which creates
      platform component for us and calls snd_soc_try_rebind_card() which
      if everything is bound properly calls previously set probe function.
      
      Amadeusz Sławiński (5):
        ASoC: topology: Properly unregister DAI on removal
        Revert "ASoC: soc-devres: add devm_snd_soc_register_dai()"
        ASoC: topology: KUnit: Add KUnit tests passing various arguments to
          snd_soc_tplg_component_load
        ASoC: topology: KUnit: Add KUnit tests passing empty topology with
          variants to snd_soc_tplg_component_load
        ASoC: topology: KUnit: Add KUnit tests passing topology with PCM to
          snd_soc_tplg_component_load
      
       include/sound/soc.h           |   4 -
       sound/soc/Kconfig             |  17 +
       sound/soc/Makefile            |   5 +
       sound/soc/soc-devres.c        |  37 --
       sound/soc/soc-topology-test.c | 843 ++++++++++++++++++++++++++++++++++
       sound/soc/soc-topology.c      |   9 +-
       6 files changed, 870 insertions(+), 45 deletions(-)
       create mode 100644 sound/soc/soc-topology-test.c
      
      --
      2.25.1
      1e924131
    • Shuming Fan's avatar
      ASoC: rt5682: remove connection with LDO2 in DAPM graph · 06c84567
      Shuming Fan authored
      The application circuit shall provide MICVDD power.
      In default, the codec driver doesn't need to enable LDO2.
      In case, a board wants to use VBAT for micbias,
      it should add a DAPM route which IN1P connects with LDO2 in the machine driver.
      e.g. { "IN1P", NULL, "LDO2" },
      Signed-off-by: default avatarShuming Fan <shumingf@realtek.com>
      Link: https://lore.kernel.org/r/20210121100353.6402-1-shumingf@realtek.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      06c84567
    • Amadeusz Sławiński's avatar
      ASoC: topology: KUnit: Add KUnit tests passing topology with PCM to snd_soc_tplg_component_load · 3ad8c8e9
      Amadeusz Sławiński authored
      In order to ensure correct behaviour of topology API, add unit tests
      exercising topology functionality.
      
      Add topology containing PCM template and tests for parsing it. Also
      adds test cases simulating modules reloads in case of separate drivers
      for card and component.
      Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
      Tested-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Link: https://lore.kernel.org/r/20210120152846.1703655-6-amadeuszx.slawinski@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      3ad8c8e9
    • Amadeusz Sławiński's avatar
      ASoC: topology: KUnit: Add KUnit tests passing empty topology with variants to... · cec9128d
      Amadeusz Sławiński authored
      ASoC: topology: KUnit: Add KUnit tests passing empty topology with variants to snd_soc_tplg_component_load
      
      In order to ensure correct behaviour of topology API, add unit tests
      exercising topology functionality.
      
      Add "empty" topology template and tests for parsing it. Also adds few
      variants with bad magic numbers.
      Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
      Tested-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Link: https://lore.kernel.org/r/20210120152846.1703655-5-amadeuszx.slawinski@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      cec9128d
    • Amadeusz Sławiński's avatar
      ASoC: topology: KUnit: Add KUnit tests passing various arguments to snd_soc_tplg_component_load · d52bbf74
      Amadeusz Sławiński authored
      In order to ensure correct behaviour of topology API, add unit tests
      exercising topology functionality.
      
      Start with adding cases for passing various arguments to
      snd_soc_tplg_component_load as it is part of exposed topology API.
      
      First test case adds test passing NULL component as argument.
      Following one adds test case for passing NULL ops as argument.
      Finally add test case passing NULL fw as argument.
      Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
      Tested-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
      Link: https://lore.kernel.org/r/20210120152846.1703655-4-amadeuszx.slawinski@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      d52bbf74
    • Mark Brown's avatar
      Merge series "ASoC: mediatek: mt8192-mt6359: support DP audio" from Tzung-Bi... · 879a67e3
      Mark Brown authored
      Merge series "ASoC: mediatek: mt8192-mt6359: support DP audio" from Tzung-Bi Shih <tzungbi@google.com>:
      
      The 1st and 2nd patches refactor the machine driver.
      
      The 3rd patch changes the platform driver to support TDM 8 channel output.
      
      The 4th patch adds an optional DT property.
      
      The 5th patch makes the machine driver support DP audio if the optional DT
      property is specified.
      
      Tzung-Bi Shih (5):
        ASoC: mediatek: mt8192-mt6359: move headset_jack to card specific data
        ASoC: mediatek: mt8192-mt6359: simplify mt8192_rt5682_init
        ASoC: mediatek: mt8192: change mclk_multiple of TDM from 128 to 512
        ASoC: dt-bindings: mt8192-mt6359: add hdmi-codec property
        ASoC: mediatek: mt8192-mt6359: support audio over DP
      
       .../sound/mt8192-mt6359-rt1015-rt5682.yaml    |  5 ++
       sound/soc/mediatek/mt8192/mt8192-dai-tdm.c    |  2 +-
       .../mt8192/mt8192-mt6359-rt1015-rt5682.c      | 54 ++++++++++++++++---
       3 files changed, 52 insertions(+), 9 deletions(-)
      
      --
      2.30.0.284.gd98b1dd5eaa7-goog
      879a67e3
    • Mark Brown's avatar
      Merge series "ASoC: remove obsolete drivers" from Arnd Bergmann <arnd@kernel.org> · 55331b55
      Mark Brown authored
      Arnd Bergmann <arnd@arndb.de>:
      
      From: Arnd Bergmann <arnd@arndb.de>
      
      A few Arm platforms are getting removed in v5.12, this removes
      the corresponding sound drivers.
      
      Link: https://lore.kernel.org/linux-arm-kernel/20210120124812.2800027-1-arnd@kernel.org/T/
      
      Arnd Bergmann (2):
        ASoC: remove sirf prima/atlas drivers
        ASoC: remove zte zx drivers
      
       .../bindings/sound/sirf-audio-codec.txt       |  17 -
       .../devicetree/bindings/sound/sirf-usp.txt    |  27 -
       .../devicetree/bindings/sound/zte,tdm.txt     |  30 -
       .../bindings/sound/zte,zx-aud96p22.txt        |  24 -
       .../devicetree/bindings/sound/zte,zx-i2s.txt  |  45 --
       .../bindings/sound/zte,zx-spdif.txt           |  27 -
       sound/soc/Kconfig                             |   2 -
       sound/soc/Makefile                            |   2 -
       sound/soc/codecs/Makefile                     |   4 -
       sound/soc/codecs/sirf-audio-codec.c           | 575 ------------------
       sound/soc/codecs/zx_aud96p22.c                | 401 ------------
       sound/soc/sirf/Kconfig                        |  21 -
       sound/soc/sirf/Makefile                       |   8 -
       sound/soc/sirf/sirf-audio-port.c              |  86 ---
       sound/soc/sirf/sirf-audio.c                   | 160 -----
       sound/soc/sirf/sirf-usp.c                     | 435 -------------
       sound/soc/sirf/sirf-usp.h                     | 292 ---------
       sound/soc/zte/Kconfig                         |  26 -
       sound/soc/zte/Makefile                        |   4 -
       sound/soc/zte/zx-i2s.c                        | 452 --------------
       sound/soc/zte/zx-spdif.c                      | 363 -----------
       sound/soc/zte/zx-tdm.c                        | 458 --------------
       22 files changed, 3459 deletions(-)
       delete mode 100644 Documentation/devicetree/bindings/sound/sirf-audio-codec.txt
       delete mode 100644 Documentation/devicetree/bindings/sound/sirf-usp.txt
       delete mode 100644 Documentation/devicetree/bindings/sound/zte,tdm.txt
       delete mode 100644 Documentation/devicetree/bindings/sound/zte,zx-aud96p22.txt
       delete mode 100644 Documentation/devicetree/bindings/sound/zte,zx-i2s.txt
       delete mode 100644 Documentation/devicetree/bindings/sound/zte,zx-spdif.txt
       delete mode 100644 sound/soc/codecs/sirf-audio-codec.c
       delete mode 100644 sound/soc/codecs/zx_aud96p22.c
       delete mode 100644 sound/soc/sirf/Kconfig
       delete mode 100644 sound/soc/sirf/Makefile
       delete mode 100644 sound/soc/sirf/sirf-audio-port.c
       delete mode 100644 sound/soc/sirf/sirf-audio.c
       delete mode 100644 sound/soc/sirf/sirf-usp.c
       delete mode 100644 sound/soc/sirf/sirf-usp.h
       delete mode 100644 sound/soc/zte/Kconfig
       delete mode 100644 sound/soc/zte/Makefile
       delete mode 100644 sound/soc/zte/zx-i2s.c
       delete mode 100644 sound/soc/zte/zx-spdif.c
       delete mode 100644 sound/soc/zte/zx-tdm.c
      
      --
      2.29.2
      55331b55
  2. 20 Jan, 2021 13 commits
  3. 19 Jan, 2021 11 commits
  4. 18 Jan, 2021 3 commits
  5. 15 Jan, 2021 6 commits