Commit graph

982906 commits

Author SHA1 Message Date
Mark Brown b6040f9b98
Merge series "ASoC: stm32: i2s: add master clock provider" from Olivier Moysan <olivier.moysan@foss.st.com>:
Add master clock generation support in STM32 I2S driver.
Resend of patch https://lkml.org/lkml/2020/9/11/264

Olivier Moysan (2):
  ASoC: dt-bindings: add mclk provider support to stm32 i2s
  ASoC: stm32: i2s: add master clock provider

 .../bindings/sound/st,stm32-i2s.yaml          |   4 +
 sound/soc/stm/stm32_i2s.c                     | 310 +++++++++++++++---
 2 files changed, 270 insertions(+), 44 deletions(-)

--
2.17.1
2021-02-05 16:42:34 +00:00
Jiaxin Yu 19657a609b
ASoC: mediatek: mt8183-mt6358: set playback and capture constraints
Sets playback and capture constraints to S16_LE, stereo, 48kHz.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1612513012-27688-1-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05 15:03:04 +00:00
Olivier Moysan 8a262e614e
ASoC: stm32: i2s: add master clock provider
Add master clock generation support in STM32 I2S driver.
The master clock provided by I2S can be used to feed a codec.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20210205104404.18786-3-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05 15:03:03 +00:00
Olivier Moysan df91785a22
ASoC: dt-bindings: add mclk provider support to stm32 i2s
Add master clock provider support to STM32 I2S.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20210205104404.18786-2-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05 15:03:02 +00:00
Mark Brown 2927e6d398
Merge branch 'asoc-5.11' into asoc-5.12 2021-02-05 15:01:21 +00:00
Mark Brown b976a5adf3
Merge series "ASoC: SOF/Intel/SoundWire: add missing quirks and DMIC support" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
HP Spectre x360 convertible devices rely on a mixed SoundWire+DMIC
configuration which wasn't well supported. This lead to the discovery
that we missed the TGL_HDMI quirk on a number of Dell devices, the
addition of DMIC autodetection (based on NHLT tables), the addition of
new component strings needed by UCM, and work-arounds due to
problematic DSDT tables.

Bard Liao (1):
  ASoC: Intel: sof_sdw: add trace for dai links

Guennadi Liakhovetski (1):
  ASoC: SOF: Intel: HDA: don't keep a temporary variable

Pierre-Louis Bossart (11):
  ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A3E
  ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A5E
  ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A32
  ASoC: Intel: sof_sdw: reorganize quirks by generation
  ASoC: Intel: sof-sdw: indent and add quirks consistently
  ASoC: Intel: sof_sdw: add quirk for HP Spectre x360 convertible
  ASoC: Intel: sof_sdw: add mic:dmic and cfg-mics component strings
  ASoC: Intel: soc-acpi: add ACPI matching table for HP Spectre x360
  ASoC: SOF: Intel: SoundWire: refine ACPI match
  ASoC: SOF: Intel: detect DMIC number in SoundWire mixed config
  ASoC: SOF: Intel: hda: add dev_dbg() when DMIC number is overridden

Rander Wang (1):
  ASoC: Intel: sof_sdw: detect DMIC number based on mach params

 sound/soc/intel/boards/sof_sdw.c              | 131 ++++++-----
 .../intel/common/soc-acpi-intel-tgl-match.c   |  20 ++
 sound/soc/sof/intel/hda.c                     | 208 ++++++++++++------
 3 files changed, 241 insertions(+), 118 deletions(-)

--
2.25.1
2021-02-05 14:50:46 +00:00
Bard Liao 30fd8f65af
ASoC: rt5682: do nothing in rt5682_suspend/resume in sdw mode
regcache sync will be done in sdw device suspend/resume functions.
And we have different jack detection mechanism for SoundWire.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210204201739.25206-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05 13:13:21 +00:00
Pierre-Louis Bossart c792c3690b
ASoC: rt5682-sdw: cancel_work_sync() in .remove and .suspend
Follow pattern from other drivers and use cancel_work_sync() for both
.remove() and .suspend().

