Skip to content
  1. Feb 08, 2021
  2. Feb 06, 2021
  3. Feb 05, 2021
  4. Feb 04, 2021
    • Mark Brown's avatar
      Merge series "ASoC: soc-pcm: cleanup soc_new_pcm() and bugfix" from Kuninori... · 1c4273a5
      Mark Brown authored
      Merge series "ASoC: soc-pcm: cleanup soc_new_pcm() and bugfix" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
      
      Hi Mark
      
      These are soc-pcm cleanup patchset.
      
      	1) - 3) : cleanup soc_new_pcm() function
      	4)      : cleanup dpcm_runtime_merge_xxx() function
      	5)      : bugfix of snd_pcm_limit_hw_rates() order
      
      Kuninori Morimoto (5):
        1) ASoC: soc-pcm: tidyup pcm setting
        2) ASoC: soc-pcm: add soc_get_playback_capture() and simplify soc_new_pcm()
        3) ASoC: soc-pcm: add soc_create_pcm() and simplify soc_new_pcm()
        4) ASoC: soc-pcm: use snd_pcm_hardware at dpcm_runtime_merge_xxx()
        5) ASoC: soc-pcm: fixup snd_pcm_limit_hw_rates() timing
      
       sound/soc/soc-pcm.c | 124 +++++++++++++++++++++++++++-----------------
       1 file changed, 75 insertions(+), 49 deletions(-)
      
      --
      2.25.1
      1c4273a5
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: fixup snd_pcm_limit_hw_rates() timing · dd5abc78
      Kuninori Morimoto authored
      
      
      soc-pcm has snd_pcm_limit_hw_rates() which determine rate_min/rate_max.
      It updates runtime->hw.rate_min/max (A) based on hw->rates (B).
      
      	int snd_pcm_limit_hw_rates(...)
      	{
      		int i;
      		for (...) {
      (B)			if (runtime->hw.rates & (1 << i)) {
      (A)				runtime->hw.rate_min = ...
      				break;
      			}
      		}
      		for (...) {
      (B)			if (runtime->hw.rates & (1 << i)) {
      (A)				runtime->hw.rate_max = ...
      				break;
      			}
      		}
      		return 0;
      	}
      
      This means, setup order is
      
      	1) set hw->rates
      	2) call snd_pcm_limit_hw_rates()
      	3) update hw->rate_min/max
      
      soc_pcm_init_runtime_hw() is calling it in good order
      
      	static void soc_pcm_init_runtime_hw(xxx)
      	{
      		...
      1)		hw->rates = snd_pcm_rate_mask_intersect(...);
      
      2)		snd_pcm_limit_hw_rates(...);
      
      3)		hw->rate_min = max(...);
      		hw->rate_min = max(...);
      		hw->rate_max = min_not_zero(...);
      		hw->rate_max = min_not_zero(...);
      	}
      
      But, dpcm_fe_dai_startup() is not.
      
      	static int dpcm_fe_dai_startup(xxx)
      	{
      		...
      1) 3)		dpcm_set_fe_runtime(...);
      2)		snd_pcm_limit_hw_rates(...);
      		...
      	}
      
      More detail of dpcm_set_fe_runtime() is
      
      	static void dpcm_set_fe_runtime()
      	{
      		...
      		for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
      			...
      
      3) 1)			dpcm_init_runtime_hw(...);
      		}
      		...
      3) 1)		dpcm_runtime_merge_rate(...);
      	}
      
      This patch fixup these into
      
      	static void dpcm_set_fe_runtime()
      	{
      		...
      		for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
      			...
      
      1) 2) 3)		dpcm_init_runtime_hw(...);
      		}
      		...
      1) 2) 3)	dpcm_runtime_merge_rate(...);
      	}
      
      	static int dpcm_fe_dai_startup(xxx)
      	{
      		...
      		dpcm_set_fe_runtime(...);
      -		snd_pcm_limit_hw_rates(...);
      		...
      	}
      
      Link: https://lore.kernel.org/r/87k15l7ewd.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/8735ytaig8.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      dd5abc78
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: use snd_pcm_hardware at dpcm_runtime_merge_xxx() · 4b260f42
      Kuninori Morimoto authored
      
      
      soc-pcm has dpcm_runtime_merge_xxx() functions,
      but uses parameters are very verbose.
      
      	dpcm_runtime_merge_format(...,	&runtime->hw.formats);
      	dpcm_runtime_merge_chan(...,	&runtime->hw.channels_min,
      					&runtime->hw.channels_max);
      	dpcm_runtime_merge_rate(...,	&runtime->hw.rates,
      					&runtime->hw.rate_min,
      					&runtime->hw.rate_max);
      
      We want to replace it into
      
      	dpcm_runtime_merge_format(...,	runtime);
      	dpcm_runtime_merge_chan(...,	runtime);
      	dpcm_runtime_merge_rate(...,	runtime);
      
      This patch do it.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/874kj9aigd.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      4b260f42
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: add soc_create_pcm() and simplify soc_new_pcm() · 2b39123b
      Kuninori Morimoto authored
      
      
      soc_new_pcm() implementation is very long / verbose / complex,
      thus, it is very difficult to read.
      If we read it carefully, we can notice that it is consisted by
      
      	int soc_new_pcm(...)
      	{
      		(1) judging playback/caputre part
      		(2) creating the PCM part
      		(3) setup pcm/rtd part
      	}
      
      This patch adds new soc_create_pcm() for (2) part
      and offload it from snd_pcm_new().
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/875z3paigi.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      2b39123b
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: add soc_get_playback_capture() and simplify soc_new_pcm() · 7fc6bebd
      Kuninori Morimoto authored
      
      
      soc_new_pcm() implementation is very long / verbose / complex,
      thus, it is very difficult to read.
      If we read it carefully, we can notice that it is consisted by
      
      	int soc_new_pcm(...)
      	{
      		(1) judging playback/caputre part
      		(2) creating the PCM part
      		(3) setup pcm/rtd part
      	}
      
      This patch adds new soc_get_playback_capture() for (1) part
      and offload it from soc_new_pcm().
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/877do5aign.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      7fc6bebd
    • Kuninori Morimoto's avatar
      ASoC: soc-pcm: tidyup pcm setting · e04e7b8c
      Kuninori Morimoto authored
      
      
      Current soc_new_pcm() setups pcm randomly.
      This patch tidyup it.
      
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/878s8laigt.wl-kuninori.morimoto.gx@renesas.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e04e7b8c
    • Yang Li's avatar
      ASoC: Intel: catpt: remove unneeded semicolon · e01a03db
      Yang Li authored
      
      
      Eliminate the following coccicheck warning:
      ./sound/soc/intel/catpt/pcm.c:355:2-3: Unneeded semicolon
      
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
      Acked-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
      Link: https://lore.kernel.org/r/1612166481-121376-1-git-send-email-yang.lee@linux.alibaba.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e01a03db
  5. Feb 03, 2021
  6. Feb 02, 2021
    • Tzung-Bi Shih's avatar
      ASoC: mt6359: reduce log verbosity for optional DT properties · 1ecebae4
      Tzung-Bi Shih authored
      
      
      DT properties "dmic-mode" and "mic-type-X" are optional.  Reduces the
      log verbosity and changes the message a bit to avoid misleading.
      
      Signed-off-by: default avatarTzung-Bi Shih <tzungbi@google.com>
      Link: https://lore.kernel.org/r/20210202033557.1621029-1-tzungbi@google.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      1ecebae4
    • Rander Wang's avatar
      ASoC: SOF: add be_hw_params_fixup() for ALH · e1711b1f
      Rander Wang authored
      
      
      Fixup BE DAI links channel count to match topology settings. Normally the
      channel count of BE is equal to FE's so we don't have any issue. For some
      cases like DSM with 2-channel FE and 4-channel BE the mismatch of BE and
      topology will result in audio issues.
      
      Signed-off-by: default avatarRander Wang <rander.wang@intel.com>
      Reviewed-by: default avatarKeyon Jie <yang.jie@intel.com>
      Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
      Link: https://lore.kernel.org/r/20210201092345.1214232-1-kai.vehmanen@linux.intel.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e1711b1f
    • Srinivas Kandagatla's avatar
      ASoC: codecs: add missing max_register in regmap config · e8820dbd
      Srinivas Kandagatla authored
      For some reason setting max_register was missed from regmap_config.
      Without this cat /sys/kernel/debug/regmap/sdw:0:217:2010:0:1/range
      actually throws below Warning.
      
      WARNING: CPU: 7 PID: 540 at drivers/base/regmap/regmap-debugfs.c:160
       regmap_debugfs_get_dump_start.part.10+0x1e0/0x220
      ...
      Call trace:
       regmap_debugfs_get_dump_start.part.10+0x1e0/0x220
       regmap_reg_ranges_read_file+0xc0/0x2e0
       full_proxy_read+0x64/0x98
       vfs_read+0xa8/0x1e0
       ksys_read+0x6c/0x100
       __arm64_sys_read+0x1c/0x28
       el0_svc_common.constprop.3+0x6c/0x190
       do_el0_svc+0x24/0x90
       el0_svc+0x14/0x20
       el0_sync_handler+0x90/0xb8
       el0_sync+0x158/0x180
      ...
      
      Fixes: a0aab9e1
      
       ("ASoC: codecs: add wsa881x amplifier support")
      Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Link: https://lore.kernel.org/r/20210201161429.28060-1-srinivas.kandagatla@linaro.org
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e8820dbd
    • Sebastian Reichel's avatar
      ASoC: cpcap: fix microphone timeslot mask · de5bfae2
      Sebastian Reichel authored
      The correct mask is 0x1f8 (Bit 3-8), but due to missing BIT() 0xf (Bit
      0-3) was set instead. This means setting of CPCAP_BIT_MIC1_RX_TIMESLOT0
      (Bit 3) still worked (part of both masks). On the other hand the code
      does not properly clear the other MIC timeslot bits. I think this
      is not a problem, since they are probably initialized to 0 and not
      touched by the driver anywhere else. But the mask also contains some
      wrong bits, that will be cleared. Bit 0 (CPCAP_BIT_SMB_CDC) should be
      safe, since the driver enforces it to be 0 anyways.
      
      Bit 1-2 are CPCAP_BIT_FS_INV and CPCAP_BIT_CLK_INV. This means enabling
      audio recording forces the codec into SND_SOC_DAIFMT_NB_NF mode, which
      is obviously bad.
      
      The bug probably remained undetected, because there are not many use
      cases for routing microphone to the CPU on platforms using cpcap and
      user base is small. I do remember having some issues with bad sound
      quality when testing voice recording back when I wrote the driver.
      It probably was this bug.
      
      Fixes: f6cdf2d3
      
       ("ASoC: cpcap: new codec")
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
      Reviewed-by: default avatarTony Lindgren <tony@atomide.com>
      Link: https://lore.kernel.org/r/20210123172945.3958622-1-sre@kernel.org
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      de5bfae2
  7. Feb 01, 2021
    • Mark Brown's avatar
      Merge series "Tegra186 and Tegra194 audio graph card" from Sameer Pujar <spujar@nvidia.com>: · 1f16aaee
      Mark Brown authored
      This series adds support for audio graph based solution on Tegra186 and
      Tegra194. This enables audio paths for I2S, DMIC and DSPK modules.
      
      Depending on the platform Jetson TX2 or Jetson AGX Xavier, required I/O
      module instances are enabled. Since the latter board has on board audio
      codec, DT support for the same is enabled and external audio playback and
      capture can be used.
      
      Changelog
      =========
      
      v1 --> v2:
      ----------
        - Dropped patch "ASoC: tegra: Select SND_SOC_RT5659" as per suggestion
          from Mark.
        - Add new patch "ASoC: rt5659: Add Kconfig prompt"
        - Add new patch "arm64: defconfig: Enable RT5659"
        - No changes in other patches from earlier series.
      
      Sameer Pujar (9):
        ASoC: dt-bindings: rt5659: Update binding doc
        ASoC: dt-bindings: tegra: Add iommus property to Tegra graph card
        ASoC: audio-graph-card: Add clocks property to endpoint node
        ASoC: rt5659: Add Kconfig prompt
        arm64: defconfig: Enable RT5659
        arm64: tegra: Add RT5658 device entry
        Revert "arm64: tegra: Disable the ACONNECT for Jetson TX2"
        arm64: tegra: Audio graph sound card for Jetson TX2
        arm64: tegra: Audio graph sound card for Jetson AGX Xavier
      
       .../bindings/sound/audio-graph-port.yaml           |   3 +
       .../sound/nvidia,tegra-audio-graph-card.yaml       |   3 +
       Documentation/devicetree/bindings/sound/rt5659.txt |  11 +
       arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 609 +++++++++++++++++++++
       arch/arm64/boot/dts/nvidia/tegra186.dtsi           |  22 +
       arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts | 468 ++++++++++++++++
       arch/arm64/boot/dts/nvidia/tegra194.dtsi           |  20 +
       arch/arm64/configs/defconfig                       |   1 +
       sound/soc/codecs/Kconfig                           |   2 +-
       9 files changed, 1138 insertions(+), 1 deletion(-)
      
      --
      2.7.4
      1f16aaee
    • Geert Uytterhoeven's avatar
      ASoC: tegra: SND_SOC_TEGRA_AUDIO_GRAPH_CARD should depend on SND_SOC_TEGRA · e86caa01
      Geert Uytterhoeven authored
      Audio Graph Card based Tegra driver is only useful on NVIDIA Tegra SoCs.
      Hence add a dependency on SND_SOC_TEGRA, to prevent asking the user
      about this driver when configuring a kernel without Tegra sound support.
      
      Wrap all Tegra sound config options inside a big if/endif block, instead
      of just adding the dependency to the single config option that does not
      have it yet, to preventing similar future mistakes.
      
      Fixes: 202e2f77
      
       ("ASoC: tegra: Add audio graph based card driver")
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: default avatarSameer Pujar <spujar@nvidia.com>
      Link: https://lore.kernel.org/r/20210129125915.2652952-1-geert+renesas@glider.be
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      e86caa01
    • Sameer Pujar's avatar
      ASoC: rt5659: Add Kconfig prompt · 563c2681
      Sameer Pujar authored
      
      
      Add tristate prompt to allow codec selection.
      
      Cc: Oder Chiou <oder_chiou@realtek.com>
      Cc: Bard Liao <bardliao@realtek.com>
      Signed-off-by: default avatarSameer Pujar <spujar@nvidia.com>
      Link: https://lore.kernel.org/r/1611944866-29373-5-git-send-email-spujar@nvidia.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      563c2681