Skip to content
  1. Apr 21, 2021
  2. Apr 20, 2021
    • Thierry Reding's avatar
      ASoC: simple-card-utils: Allocate link info structure on heap · ec1af6c6
      Thierry Reding authored
      struct link_info can grow fairly large and may cause the stack frame
      size to be exceeded when allocated on the stack. Some architectures
      such as 32-bit ARM, RISC-V or PowerPC have small stack frames where
      this causes a compiler warning, so allocate these structures on the
      heap instead of the stack.
      
      Fixes: 343e55e7
      
       ("ASoC: simple-card-utils: Increase maximum number of links to 128")
      Reported-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/20210419164117.1422242-1-thierry.reding@gmail.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      ec1af6c6
    • Jack Yu's avatar
      ASoC: rt1015p: add support on format S32_LE · 7f51384f
      Jack Yu authored
      
      
      Add support on format S32_LE for rt1015p.
      
      Signed-off-by: default avatarJack Yu <jack.yu@realtek.com>
      Link: https://lore.kernel.org/r/377f0ee05d514c66b567eb6385ac7753@realtek.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      7f51384f
    • Mark Brown's avatar
      Merge series "ASoC: rt286/rt298: Fixes for DMIC2 config and combo jack" from... · 4b1013f4
      Mark Brown authored
      Merge series "ASoC: rt286/rt298: Fixes for DMIC2 config and combo jack" from David Ward <david.ward@gatech.edu>:
      
      The last two patches in this series fix a longstanding issue that prevented
      the ALC3263 codec from using a headset mic. This codec can be found on Dell
      systems including the Latitude 13 7350, Venue 11 Pro 7140, and XPS 13 9343.
      In fact, there is an ACPI quirk for the XPS 13 9343, which forces it to use
      legacy HD Audio just to avoid this issue:
      
      https://lore.kernel.org/alsa-devel/CAPeXnHv07HkvcHrYFmZMr8OTp7U7F=k_k=LPYnUtp89iPn2d2Q@mail.gmail.com/
      
      This may allow that ACPI quirk to be removed. Either way, the other systems
      mentioned above do not support this quirk and already use the ASoC driver,
      so this fix is necessary for headset mic support on those systems.
      
      Note: there is likely other handling for this codec that only exists in the
      HDA driver, but which also belongs in the ASoC driver. Commit 394c97f8
      
      
      ("ALSA: hda/realtek - Change EAPD to verb control") describes an issue that
      does not seem to be resolved in the ASoC driver, to give an example.
      
      Other patches in this series are not specific to the ALC3263. These patches
      set the correct combo jack configuration when headphones are inserted, and
      fix a misaligned value set in the DMIC2 Configuration Default register.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=114171
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=150601
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205961
      Signed-off-by: default avatarDavid Ward <david.ward@gatech.edu>
      
      David Ward (5):
        ASoC: rt286: Fix upper byte in DMIC2 configuration
        ASoC: rt286: Configure combo jack for headphones
        ASoC: rt298: Configure combo jack for headphones
        ASoC: rt286: Make RT286_SET_GPIO_* readable and writable
        ASoC: rt286: Generalize support for ALC3263 codec
      
       sound/soc/codecs/rt286.c | 34 +++++++++++++++++++++-------------
       sound/soc/codecs/rt298.c |  9 +++++++--
       2 files changed, 28 insertions(+), 15 deletions(-)
      
      --
      2.31.1
      4b1013f4
  3. Apr 19, 2021
  4. Apr 17, 2021
  5. Apr 16, 2021
    • Mark Brown's avatar
      Merge series "ASoC: Intel: add new TGL/ADL configurations" from Pierre-Louis... · 7ae6af41
      Mark Brown authored
      Merge series "ASoC: Intel: add new TGL/ADL configurations" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
      
      Very little code but quite a few descriptors to add TigerLake (TGL)
      /AlderLake (ADL) ACPI match tables for I2S and SoundWire devices, new
      dailinks for Bluetooth offload. Some day this will be read from
      platform firmware.
      
      Also clarify how microphones are handled for SoundWire devices, and
      create modules to avoid linking the same code multiple times.
      
      Pierre-Louis Bossart (5):
        ASoC: Intel: soc-acpi: add ADL SoundWire base configurations
        ASoC: Intel: soc-acpi: add ADL jack-less SoundWire configurations
        ASoC: Intel: sof_sdw: add mutual exclusion between PCH DMIC and RT715
        ASoC: Intel: boards: handle hda-dsp-common as a module
        ASoC: Intel: boards: create sof-maxim-common module
      
      Vamshi Krishna Gopal (3):
        ASoC: Intel: soc-acpi: add entries for i2s machines in ADL match table
        ASoC: Intel: sof_sdw: add quirk for new ADL-P Rvp
        ASoC: Intel: boards: add support for adl boards in sof-rt5682
      
      Yong Zhi (1):
        ASoC: Intel: Boards: tgl_max98373: Add BT offload support
      
       sound/soc/intel/boards/Kconfig                |  18 ++
       sound/soc/intel/boards/Makefile               |  28 +-
       sound/soc/intel/boards/bxt_da7219_max98357a.c |   1 +
       sound/soc/intel/boards/bxt_rt298.c            |   1 +
       sound/soc/intel/boards/cml_rt1011_rt5682.c    |   1 +
       sound/soc/intel/boards/ehl_rt5660.c           |   1 +
       sound/soc/intel/boards/glk_rt5682_max98357a.c |   1 +
       sound/soc/intel/boards/hda_dsp_common.c       |   5 +
       sound/soc/intel/boards/skl_hda_dsp_generic.c  |   1 +
       sound/soc/intel/boards/sof_da7219_max98373.c  |   1 +
       sound/soc/intel/boards/sof_maxim_common.c     |  24 +-
       sound/soc/intel/boards/sof_maxim_common.h     |   6 +-
       sound/soc/intel/boards/sof_pcm512x.c          |   1 +
       sound/soc/intel/boards/sof_rt5682.c           |  67 ++++-
       sound/soc/intel/boards/sof_sdw.c              |  32 ++-
       sound/soc/intel/boards/sof_sdw_common.h       |   1 +
       sound/soc/intel/boards/sof_sdw_max98373.c     |   4 +-
       .../intel/common/soc-acpi-intel-adl-match.c   | 249 ++++++++++++++++++
       18 files changed, 415 insertions(+), 27 deletions(-)
      
      --
      2.25.1
      7ae6af41
    • Mark Brown's avatar
      Merge series "ASoC: soc-pcm: ignore dummy-DAI at soc_pcm_params_symmetry()"... · ac22cf52
      Mark Brown authored
      Merge series "ASoC: soc-pcm: ignore dummy-DAI at soc_pcm_params_symmetry()" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
      
      Hi Mark
      
      I noticed if we have...
      
      	1) Sound Card used DPCM
      	2) It exchanges rate to 48kHz by using .be_hw_params_fixup()
      	3) Codec had symmetric_rate = 1
      
      We will get below error.
      I didn't confirm, but maybe same things happen
      if it exchanged channels/sample_bits.
      
      	# aplay 44100.wav
      	# aplay 44100.wav
      =>	[kernel] be.ak4613-hifi: ASoC: unmatched rate symmetry: snd-soc-dummy-dai:44100 - soc_pcm_params_symmetry:48000
      	[kernel] be.ak4613-hifi: ASoC: hw_params BE failed -22
      	[kernel] fe.rsnd-dai.0: ASoC: hw_params BE failed -22
      	aplay: set_params:1407: Unable to install hw params:
      	ACCESS:  RW_INTERLEAVED
      	FORMAT:  S16_LE
      	SUBFORMAT:  STD
      	SAMPLE_BITS: 16
      	FRAME_BITS: 32
      	CHANNELS: 2
      	RATE: 44100
      	PERIOD_TIME: (23219 23220)
      	PERIOD_SIZE: 1024
      	PERIOD_BYTES: 4096
      	PERIODS: 4
      	BUFFER_TIME: (92879 92880)
      	BUFFER_SIZE: 4096
      	BUFFER_BYTES: 16384
      	TICK_TIME: 0
      
      This patch-set solves this issue.
      patch 1) - 3) are just cleanup patches.
      4) is fot this issue.
      
      Link: https://lore.kernel.org/r/87a6q0z4xt.wl-kuninori.morimoto.gx@renesas.com
      
      Kuninori Morimoto (4):
        ASoC: soc-pcm: don't use "name" on __soc_pcm_params_symmetry() macro
        ASoC: soc-pcm: indicate DAI name if soc_pcm_params_symmetry() failed
        ASoC: soc-utils: add snd_soc_component_is_dummy()
        ASoC: soc-pcm: ignore dummy-DAI at soc_pcm_params_symmetry()
      
       include/sound/soc-component.h |  1 +
       sound/soc/soc-core.c          |  2 +-
       sound/soc/soc-pcm.c           | 14 ++++++++------
       sound/soc/soc-utils.c         |  6 ++++++
       4 files changed, 16 insertions(+), 7 deletions(-)
      
      --
      2.25.1
      ac22cf52
    • Thierry Reding's avatar
      ASoC: simple-card-utils: Increase maximum number of links to 128 · 343e55e7
      Thierry Reding authored
      On Tegra186 and later, the number of links can go up to 72, so bump the
      maximum number of links to the next power of two (128).
      
      Fixes: f2138aed
      
       ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform")
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Link: https://lore.kernel.org/r/20210416071147.2149109-2-thierry.reding@gmail.com
      Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      343e55e7
    • Thierry Reding's avatar
      ASoC: simple-card-utils: Propagate errors on too many links · 0f687d82
      Thierry Reding authored
      The DAI counting code doesn't propagate errors when the number of
      maximum links is exceeded, which causes subsequent initialization code
      to continue to run and that eventually leads to memory corruption with
      the code trying to access memory that is out of bounds.
      
      Fix this by propagating errors when the maximum number of links is
      reached, which ensures that the driver fails to load and prevents the
      memory corruption.
      
      Fixes: f2138aed
      
       ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform")
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Link: https://lore.kernel.org/r/20210416071147.2149109-1-thierry.reding@gmail.com
      Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      0f687d82
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: ignore dummy-DAI at soc_pcm_params_symmetry() · 9c2ae363
      Kuninori Morimoto authored
      soc_pcm_params_symmetry() checks CPU / Codec symmetry.
      Unfortunately there was bug on it (= A) which didn't check Codec.
      But is back by (B).
      
      	A: v5.7:  commit c840f769 ("ASoC: soc-pcm: Merge for_each_rtd_cpu/codec_dais()")
      	B: v5.12: commit 3a906721
      
       ("ASoC: soc-pcm: cleanup soc_pcm_params_symmetry()")
      
      In total,
      old - v5.6 (= Generation-1):
      
      	symmetric_rate		: DAI_Link / CPU / Codec
      	symmetric_channels	: DAI_Link / CPU / Codec
      	symmetric_sample_bits	: DAI_Link / CPU / Codec
      
      v5.7 - v5.11 (= Generation-2): (= because of bug by (A))
      
      	symmetric_rate		: DAI_Link / CPU
      	symmetric_channels	: DAI_Link / CPU / Codec
      	symmetric_sample_bits	: DAI_Link / CPU / Codec
      
      v5.12 - (= Generation-3): (= back by (B))
      
      	symmetric_rate		: DAI_Link / CPU / Codec
      	symmetric_channels	: DAI_Link / CPU / Codec
      	symmetric_sample_bits	: DAI_Link / CPU / Codec
      
      OTOH, we can use DPCM which is configured by FE / BE.
      Both FE / BE uses dummy-DAI.
      
      	FE: CPU       <-> dummy-DAI
      	BE: dummy-DAI <-> Codec
      
      One note is that we can use .be_hw_params_fixup in DPCM case.
      This means BE settings might be fixuped/updated by FE.
      This feature is used for example on MIXer case.
      It can be happen not only for rate, but for channels/sample_bits too.
      
      Because of these reasons, below issue happen on
      Generation-1 / Generation-3, if...
      
      	1) Sound Card used DPCM
      	2) It exchanges rate to 48kHz by using .be_hw_params_fixup()
      	3) Codec had symmetric_rate = 1
      
      I didn't confirm, but maybe same things happen
      if it exchanged channels/sample_bits at Generation-1/2/3 too.
      
      	# aplay 44100.wav
      	# aplay 44100.wav
      =>	[kernel] be.ak4613-hifi: ASoC: unmatched rate symmetry: snd-soc-dummy-dai:44100 - soc_pcm_params_symmetry:48000
      	[kernel] be.ak4613-hifi: ASoC: hw_params BE failed -22
      	[kernel] fe.rsnd-dai.0: ASoC: hw_params BE failed -22
      	aplay: set_params:1407: Unable to install hw params:
      	ACCESS:  RW_INTERLEAVED
      	FORMAT:  S16_LE
      	SUBFORMAT:  STD
      	SAMPLE_BITS: 16
      	FRAME_BITS: 32
      	CHANNELS: 2
      	RATE: 44100
      	PERIOD_TIME: (23219 23220)
      	PERIOD_SIZE: 1024
      	PERIOD_BYTES: 4096
      	PERIODS: 4
      	BUFFER_TIME: (92879 92880)
      	BUFFER_SIZE: 4096
      	BUFFER_BYTES: 16384
      	TICK_TIME: 0
      
      soc_pcm_params_symmetry() checks by below
      
      	if (symmetry)
      		for_each_rtd_cpu_dais(rtd, i, cpu_dai)
      			if (cpu_dai->xxx && cpu_dai->xxx != d.xxx) {
      				dev_err(rtd->dev, "...");
      				return -EINVAL;
      			}
      
      Because of above reason 3) (= Codec had symmetric_rate = 1)
      BE can't ignore "if (symmetric)".
      
      At 1st aplay, soc_pcm_params_symmetry() ignores it,
      because dummy-DAI->rate is 0.
      After this check, each DAI sets/keep settings.
      
      In above sample case, BE gets 48000 and FE gets 44100,
      and it happen BE -> FE order.
      Because DPCM is sharing *same* dummy-DAI,
      dummy-DAI sets as 48000 by BE, and is overwrote by 44100 by FE.
      
      This settings never be cleaned (= a) after 1st aplay,
      because dummy-DAI is used from FE/BE, never be last user (b).
      
      	static int soc_pcm_hw_clean(...)
      	{
      		...
      		for_each_rtd_dais(rtd, i, dai) {
      			...
      (b)			if (snd_soc_dai_active(dai) == 1)
      (a)				soc_pcm_set_dai_params(dai, NULL);
      			...
      		}
      		...
      	}
      
      At 2nd aplay, BE gets 48000 but dummy-DAI is keeping 44100,
      soc_pcm_params_symmetry() checks will fail.
      
      To solve this issue, this patch ignores dummy-DAI
      at soc_pcm_params_symmetry()
      
      Link: https://lore.kernel.org/r/87a6q0z4xt.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87y2djxa2n.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      9c2ae363
    • Kuninori Morimoto's avatar
      ASoC: soc-utils: add snd_soc_component_is_dummy() · 8f1a1681
      Kuninori Morimoto authored
      
      
      There is snd_soc_dai_is_dummy(), but not for component.
      This patch adds it.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/87zgxzxa2t.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      8f1a1681
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: indicate DAI name if soc_pcm_params_symmetry() failed · ee39d77e
      Kuninori Morimoto authored
      
      
      It indicates unmatched symmetry value, but not indicates on which DAI.
      This patch indicates it.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/871rbbyono.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      ee39d77e
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: don't use "name" on __soc_pcm_params_symmetry() macro · 1cacbac4
      Kuninori Morimoto authored
      
      
      __soc_pcm_params_symmetry() macro is using "name" as parameter
      which will be exchanged to rate/channles/sample_bit, like below
      
      	dai->name => dai->rate
      	dai->name => dai->channels
      	dai->name => dai->sample_bit
      
      But, dai itself has "name". This means
      
      	1) It is very confusable naming
      	2) It can't use dai->name
      
      This patch use "xxx" instead of "name"
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/8735vryoob.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      1cacbac4
    • Daniel Baluta's avatar
      ASoC: core: Don't set platform name when of_node is set · d9714003
      Daniel Baluta authored
      
      
      A DAI link has 3 components:
      	* CPU
      	* platform
      	* codec(s)
      
      A component is specified via:
      	* name
      	* of_node
      	* dai_name
      
      In order to avoid confusion when building a sound card we disallow
      matching by both name and of_node (1).
      
      soc_check_tplg_fes allows overriding certain BE links by overriding
      BE link name. This doesn't work well if BE link was specified via DT,
      because we end up with a link with both name and of_node specified
      which is conflicting with (1).
      
      In order to fix this we need to:
      	* override of_node if component was specified via DT
      	* override name, otherwise.
      
      Signed-off-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
      Link: https://lore.kernel.org/r/20210414101212.65573-1-daniel.baluta@oss.nxp.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      d9714003