Fixes: 03f6fc6de9 ('ASoC: rt5682: Add the soundwire support')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Link: https://lore.kernel.org/r/20210204201739.25206-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05 13:13:21 +00:00
Pierre-Louis Bossart 121871a75a
ASoC: rt711-sdw: use cancel_work_sync() for .remove
Make sure the workqueues are not running after the .remove() callback,
which can lead to timeout errors.

A previous fix to use cancel_work_sync was applied for the suspend
case but the remove case is missing

Fixes: 501ef01339 ('ASoC: rt711: wait for the delayed work to finish when the system suspends')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Link: https://lore.kernel.org/r/20210204201739.25206-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05 13:13:20 +00:00
Pierre-Louis Bossart 737ee8bdf6
ASoC: rt700-sdw: use cancel_work_sync() in .remove as well as .suspend
Make sure the workqueues are not running after the .remove() callback,
which can lead to timeout errors.

A previous fix to use cancel_work_sync was applied for the suspend
case but the remove case is missing

Fixes: 5f2df2a458 ('ASoC: rt700: wait for the delayed work to finish when the system suspends')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Link: https://lore.kernel.org/r/20210204201739.25206-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05 13:13:19 +00:00
Pierre-Louis Bossart 5ab3ff4d66
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A3E
We missed adding the TGL_HDMI quirk which is very much needed to
expose the 4 display pipelines and will be required on TGL topologies.

Fixes: e787f5b5b1 ('ASoC: Intel: add support for new SoundWire hardware layout on TGL')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210204203312.27112-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05 13:12:37 +00:00
Pierre-Louis Bossart 45c92ec32b
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A32
We missed adding the TGL_HDMI quirk which is very much needed to
expose the 4 display pipelines and will be required on TGL topologies.

Fixes: 488cdbd893 ('ASoC: Intel: sof_sdw: add quirk for new TigerLake-SDCA device')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210204203312.27112-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05 13:12:36 +00:00
Pierre-Louis Bossart f12bbc50f3
ASoC: Intel: sof_sdw: add missing TGL_HDMI quirk for Dell SKU 0A5E
We missed adding the TGL_HDMI quirk which is very much needed to
expose the 4 display pipelines and will be required on TGL topologies.

Fixes: 9ad9bc59dd ('ASoC: Intel: sof_sdw: set proper flags for Dell TGL-H SKU 0A5E')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210204203312.27112-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05 13:12:35 +00:00
Mark Brown 6395a6213b
Merge series "ASoC: mediatek: mt8192: apply some cleanup" from Tzung-Bi Shih <tzungbi@google.com>:
The 1st and 2nd patch refactor to use asoc_substream_to_rtd().

The 3rd patch simplifies ops of Capture1 DAI link.

Changes from v2[1]:
- Fix typo in 3rd patch's title, s/simply/simplify/.

Changes from v1[2]:
- Separated from v1.

[1]: https://patchwork.kernel.org/project/alsa-devel/list/?series=420919
[2]: https://patchwork.kernel.org/project/alsa-devel/list/?series=419769

Tzung-Bi Shih (3):
  ASoC: mediatek: mt8192-mt6359: use asoc_substream_to_rtd()
  ASoC: mediatek: mt8192: use asoc_substream_to_rtd()
  ASoC: mediatek: mt8192-mt6359: simplify ops for Capture1 DAI link

 sound/soc/mediatek/mt8192/mt8192-afe-pcm.c    |  4 ++--
 .../mt8192/mt8192-mt6359-rt1015-rt5682.c      | 24 ++++++++-----------
 2 files changed, 12 insertions(+), 16 deletions(-)

--
2.30.0.365.g02bc693789-goog
2021-02-04 19:49:57 +00:00
Stephen Boyd 0dd4d3e8c3
ASoC: da7218: Drop CONFIG_OF ifdef
This reverts commit a06cd8cf97 ("ASoC: da7218: skip of_device_id table
when !CONFIG_OF") because we want to make of_match_device() stop using
of_match_ptr() internally, confusing compilers and causing ifdef
pollution.

Reported-by: kernel test robot <lkp@intel.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20210202192016.49028-1-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-04 18:45:19 +00:00
Tzung-Bi Shih 4cceb42f4f
ASoC: mediatek: mt8192-mt6359: simplify ops for Capture1 DAI link
1. Uses rtd->dev to get the device.
2. Generalizes the variable name.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210203032201.2882158-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-04 18:45:18 +00:00
Tzung-Bi Shih 0840706d6c
ASoC: mediatek: mt8192: use asoc_substream_to_rtd()
Uses asoc_substream_to_rtd() helper.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210203032201.2882158-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-04 18:45:17 +00:00
Tzung-Bi Shih 8e59cf943f
ASoC: mediatek: mt8192-mt6359: use asoc_substream_to_rtd()
Uses asoc_substream_to_rtd() helper.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210203032201.2882158-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-04 18:45:16 +00:00
Mark Brown 1c4273a5b1
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
2021-02-03 21:02:32 +00:00
Kuninori Morimoto dd5abc7834
ASoC: soc-pcm: fixup snd_pcm_limit_hw_rates() timing
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8735ytaig8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-03 17:41:43 +00:00
Kuninori Morimoto 4b260f4254
ASoC: soc-pcm: use snd_pcm_hardware at dpcm_runtime_merge_xxx()
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874kj9aigd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-03 17:41:42 +00:00
Kuninori Morimoto 2b39123b13
ASoC: soc-pcm: add soc_create_pcm() and simplify soc_new_pcm()
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875z3paigi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-03 17:41:41 +00:00
Kuninori Morimoto 7fc6bebd58
ASoC: soc-pcm: add soc_get_playback_capture() and simplify soc_new_pcm()
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: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877do5aign.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-03 17:41:40 +00:00
Kuninori Morimoto e04e7b8ccd
ASoC: soc-pcm: tidyup pcm setting
Current soc_new_pcm() setups pcm randomly.
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878s8laigt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-03 17:41:39 +00:00
Yang Li e01a03db74
ASoC: Intel: catpt: remove unneeded semicolon
Eliminate the following coccicheck warning:
./sound/soc/intel/catpt/pcm.c:355:2-3: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Acked-by: Cezary 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: Mark Brown <broonie@kernel.org>
2021-02-03 16:23:09 +00:00
Srinivasa Rao Mandadapu e681b1a6d7
ASoC: qcom: Fix typo error in HDMI regmap config callbacks
Had a typo in lpass platform driver that resulted in crash
during suspend/resume with an HDMI dongle connected.

The regmap read/write/volatile regesters validation callbacks in lpass-cpu
were using MI2S rdma_channels count instead of hdmi_rdma_channels.

This typo error causing to read registers from the regmap beyond the length
of the mapping created by ioremap().

This fix avoids the need for reducing number hdmi_rdma_channels,
which is done in
commit 7dfe20ee92 ("ASoC: qcom: Fix number of HDMI RDMA channels on sc7180").
So reverting the same.

Fixes: 7cb37b7bd0 ("ASoC: qcom: Add support for lpass hdmi driver")
Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Link: https://lore.kernel.org/r/20210202062727.22469-1-srivasam@codeaurora.org
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Tested-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-02 17:28:10 +00:00
Amadeusz Sławiński be6be67e13
ASoC: topology: KUnit: Convert from cpu to data format
When creating topology templates and overriding data in specific test
cases it should be done with cpu_to_le32 macro, so we operate on correct
data on all architectures, as topology parser use le32_to_cpu to parse
data from structures.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20210202163123.3942040-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-02 17:08:21 +00:00
Tang Bin 68be8ed6a4
ASoC: fsl_spdif: Utilize the defined parameter to clear code
Utilize the defined parameter 'dev' to make the code cleaner.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20210128112714.16324-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-02 17:08:20 +00:00
Tzung-Bi Shih 1ecebae473
ASoC: mt6359: reduce log verbosity for optional DT properties
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: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210202033557.1621029-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-02 13:42:46 +00:00
Rander Wang e1711b1f9d
ASoC: SOF: add be_hw_params_fixup() for ALH
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: Rander Wang <rander.wang@intel.com>
Reviewed-by: Keyon Jie <yang.jie@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210201092345.1214232-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-02 13:42:43 +00:00
Srinivas Kandagatla e8820dbddb
ASoC: codecs: add missing max_register in regmap config
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: a0aab9e140 ("ASoC: codecs: add wsa881x amplifier support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210201161429.28060-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-01 16:23:18 +00:00
Sebastian Reichel de5bfae2fd
ASoC: cpcap: fix microphone timeslot mask
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: f6cdf2d344 ("ASoC: cpcap: new codec")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210123172945.3958622-1-sre@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-01 16:23:17 +00:00
Mark Brown 1f16aaeef7
Merge series "Tegra186 and Tegra194 audio graph card" from Sameer Pujar <spujar@nvidia.com>:
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
2021-02-01 14:52:59 +00:00
Geert Uytterhoeven e86caa011c
ASoC: tegra: SND_SOC_TEGRA_AUDIO_GRAPH_CARD should depend on SND_SOC_TEGRA
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: 202e2f7745 ("ASoC: tegra: Add audio graph based card driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20210129125915.2652952-1-geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-01 13:19:46 +00:00
Sameer Pujar 563c2681d4
ASoC: rt5659: Add Kconfig prompt
Add tristate prompt to allow codec selection.

Cc: Oder Chiou <oder_chiou@realtek.com>
Cc: Bard Liao <bardliao@realtek.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1611944866-29373-5-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-01 13:19:44 +00:00
Sameer Pujar 531e5b7abb
ASoC: audio-graph-card: Add clocks property to endpoint node
Add optional 'clocks' property to audio port 'endpoint' node. One
such example is where SoC supplies a clock to external audio codec
component.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/1611944866-29373-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-01 13:19:43 +00:00
Sameer Pujar 70f0bc65f6
ASoC: dt-bindings: tegra: Add iommus property to Tegra graph card
Document 'iommus' property for APE (Audio Processing Engine) sound
card.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1611944866-29373-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-01 13:19:42 +00:00
Sameer Pujar 6bbb859012
ASoC: dt-bindings: rt5659: Update binding doc
Update following in rt5659.txt binding doc
  - Add JD source for Intel HDA header: Commit 041e74b714
    ("ASoC: rt5659: Add the support of Intel HDA Header")
    added driver support. Add missing info here.

  - sound-name-prefix: Used to prefix component widgets/kcontrols
    with given prefix.

  - ports: Helps to use the Codec with audio graph card

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reported-by: Jon Hunter <jonathanh@nvidia.com>
Cc: Oder Chiou <oder_chiou@realtek.com>
Cc: Bard Liao <bardliao@realtek.com>
Link: https://lore.kernel.org/r/1611944866-29373-2-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-01 13:19:41 +00:00
Ranjani Sridharan 941d3f0d7e
ASoC: SOF: topology: Prevent NULL pointer dereference with no TLV
When there is no TLV data in topology, extracting the TLV data
could result in a NULL pointer exception. Prevent this by making
sure that the TLV data exists before extracting it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210201093128.1226603-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-01 13:18:58 +00:00
Srinivas Kandagatla 8ac9e476b8
ASoC: soc-component: fix undefined reference to __ffssi2
microblaze-linux-gcc (GCC) 9.3.0 complains about missing __ffssi2
symbol while using __builtin_ffs at runtime.

This is because arch/h8300 is compiled with -fno-builtin option.

so fallback and use kernel ffs() instead to all the arch builds happy!

Fixes: 1da0b9899a ("ASoC: soc-component: add snd_soc_component_read/write_field()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210129100539.23459-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-29 12:40:06 +00:00
Mark Brown 2029d73d4d
Merge series "ASoC: SOF: use common code for DSP core pm" from Kai Vehmanen <kai.vehmanen@linux.intel.com>:
Series to refactor the DSP core management:
 - move tracking of powered up DSP cores to common SOF code
 - add logic filter unnecessary power actions
 - modify existing implementations to use common code
   whenever DSP cores are powered, so the state in common
   code stays in sync

Bard Liao (5):
  ASoC: SOF: Intel: hda: use snd_sof_dsp_core_power_up/down API
  ASoC: SOF: Intel: hda-loader: keep init cores alive
  ASoC: SOF: update dsp core power status in common APIs
  ASoC: SOF: Filter out unneeded core power up/downs
  ASoC: SOF: intel: hda-loader: use snd_sof_dsp_core_power_down/up APIs

 sound/soc/sof/intel/hda-dsp.c    |  2 +-
 sound/soc/sof/intel/hda-loader.c |  9 +++++----
 sound/soc/sof/intel/hda.c        |  2 +-
 sound/soc/sof/loader.c           |  6 ------
 sound/soc/sof/ops.h              | 24 ++++++++++++++++++------
 sound/soc/sof/pm.c               |  1 -
 sound/soc/sof/topology.c         |  8 --------
 7 files changed, 25 insertions(+), 27 deletions(-)

base-commit: e32df14235
--
2.29.2
2021-01-28 20:50:07 +00:00
Kai Vehmanen 1fc96dc29c
ASoC: Intel: remove duplicate MODULE_LICENSE/DESCRIPTION tags
The snd-soc-acpi-intel-match has duplicate module tags for all
platforms separately. Remove all but one and save some storage
space and cleanup modinfo output.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210128105751.1049837-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-28 17:11:39 +00:00
Bard Liao 92c6ec606c
ASoC: SOF: intel: hda-loader: use snd_sof_dsp_core_power_down/up APIs
To manage enabled_cores_mask flag, we should always use snd_sof_dsp_
core_power_down/up APIs to power up/down dsp cores. The APIs do
a little bit more than the original functions, but it is harmless.

Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210128093850.1041387-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-28 17:11:38 +00:00
Bard Liao 30876e2a06
ASoC: SOF: Filter out unneeded core power up/downs
Exclude cores that are already powered on/off correctly. This allows to
simplify dsp_power_up/down() implementations and avoid unexpected error.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210128093850.1041387-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-28 17:11:37 +00:00
Bard Liao 42077f08b3
ASoC: SOF: update dsp core power status in common APIs
Only manage enabled_cores_mask in common snd_sof_dsp_core_power_up/down
APIs to ensure it stays in sync with actual DSP core state.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210128093850.1041387-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-28 17:11:36 +00:00
Bard Liao cedd502d18
ASoC: SOF: Intel: hda-loader: keep init cores alive
init_core_mask should be the available cores mask after fw boot. So we
should keep not core 0 but init cores alive.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210128093850.1041387-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-28 17:11:35 +00:00
Bard Liao f6c246eacb
ASoC: SOF: Intel: hda: use snd_sof_dsp_core_power_up/down API
To implement common logic in SOF core, core power up/down flows should
use common SOF API and not directly use low-level platform specific
helper functions.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210128093850.1041387-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-28 17:11:34 +00:00
Ranjani Sridharan 0084364d96
ASoC: SOF: Intel: hda: cancel D0i3 work during runtime suspend
Cancel the D0i3 work during runtime suspend as no streams are
active at this point anyway.

Fixes: 63e51fd33f ("ASoC: SOF: Intel: cnl: Implement feature to support DSP D0i3 in S0")
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210128092345.1033085-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-28 17:11:31 +00:00
Srinivasa Rao Mandadapu 6c28377b71
ASoC: qcom: lpass-cpu: Remove bit clock state check
No need of BCLK state maintenance from driver side as
clock_enable and clk_disable API's maintaing state counter.

One of the major issue was spotted when Headset jack inserted
while playback continues, due to same PCM device node opens twice
for playaback/capture and closes once for capture and playback continues.

It can resolve the errors in such scenarios.

Fixes: b182496822 ("ASoC: qcom: Fix enabling BCLK and LRCLK in LPAIF invalid state")

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210127151824.8929-1-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-28 17:11:30 +00:00
Libin Yang e32df14235
ASoC: Intel: adl: remove sof_fw_filename setting in ADL snd_soc_acpi_mach
ADL will use sof-adl-s.ri if it is ADL-S platform. So let's use
the default_fw_filename in pdata->desc for the ADL FW filename.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210125070500.807474-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-27 17:28:28 +00:00